Browse Source

浙江杭州接口调整

Tony Kang 1 year atrás
parent
commit
8262096267
1 changed files with 12 additions and 4 deletions
  1. 12 4
      web/building_saas/standard_interface/import/base.js

+ 12 - 4
web/building_saas/standard_interface/import/base.js

@@ -243,6 +243,14 @@ const INTERFACE_EXPORT_BASE = (() => {
     6: fixedFlag.TOTAL_COST,
   };
 
+  function chkIfDayworkBill(billName) {
+    let rst = false;
+    if (typeof billName === 'string') {
+      rst = /计日工/.test(billName) && billName.indexOf('计日工') === 0;
+    }
+    return rst;
+  }
+
   /**
    * 将提取出来的清单合并进清单模板
    * @param {Array} source - 从xml提取出来的清单
@@ -267,7 +275,7 @@ const INTERFACE_EXPORT_BASE = (() => {
           matched = target.find((bills) => getFlag(bills) === fixedFlag.PROVISIONAL_TOTAL);
         } else if (titleTypeToFlag[titleType] === fixedFlag.BILLS_TOTAL_WT_PROV || /清单合计减去材料、工程设备、专业工程暂估价/.test(simpleName)) {
           matched = target.find((bills) => getFlag(bills) === fixedFlag.BILLS_TOTAL_WT_PROV);
-        } else if (titleTypeToFlag[titleType] === fixedFlag.DAYWORK_LABOR || /计日工合计/.test(simpleName)) {
+        } else if (titleTypeToFlag[titleType] === fixedFlag.DAYWORK_LABOR || chkIfDayworkBill(simpleName)) {
           matched = target.find((bills) => getFlag(bills) === fixedFlag.DAYWORK_LABOR);
         } else if (titleTypeToFlag[titleType] === fixedFlag.PROVISIONAL || /暂列金额[((]不含/.test(simpleName)) {
           matched = target.find((bills) => getFlag(bills) === fixedFlag.PROVISIONAL);
@@ -278,11 +286,11 @@ const INTERFACE_EXPORT_BASE = (() => {
         const parentSimpleName = parent.name ? parent.name.replace(/\s/g, "") : "";
         if (/100章.*章|100章.*700章|100章.*900章/.test(parentSimpleName) && /100章总则/.test(simpleName)) {
           matched = target.find((bills) => getFlag(bills) === fixedFlag.ONE_HUNDRED_BILLS);
-        } else if (/计日工合计/.test(parentSimpleName) && /劳务/.test(simpleName)) {
+        } else if (chkIfDayworkBill(parentSimpleName) && /劳务/.test(simpleName)) {
           matched = target.find((bills) => getFlag(bills) === fixedFlag.LABOUR_SERVICE);
-        } else if (/计日工合计/.test(parentSimpleName) && /材料/.test(simpleName)) {
+        } else if (chkIfDayworkBill(parentSimpleName) && /材料/.test(simpleName)) {
           matched = target.find((bills) => getFlag(bills) === fixedFlag.MATERIAL);
-        } else if (/计日工合计/.test(parentSimpleName) && /机械/.test(simpleName)) {
+        } else if (chkIfDayworkBill(parentSimpleName) && /机械/.test(simpleName)) {
           matched = target.find((bills) => getFlag(bills) === fixedFlag.CONSTRUCTION_MACHINE);
         }
       }