[update] 修改bug80413

This commit is contained in:
lideqin
2024-01-15 10:45:56 +08:00
parent 03a0123f04
commit 039cd7fc88
3 changed files with 119 additions and 34 deletions
@@ -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 = <p class="all-score">总分: {this.allScore}</p>
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%;
}
}
</style>