[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
@@ -148,6 +148,10 @@ const fixDataSourse = [
id: 18, id: 18,
score: '优秀', score: '优秀',
scoreRange: '7~10' scoreRange: '7~10'
},
{
id: 19,
project: '总分:0'
} }
] ]
const initData = { const initData = {
@@ -257,15 +261,17 @@ export default {
dataIndex: 'project', dataIndex: 'project',
customRender: (text, row, index) => { customRender: (text, row, index) => {
const obj = { const obj = {
children: text || this.global.emptyLine,
attrs: {} attrs: {}
} }
if (index % 3 === 0) { if (index % 3 === 0) {
obj.children = text || this.global.emptyLine
obj.attrs.rowSpan = 3 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 obj.attrs.rowSpan = 0
} }
if (index === 19) { if (index === 18) {
obj.children = <p class="all-score">总分: {this.allScore}</p>
obj.attrs.colSpan = 6 obj.attrs.colSpan = 6
} }
return obj return obj
@@ -283,10 +289,10 @@ export default {
} }
if (index % 3 === 0) { if (index % 3 === 0) {
obj.attrs.rowSpan = 3 obj.attrs.rowSpan = 3
} else if (index % 3 !== 0 && index !== 19) { } else if (index % 3 !== 0 && index !== 18) {
obj.attrs.rowSpan = 0 obj.attrs.rowSpan = 0
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
return obj return obj
@@ -303,7 +309,7 @@ export default {
children: text || this.global.emptyLine, children: text || this.global.emptyLine,
attrs: {} attrs: {}
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
return obj return obj
@@ -314,7 +320,17 @@ export default {
align: 'center', align: 'center',
width: 100, width: 100,
dataIndex: 'scoreRange', 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'), title: this.$t('enterpriseStandardLibrary.reviewMeeting.grade'),
@@ -326,7 +342,7 @@ export default {
children: text || this.global.emptyLine, children: text || this.global.emptyLine,
attrs: {} attrs: {}
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
if (index % 3 === 0) { if (index % 3 === 0) {
@@ -347,7 +363,7 @@ export default {
children: text || this.global.emptyLine, children: text || this.global.emptyLine,
attrs: {} attrs: {}
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
if (index % 3 === 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: { methods: {
open (id) { open (id) {
this.visible = true this.visible = true
@@ -440,4 +467,5 @@ export default {
width: 80%; width: 80%;
} }
} }
</style> </style>
@@ -147,6 +147,10 @@ const fixDataSourse = [
id: 18, id: 18,
score: '优秀', score: '优秀',
scoreRange: '7~10' scoreRange: '7~10'
},
{
id: 19,
project: '总分:0'
} }
] ]
@@ -168,15 +172,17 @@ export default {
dataIndex: 'project', dataIndex: 'project',
customRender: (text, row, index) => { customRender: (text, row, index) => {
const obj = { const obj = {
children: text || this.global.emptyLine,
attrs: {} attrs: {}
} }
if (index % 3 === 0) { if (index % 3 === 0) {
obj.children = text || this.global.emptyLine
obj.attrs.rowSpan = 3 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 obj.attrs.rowSpan = 0
} }
if (index === 19) { if (index === 18) {
obj.children = <p class="all-score">总分: {this.allScore}</p>
obj.attrs.colSpan = 6 obj.attrs.colSpan = 6
} }
return obj return obj
@@ -194,10 +200,10 @@ export default {
} }
if (index % 3 === 0) { if (index % 3 === 0) {
obj.attrs.rowSpan = 3 obj.attrs.rowSpan = 3
} else if (index % 3 !== 0 && index !== 19) { } else if (index % 3 !== 0 && index !== 18) {
obj.attrs.rowSpan = 0 obj.attrs.rowSpan = 0
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
return obj return obj
@@ -214,7 +220,7 @@ export default {
children: text || this.global.emptyLine, children: text || this.global.emptyLine,
attrs: {} attrs: {}
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
return obj return obj
@@ -225,7 +231,17 @@ export default {
align: 'center', align: 'center',
width: 100, width: 100,
dataIndex: 'scoreRange', 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'), title: this.$t('enterpriseStandardLibrary.reviewMeeting.grade'),
@@ -237,7 +253,7 @@ export default {
children: text || this.global.emptyLine, children: text || this.global.emptyLine,
attrs: {} attrs: {}
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
if (index % 3 === 0) { if (index % 3 === 0) {
@@ -258,7 +274,7 @@ export default {
children: text || this.global.emptyLine, children: text || this.global.emptyLine,
attrs: {} attrs: {}
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
if (index % 3 === 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: { methods: {
open (standardId) { open (standardId) {
this.visible = true this.visible = true
@@ -351,4 +378,5 @@ export default {
width: 80%; width: 80%;
} }
} }
</style> </style>
@@ -153,6 +153,10 @@ const fixDataSourse = [
id: 18, id: 18,
score: '优秀', score: '优秀',
scoreRange: '7~10' scoreRange: '7~10'
},
{
id: 19,
project: '总分:0'
} }
] ]
@@ -169,15 +173,16 @@ export default {
dataIndex: 'project', dataIndex: 'project',
customRender: (text, row, index) => { customRender: (text, row, index) => {
const obj = { const obj = {
children: text || this.global.emptyLine,
attrs: {} attrs: {}
} }
if (index % 3 === 0) { if (index % 3 === 0) {
obj.children = text || this.global.emptyLine
obj.attrs.rowSpan = 3 obj.attrs.rowSpan = 3
} else if (index % 3 !== 0 && index !== 19) { } else if (index % 3 !== 0 && index !== 18) {
obj.attrs.rowSpan = 0 obj.attrs.rowSpan = 0
} }
if (index === 19) { if (index === 18) {
obj.children = <p class="all-score">总分: {this.allScore}</p>
obj.attrs.colSpan = 6 obj.attrs.colSpan = 6
} }
return obj return obj
@@ -186,7 +191,6 @@ export default {
{ {
title: this.$t('enterpriseStandardLibrary.reviewMeeting.desc'), title: this.$t('enterpriseStandardLibrary.reviewMeeting.desc'),
align: 'center', align: 'center',
// width: 100,
dataIndex: 'desc', dataIndex: 'desc',
customRender: (text, row, index) => { customRender: (text, row, index) => {
const obj = { const obj = {
@@ -195,10 +199,10 @@ export default {
} }
if (index % 3 === 0) { if (index % 3 === 0) {
obj.attrs.rowSpan = 3 obj.attrs.rowSpan = 3
} else if (index % 3 !== 0 && index !== 19) { } else if (index % 3 !== 0 && index !== 18) {
obj.attrs.rowSpan = 0 obj.attrs.rowSpan = 0
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
return obj return obj
@@ -215,7 +219,7 @@ export default {
children: text || this.global.emptyLine, children: text || this.global.emptyLine,
attrs: {} attrs: {}
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
return obj return obj
@@ -226,7 +230,17 @@ export default {
align: 'center', align: 'center',
width: 100, width: 100,
dataIndex: 'scoreRange', 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'), title: this.$t('enterpriseStandardLibrary.reviewMeeting.grade'),
@@ -248,7 +262,7 @@ export default {
// />, // />,
attrs: {} attrs: {}
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
if (index % 3 === 0) { if (index % 3 === 0) {
@@ -275,7 +289,7 @@ export default {
/>, />,
attrs: {} attrs: {}
} }
if (index === 19) { if (index === 18) {
obj.attrs.colSpan = 0 obj.attrs.colSpan = 0
} }
if (index % 3 === 0) { if (index % 3 === 0) {
@@ -290,6 +304,17 @@ export default {
dataSource: [] 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 () { mounted () {
this.dataSource = [] this.dataSource = []
}, },
@@ -301,7 +326,7 @@ export default {
if (data.reviewMeetingDetails && data.reviewMeetingDetails.length > 0) { if (data.reviewMeetingDetails && data.reviewMeetingDetails.length > 0) {
this.dataSource = JSON.parse(JSON.stringify(fixDataSourse)) this.dataSource = JSON.parse(JSON.stringify(fixDataSourse))
for (const i in 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], 'evaluateScore', data.reviewMeetingDetails[Math.floor(i / 3)].evaluateScore || '')
this.$set(this.dataSource[i], 'deductionScoreReason', data.reviewMeetingDetails[Math.floor(i / 3)].deductionScoreReason || '') this.$set(this.dataSource[i], 'deductionScoreReason', data.reviewMeetingDetails[Math.floor(i / 3)].deductionScoreReason || '')
} }
@@ -320,7 +345,7 @@ export default {
const data = {} const data = {}
const arr = [] const arr = []
for (const item in this.dataSource) { for (const item in this.dataSource) {
if (item % 3 === 0) { if (item % 3 === 0 && Number(item) !== 18) {
// 是有评分和扣分理由的行 // 是有评分和扣分理由的行
arr.push({ arr.push({
...this.dataSource[item], ...this.dataSource[item],
@@ -337,6 +362,9 @@ export default {
let hasErr = false let hasErr = false
const arr = [] const arr = []
for (const item in this.dataSource) { for (const item in this.dataSource) {
if (Number(item) === 18) {
break
}
if (item % 3 === 0 && (!this.dataSource[item].evaluateScore || !this.dataSource[item].deductionScoreReason)) { if (item % 3 === 0 && (!this.dataSource[item].evaluateScore || !this.dataSource[item].deductionScoreReason)) {
hasErr = true hasErr = true
break break
@@ -354,6 +382,7 @@ export default {
data = false data = false
} else { } else {
data.reviewMeetingDetails = arr data.reviewMeetingDetails = arr
data.totalScore = this.allScore
} }
return data return data
} }
@@ -369,9 +398,9 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
p { p {
margin-bottom: 0; margin-bottom: 0;
height: 100%; height: 100%;
} }
} }
</style> </style>