Browse Source

池州接口映射值转换。

chenshilong 5 năm trước cách đây
mục cha
commit
253597b299
1 tập tin đã thay đổi với 67 bổ sung7 xóa
  1. 67 7
      web/building_saas/standard_interface/export/anhui_chizhou.js

+ 67 - 7
web/building_saas/standard_interface/export/anhui_chizhou.js

@@ -63,6 +63,66 @@ INTERFACE_EXPORT = (() => {
                 dt = 4;
             return dt;
         }
+
+        const valueMapArr = [
+          ['新建', '1'],
+          ['改扩建', '2'],
+          ['高速公路', '1'],
+          ['一级公路', '2'],
+          ['二级公路', '3'],
+          ['三级公路', '4'],
+          ['四级公路', '5'],
+          ['独立桥梁', '6'],
+          ['独立隧道', '7'],
+          ['一般计税', '1'],
+          ['简易计税', '2'],
+          ['清单', '1'],
+          ['招标控制价', '2'],
+          ['投标报价', '3'],
+          ['支票', '1'],
+          ['电汇', '2'],
+          ['银行汇票', '3'],
+          ['现金', '4'],
+          ['银行保函', '5'],
+          ['其他保函', '6'],
+          ['其他', '7']
+        ];
+
+        function valueMap(AValue){
+          let rst = AValue;
+          for (let i in valueMapArr) {
+            if (valueMapArr[i][0] == AValue){
+              rst = valueMapArr[i][1];
+              break;
+            }
+          }
+          return rst;
+        }
+
+      function getRCJLB(AType){   // 1=人工;2=材料;3=机械组成物;4=设备;5=混凝土/砂浆/配合比;6=机械台班
+          let rst = 2;
+          AType+="";
+          debugger;
+          if (AType == '1'){
+            rst = '1';
+          }
+          else if (['201', '205', '206', '207', '4'].includes(AType)){
+            rst = '2';
+          }
+          else if (['202', '203', '204'].includes(AType)){
+            rst = '5';
+          }
+          else if (['301'].includes(AType)){
+            rst = '6';
+          }
+          else if (['302', '303'].includes(AType)){
+            rst = '3';
+          }
+          else if (AType == '5'){
+            rst = '4';
+          };
+          return rst;
+      }
 // ------------------------------------------------------------------------------------------------------------
 
         function CreateNode(nodeName, attrArr = []) {
@@ -78,12 +138,13 @@ INTERFACE_EXPORT = (() => {
                 { name: '终点桩号', value: getValueByKey(info, 'endChainages') },
                 { name: '建设地址', value: getValueByKey(info, 'constructionAddress') },
                 { name: '项目概况', value: getValueByKey(info, 'projOverview') },
-                { name: '建设性质', value: getValueByKey(info, 'natureConstruction') },
-                { name: '专业划分', value: getValueByKey(info, 'roadGrade') },
+                { name: '建设性质', value: valueMap(getValueByKey(info, 'natureConstruction')) },
+                { name: '专业划分', value: valueMap(getValueByKey(info, 'roadGrade')) },
                 { name: '道路里程', value: getValueByKey(info, 'roadDistance') },
                 { name: '设计单位', value: getValueByKey(info, 'designUnit') },
-                { name: '计税方式', value: getValueByKey(info, 'taxMode') },
-                { name: '文件类型', value: getValueByKey(info, 'projType') },
+                { name: '计税方式', value: valueMap(getValueByKey(info, 'taxMode')) },
+                // { name: '文件类型', value: valueMap(getValueByKey(info, 'projType')) },
+                {name: '文件类型', value: isBidInvitation ? 1 : (isControl ? 2 : 3)},    // 1=工程量清单;2=招标控制价;3=投标报价;
                 { name: '标准版本号', value: '1.0' },
                 { name: 'GUID', value: projectData._id }
             ];
@@ -158,7 +219,7 @@ INTERFACE_EXPORT = (() => {
                 { name: '工期', value: getValueByKey(info, 'timeLimit') },
                 { name: '投标担保金额', value: getValueByKey(info, 'tenderGuaranteeAmount') },
                 { name: '质量承诺', value: getValueByKey(info, 'qualityCommitment') },
-                { name: '投标担保方式', value: getValueByKey(info, 'tenderGuaranteeMethod') },
+                { name: '投标担保方式', value: valueMap(getValueByKey(info, 'tenderGuaranteeMethod')) },
 
                 { name: '造价软件品牌', value: '纵横公路云造价' },
                 { name: '造价软件版本', value: "Ver" + VERSION },
@@ -318,7 +379,6 @@ INTERFACE_EXPORT = (() => {
             }
 
             for (let i = 0; i < vJRG.children.length; i++) {
-                debugger;
                 vKind = vJRG.children[i];
                 let attrs = [
                     { name: '序号', value: vKind.row() },
@@ -415,7 +475,7 @@ INTERFACE_EXPORT = (() => {
                     { name: '单位', value: pGLJ.unit },
                     { name: '数量', value: pGLJ.quantity },
                     { name: '单价', value: pGLJ.unit_price.market_price },
-                    { name: '人材机类别', value: pGLJ.type },
+                    { name: '人材机类别', value: getRCJLB(pGLJ.type) },
                     { name: '是否主要材料', value: pGLJ.is_main_material },   // , type: TYPE.BOOL
                     { name: '是否甲供', value: pGLJ.supply },
                     { name: '是否暂估', value: pGLJ.is_evaluate },