浏览代码

bug 接口调整

zhangweicheng 5 年之前
父节点
当前提交
47b8dfeaf1

+ 63 - 11
web/building_saas/standard_interface/export/guangdong_zhongshan.js

@@ -136,6 +136,57 @@ INTERFACE_EXPORT = (() => {
     return rate
   }
 
+  function billNameChecking(bNode,projectName,fixedFlag) { 
+    let data = bNode.data;
+    let fail = null;
+    let pass = true;
+    if (data.flagsIndex && data.flagsIndex.fixed) {
+      let flag = data.flagsIndex.fixed.flag;
+      switch (flag) {
+        case fixedFlag.ONE_SEVEN_BILLS:
+          pass = data.name == "第100章至900章清单";
+          break;
+        case fixedFlag.PROVISIONAL_TOTAL:
+          pass = data.name == "已包含在清单合计中的材料、工程设备、专业工程暂估价合计";
+          break;
+        case fixedFlag.BILLS_TOTAL_WT_PROV:
+          pass = data.name == "清单合计减去材料、工程设备、专业工程暂估价合计";
+          break;
+        case fixedFlag.DAYWORK_LABOR:
+          pass = data.name == "计日工合计";
+          break;
+        case fixedFlag.LABOUR_SERVICE:
+          pass = data.name == "劳务";
+          break;
+        case fixedFlag.MATERIAL:
+          pass = data.name == "材料";
+          break;
+        case fixedFlag.CONSTRUCTION_MACHINE:
+          pass = data.name == "机械";
+          break;
+        case fixedFlag.PROVISIONAL:
+          pass = data.name == "暂列金额(不含计日工总额)";
+          break;
+        case fixedFlag.TOTAL_COST:
+          pass = data.name == "投标报价";
+          break;
+        case fixedFlag.ONE_HUNDRED_BILLS:
+          pass = data.name == "清单 第100章 总则";
+          break;
+      }
+    } else { 
+      if (bNode.parent) { 
+        const pdata = bNode.parent.data;
+        if (pdata.flagsIndex && pdata.flagsIndex.fixed && pdata.flagsIndex.fixed.flag == fixedFlag.ONE_SEVEN_BILLS) { 
+          if (!sectionNameMap[data.name]) pass = false
+        }
+      }
+    }
+    if(pass == false)fail = { hint: `清单:"${data.name?data.name:""}",名字不符合规范!`, type: projectName }
+
+    return fail;
+  }
+
   /**
    *
    * @param {String} areaKey - 地区标识,如:'安徽@马鞍山',有些地区的接口只是取值上有不同,共有一个接口脚本, 需要通过地区标识确定一些特殊处理
@@ -397,7 +448,7 @@ INTERFACE_EXPORT = (() => {
         ],
         children: [],
       };
-      if (isBidSubmission) { //导出到招标、招标控制价文件中,不输出这一部分。
+      if (isBidSubmission || isControl) { //导出到招标文件中,不输出这一部分。
         let elecDatas = electrovalenceObj.getElectrovalenceDatas(null, pgljData.com_electrovalence, pgljData.gljList);
         electrovalenceObj.calcPertElectrovalenceMarketPrice(elecDatas);
         for (let e of elecDatas) {
@@ -740,7 +791,7 @@ INTERFACE_EXPORT = (() => {
       let Mechs = new emptyElement("Mechs");
       let gljKeyMap = {};
       let temMechs = [];
-      if (isBidSubmission) { //导出到招标、招标控制价文件中,不输出这一部分。
+      if (isBidSubmission || isControl) { //导出到招标文件中,不输出这一部分。
         for (let g of pgljData.gljList) {
           let type = g.type + "";
           gljKeyMap[gljUtil.getIndex(g)] = g;
@@ -846,7 +897,7 @@ INTERFACE_EXPORT = (() => {
             value: b.remark
           }
         ];
-        if (isBidSubmission) { 
+        if (isBidSubmission || isControl) { 
           attrs[7].value = b.quantity;
           attrs[8].value = b.totalPrice;
         }
@@ -931,8 +982,8 @@ INTERFACE_EXPORT = (() => {
         function bill(bNode, level) {
           let data = bNode.data;
           let CostKind = 3;
-          if (data.name.indexOf("安全生产费") != -1) CostKind = 1;
-          if (data.name.indexOf("暂列金额") != -1) CostKind = 2;
+          if (data.name && data.name.indexOf("安全生产费") != -1) CostKind = 1;
+          if (data.name && data.name.indexOf("暂列金额") != -1) CostKind = 2;
           //1 = 工程量×综合单价;2 = 计算基数×费率;3 = 工程量×单价。
           let CalcType = getCalcType(bNode);
           //取暂估价类型。读取造价书界面的专项暂定列。0=材料暂估价,1=工程设备暂估价,2=专业工程暂估价,没有选的输出为空。
@@ -950,7 +1001,7 @@ INTERFACE_EXPORT = (() => {
             if (data.quantityCoe["material"]) MaterialRatio = data.quantityCoe["material"];
             if (data.quantityCoe["machine"]) MechRatio = data.quantityCoe["machine"];
           }
-
+          let fail = billNameChecking(bNode,tenderProject.projectInfo.name,fixedFlag)
           //fail: { hint: '错误提示', type: '提示所属(基本就是单位工程名称)' }
           const attrs = [{
               name: "ListCode",
@@ -959,6 +1010,7 @@ INTERFACE_EXPORT = (() => {
             {
               name: "ListName",
               value: data.name,
+              fail:fail
             },
             {
               name: "Unit",
@@ -1042,7 +1094,7 @@ INTERFACE_EXPORT = (() => {
             },
           ];
 
-          if (isBidSubmission) { 
+          if (isBidSubmission || isControl) { 
             attrs[5].value = data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "";
             attrs[7].value = data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderTotalFee : "";
           }
@@ -1053,7 +1105,7 @@ INTERFACE_EXPORT = (() => {
           this.children.push(CostStructure(data))
 
           function CostComposition(bNode) {
-            if (isControl || isBidInvitation) return null;
+            if (isBidInvitation) return null;
             let CostComposition = new emptyElement('CostComposition');
             let Norms = [];
             let Costs = [];
@@ -1256,7 +1308,7 @@ INTERFACE_EXPORT = (() => {
                 name: 'Sum',
                 value: 0 //fee.tenderTotalFee
               }]
-              if (isBidSubmission && item.feesIndex && item.feesIndex[type]) attrs[1].value = item.feesIndex[type].tenderTotalFee;
+              if ((isBidSubmission || isControl) && item.feesIndex && item.feesIndex[type]) attrs[1].value = item.feesIndex[type].tenderTotalFee;
               Element.call(this, "CostItem", attrs);
             }
             return CostStructure;
@@ -1393,7 +1445,7 @@ INTERFACE_EXPORT = (() => {
         },
       ];
       if(isBidInvitation) attrs = [] //招标
-      if (isControl) attrs.splice(1, 5); //控制价
+      //if (isControl) attrs.splice(1, 5); //控制价
       if (isBidSubmission) { //投标文件时,读工程特征中的 招标控制价 值
         let tenderSumLimit = _.find(feature, { "key": "tenderSumLimit" }); 
         if(tenderSumLimit) attrs[0].value = tenderSumLimit.value
@@ -1486,7 +1538,7 @@ INTERFACE_EXPORT = (() => {
           value: baseMap["projectExplain"] ? baseMap["projectExplain"].value : "",
         },
       ];
-      if (isControl || isBidInvitation) { //招标、招标控制价文件,则以下的8、12~18则不输出
+      if (isBidInvitation) { //招标文件,则以下的8、12~18则不输出
         attrs.splice(11, 7);
         attrs.splice(7, 1);
       }

+ 3 - 0
web/over_write/js/shandong_2016.js

@@ -293,6 +293,9 @@ if (typeof gljUtil !== "undefined") {
   gljUtil.getAssUsedPrice = function(g){//山东辅助生产人工费取市场价
     return g.marketPrice;
   }
+  gljUtil.getElecCode = function () {
+    return "865";
+  }
 }
 
 //山东工地转移费率值修改特殊处理

+ 3 - 0
web/over_write/js/sichuan_2013.js

@@ -2,6 +2,9 @@ if (typeof gljUtil !== "undefined") {
   gljUtil.getAssUsedPrice = function(g){//四川辅助生产人工费取市场价
     return g.marketPrice;
   }
+  gljUtil.getElecCode = function () {
+    return "865";
+  }
 }