Ver código fonte

右键插入工料机不能正确反算综合单价问题。

chenshilong 5 anos atrás
pai
commit
09835a9210

+ 10 - 5
web/building_saas/main/js/models/calc_program.js

@@ -675,7 +675,8 @@ let calcTools = {
         function isRCJZC(treeNode, baseName) {         // 基数名称中是否包含人材机主设,且树结点类型要匹配一致
             let rst = (treeNode.data.subType === gljType.LABOUR && baseName.includes('人工')) ||    // 人工费、市场人工费
                 (baseMaterialTypes.includes(treeNode.data.subType) && baseName.includes('材料')) ||
-                (treeNode.data.subType === gljType.GENERAL_MACHINE && (baseName.includes('机械') || baseName.includes('机具'))) ||
+                // (treeNode.data.subType === gljType.GENERAL_MACHINE && (baseName.includes('机械') || baseName.includes('机具'))) ||
+                (baseMachineTypes.includes(treeNode.data.subType) && (baseName.includes('机械') || baseName.includes('机具'))) ||
                 (treeNode.data.subType === gljType.MAIN_MATERIAL && baseName.includes('主材')) ||
                 (treeNode.data.subType === gljType.EQUIPMENT && baseName.includes('设备'));
             return rst;
@@ -719,10 +720,14 @@ let calcTools = {
                     else
                         result = treeNode.data.marketUnitFee ? parseFloat(treeNode.data.marketUnitFee).toDecimal(decimalObj.ration.unitPrice) : 0
                 }
-                else if (calcTools.isGljRation(treeNode))
-                // result = treeNode.data.basePrice ? parseFloat(treeNode.data.basePrice).toDecimal(decimalObj.ration.unitPrice) : 0;
-                // 这里因为是算基数所以要取基价,但不能直接取basePrice,受限于项目属性的三个选项。
-                    result = gljOprObj.getBasePrice(treeNode);
+                else if (calcTools.isGljRation(treeNode)) {
+                    // result = treeNode.data.basePrice ? parseFloat(treeNode.data.basePrice).toDecimal(decimalObj.ration.unitPrice) : 0;
+                    // 这里要取基价或市场价,但不能直接取basePrice,受限于项目属性的三个选项。
+                    if (baseName.includes('定额'))
+                        result = gljOprObj.getBasePrice(treeNode)
+                    else
+                        result = treeNode.data.marketUnitFee ? parseFloat(treeNode.data.marketUnitFee).toDecimal(decimalObj.ration.unitPrice) : gljOprObj.getBasePrice(treeNode);
+                };
             }
         };
         return result;

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

@@ -43,7 +43,7 @@ let calcProgramObj = {
 
     // 刷新显示当前选中树结点的计算程序。
     // treeNode:末指定时默认是造价书当前选中树结点
-    // refreshKind: 1 仅刷新 2 计算并刷新但无需保存 3 计算保存并刷新 4 仅计算无需保存和刷新
+    // refreshKind: 1 仅刷新   2 计算+刷新     3 计算+保存+刷新      4 仅计算
     refreshCalcProgram: function (treeNode, refreshKind = 1) {
         var me = this;
         me.treeNode = treeNode;