From 55f513d46be7b14c4a5b2fec704939ca13d1f389 Mon Sep 17 00:00:00 2001 From: shj <1790240199@qq.com> Date: 星期六, 02 四月 2022 10:23:45 +0800 Subject: [PATCH] 自查清单 --- src/views/safetyproduction/gojudging.vue | 23 ++++++++++++++++++++++- src/views/safetyproduction/review.vue | 4 ++++ 2 files changed, 26 insertions(+), 1 deletions(-) diff --git a/src/views/safetyproduction/gojudging.vue b/src/views/safetyproduction/gojudging.vue index 30a46e0..e62b544 100644 --- a/src/views/safetyproduction/gojudging.vue +++ b/src/views/safetyproduction/gojudging.vue @@ -11,8 +11,10 @@ ><p><span>B级要素:</span>{{ item.elementBName }}</p></el-col > <el-col :span="6" - ><p><span>得分:</span>50</p></el-col + ><p><span>总分:</span>50</p></el-col > + <el-col :span="6" + ><p><span>得分:</span>{{item.point}}</p></el-col> </el-row> <el-row> <el-col :span="24"> @@ -130,6 +132,7 @@ arr[i].child = this.checkSameData(arr[i].child); } this.lists = arr; + // console.log('tag', arr) }); }, checkSameDataA(resData) { @@ -154,12 +157,30 @@ if (!dataInfo[elementBName]) { dataInfo[elementBName] = { elementBName, + point:"", child: [], }; } dataInfo[elementBName].child.push(item); }); let list = Object.values(dataInfo); // list 转换成功的数据 + console.log(list) + for(var i=0;i<list.length;i++){ + var pot=50 + for(var j=0;j<list[i].child.length;j++){ + if(list[i].child[j].safetyInspectionItemResult!=0){ + pot=pot-list[i].child[j].selfDeductionList[0].point + }else{ + var cont=0 + pot=0 + } + } + if(pot>0){ + list[i].point=pot + }else{ + list[i].point=0 + } + } return list; }, handleClick(data) { diff --git a/src/views/safetyproduction/review.vue b/src/views/safetyproduction/review.vue index 307f748..0af1751 100644 --- a/src/views/safetyproduction/review.vue +++ b/src/views/safetyproduction/review.vue @@ -290,12 +290,16 @@ this.form=JSON.parse(JSON.stringify(data)); }, addC(){ + if(this.form.point<=50){ for(let i = 0;i<this.list.selfDeductionList.length;i++){ if (this.form.id=this.list.selfDeductionList[i].id){ this.list.selfDeductionList[i].point = this.form.point this.list.selfDeductionList[i].remark = this.form.remark } } + }else{ + alert("扣分不得超过总分50") + } this.dialogVisible = false; }, lost() { -- Gitblit v1.9.2