diff --git a/src/pages/details/otherBussStandardDetails/index.vue b/src/pages/details/otherBussStandardDetails/index.vue index bdb6dc031..a5ddec4b7 100644 --- a/src/pages/details/otherBussStandardDetails/index.vue +++ b/src/pages/details/otherBussStandardDetails/index.vue @@ -4,7 +4,7 @@
{{sarStandardsInfoEO.standCode}} 《{{sarStandardsInfoEO.standName}}》 企标详情 - {{ ((qualityCommentScore*2*0.9)+(dynamicCommentScore*2*0.1)).toFixed(3) }} + {{ ((qualityCommentScore*2*0.9)+(dynamicCommentScore*2*0.1)).toFixed(1) }}
@@ -27,7 +27,7 @@ - @@ -294,7 +294,7 @@ @@ -1612,7 +1612,7 @@ export default { this.dynamicHistoryCommentTable = res.data this.historyCommentForm.revise = res.data[0].targetScore - this.historyCommentForm.reviseReason = res.data[0].commentReason + this.historyCommentForm.reviseReason = res.data[0].commentReason ? (res.data[0].commentReason === '-'? '':res.data[0].commentReason) : res.data[0].commentReason let averageScore = 0 res.data.forEach(item => { @@ -1630,90 +1630,92 @@ export default { }, tabsClickBtn(tab, event){ - // 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.historyInfoLoading = true - // this.indexType = 'quality' - // //查询评分表 - // const allData = { - // lawId: this.$route.params.id, - // userId: this.dynamicFirstHistoryPeopleId, - // evaluationType: this.indexType - // } - // this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getEvaluationForm', allData , { - // _this: this - // }, res => { - // 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 - // this.historyInfoLoading = false - // }, e => { - // this.historyInfoLoading = false - // }) - // } - // - // //查询动态评价总平均分和质量评价总平均分 - // let standId = this.$route.params.id - // this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getScore', {lawId:standId}, { - // _this: this - // }, res => { - // this.qualityCommentScore = res.data.quality.toFixed(3)/2 - // this.dynamicCommentScore = res.data.dynamic.toFixed(3)/2 - // - // }, e => { - // }) - // - // // 刷新质量评价评分人表格和动态评价评分人表格 - // const qualityRequest = { - // lawId: standId, - // evaluationType: 'quality' - // } - // this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getHistory', qualityRequest, { - // _this: this - // }, res => { - // this.qualityHistoryPeopleTable = res.data.records - // this.qualityFirstHistoryPeopleId = res.data.records[0].userId - // - // }, e => { - // }) - // const dynamicRequest = { - // lawId: standId, - // evaluationType: 'dynamic' - // } - // this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getHistory', dynamicRequest, { - // _this: this - // }, res => { - // this.dynamicHistoryPeopleTable = res.data.records - // this.dynamicFirstHistoryPeopleId = res.data.records[0].userId - // - // }, e => { - // }) + 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.commentAverageScoreTag = '1' + this.tabsClick() + this.dynamicHistoryCommentTable = [] + this.historyInfoLoading = true + this.indexType = 'quality' + //查询评分表 + const allData = { + lawId: this.$route.params.id, + userId: this.dynamicFirstHistoryPeopleId, + evaluationType: this.indexType + } + this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getEvaluationForm', allData , { + _this: this + }, res => { + 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 + this.historyInfoLoading = false + }, e => { + this.historyInfoLoading = false + }) + } + + //查询动态评价总平均分和质量评价总平均分 + let standId = this.$route.params.id + this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getScore', {lawId:standId}, { + _this: this + }, res => { + this.qualityCommentScore = res.data.quality.toFixed(3)/2 + this.dynamicCommentScore = res.data.dynamic.toFixed(3)/2 + + }, e => { + }) + + // 刷新质量评价评分人表格和动态评价评分人表格 + const qualityRequest = { + lawId: standId, + evaluationType: 'quality' + } + this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getHistory', qualityRequest, { + _this: this + }, res => { + this.qualityHistoryPeopleTable = res.data.records + this.qualityFirstHistoryPeopleId = res.data.records[0].userId + + }, e => { + }) + const dynamicRequest = { + lawId: standId, + evaluationType: 'dynamic' + } + this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getHistory', dynamicRequest, { + _this: this + }, res => { + this.dynamicHistoryPeopleTable = res.data.records + this.dynamicFirstHistoryPeopleId = res.data.records[0].userId + + }, e => { + }) }, tabsClick(tab, event){ @@ -1739,6 +1741,7 @@ export default { } else if (this.commentAverageScoreTag === '2'){ this.indexType = 'dynamic' + this.dynamicHistoryCommentTable = [] //查询评分表 const allData = { lawId: this.$route.params.id, @@ -1748,19 +1751,23 @@ export default { this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getEvaluationForm', allData , { _this: this }, res => { - this.dynamicHistoryCommentTable = res.data - this.historyCommentForm.revise = res.data[0].targetScore - this.historyCommentForm.reviseReason = res.data[0].commentReason + 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 - this.historyInfoLoading = false + 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 }) @@ -3029,18 +3036,8 @@ export default { this.$http.get('sarEnterpriseStandardEvaluation/quality-evaluation/getEvaluationForm', allData , { _this: this }, res => { - if(res.data && res.data.length > 0){ - let averageScore = 0 - res.data.forEach(item=>{ - item.targetScore = Number(item.targetScore)/2 - averageScore += item.targetScore - }) - this.businessCommentForm.averageScore = averageScore/4 - this.businessCommentTable = res.data this.historyInfoLoading = false this.$forceUpdate() - } - }, e => { this.historyInfoLoading = false }) @@ -3141,9 +3138,11 @@ export default { this.$http.get('sarEnterpriseStandardEvaluation/evaluation-index/getEvaluationIndex', {indexType:this.indexType}, { _this: this }, res => { - this.businessCommentTable = res.data - console.log(this.businessCommentTable) - this.$forceUpdate() + + if(res.data){ + this.businessCommentTable = res.data + this.$forceUpdate() + } }, e => { }) this.sarStandardsInfoEO.id = this.$route.params.id