This commit is contained in:
熊成强 2020-10-26 11:47:30 +08:00
parent d5bebe8583
commit c280814d02
4 changed files with 46 additions and 27 deletions

View File

@ -256,8 +256,13 @@ export default {
handler (n, o) { handler (n, o) {
console.log('nxcq: ', n) console.log('nxcq: ', n)
if (n.isActive !== 0) { if (n.isActive !== 0) {
if (n.optType === 0) n.optType = 1 if (n.optType === 0 && n.optType !== -1) {
n.name = this.options.filter(i => i.id === n.optType)[0].name n.name = this.options.filter(i => i.id === n.optType)[0].name
n.optType = 1
}
if (n.optType === -1) {
n.name = '考核人员自己'
}
} else { } else {
if (n.list) { if (n.list) {
n.name = this.handleTitle(n.list) n.name = this.handleTitle(n.list)

View File

@ -264,6 +264,13 @@ export default {
if (n.isActive !== 0) { if (n.isActive !== 0) {
if (n.optType === 0) n.optType = 1 if (n.optType === 0) n.optType = 1
n.name = this.options.filter(i => i.id === n.optType)[0].name n.name = this.options.filter(i => i.id === n.optType)[0].name
} else {
// n.name
if (n.list) {
n.name = this.handleTitle(n.list)
} else {
n.name = '未指定成员'
}
} }
n.weight = n.weight1 / 100 n.weight = n.weight1 / 100
if (n.weight1 >= 0) { if (n.weight1 >= 0) {

View File

@ -150,7 +150,7 @@
<el-radio label="">不限数量</el-radio> <el-radio label="">不限数量</el-radio>
<el-radio label="1">自定义</el-radio> <el-radio label="1">自定义</el-radio>
</el-radio-group> </el-radio-group>
<el-input clearable size="small" style="width:160px;'" v-if="maxCount==1" v-model="form.maxCount"></el-input> <el-input clearable size="small" style="width:160px;'" v-if="maxCount" v-model="form.maxCount"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="所含指标总权重"> <el-form-item label="所含指标总权重">
<div slot="label">所含指标总权重 <div slot="label">所含指标总权重
@ -162,7 +162,7 @@
<el-radio :label="0">不限权重</el-radio> <el-radio :label="0">不限权重</el-radio>
<el-radio :label="1">自定义</el-radio> <el-radio :label="1">自定义</el-radio>
</el-radio-group> </el-radio-group>
<el-input clearable size="small" style="width:160px;'" v-if="weight===1" v-model="form.weight"> <el-input clearable size="small" style="width:160px;'" v-if="weight!==0" v-model="form.weight">
<template slot="append">%</template> <template slot="append">%</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -340,13 +340,13 @@ export default {
handleSubmit () { handleSubmit () {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.form.weight = this.form.weight / 100 > 1 ? 1 : this.form.weight / 100
if (this.form.isEdit) { if (this.form.isEdit) {
this.info.modelItems[this.form.index] = Object.assign({}, this.form) this.info.modelItems[this.form.index] = Object.assign({}, this.form)
this.form = {} this.form = {}
this.show = false this.show = false
return return
} }
this.form.weight = this.form.weight / 100 > 1 ? 1 : this.form.weight / 100
this.info.modelItems.push(Object.assign({}, this.form, {isDelete: 0})) this.info.modelItems.push(Object.assign({}, this.form, {isDelete: 0}))
this.form = {} this.form = {}
this.show = false this.show = false
@ -355,15 +355,19 @@ export default {
}, },
// //
hanidleEdit (item, index, type) { hanidleEdit (item, index, type) {
this.maxCount = item.maxCount > 0 ? '1' : ''
this.weight = item.weight > 0 ? 1 : 0
if (type === -1) { if (type === -1) {
this.weiduTitle = '编辑维度' this.weiduTitle = '编辑维度'
this.form = Object.assign({}, item, {index, index2: type, isEdit: true}) this.form = Object.assign({}, item, {index, index2: type, isEdit: true})
console.log(' this.form: ', this.form)
this.form.weight = this.form.weight * 100 this.form.weight = this.form.weight * 100
console.log('this.form: ', this.form)
this.show = true this.show = true
} else { } else {
this.zhibiaoTitle = '编辑指标' this.zhibiaoTitle = '编辑指标'
this.formIndicators = Object.assign({}, item, {index, index2: type, isEdit: true}) this.formIndicators = Object.assign({}, item, {index, index2: type, isEdit: true})
this.formIndicators.weight = this.formIndicators.weight * 100 this.formIndicators.weight = this.formIndicators.weight
this.showIndicators = true this.showIndicators = true
} }
}, },
@ -394,16 +398,17 @@ export default {
}, },
handleSubmitZhibiao () { handleSubmitZhibiao () {
this.$refs.formIndicators.validate((v) => { this.$refs.formIndicators.validate((v) => {
console.log('v: ', v)
if (v) { if (v) {
this.formIndicators.weight = this.formIndicators.weight / 100 > 1 ? 1 : this.formIndicators.weight / 100
if (this.formIndicators.isEdit) { if (this.formIndicators.isEdit) {
this.info.modelItems[this.formIndicators.index].tagetLibItems[this.formIndicators.index2] = Object.assign({}, this.formIndicators) this.info.modelItems[this.formIndicators.index].tagetLibItems[this.formIndicators.index2] = Object.assign({}, this.formIndicators)
this.showIndicators = false this.showIndicators = false
return return
} }
if (!this.zanshi.tagetLibItems) this.zanshi.tagetLibItems = [] if (!this.zanshi.tagetLibItems) this.zanshi.tagetLibItems = []
this.formIndicators.weight = this.formIndicators.weight / 100 > 1 ? 1 : this.formIndicators.weight / 100
this.zanshi.tagetLibItems.push(Object.assign({}, this.formIndicators, {isDelete: 0})) this.zanshi.tagetLibItems.push(Object.assign({}, this.formIndicators, {isDelete: 0}))
this.showIndicators = false // this.showIndicators = false
} }
}) })
} }

View File

@ -66,34 +66,36 @@ export default {
console.log('this.basisForm: ', this.basisForm) console.log('this.basisForm: ', this.basisForm)
try { try {
let res = await saveBaseSet(this.basisForm) let res = await saveBaseSet(this.basisForm)
let res2 = await saveTemSet(this.templateForm)
this.basisForm = res this.basisForm = res
this.templateForm.evaluationGroupId = res.id this.templateForm.evaluationGroupId = res.id
for (let i in this.processInfo) { for (let i in this.processInfo) {
console.log('processInfo: ', i) console.log('processInfo: ', i)
let res3 = await saveDetailProcs(Object.assign({}, this.processInfo[i].chartDetails, {evaluationGroupId: res.id})) try {
console.log('res: ', res3) let res1 = await saveDetailProcs(Object.assign({}, this.processInfo[i].chartDetails, {evaluationGroupId: res.id}))
console.log('res: ', res1)
} catch (error) {
console.log('error: ', error)
}
} }
console.log('res: ', res) console.log('res: ', res)
this.$message({
message: '保存成功',
type: 'success',
onClose: () => {
this.$router.replace({name: 'workbench-group'})
}
})
} catch (error) { } catch (error) {
this.$message.error(error.msg) this.$message.error(error.msg)
} }
// console.log('this.templateForm: ', JSON.stringify(this.templateForm)) console.log('this.templateForm: ', JSON.stringify(this.templateForm))
// try { try {
// let res2 = await saveTemSet(this.templateForm) let res = await saveTemSet(this.templateForm)
// // this.basisForm = res // this.basisForm = res
// console.log('res: ', res2) console.log('res: ', res)
// } catch (error) { } catch (error) {
// this.$message.error(error.msg) this.$message.error(error.msg)
// } }
this.$message({
message: '保存成功',
type: 'success',
onClose: () => {
this.$router.replace({name: 'workbench-group'})
}
})
} }
}, },
watch: {} watch: {}