Chenshilong před 8 roky
rodič
revize
f0125acba2

+ 1 - 2
public/calc_util.js

@@ -29,9 +29,8 @@ let executeObj = {
                     else if (base.calcType == adjustCalc){price = glj["adjustPrice"];}
                     else if (base.calcType == adjustCalc){price = glj["adjustPrice"];}
                     else if (base.calcType == budgetCalc){price = glj["marketPrice"];}
                     else if (base.calcType == budgetCalc){price = glj["marketPrice"];}
                     else if (base.calcType == diffCalc){price = glj["marketPrice"] - glj["adjustPrice"];};
                     else if (base.calcType == diffCalc){price = glj["marketPrice"] - glj["adjustPrice"];};
+                    tmpSum = tmpSum + glj["quantity"] * price;
                 };
                 };
-                tmpSum = tmpSum + glj["quantity"] * price;
-                glj = null;
             };
             };
             rst = tmpSum;
             rst = tmpSum;
         };
         };

+ 3 - 3
test/tmp_data/test_ration_calc/ration_calc_base.js

@@ -60,7 +60,7 @@ let rationCalcBase = [
     },{
     },{
         'dispName': '人工费价差',
         'dispName': '人工费价差',
         'calcFun': 'diff',
         'calcFun': 'diff',
-        'calcType': budgetCalc,
+        'calcType': diffCalc,
         'gljTypes': [gljType.LABOUR]
         'gljTypes': [gljType.LABOUR]
     },{
     },{
         'dispName': '材料费价差',
         'dispName': '材料费价差',
@@ -75,12 +75,12 @@ let rationCalcBase = [
     },{
     },{
         'dispName': '主材费',
         'dispName': '主材费',
         'calcFun': 'budget',
         'calcFun': 'budget',
-        'calcType': diffCalc,
+        'calcType': baseCalc,
         'gljTypes': [gljType.MAIN_MATERIAL]
         'gljTypes': [gljType.MAIN_MATERIAL]
     },{
     },{
         'dispName': '设备费',
         'dispName': '设备费',
         'calcFun': 'budget',
         'calcFun': 'budget',
-        'calcType': budgetCalc,
+        'calcType': baseCalc,
         'gljTypes': [gljType.EQUIPMENT]
         'gljTypes': [gljType.EQUIPMENT]
     }
     }
 ];
 ];