From 92a028bc23f51f90c616e29c091944f5d15f1e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E6=88=90=E5=BC=BA?= Date: Thu, 29 Oct 2020 15:06:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E5=93=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edit/components/ApprovalList.vue | 37 ++++++++++--------- .../edit/components/ConfirmList.vue | 19 ++++++---- .../edit/components/ScoreList.vue | 2 +- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue b/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue index 83c463d..f00aad5 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue @@ -25,6 +25,7 @@ 主管(指定一级) 指定成员 + 被考核人自己
被考评人的 @@ -42,7 +43,7 @@ {{itemInfo.name}}
-
+
当执行人为多人时的处理方式:
@@ -132,7 +133,7 @@ export default { list = list.map(i => { i.isShow = false i = Object.assign({}, this.handleOptType(i), i) - i.isActive = i.optType === 0 ? 0 : 1 + i.isActive = (i.optType === 0 || i.optType === -1) ? i.optType : 1 i.roleDtos = JSON.parse(JSON.stringify(this.roleDtos)).map(j => { j.checked = i.roleIds ? i.roleIds.includes(String(j.id)) : false return j @@ -157,6 +158,7 @@ export default { return obj } if (i.optType === -1) { + obj.name = '被考核人' return obj } else { obj.name = this.options.filter(j => j.id === i.optType)[0].name @@ -231,10 +233,11 @@ export default { n.map(i => { i.roleIds = '' i.roleDtos.map(j => { - if (j.type !== 1 && j.checked) i.roleIds += j.id + ',' + console.log('j: ', j) + if (j.type !== 1 && j.checked) i.roleIds += j.roleId + ',' }) i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1) - i.optType = i.isActive === 0 ? 0 : i.optType + i.optType = (i.isActive === 0 || i.isActive === -1) ? i.isActive : i.optType }) console.log('n: ', n) this.$emit('update:info', this.list) @@ -248,27 +251,25 @@ export default { list: { deep: true, handler (n, o) { - this.handleIsEmit(n) + this.handleIsEmit(JSON.parse(JSON.stringify(n))) } }, itemInfo: { deep: true, 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 - n.optType = 1 - } - if (n.optType === -1) { - n.name = '考核人员自己' + const arr = n + console.log('arr: ', arr) + if (arr.isActive !== 0 && arr.isActive !== -1) { + if (arr.optType < 1) arr.optType = 1 + arr.name = this.options.filter(i => i.id === arr.optType)[0].name + } else if (arr.isActive === 0) { + if (arr.list) { + arr.name = this.handleTitle(arr.list) + } else { + arr.name = '未指定成员' } } else { - if (n.list) { - n.name = this.handleTitle(n.list) - } else { - n.name = '未指定成员' - } + arr.name = '被考核人自己' } // n.roleIds = '' // n.roleDtos.map(i => { diff --git a/src/views/kpi/workbench/assessmentGroup/edit/components/ConfirmList.vue b/src/views/kpi/workbench/assessmentGroup/edit/components/ConfirmList.vue index 0fe17db..9c2e573 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/components/ConfirmList.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/components/ConfirmList.vue @@ -25,6 +25,7 @@ 主管(指定一级) 指定成员 + 被考核人自己
被考评人的 @@ -42,7 +43,7 @@ {{itemInfo.name}}
-
+
当执行人为多人时的处理方式:
@@ -137,7 +138,8 @@ export default { list = list.map(i => { i.isShow = false i = Object.assign({}, this.handleOptType(i), i) - i.isActive = i.optType === 0 ? 0 : 1 + console.log('i: ', i) + i.isActive = (i.optType === 0 || i.optType === -1) ? i.optType : 1 i.roleDtos = JSON.parse(JSON.stringify(this.roleDtos)).map(j => { j.checked = i.roleIds ? i.roleIds.includes(String(j.id)) : false return j @@ -162,6 +164,7 @@ export default { return obj } if (i.optType === -1) { + obj.name = '被考核人' return obj } else { obj.name = this.options.filter(j => j.id === i.optType)[0].name @@ -239,10 +242,10 @@ export default { arr = arr.map(i => { i.roleIds = '' i.roleDtos.map(j => { - if (j.type !== 1 && j.checked) i.roleIds += j.id + ',' + if (j.type !== 1 && j.checked) i.roleIds += j.roleId + ',' }) i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1) - i.optType = i.isActive === 0 ? 0 : i.optType + i.optType = (i.isActive === 0 || i.isActive === -1) ? i.isActive : i.optType return i }) console.log('arr: ', arr) @@ -266,15 +269,17 @@ export default { handler (n, o) { const arr = n console.log('arr: ', arr) - if (arr.isActive !== 0) { - if (arr.optType === 0) arr.optType = 1 + if (arr.isActive !== 0 && arr.isActive !== -1) { + if (arr.optType < 1) arr.optType = 1 arr.name = this.options.filter(i => i.id === arr.optType)[0].name - } else { + } else if (arr.isActive === 0) { if (arr.list) { arr.name = this.handleTitle(arr.list) } else { arr.name = '未指定成员' } + } else { + arr.name = '被考核人自己' } // this.$emit('update:info', this.list) // n.roleIds = '' diff --git a/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue b/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue index e867f90..acc2f05 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue @@ -239,7 +239,7 @@ export default { n.map(i => { i.roleIds = '' i.roleDtos.map(j => { - if (j.type !== 1 && j.checked) i.roleIds += j.id + ',' + if (j.type !== 1 && j.checked) i.roleIds += j.roleId + ',' }) i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1) })