283 lines
9.4 KiB
Vue
283 lines
9.4 KiB
Vue
<template>
|
|
<el-form class="el_form" :model="data" ref="addForm" :rules="formRules" label-width="100px">
|
|
<vi-title title="指标信息"></vi-title>
|
|
<el-row :gutter="20">
|
|
<el-col :span="12">
|
|
<el-form-item prop="annual" label="年  度">
|
|
<el-date-picker
|
|
style="width: 100%"
|
|
v-if="!is_view"
|
|
:picker-options="pickerOptions"
|
|
v-model="data.annual"
|
|
type="year"
|
|
value-format="yyyy"
|
|
placeholder="选择年度">
|
|
</el-date-picker>
|
|
<el-input v-else style="color: #F6F7FA;" disabled v-model="data.annual"></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item prop="assessment" label="考核名称">
|
|
<el-input maxlength="30" v-if="!is_view" v-model="data.assessment" placeholder="请填写考核名称"
|
|
type="text">
|
|
</el-input>
|
|
<el-input v-else style="color: #F6F7FA;" disabled v-model="data.assessment"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item prop="assessment" label="" v-if="!is_view">
|
|
<el-checkbox v-model="data.isEvaluationIndex">是否采用往年考核指标</el-checkbox>
|
|
</el-form-item>
|
|
<el-form-item prop="zbId" label="往年指标" v-show="data.isEvaluationIndex">
|
|
<el-select v-model="data.zbId" placeholder="请选择指标" filterable clearable
|
|
style="width: 100%" @change="getByZbData">
|
|
<el-option
|
|
v-for="item in zbList"
|
|
:key="item.id"
|
|
:label="item.annual+item.assessment"
|
|
:value="item.id">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
|
|
<vi-title2 title="考核项目">
|
|
<template #func>
|
|
<el-button v-if="!is_view" size="small" style="float: right" icon="el-icon-plus" type="primary"
|
|
@click="data.nrs.push({bzs:[{}]})">
|
|
添加内容
|
|
</el-button>
|
|
</template>
|
|
</vi-title2>
|
|
|
|
<el-form-item label="" label-width="0" v-for="nr,idx in data.nrs">
|
|
|
|
<el-row type="flex" align="middle" justify="space-between">
|
|
<el-input v-model="nr.content" v-if="!is_view" maxlength="30" style="width: 50%" placeholder="请填写考核项目">
|
|
<template slot="prepend"><span v-model="nr.contentNumber">{{ nr.contentNumber = idx + 1 }}</span></template>
|
|
</el-input>
|
|
<span style="background-color: #F6F7FA;" v-else>{{ idx + 1 }} {{ nr.content }}</span>
|
|
<el-button v-if="!is_view" size="medium" :disabled="data.nrs.length<=1" type="danger"
|
|
@click="data.nrs.splice(idx,1)"
|
|
icon="el-icon-delete"></el-button>
|
|
</el-row>
|
|
|
|
<el-row style="margin-top: 20px">
|
|
<el-table :data="nr.bzs" style="width: 100%" border show-summary :summary-method="getSummaries" size="small">
|
|
<el-table-column align="center" header-align="center" label="序号" type="index" width="70px">
|
|
</el-table-column>
|
|
|
|
<el-table-column label="考评内容" prop="inspection" header-align="center" align="center">
|
|
<template scope="{row}">
|
|
<el-input v-if="!is_view" v-model="row.inspection" placeholder="请填写考核标准"
|
|
maxlength="500" type="textarea" autosize></el-input>
|
|
<span v-else>{{ row.inspection }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column label="评分标准" prop="scoringCriteria" header-align="center" align="center" width="300px"
|
|
min-width="200">
|
|
<template scope="{row}">
|
|
<el-input v-if="!is_view" v-model="row.scoringCriteria" placeholder="请填写评分标准"
|
|
maxlength="250" type="textarea" autosize></el-input>
|
|
<span v-else>{{ row.scoringCriteria }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column label="项目自评(分数)" prop="score" header-align="center" align="center" width="120px">
|
|
<template scope="{row}">
|
|
<el-input v-if="!is_view" type="number" v-model.number="row.score" maxlength="4"
|
|
placeholder="请填写项目自评"></el-input>
|
|
<span v-else>{{ row.score }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column label="考核办法" prop="assessmentMethod" header-align="center" align="center" width="300px">
|
|
<template scope="{row}">
|
|
<el-input v-if="!is_view" v-model="row.assessmentMethod" maxlength="50"
|
|
placeholder="请填写考核办法"></el-input>
|
|
<span v-else>{{ row.assessmentMethod }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<!-- <el-table-column label="是否提供佐证材料" prop="isEvidence" header-align="center" align="center"-->
|
|
<!-- width="120px">-->
|
|
<!-- <template scope="{row}">-->
|
|
<!-- <el-switch-->
|
|
<!-- v-if="!is_view"-->
|
|
<!-- v-model="row.isEvidence"-->
|
|
<!-- active-color="#13ce66"-->
|
|
<!-- inactive-color="#ff4949">-->
|
|
<!-- </el-switch>-->
|
|
<!-- <el-switch-->
|
|
<!-- v-else-->
|
|
<!-- disabled-->
|
|
<!-- v-model="row.isEvidence">-->
|
|
<!-- </el-switch>-->
|
|
<!-- </template>-->
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
<el-table-column v-if="!is_view" label="操作" header-align="center" align="center" width="100px">
|
|
<template slot="header" scope="{row,$index}">
|
|
<el-button size="mini" icon="el-icon-plus" type="primary" @click="nr.bzs.push({})" title="添加考评内容"></el-button>
|
|
</template>
|
|
<template scope="{row,$index}">
|
|
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id)" type="danger"
|
|
icon="el-icon-delete"
|
|
@click="nr.bzs.splice($index,1)"></el-button>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
<!-- <el-button v-if="!is_view" type="primary" plain style="width: 100%" size="mini" icon="el-icon-plus"-->
|
|
<!-- @click="nr.bzs.push({})">-->
|
|
<!-- 添加考核标准-->
|
|
<!-- </el-button>-->
|
|
|
|
<!-- <el-divider></el-divider>-->
|
|
</el-row>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
const METHOD_NAME = "change"
|
|
|
|
module.exports = {
|
|
props: {
|
|
is_view: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
data: {
|
|
type: Object,
|
|
default: {
|
|
nrs: [{
|
|
bzs: [{}]
|
|
}],
|
|
}
|
|
}
|
|
},
|
|
watch: {
|
|
data: {
|
|
deep: true,
|
|
handler(val) {
|
|
this.$emit(METHOD_NAME, val)
|
|
}
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
isEvaluationIndex: false,
|
|
zbList: [],
|
|
formRules: {
|
|
xxx: [{required: true, message: '请填写年度', trigger: ['blur', 'change']}],
|
|
},
|
|
pickerOptions: {
|
|
disabledDate(time) {
|
|
return (
|
|
time.getFullYear() > new Date().getFullYear()
|
|
);
|
|
}
|
|
},
|
|
relationData: [
|
|
{moduleName: '提案系统模块', id: 'proposal'},
|
|
{moduleName: '二级教代会', id: 'secteameet'},
|
|
{moduleName: '慰问/补助', id: 'ConandDif'},
|
|
]
|
|
}
|
|
},
|
|
methods: {
|
|
async getByZbData() {
|
|
const {code, data, msg} = await $.get('/platform/ghkh/khzb/edit', {id: this.data.zbId})
|
|
this.$set(this.data, "nrs", data.nrs)
|
|
},
|
|
async getZbList() {
|
|
await $.get("/platform/ghkh/Xjkhzb/getZbList").then(res => {
|
|
this.zbList = res.data
|
|
})
|
|
},
|
|
async getKh() {
|
|
await $.get("/platform/ghkh/khph/getKh", {"annual": this.data.annual}).then(res => {
|
|
if (res.data.length != 0) {
|
|
this.kh = res.data
|
|
this.data.khid = this.kh[0].id
|
|
} else {
|
|
this.kh = []
|
|
this.pageForm.khid = ""
|
|
}
|
|
})
|
|
},
|
|
async khSearch() {
|
|
await this.getKh()
|
|
},
|
|
getSummaries(param) {
|
|
const {columns, data} = param;
|
|
const sums = [];
|
|
columns.forEach((column, index) => {
|
|
if (index === 0) {
|
|
sums[index] = '小计';
|
|
return;
|
|
} else if ([1, 4, 5, 6, 7].includes(index)) {
|
|
sums[index] = '';
|
|
return;
|
|
}
|
|
const values = data.map(item => Number(item[column.property]));
|
|
if (!values.every(value => isNaN(value))) {
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
const value = Number(curr);
|
|
if (!isNaN(value)) {
|
|
return prev + curr;
|
|
} else {
|
|
return prev;
|
|
}
|
|
}, 0);
|
|
sums[index] += ' 分';
|
|
} else {
|
|
sums[index] = '';
|
|
}
|
|
});
|
|
return sums;
|
|
}
|
|
},
|
|
created() {
|
|
this.getZbList()
|
|
if (!this.data || !Object.keys(this.data).length) {
|
|
this.data = {
|
|
nrs: [{
|
|
bzs: [{}]
|
|
}],
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.fixedBox {
|
|
position: fixed;
|
|
top: 200px;
|
|
right: 10px;
|
|
z-index: 100;
|
|
}
|
|
|
|
.el-divider {
|
|
background-color: #409EFF;
|
|
}
|
|
|
|
.el_form {
|
|
position: relative;
|
|
}
|
|
|
|
</style>
|