Przeglądaj źródła

feat: 开放计算选项

zhangweicheng 4 lat temu
rodzic
commit
1ab7a2cbb6
1 zmienionych plików z 11 dodań i 7 usunięć
  1. 11 7
      web/building_saas/main/js/models/calc_program.js

+ 11 - 7
web/building_saas/main/js/models/calc_program.js

@@ -972,10 +972,9 @@ let calcTools = {
     } else if (this.isLeafBill(treeNode)) {
       if (treeNode.children && treeNode.children.length > 0) {
         // 清单单价计算模式下的叶子清单:取自己的计算程序ID,找到自己的计算程序计算。(汇总清单所有定额的工料机)
-        // if (projectObj.project.property.billsCalcMode === leafBillGetFeeType.billsPrice)
-        //     return treeNodeCalcType.ctBillCalcProgram;
-        // else                                        // 前三种计算模式下的叶子清单:汇总定额的计算程序的费用类别
-        return treeNodeCalcType.ctGatherRationsFees;
+         if (projectObj.project.property.billsCalcMode === leafBillGetFeeType.billsPrice)
+             return treeNodeCalcType.ctBillCalcProgram;
+         else return treeNodeCalcType.ctGatherRationsFees;// 前三种计算模式下的叶子清单:汇总定额的计算程序的费用类别
       } else {
         // 公式计算
         return treeNodeCalcType.ctCalcBaseValue;
@@ -2284,15 +2283,20 @@ class CalcProgram {
           bttf = sum_rttf;
         }
 
-        if (
+       /*  if (
           calcTools.isBillProject() &&
           (ft.type == "common" || ft.type == "rationCommon")
+        )  */
+        if (
+          me.project.property.billsCalcMode == leafBillGetFeeType.rationPriceConverse &&
+          (ft.type == "common" || ft.type == "rationCommon")
         ) {
-          // 招投标项目, 还要反算
+          // 招投标项目, 还要反算 
+          // 9-24 新需求 开放正算反算选项,按选项判断
           buf = buf.toDecimal(decimalObj.bills.unitPrice);
           btuf = btuf.toDecimal(decimalObj.bills.unitPrice);
           btf = (buf * nQ).toDecimal(decimalObj.bills.totalPrice);
-          bttf = (btuf * nQ).toDecimal(decimalObj.bills.totalPrice);
+          bttf = (btuf * nQ).toDecimal(decimalObj.bills.totalPrice); 
         }
       }