zhangweicheng 5 лет назад
Родитель
Сommit
4525f7bc1c
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      modules/main/facade/project_facade.js

+ 6 - 2
modules/main/facade/project_facade.js

@@ -342,13 +342,14 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal,isP
     }
     setChildrenDatas(items,datas);
     let totalExp = totalItem.calcBase;
-    if(isProgressiveType&&progressiveInterval){
+    if(isProgressiveType&&progressiveInterval){//有累进的要重新计算总金额和技术经济综合指标
       for(let t of datas){
         totalExp = totalExp.replace(t.ID,t.billsTtlPrice+"");
       }
       totalExp = totalExp.replace(/@/g,"");
       let nTotal = eval(totalExp);
       totalItem.billsTtlPrice = scMathUtil.roundForObj(nTotal,decimal.bills.totalPrice);
+      totalItem['技术经济综合指标'] = (totalItem.billsTtlAmt && parseFloat(totalItem.billsTtlAmt) !== 0)?scMathUtil.roundForObj(totalItem.billsTtlPrice/totalItem.billsTtlAmt,2):scMathUtil.roundForObj(totalItem.billsTtlPrice,2);
     }
 
     for(let d of datas){
@@ -373,8 +374,11 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal,isP
             arr.push(tbill);
             let sumChildren = setChildrenDatas(c.children,arr,level+1,rootFlag);  
             if(isProgressiveType && progressiveInterval && rootFlag == fixedFlag.MAINTENANCE_EXPENSES){//如果要累进的,父节点要重新汇总
+              if(c.children.length > 0){
+                tbill.billsTtlPrice = sumChildren;
+                tbill['技术经济综合指标'] = (tbill.billsTtlAmt && parseFloat(tbill.billsTtlAmt) !== 0)?scMathUtil.roundForObj(tbill.billsTtlPrice/tbill.billsTtlAmt,2):scMathUtil.roundForObj(tbill.billsTtlPrice,2);
+              } 
               if(level>0) temTotalPrice = scMathUtil.roundForObj(tbill.billsTtlPrice + temTotalPrice,decimal.bills.totalPrice); 
-              if(c.children.length > 0) tbill.billsTtlPrice = sumChildren;
             }
         }
         return temTotalPrice;