Browse Source

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

Tony Kang 1 year ago
parent
commit
6acfbc6005

+ 23 - 4
web/building_saas/main/js/models/project_glj.js

@@ -631,7 +631,7 @@ ProjectGLJ.prototype.m_updateUnitPrice = function (datas,isFromFeeRate=false) {/
     //刷新定额工料机
     gljOprObj.refreshView();
     //socket推送更新信息
-    projectGljObject.onUnitFileChange(isFromFeeRate?false:true);//如果是从更新费率过来的,不用在项目属性上做标记,费率那里已经自动计算所有节点了
+    projectGljObject.onUnitFileChange(!isFromFeeRate);//如果是从更新费率过来的,不用在项目属性上做标记,费率那里已经自动计算所有节点了
 
     return gljList
 
@@ -769,11 +769,21 @@ ProjectGLJ.prototype.refreshEctrovalenceCache = function (updateMap) {
     }
 
     if(updateMap["unitPrice"]) {
+        let gljList = [];
         if(Array.isArray(updateMap["unitPrice"])){
-            this.m_updateUnitPrice(updateMap["unitPrice"]);
+            gljList=  this.m_updateUnitPrice(updateMap["unitPrice"]);
         }else {
-            this.m_updateUnitPrice([updateMap["unitPrice"]]);
+            gljList = this.m_updateUnitPrice([updateMap["unitPrice"]]);
         }
+        const conditions = [];
+        for(const glj of gljList){
+            const keys = this.datas.mixRatioConnectData[gljUtil.getIndex(glj)]||[];
+            for(const key of keys){
+                conditions.push(gljOprObj.getConditionByKey(key));
+            }
+        }
+        const parentGljs = this.getProjectGLJs(conditions,false)
+        this.getImpactRationNodes([...gljList,...parentGljs]);//更新工料机类型的定额价格
     }
 };
 
@@ -788,9 +798,18 @@ ProjectGLJ.prototype.refreshMaterialCalcCache = function (updateMap,isFromFeeRat
       }else {
         gljList =  this.m_updateUnitPrice([updateMap["unitPrice"]],isFromFeeRate);
       }
+      const conditions = [];
+      for(const glj of gljList){
+          const keys = this.datas.mixRatioConnectData[gljUtil.getIndex(glj)]||[];
+          for(const key of keys){
+              conditions.push(gljOprObj.getConditionByKey(key));
+          }
+      }
+      const parentGljs = this.getProjectGLJs(conditions,false)
+      this.getImpactRationNodes([...gljList,...parentGljs]);//更新工料机类型的定额价格
    }
    return gljList;
-
+ 
     function updateList(list,updateMap) {
        if(updateMap["update"]){
            let map = updateMap["update"];

+ 16 - 8
web/building_saas/main/js/models/ration_glj.js

@@ -479,6 +479,13 @@ let ration_glj = {
             let callback = function (data) {
                 if (updateField == 'customQuantity') {
                     me.refreshAfterQuantityUpdate(data, node);
+                    me.refreshTreeNodeIfNeeded(recode);//刷新造价书上的树节点(如果需要)
+                    me.reCalcWhenGLJChange(recode);//触发计算定额以及父节点
+                    projectObj.project.projectGLJ.calcQuantity();
+                    zmhs_obj.refreshStableDataIfNeeded();
+                    gljOprObj.refreshView();
+                    $.bootstrapLoading.end();
+                    installationFeeObj.calcInstallationFee();
                 } else {
                     let doc = data.doc;
                     for (let key in doc) {
@@ -490,15 +497,16 @@ let ration_glj = {
                             projectObj.mainController.deleteNode(node, true);
                         }
                     }
+                    projectObj.project.projectGLJ.loadData(function () {//等项目工料机加载完成后再给用户编辑
+                        me.refreshTreeNodeIfNeeded(recode);//刷新造价书上的树节点(如果需要)
+                        me.reCalcWhenGLJChange(recode);//触发计算定额以及父节点
+                        zmhs_obj.refreshStableDataIfNeeded();
+                        gljOprObj.refreshView();
+                        $.bootstrapLoading.end();
+                        installationFeeObj.calcInstallationFee();
+                    });
                 }
-                projectObj.project.projectGLJ.loadData(function () {//等项目工料机加载完成后再给用户编辑
-                    me.refreshTreeNodeIfNeeded(recode);//刷新造价书上的树节点(如果需要)
-                    me.reCalcWhenGLJChange(recode);//触发计算定额以及父节点
-					zmhs_obj.refreshStableDataIfNeeded();
-                    gljOprObj.refreshView();
-					$.bootstrapLoading.end();
-                    installationFeeObj.calcInstallationFee();
-                });
+             
             };
             $.bootstrapLoading.start();
             CommonAjax.post("/rationGlj/updateRationGLJByEdit", {

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

@@ -709,6 +709,7 @@ projectGljObject = {
     projectGLJ.batchUpdateConsumption(updateData, updateMap, async function () {
       //更新人材机汇总表
       me.refreshDataSheet();
+      projectGLJ.getImpactRationNodes([ me.getProjectGLJSelected()]);//更新工料机类型的定额价格
       let materialGljList = await projectGLJ.calcAllMaterialWhenChange();
       if (materialGljList.length == 0) me.onUnitFileChange(true);
       gljOprObj.refreshView();

+ 0 - 1
web/building_saas/standard_interface/import/base.js

@@ -500,7 +500,6 @@ const INTERFACE_EXPORT_BASE = (() => {
    * @return {Promise<Object>}
    */
   async function handleImportData(importData, areaKey, onlyImportMatchBills) {
-    debugger;
     const valuationID = compilationData.ration_valuation[0].id;
     if (!Array.isArray(importData.tenders) && !importData.tenders.length) {
       throw "导入的文件中不存在有效的标段数据。";

+ 0 - 1
web/building_saas/standard_interface/import/view.js

@@ -66,7 +66,6 @@ const IMPORT_VIEW = (() => {
           areaKey = curAreaKey;
           await STD_INTERFACE.loadScriptByArea(areaKey, STD_INTERFACE.ScriptType.IMPORT);
           const onlyImportMatchBills = areaKey === '广东@中山';
-          debugger;
           importData = await INTERFACE_EXPORT_BASE.extractImportData(INTERFACE_IMPORT.entry, file, areaKey, false, onlyImportMatchBills, INTERFACE_IMPORT.handleAfterImport);
         }
         const constructionName = $('#import-rename').is(':visible') ? $('#import-rename-input').val() : importData.name;

+ 1 - 1
web/building_saas/standard_interface/import/zhejiang_xiangshan.js

@@ -114,7 +114,7 @@ INTERFACE_IMPORT = (() => {
           const simpleName = item.name ? item.name : ''; // 根据需求,保留所有类型的空格(空格、换行、tab缩进)
           if (item.titleType === '1' || /100章至第700章|100章至700章/.test(simpleName)) {
             oneSevenBills = item;
-          } else if (item.titleType === '4' || /计日工合计|计日工/.test(simpleName)) {
+          } else if (item.titleType === '4' || (/计日工合计|计日工/.test(simpleName) && !(/不含计日工/.test(simpleName)))) {
             dayWorkBills = item;
           }
         });