|
@@ -191,6 +191,8 @@
|
|
|
<div>审核进度:{{ computedStep }}/{{ twoTarget }}</div>
|
|
|
<div>自评分数:{{ DigSelfSco }}</div>
|
|
|
<div>考核分数:{{ computedSco }}</div>
|
|
|
+ <div v-if="formula">最终得分:{{formulaScore}}</div>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="height:100%;overflow: auto;padding-bottom: 80px;">
|
|
@@ -460,7 +462,8 @@ export default {
|
|
|
PageBaseDataTwo: [],
|
|
|
remDig: false,
|
|
|
timeSortList:[],
|
|
|
- typeStatusList:["待办","已完成",'/']
|
|
|
+ typeStatusList:["待办","已完成",'/'],
|
|
|
+ formula:""
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -538,6 +541,45 @@ export default {
|
|
|
return score;
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ formulaScore(){
|
|
|
+ let _result = "0.00"
|
|
|
+
|
|
|
+ if(this.formula && this.PageBaseData){
|
|
|
+ let scoreObj = {}
|
|
|
+ this.PageBaseData.forEach(i=>{
|
|
|
+ if(!scoreObj[i.id]){
|
|
|
+ scoreObj[i.id] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ i.children.forEach(i2=>{
|
|
|
+ if(i2.sco2){
|
|
|
+ scoreObj[i.id]+=parseFloat(i2.sco2)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ let formulaText = this.formula;
|
|
|
+ for (const key in scoreObj) {
|
|
|
+ if (scoreObj.hasOwnProperty(key)) {
|
|
|
+ const regex = new RegExp('\\b' + key + '\\b', 'g');
|
|
|
+ formulaText = formulaText.replace(regex, scoreObj[key]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!formulaText)return _result;
|
|
|
+
|
|
|
+ try{
|
|
|
+ _result = eval(formulaText).toFixed(2)
|
|
|
+ }catch(e){
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return _result;
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getData();
|
|
@@ -1209,7 +1251,8 @@ ws['!rows'] = [
|
|
|
.get(this.$store.state.api + "selectTestExamineBase", params)
|
|
|
.then(res => {
|
|
|
// console.log("selectTestExamineBase", res.data[0][0]);
|
|
|
-
|
|
|
+ this.formula = res.data[0][0].formula?res.data[0][0].formula:"";
|
|
|
+ console.log("formula",this.formula)
|
|
|
this.PageBaseData = JSON.parse(res.data[0][0].json);
|
|
|
this.PageBaseDataTwo = JSON.parse(res.data[0][0].json);
|
|
|
// 处理数据来源
|