anhui_chizhou.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. INTERFACE_EXPORT = (() => {
  2. 'use strict';
  3. /**
  4. *
  5. * @param {String} areaKey - 地区标识,如:'安徽@马鞍山',有些地区的接口只是取值上有不同,共有一个接口脚本, 需要通过地区标识确定一些特殊处理
  6. * @param {Number} exportKind - 导出类型,招标、投标、控制价
  7. * @param {Object} projectData - 项目表数据:{ 建设项目Data, children: [单位工程...] }
  8. * @param {Object} tenderDetailMap - 单位工程ID与getData接口数据(projectObj.project的结构)的映射。
  9. * @return {Promise<Array>} - 返回的数据结构必须按照规定:[{ data, exportKind, fileName }],参考web\building_saas\standard_interface\index.js中的注释说明
  10. */
  11. async function entry(areaKey, exportKind, projectData, tenderDetailMap) {
  12. const {
  13. CONFIG: {
  14. TYPE,
  15. WHITE_SPACE
  16. },
  17. UTIL: {
  18. getValueByKey,
  19. getHan,
  20. getFee,
  21. generateHardwareId,
  22. },
  23. Element,
  24. } = INTERFACE_EXPORT_BASE;
  25. const {
  26. EXPORT_KIND: { BID_INVITATION, BID_SUBMISSION, CONTROL },
  27. fixedFlag,
  28. RationType,
  29. } = window.commonConstants
  30. const GljType = gljUtil.gljType;
  31. const { isEmptyVal, isDef } = window.commonUtil;
  32. const isBidInvitation = exportKind === BID_INVITATION; // 是否是招标
  33. const isBidSubmission = exportKind === BID_SUBMISSION; // 是否是投标
  34. const isControl = exportKind === CONTROL; // 是否是控制价
  35. // 节点定义------------------------------------------------------------------------------------------------------------
  36. function CreateNode(nodeName, attrArr = []) {
  37. Element.call(this, nodeName, attrArr);
  38. }
  39. function GongCXX(information) {
  40. const attrs = [
  41. { name: '项目编号', value: getValueByKey(information, 'projNum') },
  42. { name: '项目名称', value: getValueByKey(information, '') },
  43. { name: '建设单位', value: getValueByKey(information, 'constructingUnits') },
  44. { name: '起始桩号', value: getValueByKey(information, 'startAndChainages') },
  45. { name: '终点桩号', value: getValueByKey(information, 'startAndChainages') },
  46. { name: '建设地址', value: getValueByKey(information, '') },
  47. { name: '项目概况', value: getValueByKey(information, '') },
  48. { name: '建设性质', value: getValueByKey(information, '') },
  49. { name: '专业划分', value: getValueByKey(information, '') },
  50. { name: '道路里程', value: getValueByKey(information, '') },
  51. { name: '设计单位', value: getValueByKey(information, '') },
  52. { name: '计税方式', value: getValueByKey(information, 'taxMode') },
  53. { name: '文件类型', value: getValueByKey(information, 'projType') },
  54. { name: '标准版本号', value: getValueByKey(information, '') },
  55. { name: 'GUID', value: getValueByKey(information, '') }
  56. ];
  57. Element.call(this, '工程信息', attrs);
  58. }
  59. function ZhaoBiaoXx(information) {
  60. const attrs = [
  61. { name: '招标人', value: getValueByKey(information, 'tendereeName') },
  62. { name: '招标人纳税识别号', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') },
  63. { name: '招标法定代表人或其授权人', value: getValueByKey(information, 'tenderAuthorizer') },
  64. { name: '招标法人或其授权人身份证号', value: getValueByKey(information, 'tenderAuthorizerIDNo') },
  65. { name: '造价咨询人', value: getValueByKey(information, 'costConsultant') },
  66. { name: '造价咨询人纳税识别号', value: getValueByKey(information, 'costConsultantTaxpayerIdentificationNo') },
  67. { name: '造价咨询人法定代表人或其授权人', value: getValueByKey(information, 'consultantAuthorizer') },
  68. { name: '造价咨询法人或其授权人身份证号', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') },
  69. { name: '编制人', value: getValueByKey(information, 'tenderCompiler') },
  70. { name: '编制人资格证号', value: getValueByKey(information, '') },
  71. { name: '编制日期', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE},
  72. { name: '复核人', value: getValueByKey(information, 'tenderExaminer') },
  73. { name: '复核人资格证号', value: getValueByKey(information, '') },
  74. { name: '复核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE }
  75. ];
  76. Element.call(this, '招标信息', attrs);
  77. }
  78. function ZhaoBiaoKzXx(information, totalCost) {
  79. const attrs = [
  80. { name: '招标人', value: getValueByKey(information, 'tendereeName') },
  81. { name: '招标人纳税识别号', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') },
  82. { name: '招标法定代表人或其授权人', value: getValueByKey(information, 'tenderAuthorizer') },
  83. { name: '招标法人或其授权人身份证号', value: getValueByKey(information, 'tenderAuthorizerIDNo') },
  84. { name: '造价咨询人', value: getValueByKey(information, 'costConsultant') },
  85. { name: '造价咨询人纳税识别号', value: getValueByKey(information, 'costConsultantTaxpayerIdentificationNo') },
  86. { name: '造价咨询人法定代表人或其授权人', value: getValueByKey(information, 'consultantAuthorizer') },
  87. { name: '造价咨询法人或其授权人身份证号', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') },
  88. { name: '编制人', value: getValueByKey(information, 'tenderCompiler') },
  89. { name: '编制人资格证号', value: getValueByKey(information, '') },
  90. { name: '编制日期', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE},
  91. { name: '复核人', value: getValueByKey(information, 'tenderExaminer') },
  92. { name: '复核人资格证号', value: getValueByKey(information, '') },
  93. { name: '复核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
  94. { name: '审核人', value: getValueByKey(information, 'tenderExaminer') },
  95. { name: '审核人资格证号', value: getValueByKey(information, '') },
  96. { name: '审核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
  97. { name: '控制价总价', value: totalCost, type: TYPE.DECIMAL },
  98. { name: '工期', value: getValueByKey(information, '') },
  99. { name: '质量要求', value: getValueByKey(information, '') }
  100. ];
  101. Element.call(this, '招标控制价', attrs);
  102. }
  103. function TouBiaoXx(information, totalCost) {
  104. const attrs = [
  105. { name: '投标人', value: getValueByKey(information, 'bidderName') },
  106. { name: '投标人纳税识别号', value: getValueByKey(information, '') },
  107. { name: '投标人法定代表或其授权人', value: getValueByKey(information, 'bidderAuthorizer') },
  108. { name: '投标人法人或其授权人身份证号', value: getValueByKey(information, '') },
  109. { name: '编制人', value: getValueByKey(information, 'tenderCompiler') },
  110. { name: '编制人资格证号', value: getValueByKey(information, '') },
  111. { name: '编制日期', value: getValueByKey(information, 'compilationTime'), type: TYPE.DATE},
  112. { name: '复核人', value: getValueByKey(information, 'tenderExaminer') },
  113. { name: '复核人资格证号', value: getValueByKey(information, '') },
  114. { name: '复核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
  115. { name: '审核人', value: getValueByKey(information, 'tenderExaminer') },
  116. { name: '审核人资格证号', value: getValueByKey(information, '') },
  117. { name: '审核日期', value: getValueByKey(information, 'reviewTime'), type: TYPE.DATE },
  118. { name: '投标总价', value: totalCost, type: TYPE.DECIMAL },
  119. { name: '工期', value: getValueByKey(information, '') },
  120. { name: '投标担保金额', value: getValueByKey(information, '') },
  121. { name: '质量承诺', value: getValueByKey(information, '') },
  122. { name: '投标担保方式', value: getValueByKey(information, '') },
  123. { name: '造价软件品牌', value: getValueByKey(information, '') },
  124. { name: '造价软件版本', value: getValueByKey(information, '') },
  125. { name: '造价软件加密锁编号', value: getValueByKey(information, '') },
  126. { name: '计算机硬件信息', value: getValueByKey(information, '') },
  127. { name: '', value: getValueByKey(information, '') }
  128. ];
  129. Element.call(this, '投标信息', attrs);
  130. }
  131. // 生成标段工程
  132. function CreateGLBDGC(tenderData, gongLGCSJ, gongLGCHZ, Num){
  133. let attrs0 = [
  134. { name: '序号', value: Num },
  135. { name: '标段名称', value: tenderData.name },
  136. { name: '金额', value: projectData.summaryInfo[tenderData.ID].totalCost }
  137. ];
  138. const attrs1 = [{ name: '唯一标识-Guid', value: tenderData._id }]; // 公路标段工程
  139. const gongLBDGC = new CreateNode('公路标段工程', attrs0.concat(attrs1));
  140. gongLGCSJ.children.push(gongLBDGC);
  141. const gongCLQDB = new CreateNode('工程量清单表');
  142. const jiRGXXB = new CreateNode('计日工信息表');
  143. const ZaoJHZB = new CreateNode('造价汇总表');
  144. const RenCJHZ = new CreateNode('人材机汇总');
  145. gongLBDGC.children = [gongCLQDB, jiRGXXB, ZaoJHZB, RenCJHZ];
  146. const attrs2 = [{ name: '备注', value: '' }];
  147. const gongLGCHZMX = new CreateNode('公路工程汇总明细', attrs0.concat(attrs2));
  148. gongLGCHZ.children.push(gongLGCHZMX);
  149. }
  150. // 组装主体框架数据
  151. function setupConstruction() {
  152. const information = projectData.property && projectData.property.basicInformation || [];
  153. const summaryInfo = projectData.summaryInfo[projectData.ID];
  154. const chiZGLGC = new CreateNode('池州公路工程');
  155. const gongCXX = new GongCXX(information); // 工程信息
  156. const zhaoTBXX = new CreateNode('招投标信息');
  157. const gongLGCSJ = new CreateNode('公路工程数据');
  158. chiZGLGC.children = [gongCXX, zhaoTBXX, gongLGCSJ];
  159. if (isBidInvitation)
  160. zhaoTBXX.children.push(new ZhaoBiaoXx(information));
  161. else if (isControl)
  162. zhaoTBXX.children.push(new ZhaoBiaoKzXx(information, summaryInfo.totalCost));
  163. else
  164. zhaoTBXX.children.push(new TouBiaoXx(information, summaryInfo.totalCost));
  165. const gongLGCHZ = new CreateNode('公路工程汇总');
  166. gongLGCSJ.children.push(gongLGCHZ);
  167. let n = 0;
  168. for (const tenderData of projectData.children) {
  169. n++;
  170. CreateGLBDGC(tenderData, gongLGCSJ, gongLGCHZ, n);
  171. }
  172. gongLGCSJ.children.push(gongLGCSJ.children.shift());
  173. const suffix = INTERFACE_CONFIG[areaKey]['fileSuffix'][exportKind];
  174. return [{
  175. data: chiZGLGC,
  176. exportKind,
  177. fileName: `${projectData.name}${suffix}`
  178. }];
  179. }
  180. return setupConstruction();
  181. }
  182. return {
  183. entry
  184. };
  185. })();