Prechádzať zdrojové kódy

广西接口反馈补漏

Tony Kang 2 rokov pred
rodič
commit
2aa3a3ae6b

+ 22 - 3
web/building_saas/standard_interface/export/guangxi_common.js

@@ -1293,7 +1293,7 @@ INTERFACE_EXPORT = (() => {
               if( CostKind==2 && !gljUtil.isNotEmpty(data.quantity)) attrs[4].value  = 0
             }
             // 计日工合计下的劳务、材料、机械Item节点单价及合价(Price, Sum)也要输出
-            if (bNode.children && bNode.children.length === 0 && bNode.data.quantity) { //先检测是否有费用
+            if (bNode.children && bNode.children.length === 0 && _getFee(bNode) > 0) { //先检测是否有费用
               // 再检测是否计日工合计清单下
               if (_chkIfJRGHJ(bNode, ['计日工合计'])) {
                 attrs[4].value = data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "";
@@ -1330,11 +1330,27 @@ INTERFACE_EXPORT = (() => {
               }
               return rst;
             }
+            function _getFee(bNode, key = 'common', valueKey = 'tenderTotalFee') {
+              let rstSum = 0;
+              if (bNode) {
+                let dtlB = (bNode.data) ? bNode.data : bNode;
+                if (dtlB.fees) {
+                  for (let fee of dtlB.fees) {
+                    if (fee.fieldName === key) {
+                      rstSum = parseFloat(fee[valueKey]);
+                      if (isNaN(rstSum)) rstSum = 0;
+                      break;
+                    }
+                  }
+                }
+              }
+              return rstSum;
+            }
             function _chkIfNeedCostComposition(bNode) {
               let rst = isBidInvitation && !(ProvisionalType === 0 || ProvisionalType === 1);
               if (rst) {
                 //计日工合计下的劳务、材料、机械 有费用也要输出
-                if (bNode.children && bNode.children.length === 0 && bNode.data.quantity) { //先检测是否有费用
+                if (bNode.children && bNode.children.length === 0 && _getFee(bNode) > 0) { //先检测是否有费用
                   // 再检测是否计日工合计清单下
                   rst = !_chkIfJRGHJ(bNode, ['计日工合计']);
                 }
@@ -1361,10 +1377,13 @@ INTERFACE_EXPORT = (() => {
                   }
                 }
               }
+              if (Costs.length === 0 && _chkIfJRGHJ(bNode, ['计日工合计'])) {
+                Costs.push(new Cost(bNode.data));
+              }
               if (Norms.length > 0) CostComposition.children.push(...Norms);
               if (Costs.length > 0) CostComposition.children.push(...Costs);
               if (bNode.data.calcBase) CostComposition.children.push(new Formula(bNode.data));
-              return CostComposition.children.length > 0 ? CostComposition : null;
+              return (CostComposition.children.length > 0) ? CostComposition : null;
   
             //定额空行不输出到接口文件中。 //定额空行的判断是:定额编码、定额名称、定额单位、定额单位、定额工程量为零或为空时
             function isEmptyRation(ration){