|
|
@@ -349,15 +349,19 @@ function getReportData(nameList, items, prjTypeNames, compilationScopes, decimal
|
|
|
let totalExp = item.calcBase;
|
|
|
if (totalExp.indexOf('@') == -1) return;
|
|
|
if (isProgressiveType && progressiveInterval) { //有累进的要重新计算总金额和技术经济综合指标
|
|
|
+ let hasReplace = false;
|
|
|
for (let t of datas) {
|
|
|
+ if (totalExp.includes(t.ID)) hasReplace = true; // 强壮性处理:控制提前计算问题(ID在datas中找不到)
|
|
|
totalExp = totalExp.replace(t.ID, t.billsTtlPrice + "");
|
|
|
}
|
|
|
- totalExp = totalExp.replace(/@/g, "");
|
|
|
- //还有其他符号(如%)
|
|
|
- totalExp = totalExp.replace(/%/g, " / 100 ");
|
|
|
- let nTotal = eval(totalExp);
|
|
|
- item.billsTtlPrice = scMathUtil.roundForObj(nTotal, decimal.bills.totalPrice);
|
|
|
- item['技术经济综合指标'] = (item.billsTtlAmt && parseFloat(item.billsTtlAmt) !== 0) ? scMathUtil.roundForObj(item.billsTtlPrice / item.billsTtlAmt, 2) : scMathUtil.roundForObj(item.billsTtlPrice, 2);
|
|
|
+ if (hasReplace) {
|
|
|
+ totalExp = totalExp.replace(/@/g, "");
|
|
|
+ //还有其他符号(如%)
|
|
|
+ totalExp = totalExp.replace(/%/g, " / 100 ");
|
|
|
+ let nTotal = eval(totalExp);
|
|
|
+ item.billsTtlPrice = scMathUtil.roundForObj(nTotal, decimal.bills.totalPrice);
|
|
|
+ item['技术经济综合指标'] = (item.billsTtlAmt && parseFloat(item.billsTtlAmt) !== 0) ? scMathUtil.roundForObj(item.billsTtlPrice / item.billsTtlAmt, 2) : scMathUtil.roundForObj(item.billsTtlPrice, 2);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|