| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- INTERFACE_EXPORT = (() => {
- 'use strict';
- /**
- *
- * @param {String} areaKey - 地区标识,如:'安徽@马鞍山',有些地区的接口只是取值上有不同,共有一个接口脚本, 需要通过地区标识确定一些特殊处理
- * @param {Number} exportKind - 导出类型,招标、投标、控制价
- * @param {Object} projectData - 项目表数据:{ 建设项目Data, children: [单位工程...] }
- * @param {Object} tenderDetailMap - 单位工程ID与getData接口数据(projectObj.project的结构)的映射。
- * @return {Promise<Array>} - 返回的数据结构必须按照规定:[{ data, exportKind, fileName }],参考web\building_saas\standard_interface\index.js中的注释说明
- */
- async function entry(areaKey, exportKind, projectData, tenderDetailMap) {
- const {
- CONFIG: {
- TYPE,
- WHITE_SPACE
- },
- UTIL: {
- getValueByKey,
- getHan,
- getFee,
- generateHardwareId,
- },
- Element,
- } = INTERFACE_EXPORT_BASE;
- const {
- EXPORT_KIND: { BID_INVITATION, BID_SUBMISSION, CONTROL },
- fixedFlag,
- RationType,
- } = window.commonConstants
- const GljType = gljUtil.gljType;
- const { isEmptyVal, isDef } = window.commonUtil;
- const isBidInvitation = exportKind === BID_INVITATION; // 是否是招标
- const isBidSubmission = exportKind === BID_SUBMISSION; // 是否是投标
- const isControl = exportKind === CONTROL; // 是否是控制价
- // 节点定义------------------------------------------------------------------------------------------------------------
- function CreateNode(nodeName, attrArr = []) {
- Element.call(this, nodeName, attrArr);
- }
- function GongCXX(information) {
- const attrs = [
- { name: '项目编号', value: getValueByKey(information, 'projNum') },
- { name: '项目名称', value: getValueByKey(information, '') },
- { name: '建设单位', value: getValueByKey(information, 'constructingUnits') },
- { name: '起始桩号', value: getValueByKey(information, 'startAndChainages') },
- { name: '终点桩号', value: getValueByKey(information, 'startAndChainages') },
- { name: '建设地址', value: getValueByKey(information, '') },
- { name: '项目概况', value: getValueByKey(information, '') },
- { name: '建设性质', value: getValueByKey(information, '') },
- { name: '专业划分', value: getValueByKey(information, '') },
- { name: '道路里程', value: getValueByKey(information, '') },
- { name: '设计单位', value: getValueByKey(information, '') },
- { name: '计税方式', value: getValueByKey(information, 'taxMode') },
- { name: '文件类型', value: getValueByKey(information, 'projType') },
- { name: '标准版本号', value: getValueByKey(information, '') },
- { name: 'GUID', value: getValueByKey(information, '') }
- ];
- Element.call(this, '工程信息', attrs);
- }
- function ZhaoBiaoXx(information) {
- const attrs = [
- { name: '招标人', value: getValueByKey(information, 'tendereeName') },
- { name: '招标人纳税识别号', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') },
- { name: '招标法定代表人或其授权人', value: getValueByKey(information, 'tenderAuthorizer') },
- { name: '招标法人或其授权人身份证号', value: getValueByKey(information, 'tenderAuthorizerIDNo') },
- { name: '造价咨询人', value: getValueByKey(information, 'costConsultant') },
- { name: '造价咨询人纳税识别号', value: getValueByKey(information, 'costConsultantTaxpayerIdentificationNo') },
- { name: '造价咨询人法定代表人或其授权人', value: getValueByKey(information, 'consultantAuthorizer') },
- { name: '造价咨询法人或其授权人身份证号', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') },
- { name: '编制人', value: getValueByKey(information, 'tenderCompiler') },
- { name: '编制人资格证号', value: getValueByKey(information, '') },
- { name: '编制日期', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE},
- { name: '复核人', value: getValueByKey(information, 'tenderExaminer') },
- { name: '复核人资格证号', value: getValueByKey(information, '') },
- { name: '复核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE }
- ];
- Element.call(this, '招标信息', attrs);
- }
- function ZhaoBiaoKzXx(information, totalCost) {
- const attrs = [
- { name: '招标人', value: getValueByKey(information, 'tendereeName') },
- { name: '招标人纳税识别号', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') },
- { name: '招标法定代表人或其授权人', value: getValueByKey(information, 'tenderAuthorizer') },
- { name: '招标法人或其授权人身份证号', value: getValueByKey(information, 'tenderAuthorizerIDNo') },
- { name: '造价咨询人', value: getValueByKey(information, 'costConsultant') },
- { name: '造价咨询人纳税识别号', value: getValueByKey(information, 'costConsultantTaxpayerIdentificationNo') },
- { name: '造价咨询人法定代表人或其授权人', value: getValueByKey(information, 'consultantAuthorizer') },
- { name: '造价咨询法人或其授权人身份证号', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') },
- { name: '编制人', value: getValueByKey(information, 'tenderCompiler') },
- { name: '编制人资格证号', value: getValueByKey(information, '') },
- { name: '编制日期', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE},
- { name: '复核人', value: getValueByKey(information, 'tenderExaminer') },
- { name: '复核人资格证号', value: getValueByKey(information, '') },
- { name: '复核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
- { name: '审核人', value: getValueByKey(information, 'tenderExaminer') },
- { name: '审核人资格证号', value: getValueByKey(information, '') },
- { name: '审核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
- { name: '控制价总价', value: totalCost, type: TYPE.DECIMAL },
- { name: '工期', value: getValueByKey(information, '') },
- { name: '质量要求', value: getValueByKey(information, '') }
- ];
- Element.call(this, '招标控制价', attrs);
- }
- function TouBiaoXx(information, totalCost) {
- const attrs = [
- { name: '投标人', value: getValueByKey(information, 'bidderName') },
- { name: '投标人纳税识别号', value: getValueByKey(information, '') },
- { name: '投标人法定代表或其授权人', value: getValueByKey(information, 'bidderAuthorizer') },
- { name: '投标人法人或其授权人身份证号', value: getValueByKey(information, '') },
- { name: '编制人', value: getValueByKey(information, 'tenderCompiler') },
- { name: '编制人资格证号', value: getValueByKey(information, '') },
- { name: '编制日期', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE},
- { name: '复核人', value: getValueByKey(information, 'tenderExaminer') },
- { name: '复核人资格证号', value: getValueByKey(information, '') },
- { name: '复核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
- { name: '审核人', value: getValueByKey(information, 'tenderExaminer') },
- { name: '审核人资格证号', value: getValueByKey(information, '') },
- { name: '审核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
- { name: '投标总价', value: totalCost, type: TYPE.DECIMAL },
- { name: '工期', value: getValueByKey(information, '') },
- { name: '投标担保金额', value: getValueByKey(information, '') },
- { name: '质量承诺', value: getValueByKey(information, '') },
- { name: '投标担保方式', value: getValueByKey(information, '') },
- { name: '造价软件品牌', value: getValueByKey(information, '') },
- { name: '造价软件版本', value: getValueByKey(information, '') },
- { name: '造价软件加密锁编号', value: getValueByKey(information, '') },
- { name: '计算机硬件信息', value: getValueByKey(information, '') },
- { name: '', value: getValueByKey(information, '') }
- ];
- Element.call(this, '投标信息', attrs);
- }
- // 生成标段工程
- function CreateGLBDGC(tenderData, gongLGCSJ, gongLGCHZ, Num){
- let attrs0 = [
- { name: '序号', value: Num },
- { name: '标段名称', value: tenderData.name },
- { name: '金额', value: projectData.summaryInfo[tenderData.ID].totalCost }
- ];
- const attrs1 = [{ name: '唯一标识-Guid', value: tenderData._id }]; // 公路标段工程
- const gongLBDGC = new CreateNode('公路标段工程', attrs0.concat(attrs1));
- gongLGCSJ.children.push(gongLBDGC);
- const gongCLQDB = new CreateNode('工程量清单表');
- const jiRGXXB = new CreateNode('计日工信息表');
- const ZaoJHZB = new CreateNode('造价汇总表');
- const RenCJHZ = new CreateNode('人材机汇总');
- gongLBDGC.children = [gongCLQDB, jiRGXXB, ZaoJHZB, RenCJHZ];
- const attrs2 = [{ name: '备注', value: '' }];
- const gongLGCHZMX = new CreateNode('公路工程汇总明细', attrs0.concat(attrs2));
- gongLGCHZ.children.push(gongLGCHZMX);
- }
- // 组装主体框架数据
- function setupConstruction() {
- const information = projectData.property && projectData.property.basicInformation || [];
- const summaryInfo = projectData.summaryInfo[projectData.ID];
- const chiZGLGC = new CreateNode('池州公路工程');
- const gongCXX = new GongCXX(information); // 工程信息
- const zhaoTBXX = new CreateNode('招投标信息');
- const gongLGCSJ = new CreateNode('公路工程数据');
- chiZGLGC.children = [gongCXX, zhaoTBXX, gongLGCSJ];
- if (isBidInvitation)
- zhaoTBXX.children.push(new ZhaoBiaoXx(information));
- else if (isControl)
- zhaoTBXX.children.push(new ZhaoBiaoKzXx(information, summaryInfo.totalCost));
- else
- zhaoTBXX.children.push(new TouBiaoXx(information, summaryInfo.totalCost));
- const gongLGCHZ = new CreateNode('公路工程汇总');
- gongLGCSJ.children.push(gongLGCHZ);
- let n = 0;
- for (const tenderData of projectData.children) {
- n++;
- CreateGLBDGC(tenderData, gongLGCSJ, gongLGCHZ, n);
- }
- gongLGCSJ.children.push(gongLGCSJ.children.shift());
- const suffix = INTERFACE_CONFIG[areaKey]['fileSuffix'][exportKind];
- return [{
- data: chiZGLGC,
- exportKind,
- fileName: `${projectData.name}${suffix}`
- }];
- }
- return setupConstruction();
- }
- return {
- entry
- };
- })();
|