chenshilong před 7 roky
rodič
revize
44f7f993f3

+ 1 - 2
web/building_saas/main/js/views/project_property_labour_coe_view.js

@@ -131,9 +131,8 @@ let labourCoeView = {
         me.loadData(datas);
     },
 
-    refresh(data){
+    refresh(){
         let me = this;
-        projectObj.project.labourCoe.refreshData(data);
         me.needUpdateDatas.splice(0, me.needUpdateDatas.length);
         $("#std_labour_coe_files").val('');
         calcProgramManage.buildSheet();

+ 6 - 5
web/building_saas/main/js/views/project_view.js

@@ -767,14 +767,14 @@ $('#property_ok').click(function () {
 
     // 人工系数
     if (labourCoeView.needSave()){
-        reCalcRations = true;
-        reCalcBills = true;
-        project.calcProgram.compileAllTemps();
-
         let libID = $("#std_labour_coe_files").children("option:selected").val();
         let libName = $("#std_labour_coe_files").children("option:selected").text();
 
         labourCoes.updateData = {libID: libID, libName: libName, newItemArr: labourCoeView.needUpdateDatas};
+        project.labourCoe.refreshData(labourCoes.updateData);  // 全编译所用到的人工系数来自project.labourCoe,所以必须先刷新project.labourCoe
+        project.calcProgram.compileAllTemps();
+        reCalcRations = true;
+        reCalcBills = true;
     };
 
     // 重新计算树节点
@@ -807,6 +807,7 @@ $('#property_ok').click(function () {
     };
 
     console.log(mixDatas);
+    // return;   // for test.
     function hasMixData() {
         return Object.keys(mixDatas.properties).length > 0 ||
             mixDatas.labourCoes.updateData || mixDatas.rations.length > 0 || mixDatas.bills.length > 0;
@@ -817,7 +818,7 @@ $('#property_ok').click(function () {
 /*            if (changedNodes.length > 0) {
                 for (let node of changedNodes){delete node.changed};
             };
-            if (mixDatas.labourCoes.updateData) labourCoeView.refresh(mixDatas.labourCoes.updateData);*/
+            if (mixDatas.labourCoes.updateData) labourCoeView.refresh();*/
             window.location.href = '/main?project=' + projectID;
         });
     }