Selaa lähdekoodia

fix: 浙江宁海接口调整

vian 4 vuotta sitten
vanhempi
commit
568f747c90

+ 25 - 8
web/building_saas/standard_interface/export/zhejiang_ninghai.js

@@ -81,7 +81,12 @@ INTERFACE_EXPORT = (() => {
     const isMaterial = (type) => {
     const isMaterial = (type) => {
       return /^2/.test(type);
       return /^2/.test(type);
     }
     }
-
+    
+    // 是否是机械
+    const isMachine = (type) => {
+      return /^3/.test(type);
+    }
+    
     // 获取预算价
     // 获取预算价
     const getMarketPrice = (glj) => {
     const getMarketPrice = (glj) => {
       const tenderCoe = gljUtil.getTenderPriceCoe(glj, curTender.property);
       const tenderCoe = gljUtil.getTenderPriceCoe(glj, curTender.property);
@@ -188,7 +193,7 @@ INTERFACE_EXPORT = (() => {
           { name: '计税方式', value: valueMap[getValueByKey(info, 'taxMode')] },
           { name: '计税方式', value: valueMap[getValueByKey(info, 'taxMode')] },
           {name: '文件类型', value: isBidInvitation ? 1 : (isControl ? 2 : 3)},    // 1=工程量清单;2=招标控制价;3=投标报价;
           {name: '文件类型', value: isBidInvitation ? 1 : (isControl ? 2 : 3)},    // 1=工程量清单;2=招标控制价;3=投标报价;
           { name: '标准版本号', value: '1.0' },
           { name: '标准版本号', value: '1.0' },
-          { name: 'GUID', value: uuid.v1() }
+          { name: 'GUID', value: projectData.GUID }
       ];
       ];
       Element.call(this, '工程信息', attrs);
       Element.call(this, '工程信息', attrs);
     }
     }
@@ -300,6 +305,18 @@ INTERFACE_EXPORT = (() => {
         return sectionCode
         return sectionCode
       }
       }
     }
     }
+
+    // 获取子目号
+    const getBillCode = (node) => {
+      if (node.data.code) {
+        return node.data.code;
+      }
+      const parentFlag = node.parent ? node.parent.getFlag() : null;
+      if (parentFlag === fixedFlag.ONE_SEVEN_BILLS) {
+        return getBillSection(node);
+      }
+      return node.data.code;
+    }
     function GongCLQDMX(node) {
     function GongCLQDMX(node) {
       const { mainFee, assFee } = getMaterialFee(node);
       const { mainFee, assFee } = getMaterialFee(node);
       const attrs = [
       const attrs = [
@@ -310,7 +327,7 @@ INTERFACE_EXPORT = (() => {
           '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2000', 
           '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2000', 
         ]},
         ]},
         {name: '子目长编号', value: divideObj.getExeBillCode(node.data.ID, node. tree)},
         {name: '子目长编号', value: divideObj.getExeBillCode(node.data.ID, node. tree)},
-        {name: '子目号', value: node.data.code, minLen: 1},
+        {name: '子目号', value: getBillCode(node), minLen: 1},
         {name: '子目名称', value: node.data.name, minLen: 1},
         {name: '子目名称', value: node.data.name, minLen: 1},
         {name: '单位', value: node.data.unit},
         {name: '单位', value: node.data.unit},
         {name: '数量', value: node.data.quantity, type: TYPE.DECIMAL},
         {name: '数量', value: node.data.quantity, type: TYPE.DECIMAL},
@@ -442,22 +459,22 @@ INTERFACE_EXPORT = (() => {
       if (glj.type === 1) {
       if (glj.type === 1) {
         return '1';
         return '1';
       }
       }
-      if (glj.type === 201) {
+      if (!glj.is_main_material && isMaterial(glj.type) && ![202, 203, 204 ].includes(glj.type)) {
         return '2';
         return '2';
       }
       }
-      if (glj.type === 302) {
+      if (isMachine(glj.type) && glj.type !== 301) {
         return '3';
         return '3';
       }
       }
       if (glj.type === 5) {
       if (glj.type === 5) {
         return '4';
         return '4';
       }
       }
-      if (glj.type === 204) {
+      if ([202, 203, 204].includes(glj.type)) {
         return '5';
         return '5';
       }
       }
       if (glj.type === 301) {
       if (glj.type === 301) {
         return '6';
         return '6';
       }
       }
-      if (glj.type === 4) {
+      if (glj.is_main_material && isMaterial(glj.type) && ![202, 203, 204 ].includes(glj.type)) {
         return '7';
         return '7';
       }
       }
       return '2';
       return '2';
@@ -663,7 +680,7 @@ INTERFACE_EXPORT = (() => {
           { name: '序号', value: seq, minLen: 1 },
           { name: '序号', value: seq, minLen: 1 },
           { name: '标段名称', value: rawTender.name, minLen: 1 },
           { name: '标段名称', value: rawTender.name, minLen: 1 },
           { name: '金额', value: isBidInvitation ? 0 : projectData.summaryInfo[rawTender.ID].totalCost },
           { name: '金额', value: isBidInvitation ? 0 : projectData.summaryInfo[rawTender.ID].totalCost },
-          { name: '唯一标识-Guid', value: uuid.v1() }
+          { name: '唯一标识-Guid', value: rawTender.GUID }
       ];
       ];
       const gongLBDGC = new Element('公路标段工程', tenderAttrs)
       const gongLBDGC = new Element('公路标段工程', tenderAttrs)
       // 工程量清单表
       // 工程量清单表

+ 2 - 0
web/building_saas/standard_interface/import/zhejiang_ninghai.js

@@ -146,6 +146,7 @@ INTERFACE_IMPORT = (() => {
       const rootSrc = getValue(tenderSrc, ['造价汇总表']);
       const rootSrc = getValue(tenderSrc, ['造价汇总表']);
       return {
       return {
         name: getValue(tenderSrc, ['_标段名称']),
         name: getValue(tenderSrc, ['_标段名称']),
+        GUID: getValue(tenderSrc, ['_唯一标识-Guid']),
         bills: setupBills(rootSrc, oneSevenSrc, dayWorkSrc)
         bills: setupBills(rootSrc, oneSevenSrc, dayWorkSrc)
       };
       };
     }
     }
@@ -156,6 +157,7 @@ INTERFACE_IMPORT = (() => {
         .map(tenderSrc => setupTender(tenderSrc));
         .map(tenderSrc => setupTender(tenderSrc));
       return {
       return {
         name: getValue(projectSrc, ['工程信息', '_项目名称']),
         name: getValue(projectSrc, ['工程信息', '_项目名称']),
+        GUID: getValue(projectSrc, ['工程信息', '_GUID']),
         info: setupInformation(projectSrc),
         info: setupInformation(projectSrc),
         tenders,
         tenders,
       };
       };