Browse Source

报表接口

zhangweicheng 5 years ago
parent
commit
2f40c7fb71
2 changed files with 17 additions and 13 deletions
  1. 15 12
      modules/main/facade/project_facade.js
  2. 2 1
      web/over_write/js/neimeng_2019.js

+ 15 - 12
modules/main/facade/project_facade.js

@@ -338,15 +338,15 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal,isP
     let datas = [],totalItem = null;
     let overWrite = null;
     if(overWriteUrl && overWriteUrl!=""){
-      overWrite = require("../../.."+compilation.overWriteUrl);
+      overWrite = require("../../.."+overWriteUrl);
     }
     setChildrenDatas(items,datas);
     let totalExp = totalItem.calcBase;
     if(isProgressiveType&&progressiveInterval){
       for(let t of datas){
-        totalExp.replace(t.ID,t.billsTtlPrice+"");
+        totalExp = totalExp.replace(t.ID,t.billsTtlPrice+"");
       }
-      totalExp.replace(/@/g,"");
+      totalExp = totalExp.replace(/@/g,"");
       let nTotal = eval(totalExp);
       totalItem.billsTtlPrice = scMathUtil.roundForObj(nTotal,decimal.bills.totalPrice);
     }
@@ -393,6 +393,7 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal,isP
             billsAmounts:[],
             '技术经济指标':[],
             billsLevel:level,
+            calcBase:bills.calcBase,
             billsMemos:bills.remark
         };
         let total = 0;
@@ -429,14 +430,16 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal,isP
               }
             }
         }
-        if(progressiveInterval && isProgressiveType&&calcUtil.isProgressive(bills.calcBase,overWrite?overWrite.progression:undefined) && rootFlag == fixedFlag.MAINTENANCE_EXPENSES){
-          let calcTotal = calcUtil.getProgressiveFee(baseTotal,bills.calcBase,progressiveInterval,decimal.bills.totalPrice,overWrite?overWrite.deficiency:undefined);
-          tem.billsTtlPrice = calcTotal;
-          let rate =  scMathUtil.roundForObj(calcTotal * 100/baseTotal,decimal.feeRate);
-          tem.billsMemos = "费率:"+rate+"%"; 
-          //“费率:n%”,n为汇总后重算的金额/汇总后的基数
-        }else{
-          tem.billsTtlPrice = scMathUtil.roundForObj(total,decimal.bills.totalPrice);
+        tem.billsTtlPrice = scMathUtil.roundForObj(total,decimal.bills.totalPrice);
+        if(progressiveInterval && isProgressiveType  && rootFlag == fixedFlag.MAINTENANCE_EXPENSES){
+          let baseArr =  calcUtil.getProgressive(bills.calcBase,overWrite?overWrite.progression:undefined);
+          if(baseArr.length > 0){
+            let calcTotal = calcUtil.getProgressiveFee(baseTotal,baseArr[0],progressiveInterval,decimal.bills.totalPrice,overWrite?overWrite.deficiency:undefined);
+            tem.billsTtlPrice = calcTotal;
+            let rate =  scMathUtil.roundForObj(calcTotal * 100/baseTotal,decimal.feeRate);
+            tem.billsMemos = "费率:"+rate+"%"; 
+            //“费率:n%”,n为汇总后重算的金额/汇总后的基数
+          }
         }
         tem.rationTotal =  scMathUtil.roundForObj(rationTotal,decimal.bills.totalPrice);//定额总建安费
         tem['技术经济综合指标'] = (tem.billsTtlAmt && parseFloat(tem.billsTtlAmt) !== 0)?scMathUtil.roundForObj(tem.billsTtlPrice/tem.billsTtlAmt,2):scMathUtil.roundForObj(tem.billsTtlPrice,2);
@@ -583,7 +586,7 @@ async function getBillsByProjectID(projectID){
        if(commonFee&&commonFee.totalFee) prices[projectName] =  commonFee.totalFee;
        if(commonFee&&commonFee.unitFee) unitPrices[projectName] = commonFee.unitFee;
        if(rationFee&&rationFee.totalFee) rationCommons[projectName] = rationFee.totalFee;
-       baseProgressiveFees = baseProgressiveFees[projectName] = b.baseProgressiveFee;
+       baseProgressiveFees[projectName] = b.baseProgressiveFee;
 
        quantityMap[projectName] = b.quantity;
        let flagIndex = _.find(b._doc.flags,{'fieldName':'fixed'});

+ 2 - 1
web/over_write/js/neimeng_2019.js

@@ -255,7 +255,8 @@ if (typeof baseFigureTemplate !== 'undefined') {
         },
         // 信息化费:以累进办法计算,计算基数为“定额建筑安装工程费(定额设备购置费按40%计)”
         XXHF(tender) {
-            const baseFee = this['DEJZAZGCFSBSS'](tender);
+            //const baseFee = this['DEJZAZGCFSBSS'](tender);
+            const baseFee = 4641380;
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }