From c280814d0215765fe34818517fe4526646587fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E6=88=90=E5=BC=BA?= Date: Mon, 26 Oct 2020 11:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edit/components/ApprovalList.vue | 9 ++++- .../edit/components/ScoreList.vue | 7 ++++ .../edit/components/templateSet.vue | 17 +++++--- .../workbench/assessmentGroup/edit/index.vue | 40 ++++++++++--------- 4 files changed, 46 insertions(+), 27 deletions(-) diff --git a/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue b/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue index e7b542e..83c463d 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue @@ -256,8 +256,13 @@ export default { handler (n, o) { console.log('nxcq: ', n) if (n.isActive !== 0) { - if (n.optType === 0) n.optType = 1 - n.name = this.options.filter(i => i.id === n.optType)[0].name + if (n.optType === 0 && n.optType !== -1) { + n.name = this.options.filter(i => i.id === n.optType)[0].name + n.optType = 1 + } + if (n.optType === -1) { + n.name = '考核人员自己' + } } else { if (n.list) { n.name = this.handleTitle(n.list) diff --git a/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue b/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue index 688804f..e867f90 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue @@ -264,6 +264,13 @@ export default { if (n.isActive !== 0) { if (n.optType === 0) n.optType = 1 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 if (n.weight1 >= 0) { diff --git a/src/views/kpi/workbench/assessmentGroup/edit/components/templateSet.vue b/src/views/kpi/workbench/assessmentGroup/edit/components/templateSet.vue index c92bfdd..c1fd2c1 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/components/templateSet.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/components/templateSet.vue @@ -150,7 +150,7 @@ 不限数量 自定义 - +
所含指标总权重 @@ -162,7 +162,7 @@ 不限权重 自定义 - + @@ -340,13 +340,13 @@ export default { handleSubmit () { this.$refs.form.validate((v) => { if (v) { + this.form.weight = this.form.weight / 100 > 1 ? 1 : this.form.weight / 100 if (this.form.isEdit) { this.info.modelItems[this.form.index] = Object.assign({}, this.form) this.form = {} this.show = false 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.form = {} this.show = false @@ -355,15 +355,19 @@ export default { }, // 编辑 hanidleEdit (item, index, type) { + this.maxCount = item.maxCount > 0 ? '1' : '' + this.weight = item.weight > 0 ? 1 : 0 if (type === -1) { this.weiduTitle = '编辑维度' this.form = Object.assign({}, item, {index, index2: type, isEdit: true}) + console.log(' this.form: ', this.form) this.form.weight = this.form.weight * 100 + console.log('this.form: ', this.form) this.show = true } else { this.zhibiaoTitle = '编辑指标' 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 } }, @@ -394,16 +398,17 @@ export default { }, handleSubmitZhibiao () { this.$refs.formIndicators.validate((v) => { + console.log('v: ', v) if (v) { + this.formIndicators.weight = this.formIndicators.weight / 100 > 1 ? 1 : this.formIndicators.weight / 100 if (this.formIndicators.isEdit) { this.info.modelItems[this.formIndicators.index].tagetLibItems[this.formIndicators.index2] = Object.assign({}, this.formIndicators) this.showIndicators = false return } 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.showIndicators = false + // this.showIndicators = false } }) } diff --git a/src/views/kpi/workbench/assessmentGroup/edit/index.vue b/src/views/kpi/workbench/assessmentGroup/edit/index.vue index 24b5d77..0ac623e 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/index.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/index.vue @@ -66,34 +66,36 @@ export default { console.log('this.basisForm: ', this.basisForm) try { let res = await saveBaseSet(this.basisForm) - let res2 = await saveTemSet(this.templateForm) - this.basisForm = res this.templateForm.evaluationGroupId = res.id for (let i in this.processInfo) { console.log('processInfo: ', i) - let res3 = await saveDetailProcs(Object.assign({}, this.processInfo[i].chartDetails, {evaluationGroupId: res.id})) - console.log('res: ', res3) + try { + 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) - this.$message({ - message: '保存成功', - type: 'success', - onClose: () => { - this.$router.replace({name: 'workbench-group'}) - } - }) } catch (error) { this.$message.error(error.msg) } - // console.log('this.templateForm: ', JSON.stringify(this.templateForm)) - // try { - // let res2 = await saveTemSet(this.templateForm) - // // this.basisForm = res - // console.log('res: ', res2) - // } catch (error) { - // this.$message.error(error.msg) - // } + console.log('this.templateForm: ', JSON.stringify(this.templateForm)) + try { + let res = await saveTemSet(this.templateForm) + // this.basisForm = res + console.log('res: ', res) + } catch (error) { + this.$message.error(error.msg) + } + this.$message({ + message: '保存成功', + type: 'success', + onClose: () => { + this.$router.replace({name: 'workbench-group'}) + } + }) } }, watch: {}