Browse Source

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/ConstructionCost

vian 5 years ago
parent
commit
f81f0f704f
1 changed files with 16 additions and 2 deletions
  1. 16 2
      modules/reports/util/rpt_construct_data_util.js

+ 16 - 2
modules/reports/util/rpt_construct_data_util.js

@@ -144,8 +144,10 @@ class Rpt_Data_Extractor {
                             rst.push(key);
                             if (key === projectConst.RATION_GLJ && (rst.indexOf(projectConst.PROJECTGLJ) < 0)) {
                                 rst.push(projectConst.PROJECTGLJ);
+                                if (rst.indexOf(projectConst.LABOUR_COE < 0)) rst.push(projectConst.LABOUR_COE);
                             }
                             if (key === projectConst.PROJECTGLJ) {
+                                if (rst.indexOf(projectConst.LABOUR_COE < 0)) rst.push(projectConst.LABOUR_COE);
                                 if (rst.indexOf(projectConst.RATION_GLJ) < 0) rst.push(projectConst.RATION_GLJ);
                                 if (field[JV.PROP_FIELD_EXP_MAP].indexOf("'quantity'") > 0 ||
                                     field[JV.PROP_FIELD_EXP_MAP].indexOf("'subdivisionQuantity'") > 0 ||
@@ -263,6 +265,7 @@ class Rpt_Data_Extractor {
                     }
                 }
             }
+            let labourCoeDatas =  getModuleDataByKey(rawDataObj.prjData, "labour_coe");
             let rationGLJDatas = getModuleDataByKey(rawDataObj.prjData, "ration_glj");
             let rationDatas = getModuleDataByKey(rawDataObj.prjData, "ration");
             let billsDatas = getModuleDataByKey(rawDataObj.prjData, "bills");
@@ -271,10 +274,21 @@ class Rpt_Data_Extractor {
             if (projectGLJDatas && rationGLJDatas && rationDatas && billsDatas) {
                 gljUtil.calcProjectGLJQuantity(projectGLJDatas.data, rationGLJDatas.data, rationDatas.data, billsDatas.data, decimal, true);
             }
-            if (projectGLJDatas && rationGLJDatas) {
+            if (projectGLJDatas && rationGLJDatas && labourCoeDatas) {
                 //考虑调价情况
+                const newAdjPriceArr = [];
                 for (const glj of projectGLJDatas.data.gljList) {
-                    glj.unit_price.market_price_tender = gljUtil.getMarketPrice(glj, projectGLJDatas.data, calcOptions, rawDataObj.prj.property.decimal, false, gljUtil.getTenderPriceCoe(glj, rawDataObj.prj.property));
+                    newAdjPriceArr.push(gljUtil.getGLJPrice(glj, projectGLJDatas.data, calcOptions, labourCoeDatas, decimalObj, false, gljUtil.getTenderPriceCoe(glj, rawDataObj.prj.property), true));
+                    // glj.unit_price.market_price_tender = gljUtil.getMarketPrice(glj, projectGLJDatas.data, calcOptions, rawDataObj.prj.property.decimal, false, gljUtil.getTenderPriceCoe(glj, rawDataObj.prj.property));
+                }
+                for (let gljIdx = 0; gljIdx < newAdjPriceArr.length; gljIdx++) {
+                    let newGlj = newAdjPriceArr[gljIdx];
+                    let gljItem = projectGLJDatas.data.gljList[gljIdx];
+                    gljItem.unit_price.market_price_tender = newGlj.marketPrice;
+                    gljItem.unit_price.org_basePrice =  gljItem.unit_price.base_price;
+                    gljItem.unit_price.base_price = newGlj.basePrice;
+                    // rationItem.marketUnitFee = newGlj.marketPrice;//更新树节点市场单价列的值
+                    //
                 }
             }
         }