zhangweicheng 5 rokov pred
rodič
commit
3dba82e23d

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

@@ -359,15 +359,18 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal) {
             billsTtlAmt:bills.quantity,
             billsPrices:[],
             billsUnitPrices:[],
+            rationCommons:[],
             billsAmounts:[],
             '技术经济指标':[],
             billsLevel:level,
             billsMemos:bills.remark
         };
         let total = 0;
+        let rationTotal =0;
         for(let n of nameList){
             let  p = 0;//金额
             let up =0;//单价
+            let ra = 0;//定额建安费
             if(bills.unitPrices[n]) up = scMathUtil.roundForObj(bills.unitPrices[n],decimal.bills.unitPrice);
             tem.billsUnitPrices.push(up);
             if(bills.prices[n]){
@@ -375,6 +378,11 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal) {
                 total = scMathUtil.roundForObj(p+total,decimal.process);
             }
             tem.billsPrices.push(p);
+            if(bills.rationCommons[n]){
+               ra = scMathUtil.roundForObj(bills.rationCommons[n],decimal.bills.totalPrice);
+               total = scMathUtil.roundForObj(ra+rationTotal,decimal.process);
+            }
+            tem.rationCommons.push(ra); 
             if(bills.quantityMap[n] && parseFloat(bills.quantityMap[n]) !== 0){
                 tem.billsAmounts.push(bills.quantityMap[n]);
                 tem['技术经济指标'].push(scMathUtil.roundForObj(p/bills.quantityMap[n],2));
@@ -384,6 +392,7 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal) {
             }
         }
         tem.billsTtlPrice = scMathUtil.roundForObj(total,decimal.bills.totalPrice);
+        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);
         if(bills.flag == fixedFlag.TOTAL_COST) totalItem = tem;
         return tem
@@ -415,6 +424,7 @@ async function mergeItem(a,b,decimal,project) {
     a.quantity = scMathUtil.roundForObj(a.quantity+b.quantity,decimal.process);
     for(let name in b.prices){
         a.prices[name] = b.prices[name];
+        a.rationCommons[name] = b.rationCommons[name];
         a.quantityMap[name] = b.quantityMap[name];
         a.unitPrices[name]=b.unitPrices[name];
     }
@@ -516,11 +526,14 @@ async function getBillsByProjectID(projectID){
        let prices = {};
        let quantityMap={};
        let unitPrices ={};
+       let rationCommons={};
+       let rationFee = _.find(b._doc.fees,{"fieldName":"rationCommon"});
        if(commonFee&&commonFee.totalFee) prices[projectName] =  commonFee.totalFee;
-       if (commonFee&&commonFee.unitFee) unitPrices[projectName] = commonFee.unitFee;
+       if(commonFee&&commonFee.unitFee) unitPrices[projectName] = commonFee.unitFee;
+       if(rationFee&&rationFee.totalFee) rationCommons[projectName] = rationFee.totalFee;
        quantityMap[projectName] = b.quantity;
        let flagIndex = _.find(b._doc.flags,{'fieldName':'fixed'});
-       let doc = {ID:b.ID,name:b.name,code:b.code,unit:b.unit,projectID:b.projectID, ParentID:b.ParentID,NextSiblingID:b.NextSiblingID,unitPrices:unitPrices,quantity:b.quantity,prices:prices,quantityMap:quantityMap,flag:flagIndex?flagIndex.flag:-99,remark:b.remark};//选取有用字段
+       let doc = {ID:b.ID,name:b.name,code:b.code,unit:b.unit,projectID:b.projectID, ParentID:b.ParentID,NextSiblingID:b.NextSiblingID,unitPrices:unitPrices,quantity:b.quantity,prices:prices,rationCommons:rationCommons,quantityMap:quantityMap,flag:flagIndex?flagIndex.flag:-99,remark:b.remark};//选取有用字段
        if(b.ParentID == -1) roots.push(doc);
        parentMap[b.ParentID]?parentMap[b.ParentID].push(doc):parentMap[b.ParentID]=[doc];
    }//设置子节点

+ 1 - 1
web/building_saas/main/js/views/project_glj_view.js

@@ -1086,7 +1086,6 @@ projectGljObject={
     changeFileCallback:function(){
         projectGljObject.unitPriceFileInit();
         projectGljObject.refreshDataSheet();
-        gljOprObj.refreshView();
         projectGljObject.initVvTax();
         materialCalcObj.showDatas();
         projectObj.project.calcProgram.calcAllNodesAndSave(calcAllType.catAll,function () {
@@ -1102,6 +1101,7 @@ projectGljObject={
                 socketObject.roomInfo.unitFile = socketObject.getUnitFileRoomID();
             }
         });
+        gljOprObj.refreshView();
 
     },
     calcPartASupplyFeeByProjectGLJs: function (projectGLJsArr) {