Explorar o código

feat:安徽-马鞍山导出接口更新

vian %!s(int64=5) %!d(string=hai) anos
pai
achega
23c21ed305

+ 65 - 24
web/building_saas/standard_interface/export/anhui_maanshan.js

@@ -86,10 +86,10 @@ INTERFACE_EXPORT = (() => {
             // 额外字段
             const extraMap = {
                 '淮北': [
-                    { name: 'ZbrNssbh', value: getValueByKey(information, '') }, // 招标人纳税识别号
-                    { name: 'ZxrNssbh', value: getValueByKey(information, '') }, // 造价咨询人纳税识别号
-                    { name: 'ZbrDbSfzh', value: getValueByKey(information, '') }, // 招标人法定代表人或其授权人身份证号
-                    { name: 'ZxrNssbh', value: getValueByKey(information, '') }, // 造价咨询人法定代表或其授权人纳税识别号
+                    { name: 'ZbrNssbh', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') }, // 招标人纳税识别号
+                    { name: 'ZxrNssbh', value: getValueByKey(information, 'costConsultantTaxpayerIdentificationNo') }, // 造价咨询人纳税识别号
+                    { name: 'ZbrDbSfzh', value: getValueByKey(information, 'tenderAuthorizerIDNo') }, // 招标人法定代表人或其授权人身份证号
+                    { name: 'ZxrNssbh', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') }, // 造价咨询人法定代表或其授权人纳税识别号
                 ]
             };
             if (extraMap[subArea]) {
@@ -114,10 +114,10 @@ INTERFACE_EXPORT = (() => {
             // 额外字段
             const extraMap = {
                 '淮北': [
-                    { name: 'ZbrNssbh', value: getValueByKey(information, '') }, // 招标人纳税识别号
-                    { name: 'ZxrNssbh', value: getValueByKey(information, '') }, // 造价咨询人纳税识别号
-                    { name: 'ZbrDbSfzh', value: getValueByKey(information, '') }, // 招标人法定代表人或其授权人身份证号
-                    { name: 'ZxrNssbh', value: getValueByKey(information, '') }, // 造价咨询人法定代表或其授权人纳税识别号
+                    { name: 'ZbrNssbh', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') }, // 招标人纳税识别号
+                    { name: 'ZxrNssbh', value: getValueByKey(information, 'costConsultantTaxpayerIdentificationNo') }, // 造价咨询人纳税识别号
+                    { name: 'ZbrDbSfzh', value: getValueByKey(information, 'tenderAuthorizerIDNo') }, // 招标人法定代表人或其授权人身份证号
+                    { name: 'ZxrNssbh', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') }, // 造价咨询人法定代表或其授权人纳税识别号
                 ]
             };
             if (extraMap[subArea]) {
@@ -130,8 +130,8 @@ INTERFACE_EXPORT = (() => {
         function TouBiaoXx(information, totalCost) {
             const attrs = [
                 { name: 'Zbr', value: getValueByKey(information, 'tendereeName') }, // 招标人
-                { name: 'Tbr', value: getValueByKey(information, '') }, // 投标人
-                { name: 'TbrDb', value: getValueByKey(information, '') }, // 投标人法定代表或其授权
+                { name: 'Tbr', value: getValueByKey(information, 'bidder') }, // 投标人
+                { name: 'TbrDb', value: getValueByKey(information, 'bidderAuthorizer') }, // 投标人法定代表或其授权
                 { name: 'Bzr', value: getValueByKey(information, 'tenderCompiler') }, // 编制人
                 { name: 'BzTime', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE }, // 编制时间
                 { name: 'Tbzj', value: totalCost, type: TYPE.DECIMAL }, // 控制价总价(元),取“投标报价”的金额。
@@ -139,9 +139,9 @@ INTERFACE_EXPORT = (() => {
             // 额外字段
             const extraMap = {
                 '淮北': [
-                    { name: 'ZbrNssbh', value: getValueByKey(information, '') }, // 招标人纳税识别号
-                    { name: 'TbrNssbh', value: getValueByKey(information, '') }, // 投标人纳税识别号
-                    { name: 'TbrDbsfzh', value: getValueByKey(information, '') }, // 投标人法定代表或其授权人身份证号
+                    { name: 'ZbrNssbh', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') }, // 招标人纳税识别号
+                    { name: 'TbrNssbh', value: getValueByKey(information, 'bidderTaxpayerIdentificationNo') }, // 投标人纳税识别号
+                    { name: 'TbrDbsfzh', value: getValueByKey(information, 'tenderAuthorizerIDNo') }, // 投标人法定代表或其授权人身份证号
                 ]
             };
             if (extraMap[subArea]) {
@@ -426,13 +426,13 @@ INTERFACE_EXPORT = (() => {
             Element.call(this, 'JrgBJrgMx', attrs);
         }
 
-        // 暂估材料表
-        function ZgCl() {
-            Element.call(this, 'ZgCl');
+        // 暂估材料表、评标材料表
+        function gljRefRoot(eleName) {
+            Element.call(this, eleName);
         }
 
-        // 暂估材料明细
-        function ZgClMx(glj) {
+        // 暂估材料表、评标材料表明细
+        function gljRefElement(eleName, glj) {
             const attrs = [
                 { name: 'Xh', value: glj.seq }, // 序号
                 { name: 'RcjId', value: projectGLJIDToRcjID[glj.projectGLJID] }, // 资源ID
@@ -441,10 +441,38 @@ INTERFACE_EXPORT = (() => {
                 { name: 'Ggxh', value: glj.specs }, // 规格型号
                 { name: 'Dw', value: glj.unit }, // 单位
                 { name: 'Sl', value: BID_INVITATION ? '0' : glj.quantity, type: TYPE.DECIMAL }, // 工程量
-                { name: 'Dj', value: BID_INVITATION ? '0' : glj.market_price, type: TYPE.DECIMAL }, // 单价
-                { name: 'Hj', value: BID_INVITATION ? '0' : glj.market_price, type: TYPE.DECIMAL }, // 合价
+                { name: 'Dj', value: glj.marketPrice, type: TYPE.DECIMAL }, // 暂定价、单价
+                { name: 'Hj', value: BID_INVITATION ? '0' : glj.totalPrice, type: TYPE.DECIMAL }, // 合价
+                { name: 'Bz', value: glj.remark, type: TYPE.DECIMAL }, // 备注
+            ];
+            Element.call(this, eleName, attrs);
+        }
+        
+        // 人材机汇总
+        function Rcjhz() {
+            Element.call(this, 'Rcjhz');
+        }
+        
+        // 人材机汇总明细
+        function RcjhzMx(glj) {
+            const attrs = [
+                { name: 'RcjId', value: projectGLJIDToRcjID[glj.id] }, // 资源ID
+                { name: 'Bm', value: glj.code }, // 编码
+                { name: 'Mc', value: glj.name }, // 名称
+                { name: 'Ggxh', value: glj.specs }, // 规格型号
+                { name: 'Dw', value: glj.unit }, // 单位
+                { name: 'Dj', value: glj.priceInfo.tenderPrice, type: TYPE.DECIMAL }, // 预算价,调后
+                { name: 'Sl', value: glj.tenderQuantity, type: TYPE.DECIMAL }, // 总消耗量
+                { name: 'Hj', value: glj.totalPrice, type: TYPE.DECIMAL }, // 合价,人材料总消耗量*预算价
+                { name: 'Cd', value: '' }, // 产地
+                { name: 'Gycs', value: '' }, // 厂商
+                { name: 'Rcjlb', value: '', type: TYPE.INT }, // 人材机类型 1=人工;2=材料;3=机械
+                { name: 'Jgbz', value: 'false', type: TYPE.BOOL }, // 供材方
+                { name: 'Zyclbj', value: !!glj.is_main_material, type: TYPE.BOOL }, // 主要材料
+                { name: 'Zgjbz', value: !!glj.is_evaluate, type: TYPE.BOOL }, // 是否暂估
+                { name: 'Zcbz', value: 'false', type: TYPE.BOOL }, // 主材标记
             ]
-            Element.call(this, 'ZgClMx', attrs);
+            Element.call(this, 'RcjhzMx', attrs);
         }
         // 组装数据 --------------------------------------
 
@@ -638,9 +666,22 @@ INTERFACE_EXPORT = (() => {
             return [root]
         }
 
-        // 组装暂估材料
-        function setupEvaluationList(evaluationListDetail) {
-
+        // 组装人材机汇总相关表数据
+        function setupGLJList() {
+            // 暂估材料
+            const zgcl = new gljRefRoot('ZgCl');
+            const zgclData = curDetail.evaluateMaterialData.map(glj => new gljRefElement('ZgClMx', glj));
+            zgcl.children.push(...zgclData);
+            
+            // 评标材料
+            const jpcl = new gljRefRoot('JpCl');
+            const jpclData = curDetail.bidMaterialData.map(glj => new gljRefElement('JpClMx', glj));
+            jpcl.children.push(...jpclData);
+            if (BID_INVITATION) {
+                return [zgcl, jpcl];
+            }
+            // 人材机汇总 (招标不导出)
+            const rcjhz = new Rcjhz();
         }
 
         return setupConstruction(projectData);

+ 29 - 4
web/building_saas/standard_interface/export/base.js

@@ -35,9 +35,9 @@ const INTERFACE_EXPORT_BASE = (() => {
     };
     // 加载数据间隔,减少服务器压力
     const TIMEOUT_TIME = 400;
-    const { 
+    const {
         GRANULARITY,
-        EXPORT_KIND 
+        EXPORT_KIND
     } = window.commonConstants;
     /* const EXPORT_KIND_NAME = {
         1: '招标',
@@ -704,13 +704,38 @@ const INTERFACE_EXPORT_BASE = (() => {
             }
             // 获取单位工程详细数据
             const detail = await getTenderDetail(tenderItem.ID, userID);
-            // 人材机汇总排序
-            gljUtil.sortRationGLJ(detail.projectGLJ.datas.gljList);
+            tenderDetailPretreatment(detail);
+            console.log(detail);
         }
         // 提取相关项目的详细导出数据
         return await entryFunc(areaKey, exportKind, projectData, tenderDetailMap);
     }
 
+    // 对getData返回的数据进行一些通用预处理,方便各接口直接取值、处理
+    function tenderDetailPretreatment(tenderDetail) {
+        const projectGLJList = tenderDetail.projectGLJ.datas.gljList;
+        const bidEvaluationList = tenderDetail.bid_evaluation_list.datas;
+        const evaluateList = tenderDetail.evaluate_list.datas;
+        const decimalInfo = tenderDetail.projectInfo.property.decimal;
+        // 项目人材机汇总排序
+        gljUtil.sortRationGLJ(projectGLJList);
+        // 计算人材机总消耗量,否则projectGLJ.datas.gljList里的数据不会有消耗量数据
+        gljUtil.calcProjectGLJQuantity(tenderDetail.projectGLJ.datas, tenderDetail.ration_glj.datas, tenderDetail.Ration.datas, tenderDetail.Bills.datas, tenderDetail.property.decimal.glj.quantity, _, scMathUtil);
+        projectGLJList.forEach(glj => {
+            // 项目人材机设置价格信息,否则projectGLJ.datas.gljList里的数据不会有相关价格信息
+            // 价格信息存在新的priceInfo字段,以免对一些方法造成影响
+            glj.priceInfo = gljUtil.getGLJPrice(glj, tenderDetail.projectGLJ.datas, tenderDetail.property.calcOptions, tenderDetail.labourCoe.datas, decimalInfo, false, _, scMathUtil, {}, tenderDetail.projectGLJ.getTenderPriceCoe(glj, tenderDetail.property));
+            // 计算合价:人材料总消耗量*预算价
+            glj.priceInfo.totalPrice = scMathUtil.roundForObj(glj.priceInfo.tenderPrice * glj.tenderQuantity, 2);
+        });
+        // 获取暂估价材料数据,getData原始数据evaluate_list.datas里的数据缺少一些价格数据,需要调用额外接口
+        tenderDetail.evaluateMaterialData = configMaterialObj.getEvaluateMaterialDatas(projectGLJList, evaluateList, decimalInfo);
+        // 获取评标材料数据
+        tenderDetail.bidMaterialData = configMaterialObj.getBidMaterialDatas(projectGLJList, bidEvaluationList, decimalInfo);
+
+
+    }
+
     /**
      * 根据各自费用定额的文件结构,导出文件
      * 每个费用定额可能导出的结果文件都不同

+ 3 - 3
web/building_saas/standard_interface/export/view.js

@@ -70,13 +70,13 @@ const EXPORT_VIEW = (() => {
             }
         });
         //导出窗口--------
-        $('#export').on('hide.bs.modal', function () {
+        $('#interface-export-modal').on('hide.bs.modal', function () {
             resetState();
             STATE.checking = false;
             STATE.exporting = false;
-            $('#export input[type="checkbox"]:eq(0)').prop('checked', true);
+            $('#interface-export-modal input[type="checkbox"]:eq(0)').prop('checked', true);
         });
-        $('#export input[type="checkbox"]').click(function () {
+        $('#interface-export-modal input[type="checkbox"]').click(function () {
             resetState();
         });
     }