瀏覽代碼

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost

zhangweicheng 7 年之前
父節點
當前提交
fcad2588e4
共有 2 個文件被更改,包括 13 次插入4 次删除
  1. 12 3
      web/building_saas/main/js/models/calc_program.js
  2. 1 1
      web/building_saas/main/js/views/fee_rate_view.js

+ 12 - 3
web/building_saas/main/js/models/calc_program.js

@@ -1425,6 +1425,7 @@ class CalcProgram {
         else{
             let fnArr = [];
             if (treeNode.calcType == treeNodeCalcType.ctRationCalcProgram) {
+                // 量价、工料机类型的定额要求市场合价
                 if (treeNode.data.type == rationType.volumePrice || treeNode.data.type == rationType.gljRation){
                     delete treeNode.data.gljList;
                     let muf = treeNode.data.marketUnitFee ? treeNode.data.marketUnitFee : 0;
@@ -1434,9 +1435,17 @@ class CalcProgram {
                         treeNode.data.marketTotalFee = mtf;
                         treeNode.changed = true;
                     } ;
-                }
-                else{
-                    treeNode.data.gljList = me.project.ration_glj.getGljArrByRation(treeNode.data.ID);
+                };
+
+                // 工料机类型的定额、定额要算暂估费
+                if (treeNode.data.type != rationType.volumePrice){
+                    if (treeNode.data.type == rationType.gljRation){
+                        let glj = JSON.parse(JSON.stringify(treeNode.data));
+                        glj.type = glj.subType;
+                        treeNode.data.gljList = [glj];
+                    }                        
+                    else
+                        treeNode.data.gljList = me.project.ration_glj.getGljArrByRation(treeNode.data.ID);
                     // 计算程序里没有暂估费的计算规则,会漏掉,所以这里要专门算。
                     calcTools.estimateFee(treeNode);
                     fnArr.push('estimate');

+ 1 - 1
web/building_saas/main/js/views/fee_rate_view.js

@@ -733,6 +733,7 @@ var feeRateObject={
             projectObj.project.calcProgram.calcAndSave(selected);
             //projectObj.mainController.refreshTreeNode([selected]);
             $("#fee_rate_tree").modal('hide');
+            $.bootstrapLoading.end();
         });
     },
     submitFeeRateFromCalc:function () {
@@ -743,7 +744,6 @@ var feeRateObject={
         var data={'projectID': projectObj.project.ID(),'templatesID': calInfo.template.ID,'calcItem': calInfo.calcItem};
         $.bootstrapLoading.start();
         calcProgramManage.saveCalcItem(data,function (result) {
-            $.bootstrapLoading.end();
             calInfo.calcItem.feeRate=rate.rate;
             projectObj.project.calcProgram.compileAllTemps();
             projectObj.project.calcProgram.calcAllNodesAndSave();