From 039cd7fc88cdf26de866841bf29c045240eb17ce Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Mon, 15 Jan 2024 10:45:56 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BF=AE=E6=94=B9bug80413?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reviewMeeting/modules/ScoreDetail.vue | 46 +++++++++++--- .../EnterpriseStandardEvaluateModal.vue | 46 +++++++++++--- .../modules/ScorerMarkBaseInfo.vue | 61 ++++++++++++++----- 3 files changed, 119 insertions(+), 34 deletions(-) diff --git a/src/views/enterpriseStandardLibrary/reviewMeeting/modules/ScoreDetail.vue b/src/views/enterpriseStandardLibrary/reviewMeeting/modules/ScoreDetail.vue index b4950da0..1f17ffa3 100644 --- a/src/views/enterpriseStandardLibrary/reviewMeeting/modules/ScoreDetail.vue +++ b/src/views/enterpriseStandardLibrary/reviewMeeting/modules/ScoreDetail.vue @@ -148,6 +148,10 @@ const fixDataSourse = [ id: 18, score: '优秀', scoreRange: '7~10' + }, + { + id: 19, + project: '总分:0' } ] const initData = { @@ -257,15 +261,17 @@ export default { dataIndex: 'project', customRender: (text, row, index) => { const obj = { - children: text || this.global.emptyLine, attrs: {} } if (index % 3 === 0) { + obj.children = text || this.global.emptyLine obj.attrs.rowSpan = 3 - } else if (index % 3 !== 0 && index !== 19) { + } else if (index % 3 !== 0 && index !== 18) { + obj.children = text || this.global.emptyLine obj.attrs.rowSpan = 0 } - if (index === 19) { + if (index === 18) { + obj.children =
总分: {this.allScore}
obj.attrs.colSpan = 6 } return obj @@ -283,10 +289,10 @@ export default { } if (index % 3 === 0) { obj.attrs.rowSpan = 3 - } else if (index % 3 !== 0 && index !== 19) { + } else if (index % 3 !== 0 && index !== 18) { obj.attrs.rowSpan = 0 } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } return obj @@ -303,7 +309,7 @@ export default { children: text || this.global.emptyLine, attrs: {} } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } return obj @@ -314,7 +320,17 @@ export default { align: 'center', width: 100, dataIndex: 'scoreRange', - colSpan: 0 + colSpan: 0, + customRender: (text, row, index) => { + const obj = { + children: text || this.global.emptyLine, + attrs: {} + } + if (index === 18) { + obj.attrs.colSpan = 0 + } + return obj + } }, { title: this.$t('enterpriseStandardLibrary.reviewMeeting.grade'), @@ -326,7 +342,7 @@ export default { children: text || this.global.emptyLine, attrs: {} } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } if (index % 3 === 0) { @@ -347,7 +363,7 @@ export default { children: text || this.global.emptyLine, attrs: {} } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } if (index % 3 === 0) { @@ -385,6 +401,17 @@ export default { } } }, + computed: { + // 总分 + allScore () { + const arr = [0, 3, 6, 9, 12, 15] + let score = 0 + for (const item of arr) { + score += Number(this.dataSource[item].evaluateScore) || 0 + } + return score + } + }, methods: { open (id) { this.visible = true @@ -440,4 +467,5 @@ export default { width: 80%; } } + diff --git a/src/views/enterpriseStandardLibrary/standard/detail/module/EnterpriseStandardEvaluateModal.vue b/src/views/enterpriseStandardLibrary/standard/detail/module/EnterpriseStandardEvaluateModal.vue index e2c17793..6b48dabc 100644 --- a/src/views/enterpriseStandardLibrary/standard/detail/module/EnterpriseStandardEvaluateModal.vue +++ b/src/views/enterpriseStandardLibrary/standard/detail/module/EnterpriseStandardEvaluateModal.vue @@ -147,6 +147,10 @@ const fixDataSourse = [ id: 18, score: '优秀', scoreRange: '7~10' + }, + { + id: 19, + project: '总分:0' } ] @@ -168,15 +172,17 @@ export default { dataIndex: 'project', customRender: (text, row, index) => { const obj = { - children: text || this.global.emptyLine, attrs: {} } if (index % 3 === 0) { + obj.children = text || this.global.emptyLine obj.attrs.rowSpan = 3 - } else if (index % 3 !== 0 && index !== 19) { + } else if (index % 3 !== 0 && index !== 18) { + obj.children = text || this.global.emptyLine obj.attrs.rowSpan = 0 } - if (index === 19) { + if (index === 18) { + obj.children =总分: {this.allScore}
obj.attrs.colSpan = 6 } return obj @@ -194,10 +200,10 @@ export default { } if (index % 3 === 0) { obj.attrs.rowSpan = 3 - } else if (index % 3 !== 0 && index !== 19) { + } else if (index % 3 !== 0 && index !== 18) { obj.attrs.rowSpan = 0 } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } return obj @@ -214,7 +220,7 @@ export default { children: text || this.global.emptyLine, attrs: {} } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } return obj @@ -225,7 +231,17 @@ export default { align: 'center', width: 100, dataIndex: 'scoreRange', - colSpan: 0 + colSpan: 0, + customRender: (text, row, index) => { + const obj = { + children: text || this.global.emptyLine, + attrs: {} + } + if (index === 18) { + obj.attrs.colSpan = 0 + } + return obj + } }, { title: this.$t('enterpriseStandardLibrary.reviewMeeting.grade'), @@ -237,7 +253,7 @@ export default { children: text || this.global.emptyLine, attrs: {} } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } if (index % 3 === 0) { @@ -258,7 +274,7 @@ export default { children: text || this.global.emptyLine, attrs: {} } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } if (index % 3 === 0) { @@ -296,6 +312,17 @@ export default { } } }, + computed: { + // 总分 + allScore () { + const arr = [0, 3, 6, 9, 12, 15] + let score = 0 + for (const item of arr) { + score += Number(this.dataSource[item].evaluateScore) || 0 + } + return score + } + }, methods: { open (standardId) { this.visible = true @@ -351,4 +378,5 @@ export default { width: 80%; } } + diff --git a/src/views/workCenter/enterpriseStandardRevision/modules/ScorerMarkBaseInfo.vue b/src/views/workCenter/enterpriseStandardRevision/modules/ScorerMarkBaseInfo.vue index 5a103e3c..f97bb6b3 100644 --- a/src/views/workCenter/enterpriseStandardRevision/modules/ScorerMarkBaseInfo.vue +++ b/src/views/workCenter/enterpriseStandardRevision/modules/ScorerMarkBaseInfo.vue @@ -153,6 +153,10 @@ const fixDataSourse = [ id: 18, score: '优秀', scoreRange: '7~10' + }, + { + id: 19, + project: '总分:0' } ] @@ -169,15 +173,16 @@ export default { dataIndex: 'project', customRender: (text, row, index) => { const obj = { - children: text || this.global.emptyLine, attrs: {} } if (index % 3 === 0) { + obj.children = text || this.global.emptyLine obj.attrs.rowSpan = 3 - } else if (index % 3 !== 0 && index !== 19) { + } else if (index % 3 !== 0 && index !== 18) { obj.attrs.rowSpan = 0 } - if (index === 19) { + if (index === 18) { + obj.children =总分: {this.allScore}
obj.attrs.colSpan = 6 } return obj @@ -186,7 +191,6 @@ export default { { title: this.$t('enterpriseStandardLibrary.reviewMeeting.desc'), align: 'center', - // width: 100, dataIndex: 'desc', customRender: (text, row, index) => { const obj = { @@ -195,10 +199,10 @@ export default { } if (index % 3 === 0) { obj.attrs.rowSpan = 3 - } else if (index % 3 !== 0 && index !== 19) { + } else if (index % 3 !== 0 && index !== 18) { obj.attrs.rowSpan = 0 } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } return obj @@ -215,7 +219,7 @@ export default { children: text || this.global.emptyLine, attrs: {} } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } return obj @@ -226,7 +230,17 @@ export default { align: 'center', width: 100, dataIndex: 'scoreRange', - colSpan: 0 + colSpan: 0, + customRender: (text, row, index) => { + const obj = { + children: text || this.global.emptyLine, + attrs: {} + } + if (index === 18) { + obj.attrs.colSpan = 0 + } + return obj + } }, { title: this.$t('enterpriseStandardLibrary.reviewMeeting.grade'), @@ -248,7 +262,7 @@ export default { // />, attrs: {} } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } if (index % 3 === 0) { @@ -275,7 +289,7 @@ export default { />, attrs: {} } - if (index === 19) { + if (index === 18) { obj.attrs.colSpan = 0 } if (index % 3 === 0) { @@ -290,6 +304,17 @@ export default { dataSource: [] } }, + computed: { + // 总分 + allScore () { + const arr = [0, 3, 6, 9, 12, 15] + let score = 0 + for (const item of arr) { + score += Number(this.dataSource[item].evaluateScore) || 0 + } + return score + } + }, mounted () { this.dataSource = [] }, @@ -301,7 +326,7 @@ export default { if (data.reviewMeetingDetails && data.reviewMeetingDetails.length > 0) { this.dataSource = JSON.parse(JSON.stringify(fixDataSourse)) for (const i in fixDataSourse) { - if (i % 3 === 0) { + if (i % 3 === 0 && Number(i) !== 18) { this.$set(this.dataSource[i], 'evaluateScore', data.reviewMeetingDetails[Math.floor(i / 3)].evaluateScore || '') this.$set(this.dataSource[i], 'deductionScoreReason', data.reviewMeetingDetails[Math.floor(i / 3)].deductionScoreReason || '') } @@ -320,7 +345,7 @@ export default { const data = {} const arr = [] for (const item in this.dataSource) { - if (item % 3 === 0) { + if (item % 3 === 0 && Number(item) !== 18) { // 是有评分和扣分理由的行 arr.push({ ...this.dataSource[item], @@ -337,6 +362,9 @@ export default { let hasErr = false const arr = [] for (const item in this.dataSource) { + if (Number(item) === 18) { + break + } if (item % 3 === 0 && (!this.dataSource[item].evaluateScore || !this.dataSource[item].deductionScoreReason)) { hasErr = true break @@ -354,6 +382,7 @@ export default { data = false } else { data.reviewMeetingDetails = arr + data.totalScore = this.allScore } return data } @@ -369,9 +398,9 @@ export default { display: flex; justify-content: space-between; align-items: center; -p { - margin-bottom: 0; - height: 100%; -} + p { + margin-bottom: 0; + height: 100%; + } }