企标详情-评分优化

This commit is contained in:
zyn
2023-11-08 17:08:38 +08:00
parent 527797ec81
commit efa7d28c58
@@ -142,8 +142,9 @@
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.row.processNode" placement="right">
<el-button type="default"
:class="currentPeople === scope.$index ? 'active' : ''"
style="width: 180px;" size="mini"
@click="historyPeopleChange(scope.row)">
@click="historyPeopleChange(scope.row, scope.$index)">
{{ scope.row.userName + '-' + scope.row.processNode.substring(0,9) }}
</el-button>
</el-tooltip>
@@ -166,7 +167,8 @@
show-overflow-tooltip>
<template slot-scope="scope">
<el-button type="default"
style="width: 100px;" size="mini" @click="historyPeopleChange(scope.row)">
:class="currentPeople === scope.$index ? 'active' : ''"
style="width: 100px;" size="mini" @click="historyPeopleChange(scope.row, scope.$index)">
{{ scope.row.userName }}
</el-button>
</template>
@@ -1575,6 +1577,7 @@ export default {
importForm: {
content: ''
},
currentPeople: 0, // 历史评价-当前评价人索引
STANDSOURCEREVISION: []
}
},
@@ -1583,7 +1586,9 @@ export default {
watch: {
},
methods: {
historyPeopleChange(row){
historyPeopleChange(row, index){
this.currentPeople = index
this.historyInfoLoading = true
const qualityAllData = {
lawId: this.$route.params.id,
@@ -1630,7 +1635,112 @@ export default {
}
},
getScore () {
//查询动态评价总平均分和质量评价总平均分
let standId = this.$route.params.id
this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getScore', {lawId:standId}, {
_this: this
}, res => {
if (res.ok) {
this.score = res.data.finalScore.toFixed(2)
this.qualityCommentScore = res.data.quality.toFixed(2)
this.dynamicCommentScore = res.data.dynamic.toFixed(2)
}
}, e => {
})
},
getPeopleTable () {
return new Promise((resolve,reject) => {
// 历史评价
if (this.commentActiveName === 'historyComment') {
// 刷新质量评价评分人表格和动态评价评分人表格
let standId = this.$route.params.id
// 质量评价人
if (this.commentAverageScoreTag === '1') {
const qualityRequest = {
lawId: standId,
evaluationType: 'quality'
}
this.$http._getData('sarEnterpriseStandardEvaluation/quality-evaluation/getHistory', qualityRequest).then(res => {
this.qualityHistoryPeopleTable = res.data.records
this.qualityFirstHistoryPeopleId = res.data.records[0].userId
resolve(res)
})
} else {
// 动态评价人
const dynamicRequest = {
lawId: standId,
evaluationType: 'dynamic'
}
this.$http._getData('sarEnterpriseStandardEvaluation/quality-evaluation/getHistory', dynamicRequest).then(res => {
this.dynamicHistoryPeopleTable = res.data.records
this.dynamicFirstHistoryPeopleId = res.data.records[0].userId
resolve(res)
})
}
}
})
},
getHistoryData () {
this.historyInfoLoading = true
if (this.commentAverageScoreTag === '1'){
this.indexType = 'quality'
//查询评分表
const allData = {
lawId: this.$route.params.id,
userId: this.qualityFirstHistoryPeopleId,
evaluationType: this.indexType,
processNode: this.qualityHistoryPeopleTable.length>0?this.qualityHistoryPeopleTable[0].processNode:null
}
this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getEvaluationForm', allData , {
_this: this
}, res => {
this.qualityHistoryCommentTable = res.data
this.historyInfoLoading = false
}, e => {
this.historyInfoLoading = false
})
}
else if (this.commentAverageScoreTag === '2'){
this.indexType = 'dynamic'
this.dynamicHistoryCommentTable = []
//查询评分表
const allData = {
lawId: this.$route.params.id,
userId: this.dynamicFirstHistoryPeopleId,
evaluationType: this.indexType
}
this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getEvaluationForm', allData , {
_this: this
}, res => {
if(res.data && res.data.length > 0){
this.dynamicHistoryCommentTable = res.data
this.historyCommentForm.revise = res.data[0].targetScore
this.historyCommentForm.reviseReason = res.data[0].commentReason
let averageScore = 0
res.data.forEach(item => {
if (item.valueType === 'number'){
averageScore += parseInt(item.targetScore)
}
})
averageScore = averageScore / 4
this.historyCommentForm.averageScore = averageScore
}else {
this.historyCommentForm.averageScore = 0
}
this.historyInfoLoading = false
}, e => {
this.historyInfoLoading = false
})
}
},
tabsClickBtn(tab, event){
this.commentAverageScoreTag = '1'
this.tabsClick()
/*
if (this.commentActiveName === 'dynamicComment'){
this.indexType = 'dynamic'
//查询评分表
@@ -1721,8 +1831,37 @@ export default {
}, e => {
})
*/
},
tabsClick(tab, event){
this.getScore()
this.getPeopleTable().then(() => {
// 动态评价
if (this.commentActiveName === 'dynamicComment'){
this.indexType = 'dynamic'
//查询评分表
const allData = {
lawId: this.$route.params.id,
userId: this.qualityFirstHistoryPeopleId,
evaluationType: this.indexType,
}
this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getEvaluationForm', allData , {
_this: this
}, res => {
this.qualityHistoryCommentTable = res.data
this.historyInfoLoading = false
}, e => {
this.historyInfoLoading = false
})
}else if (this.commentActiveName === 'historyComment'){
// 历史评价
this.currentPeople = 0
this.getHistoryData()
}
})
/*
this.historyInfoLoading = true
if (this.commentAverageScoreTag === '1'){
this.indexType = 'quality'
@@ -1816,7 +1955,7 @@ export default {
}, e => {
})
*/
},
targetScoreChange(row){
if (this.targetScore1 === '') {
@@ -1929,6 +2068,8 @@ export default {
}, e => {
})
//刷新动态评价总平均分和质量评价总平均分
this.getScore()
/*
this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getScore', {lawId:standId}, {
_this: this
}, res => {
@@ -1940,6 +2081,7 @@ export default {
}, e => {
})
*/
}
}, e => {
})
@@ -1958,7 +2100,13 @@ export default {
sums[index] = '';
return;
}
const values = data.map(item => Number(item[column.property]));
const values = data.map(item => {
if (column.property === 'scoreMin') {
// 此时不存在scoreMin,需要重新计算
this.setScoreMin(item)
}
return Number(item[column.property])
});
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
@@ -3121,6 +3269,10 @@ export default {
},
qbBtn() {
// 默认动态评价
this.commentActiveName = 'dynamicComment'
this.commentAverageScoreTag = '1'
if (this.commentActiveName === 'dynamicComment'){
this.indexType = 'dynamic'
//查询评分表
@@ -3202,6 +3354,8 @@ export default {
this.STANDSOURCEREVISION = res.data.STANDSOURCEREVISION
}, e => {
})
this.getScore()
/*
this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getScore', {lawId:standId}, {
_this: this
}, res => {
@@ -3238,6 +3392,7 @@ export default {
}, e => {
})
*/
this.$http.get('sarEnterpriseStandardEvaluation/evaluation-index/getEvaluationIndex', {indexType:this.indexType}, {
_this: this
}, res => {
@@ -3460,6 +3615,11 @@ export default {
}
}
.modular-header-btn{
.active {
color: #409EFF;
border-color: #c6e2ff;
background-color: #ecf5ff;
}
& > button{
height: 30px;
line-height: 30px;