From dd43c95c5a020c1a828263cc5944ed6fb644b65d Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期五, 05 五月 2023 08:53:18 +0800 Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/~mayuhao/HazardInvestigationSystem --- src/views/safetyproduction/gojudging.vue | 56 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 48 insertions(+), 8 deletions(-) diff --git a/src/views/safetyproduction/gojudging.vue b/src/views/safetyproduction/gojudging.vue index f941b95..55b365f 100644 --- a/src/views/safetyproduction/gojudging.vue +++ b/src/views/safetyproduction/gojudging.vue @@ -6,8 +6,11 @@ class="btn" v-if="typeId == 2 ? false : true" @click="finish()" - >结单</el-button - > + >结单</el-button> + <div class="point"> + 所有A级要素总分= {{remark}} + </div> + <div v-for="(item, index) in lists" :key="index" @@ -112,7 +115,7 @@ type="text" size="small" :disabled="typeId == 2 ? true : false" - >评价</el-button + >评审</el-button > <!-- <el-button type="text" size="small" style="color: red" >删除</el-button @@ -150,6 +153,7 @@ lists: [], listType: [], typeId: "", + remark:"", }; }, created() { @@ -178,7 +182,6 @@ }) .then(() => { safetySelfInspectionFinish({ id: this.id }).then((res) => { - console.log(123, res); if (res.data.code === "200") { this.$notify({ title: "成功", @@ -187,7 +190,7 @@ duration: 2000, }); this.$router.push({ - path: "/checklistself", + path:"/safetyproduction/safetyproduction/checklistself" }); } else { this.$message({ @@ -199,7 +202,7 @@ }) .catch((error) => {}); } else { - alert("请将所有评分评价后再点结算"); + alert("所有的检查项评审后才可以结单!"); } }, @@ -210,10 +213,40 @@ var arr = this.checkSameDataA(this.list.itemList); for (var i = 0; i < arr.length; i++) { arr[i].child = this.checkSameData(arr[i].child); + arr[i].elementAWeight = arr[i].child[0].elementAWeight; arr[i].child.points = arr[i].child.point; } this.lists = arr; - console.log("tag", arr); + let showDetail = '' + for (let i = 0 ; i < arr.length ; i++){ + if (i < arr.length - 1 ){ + showDetail+='('+arr[i].elementAName + ' * '+arr[i].elementAWeight+ ') + ' + } else{ + showDetail+='('+arr[i].elementAName + ' * '+arr[i].elementAWeight+ ')' + } + } + this.remark+=showDetail + if (this.typeId==2){ + let pointA = '' + let pointDetail = ' = ' + let finalPoint=0 + for (let i = 0 ; i < arr.length ; i++){ + let childData = arr[i].child + pointA = 0 + for (let j = 0 ; j < childData.length ; j++){ + //改A级要素的总分 + pointA += childData[j].point + } + finalPoint += pointA * arr[i].elementAWeight + if (i < arr.length - 1 ){ + pointDetail +='('+pointA + ' * '+arr[i].elementAWeight+ ') + ' + } else{ + pointDetail +='('+pointA + ' * '+arr[i].elementAWeight+ ') = ' + } + } + pointDetail +=finalPoint + this.remark+=pointDetail + } }); }, checkSameDataA(resData) { @@ -223,6 +256,7 @@ if (!dataInfo[elementAName]) { dataInfo[elementAName] = { elementAName, + elementAWeight:'', child: [], }; } @@ -239,6 +273,7 @@ dataInfo[elementBName] = { elementBName, point: "", + elementAWeight:item.elementAWeight, points: item.point, child: [], }; @@ -246,7 +281,6 @@ dataInfo[elementBName].child.push(item); }); let list = Object.values(dataInfo); // list 转换成功的数据 - // console.log("数据",list) for (var i = 0; i < list.length; i++) { var pot = list[i].points; for (var j = 0; j < list[i].child.length; j++) { @@ -298,6 +332,12 @@ height: 850px; overflow-y: overlay; } +.point { + background-color: rgba(3,78,162,0.1); + font-size: 20px; + padding: 10px 5px; + font-weight: bold; +} .title { font-size: 16px; padding: 10px 0px; -- Gitblit v1.9.2