Browse Source

项目工料机勾选"不调价"时按系数1调价处理。

chenshilong 6 years atrás
parent
commit
286d182107
1 changed files with 32 additions and 27 deletions
  1. 32 27
      web/building_saas/main/js/models/calc_program.js

+ 32 - 27
web/building_saas/main/js/models/calc_program.js

@@ -841,7 +841,8 @@ let calcTools = {
         if (this.isBill(treeNode))                 // 清单只有一个工程量,没有调整后工程量。
             return this.uiNodeQty(treeNode)
         else{
-            let qCoe = (treeNode.data.rationQuantityCoe == undefined || treeNode.data.rationQuantityCoe == null || treeNode.data.rationQuantityCoe == 0) ? 1 : treeNode.data.rationQuantityCoe;
+            let qCoe = (treeNode.data.rationQuantityCoe == undefined || treeNode.data.rationQuantityCoe == null ||
+                treeNode.data.rationQuantityCoe == 0) ? 1 : treeNode.data.rationQuantityCoe;
             treeNode.data.tenderQuantity = (this.uiNodeQty(treeNode) * qCoe).toDecimal(decimalObj.decimal("quantity", treeNode));
             return treeNode.data.tenderQuantity;
         }
@@ -853,38 +854,42 @@ let calcTools = {
         };
 
         let qCoe = 1;
-        if (gljType.LABOUR == glj.type){
-            if (treeNode.data.quantityCoe.labour)
-                qCoe = treeNode.data.quantityCoe.labour;
-        }
-        else if (baseMaterialTypes.indexOf(glj.type)){
-            if (treeNode.data.quantityCoe.material)
-                qCoe = treeNode.data.quantityCoe.material;
-        }
-        else if (baseMachineTypes.indexOf(glj.type)){
-            if (treeNode.data.quantityCoe.machine)
-                qCoe = treeNode.data.quantityCoe.machine;
-        }
-        else if (gljType.MAIN_MATERIAL == glj.type){
-            if (treeNode.data.quantityCoe.main)
-                qCoe = treeNode.data.quantityCoe.main;
+        let projGLJ = calcTools.getProjectGLJ(glj);
+        if (projGLJ.is_adjust_price != 1) {      // 先检查项目工料机里,该工料机是否参与调价
+            if (gljType.LABOUR == glj.type){
+                if (treeNode.data.quantityCoe.labour)
+                    qCoe = treeNode.data.quantityCoe.labour;
+            }
+            else if (baseMaterialTypes.indexOf(glj.type)){
+                if (treeNode.data.quantityCoe.material)
+                    qCoe = treeNode.data.quantityCoe.material;
+            }
+            else if (baseMachineTypes.indexOf(glj.type)){
+                if (treeNode.data.quantityCoe.machine)
+                    qCoe = treeNode.data.quantityCoe.machine;
+            }
+            else if (gljType.MAIN_MATERIAL == glj.type){
+                if (treeNode.data.quantityCoe.main)
+                    qCoe = treeNode.data.quantityCoe.main;
+            }
+            else if (gljType.EQUIPMENT == glj.type){
+                if (treeNode.data.quantityCoe.equipment)
+                    qCoe = treeNode.data.quantityCoe.equipment;
+            };
         }
-        else if (gljType.EQUIPMENT == glj.type){
-            if (treeNode.data.quantityCoe.equipment)
-                qCoe = treeNode.data.quantityCoe.equipment;
-        };
-
         glj.tenderQuantity = (glj.quantity * qCoe).toDecimal(decimalObj.glj.quantity);
     },
     calcGLJTenderPrice: function (glj) {
-        if (!glj.projectGLJID){   // 量价定额虚拟出来的工料机,没有projectGLJID,在项目工料机中查不到。
+        let projGLJ = calcTools.getProjectGLJ(glj);
+        if (projGLJ == null){   // 量价定额虚拟出来的工料机,在项目工料机中查不到。
+            glj.tenderPrice = projectObj.project.projectGLJ.getTenderMarketPrice(projGLJ);
+        }else{
             let pCoe = 1;
-            if (projectObj.project.property.tenderSetting && projectObj.project.property.tenderSetting.gljPriceTenderCoe)
-                pCoe = projectObj.project.property.tenderSetting.gljPriceTenderCoe;
+            if (projGLJ.is_adjust_price != 1){      // 先检查项目工料机里,该工料机是否参与调价
+                if (projectObj.project.property.tenderSetting && projectObj.project.property.tenderSetting.gljPriceTenderCoe)
+                    pCoe = projectObj.project.property.tenderSetting.gljPriceTenderCoe;
+            };
             glj.tenderPrice = (glj.marketPrice * pCoe).toDecimal(decimalObj.glj.unitPrice);
-        }else{
-            let projGLJ = calcTools.getProjectGLJ(glj);
-            glj.tenderPrice = projectObj.project.projectGLJ.getTenderMarketPrice(projGLJ);
         };
     },
     // 界面显示的工料机价格,包括定额价、市场价等。参数 price 传入一个普通的价格数值即可。