Prechádzať zdrojové kódy

fix(client): 直接输入单价金额的清单,指标建安费无值问题:定额建安费、指标建安费自动复制同步。湖南养护新建项目前端不显示问题。

chenshilong 3 rokov pred
rodič
commit
92bcc7a0ec

+ 1 - 1
web/building_saas/main/js/models/calc_base.js

@@ -160,7 +160,7 @@ let cbTools = {
   //设置清单固定行下可用的基数映射
   //@param {Object}baseFigures(当前项目可用总基数配置表) {Object}mapping(可用基数映射,初始为空object,目标:{flag: Array(baseList)}) eg: {'1': ['xx费']}
   setValidBaseMapping: function (baseFigures, mapping) {
-    const baseFigures2 = {};
+    let baseFigures2 = {};
     if (typeof filterByProjectKind !== "undefined") {
       const engName = projectObj.project.property.engineeringName;
       for (let baseName in baseFigures) {

+ 28 - 18
web/building_saas/main/js/models/calc_program.js

@@ -290,6 +290,23 @@ let calcTools = {
       treeNode.changed = true;
     }
   },
+
+  checkRationCommon: function (treeNode, obj) {
+    let commonFields = ["rationCommon", "indexCommon"];
+    for (const cf of commonFields) {
+      let ft = cpFeeTypes.find((e) => e.type === cf);
+      if (ft) {
+        calcTools.checkFeeField(treeNode, {
+          fieldName: cf,
+          unitFee: obj.unitFee,
+          totalFee: obj.totalFee,
+          tenderUnitFee: obj.tenderUnitFee,
+          tenderTotalFee: obj.tenderTotalFee,
+        });
+      }
+    }
+  },
+
   setFieldValue: function (treeNode, fieldName, value) {
     if (value == null) value = 0;
     if (fieldName.includes("feesIndex")) {
@@ -1971,11 +1988,7 @@ class CalcProgram {
           bttf = sum_rttf;
         }
 
-        /*  if (
-          calcTools.isBillProject() &&
-          (ft.type == "common" || ft.type == "rationCommon")
-        )  */
-        if (me.project.property.billsCalcMode == leafBillGetFeeType.rationPriceConverse && (ft.type == "common" || ft.type == "rationCommon")) {
+        if (me.project.property.billsCalcMode == leafBillGetFeeType.rationPriceConverse && ["common", "rationCommon", "indexCommon"].includes(ft.type)) {
           // 招投标项目, 还要反算
           // 9-24 新需求 开放正算反算选项,按选项判断
           buf = buf.toDecimal(decimalObj.bills.unitPrice);
@@ -2006,7 +2019,7 @@ class CalcProgram {
     delete treeNode.data.gljList;
     let me = this;
     me.deleteProperties(treeNode, ["programID"]);
-    me.deleteUselessFees(treeNode, ["common", "rationCommon"]);
+    me.deleteUselessFees(treeNode, ["common", "rationCommon", "indexCommon"]);
 
     let nQ = calcTools.uiNodeQty(treeNode);
     let nTQ = calcTools.uiNodeTenderQty(treeNode);
@@ -2032,14 +2045,10 @@ class CalcProgram {
     }
     calcTools.checkFeeField(treeNode, feeItem);
     //第一部分建安费下,使用基数计算的清单,定额建安费应=金额
-    if (cbTools.getBelongFlagList(treeNode).includes(fixedFlag.CONSTRUCTION_INSTALL_FEE))
-      calcTools.checkFeeField(treeNode, {
-        fieldName: "rationCommon",
-        unitFee: uf,
-        totalFee: tf,
-        tenderUnitFee: tuf,
-        tenderTotalFee: ttf,
-      });
+    if (cbTools.getBelongFlagList(treeNode).includes(fixedFlag.CONSTRUCTION_INSTALL_FEE)) {
+      let obj = { unitFee: uf, totalFee: tf, tenderUnitFee: tuf, tenderTotalFee: ttf };
+      calcTools.checkRationCommon(treeNode, obj);
+    }
 
     // 总造价清单还要做单项工程、建设项目的四大项金额汇总
     if (calcTools.isTotalCostBill(treeNode)) {
@@ -2049,6 +2058,7 @@ class CalcProgram {
       //     treeNode.data.summaryFees.totalFee = tf;
       //     treeNode.data.summaryFees.estimateFee = calcTools.getFee(treeNode, 'estimate.totalFee');
     }
+
     treeNode.data.calcTemplate = {
       calcItems: [],
     };
@@ -2058,7 +2068,7 @@ class CalcProgram {
     let me = this;
     delete treeNode.data.gljList;
     me.deleteProperties(treeNode, ["calcBase", "calcBaseValue", "tenderCalcBaseValue", "programID"]);
-    me.deleteUselessFees(treeNode, ["common", "rationCommon"]);
+    me.deleteUselessFees(treeNode, ["common", "rationCommon", "indexCommon"]);
 
     if (treeNode.data.feesIndex && treeNode.data.feesIndex.common) {
       let ftObj = {
@@ -2096,15 +2106,15 @@ class CalcProgram {
         (calcTools.isInheritFrom(treeNode, fixedFlag.CONSTRUCTION_INSTALL_FEE) || calcTools.isInheritFrom(treeNode, fixedFlag.ONE_SEVEN_BILLS))
       )
         need = true;
+      debugger;
       if (need) {
-        let ftObj2 = {
-          fieldName: "rationCommon",
+        let obj = {
           unitFee: ftObj.unitFee,
           totalFee: ftObj.totalFee,
           tenderUnitFee: ftObj.tenderUnitFee,
           tenderTotalFee: ftObj.tenderTotalFee,
         };
-        calcTools.checkFeeField(treeNode, ftObj2);
+        calcTools.checkRationCommon(treeNode, obj);
       }
     }