From e20c00b978046bb77fc302aa0a49cda49f4f1345 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期三, 26 六月 2024 18:03:54 +0800 Subject: [PATCH] 完善计算 --- src/components/do/b1-inspect-order-plan/Inspection.vue | 30 +++++++++++++++++++++++++++++- 1 files changed, 29 insertions(+), 1 deletions(-) diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue index 3a03d0d..25a7495 100644 --- a/src/components/do/b1-inspect-order-plan/Inspection.vue +++ b/src/components/do/b1-inspect-order-plan/Inspection.vue @@ -1240,7 +1240,35 @@ this.saveInsContext() } } else { - let comResult = excelFunction.compute(item.v.f.replace(/=/g, ' '),comValue); + let comResult = '' + try { + if(this.getInspectionValueType(item.i)==1){ + comResult = excelFunction.compute(item.v.f.replace(/=/g, ' '),comValue) + }else{ + let valueList = []; + item.valueList.forEach(a => { + valueList.push({ + name: `${this.comparisonList.find(e=>e.value==a.c).label}${a.r+1}`, + value: 0, + }) + }) + for (var a in comValue) { + valueList.forEach(b => { + if (b.name == a) { + b.value = comValue[a] + } + }) + } + let str = item.v.f.replace(/=/g, ' ') + valueList.forEach(b => { + str = str.replace(b.name, b.value) + }) + comResult = str + } + } catch (error) { + + } + // comResult = excelFunction.compute(item.v.f.replace(/=/g, ' '),comValue); // switch (item.methodName) { // case 'AVERAGE': // let num = 0 -- Gitblit v1.9.3