Selaa lähdekoodia

计算修正。

Chenshilong 7 vuotta sitten
vanhempi
commit
f0125acba2
2 muutettua tiedostoa jossa 4 lisäystä ja 5 poistoa
  1. 1 2
      public/calc_util.js
  2. 3 3
      test/tmp_data/test_ration_calc/ration_calc_base.js

+ 1 - 2
public/calc_util.js

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

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

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