anhui_chizhou.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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. getFee,
  20. generateHardwareId,
  21. },
  22. Element,
  23. } = INTERFACE_EXPORT_BASE;
  24. const {
  25. EXPORT_KIND: { BID_INVITATION, BID_SUBMISSION, CONTROL },
  26. fixedFlag,
  27. RationType,
  28. } = window.commonConstants
  29. const isBidInvitation = exportKind === BID_INVITATION; // 是否是招标
  30. const isBidSubmission = exportKind === BID_SUBMISSION; // 是否是投标
  31. const isControl = exportKind === CONTROL; // 是否是控制价
  32. let serialNo;
  33. let vTree;
  34. const info = projectData.property && projectData.property.basicInformation || [];
  35. const summary = projectData.summaryInfo[projectData.ID];
  36. // const feature = tenderDetailMap[projectData.children[0].ID].property.projectFeature;
  37. // ------------------------------------------------------------------------------------------------------------
  38. // 提取字符串中的数字
  39. function getNum(str) {
  40. let num = str.replace(/[^0-9]/ig, "");
  41. return num;
  42. }
  43. function CheckNull(Value) {
  44. if (!Value)
  45. return 0
  46. else
  47. return Value;
  48. }
  49. function GetRationDataType(ration){
  50. let dt;
  51. if (calcTools.isRationItem(ration))
  52. dt = 3
  53. else if (calcTools.isGljRation(ration))
  54. dt = 1
  55. else if (calcTools.isVolumePrice(ration))
  56. dt = 4;
  57. return dt;
  58. }
  59. // ------------------------------------------------------------------------------------------------------------
  60. function CreateNode(nodeName, attrArr = []) {
  61. Element.call(this, nodeName, attrArr);
  62. }
  63. function GongCXX() {
  64. const attrs = [
  65. { name: '项目编号', value: getValueByKey(info, 'projNum') },
  66. { name: '项目名称', value: projectData.name }, // projName
  67. { name: '建设单位', value: getValueByKey(info, 'constructingUnits') },
  68. { name: '起始桩号', value: getValueByKey(info, 'startAndChainages') },
  69. { name: '终点桩号', value: getValueByKey(info, 'endChainages') },
  70. { name: '建设地址', value: getValueByKey(info, 'constructionAddress') },
  71. { name: '项目概况', value: getValueByKey(info, 'projOverview') },
  72. { name: '建设性质', value: getValueByKey(info, 'natureConstruction') },
  73. { name: '专业划分', value: getValueByKey(info, 'specialityDivision') },
  74. { name: '道路里程', value: getValueByKey(info, 'roadDistance') },
  75. { name: '设计单位', value: getValueByKey(info, 'designUnit') },
  76. { name: '计税方式', value: getValueByKey(info, 'taxMode') },
  77. { name: '文件类型', value: getValueByKey(info, 'projType') },
  78. { name: '标准版本号', value: '1.0' },
  79. { name: 'GUID', value: projectData._id }
  80. ];
  81. Element.call(this, '工程信息', attrs);
  82. }
  83. function ZhaoBiaoXX() {
  84. const attrs = [
  85. { name: '招标人', value: getValueByKey(info, 'tendereeName') },
  86. { name: '招标人纳税识别号', value: getValueByKey(info, 'tendereeTaxpayerIdentificationNo') },
  87. { name: '招标法定代表人或其授权人', value: getValueByKey(info, 'tenderAuthorizer') },
  88. { name: '招标法人或其授权人身份证号', value: getValueByKey(info, 'tenderAuthorizerIDNo') },
  89. { name: '造价咨询人', value: getValueByKey(info, 'costConsultant') },
  90. { name: '造价咨询人纳税识别号', value: getValueByKey(info, 'costConsultantTaxpayerIdentificationNo') },
  91. { name: '造价咨询人法定代表人或其授权人', value: getValueByKey(info, 'consultantAuthorizer') },
  92. { name: '造价咨询法人或其授权人身份证号', value: getValueByKey(info, 'consultantAuthorizerTaxpayerIdentificationNo') },
  93. { name: '编制人', value: getValueByKey(info, 'tenderCompiler') },
  94. { name: '编制人资格证号', value: getValueByKey(info, 'tenderCompilerQualificationCertificateNo') },
  95. { name: '编制日期', value: getValueByKey(info, 'compilationTime'), type: TYPE.DATE},
  96. { name: '复核人', value: getValueByKey(info, 'tenderExaminer') },
  97. { name: '复核人资格证号', value: getValueByKey(info, 'tenderExaminerQualificationCertificateNo') },
  98. { name: '复核日期', value: getValueByKey(info, 'reviewTime'), type: TYPE.DATE }
  99. ];
  100. Element.call(this, '招标信息', attrs);
  101. }
  102. function ZhaoBiaoKZJ() {
  103. const attrs = [
  104. { name: '招标人', value: getValueByKey(info, 'tendereeName') },
  105. { name: '招标人纳税识别号', value: getValueByKey(info, 'tendereeTaxpayerIdentificationNo') },
  106. { name: '招标法定代表人或其授权人', value: getValueByKey(info, 'tenderAuthorizer') },
  107. { name: '招标法人或其授权人身份证号', value: getValueByKey(info, 'tenderAuthorizerIDNo') },
  108. { name: '造价咨询人', value: getValueByKey(info, 'costConsultant') },
  109. { name: '造价咨询人纳税识别号', value: getValueByKey(info, 'costConsultantTaxpayerIdentificationNo') },
  110. { name: '造价咨询人法定代表人或其授权人', value: getValueByKey(info, 'consultantAuthorizer') },
  111. { name: '造价咨询法人或其授权人身份证号', value: getValueByKey(info, 'consultantAuthorizerTaxpayerIdentificationNo') },
  112. { name: '编制人', value: getValueByKey(info, 'tenderCompiler') },
  113. { name: '编制人资格证号', value: getValueByKey(info, 'tenderCompilerQualificationCertificateNo') },
  114. { name: '编制日期', value: getValueByKey(info, 'compilationTime'), type: TYPE.DATE},
  115. { name: '复核人', value: getValueByKey(info, 'tenderExaminer') },
  116. { name: '复核人资格证号', value: getValueByKey(info, 'tenderExaminerQualificationCertificateNo') },
  117. { name: '复核日期', value: getValueByKey(info, 'reviewTime'), type: TYPE.DATE },
  118. { name: '审核人', value: getValueByKey(info, 'tenderExaminer') },
  119. { name: '审核人资格证号', value: getValueByKey(info, 'reviewerQualificationCertificateNo') },
  120. { name: '审核日期', value: getValueByKey(info, 'reviewTime'), type: TYPE.DATE },
  121. { name: '控制价总价', value: summary.totalCost, type: TYPE.DECIMAL },
  122. { name: '工期', value: getValueByKey(info, 'timeLimit') },
  123. { name: '质量要求', value: getValueByKey(info, 'qualityRequirements') }
  124. ];
  125. Element.call(this, '招标控制价', attrs);
  126. }
  127. function TouBiaoXX() {
  128. let hardID = generateHardwareId();
  129. let [cpuId, diskId, macId] = hardID.split(";");
  130. const attrs = [
  131. { name: '投标人', value: getValueByKey(info, 'bidderName') },
  132. { name: '投标人纳税识别号', value: getValueByKey(info, 'bidderAuthorizerIDNo') },
  133. { name: '投标人法定代表或其授权人', value: getValueByKey(info, 'bidderAuthorizer') },
  134. { name: '投标人法人或其授权人身份证号', value: getValueByKey(info, 'bidderAuthorizerTaxpayerIdentificationNo') },
  135. { name: '编制人', value: getValueByKey(info, 'tenderCompiler') },
  136. { name: '编制人资格证号', value: getValueByKey(info, 'tenderCompilerQualificationCertificateNo') },
  137. { name: '编制日期', value: getValueByKey(info, 'compilationTime'), type: TYPE.DATE},
  138. { name: '复核人', value: getValueByKey(info, 'tenderExaminer') },
  139. { name: '复核人资格证号', value: getValueByKey(info, 'tenderExaminerQualificationCertificateNo') },
  140. { name: '复核日期', value: getValueByKey(info, 'reviewTime'), type: TYPE.DATE },
  141. { name: '审核人', value: getValueByKey(info, 'tenderExaminer') },
  142. { name: '审核人资格证号', value: getValueByKey(info, 'auditorNo') },
  143. { name: '审核日期', value: getValueByKey(info, 'reviewTime'), type: TYPE.DATE },
  144. { name: '投标总价', value: summary.totalCost, type: TYPE.DECIMAL },
  145. { name: '工期', value: getValueByKey(info, 'timeLimit') },
  146. { name: '投标担保金额', value: getValueByKey(info, 'tenderGuaranteeAmount') },
  147. { name: '质量承诺', value: getValueByKey(info, 'qualityCommitment') },
  148. { name: '投标担保方式', value: getValueByKey(info, 'tenderGuaranteeMethod') },
  149. { name: '造价软件品牌', value: '纵横公路云造价' },
  150. { name: '造价软件版本', value: "Ver" + VERSION },
  151. { name: '造价软件加密锁编号', value: userID },
  152. { name: '计算机硬件信息', value: cpuId + diskId + macId }
  153. ];
  154. Element.call(this, '投标信息', attrs);
  155. }
  156. function addRationGLJs(rData, rationNode){
  157. for (let i = 0; i < rData.rationGLJList.length; i++) {
  158. let glj = rData.rationGLJList[i];
  159. const attrs = [
  160. { name: '人材机标识', value: glj.GLJID},
  161. { name: '人材机含量', value: glj.tenderQuantity}
  162. ];
  163. let gljNode = new CreateNode('定额人材机含量明细', attrs);
  164. rationNode.children.push(gljNode);
  165. }
  166. }
  167. function addRations(ABillItem, ABillNode){
  168. for (let i = 0; i < ABillItem.children.length; i++) {
  169. let r = ABillItem.children[i];
  170. let rData = ABillItem.children[i].data;
  171. const attrs = [
  172. { name: '序号', value: r.row()},
  173. { name: '定额编号', value: rData.code},
  174. { name: '定额名称', value: rData.name},
  175. { name: '单位', value: rData.unit},
  176. { name: '数量', value: rData.tenderQuantity},
  177. { name: '单价', value: rData.feesIndex && rData.feesIndex.common ? rData.feesIndex.common.tenderUnitFee : 0},
  178. { name: '合价', value: rData.feesIndex && rData.feesIndex.common ? rData.feesIndex.common.tenderTotalFee : 0},
  179. { name: '备注', value: ''},
  180. { name: '数据类型', value: GetRationDataType(r)},
  181. { name: '人工费', value: getFee(rData.fees, 'marketLabour.tenderTotalFee'), type: TYPE.DECIMAL},
  182. { name: '主材费', value: getFee(rData.fees, 'marketMaterial.tenderTotalFee'), type: TYPE.DECIMAL},
  183. { name: '辅材费', value: 0},
  184. { name: '机械使用费', value: getFee(rData.fees, 'marketMachine.tenderTotalFee'), type: TYPE.DECIMAL},
  185. { name: '设备费', value: 0},
  186. { name: '措施费1', value: getFee(rData.fees, 'measure.tenderTotalFee'), type: TYPE.DECIMAL}, // FQuery2.FieldByName('OtherDirectFee'},
  187. { name: '措施费2', value: 0}, //getFee(r.fees, 'measure.tenderTotalFee'), type: TYPE.DECIMAL
  188. { name: '企业管理费', value: getFee(rData.fees, 'manage.tenderTotalFee'), type: TYPE.DECIMAL},
  189. { name: '规费', value: getFee(rData.fees, 'force.tenderTotalFee'), type: TYPE.DECIMAL},
  190. { name: '利润', value: getFee(rData.fees, 'profit.tenderTotalFee'), type: TYPE.DECIMAL},
  191. { name: '税金', value: getFee(rData.fees, 'tax.tenderTotalFee'), type: TYPE.DECIMAL},
  192. ];
  193. let rationNode = new CreateNode('定额信息表', attrs);
  194. ABillNode.children.push(rationNode);
  195. addRationGLJs(rData, rationNode);
  196. }
  197. }
  198. function recursiveAddBills(AItem, AXMLParent) {
  199. if (AItem == undefined || !calcTools.isBill(AItem)) return;
  200. let vBillNode;
  201. function addBillNode () {
  202. serialNo++;
  203. let zmh = (AItem.parent == vTree.roots[0]) ? getNum(AItem.data.name) : AItem.data.code;
  204. const attrs = [
  205. {name: "序号", value: AItem.row()}, //AItem.data.ID
  206. {name: "清单章节号", value: zmh},
  207. {name: "子目号", value: zmh},
  208. {name: "子目名称", value: AItem.data.name},
  209. {name: "单位", value: AItem.data.unit},
  210. {name: "数量", value: AItem.data.quantity, type: TYPE.DECIMAL}
  211. ];
  212. let dj = 0, hj = 0;
  213. if ((isBidSubmission || isControl) || (AItem.data.specialProvisional == '专业工程')){
  214. hj = CheckNull(AItem.data.feesIndex && AItem.data.feesIndex.common ? AItem.data.feesIndex.common.tenderTotalFee : 0);
  215. dj = hj;
  216. }
  217. attrs.push({name: "单价", value: dj}, {name: "合价", value: hj});
  218. attrs.push({name: "备注", value: isBidInvitation ? '' : AItem.data.remark});
  219. let sjlx;
  220. if (AItem.data.specialProvisional == '专业工程') // 专项暂定
  221. sjlx = 21;
  222. else {
  223. if (calcTools.isLeafBill(AItem)) {
  224. if (AItem.data.code == '102-3') // 安全生产费
  225. sjlx = '22'
  226. else if ((AItem.data.code == '-a') && (AItem.parent && (AItem.parent.data.code == '101-1'))) // 工程一切险
  227. sjlx = '23'
  228. else if ((AItem.data.code == '-b') && (AItem.parent && (AItem.parent.data.code == '101-1'))) // 第三者责任险
  229. sjlx = '24'
  230. else
  231. sjlx = '20';
  232. }
  233. else {
  234. sjlx = '1'; // 父清单
  235. attrs.find(function getE(e) {return e.name == '单位'}).value = '项';
  236. }
  237. }
  238. attrs.push({name: "数据类型", value: sjlx});
  239. if (isBidSubmission || isControl){
  240. attrs.push(
  241. {name: "人工费", value: getFee(AItem.data.fees, 'marketLabour.tenderTotalFee'), type: TYPE.DECIMAL},
  242. {name: "主材费", value: getFee(AItem.data.fees, 'marketMaterial.tenderTotalFee'), type: TYPE.DECIMAL},
  243. {name: "辅材费", value: 0},
  244. {name: "机械使用费", value: getFee(AItem.data.fees, 'marketMachine.tenderTotalFee'), type: TYPE.DECIMAL},
  245. {name: "设备费", value: 0},
  246. {name: "措施费1", value: getFee(AItem.data.fees, 'measure.tenderTotalFee'), type: TYPE.DECIMAL},
  247. {name: "措施费2", value: 0}, // getFee(AItem.data.fees, 'measure.tenderTotalFee'), type: TYPE.DECIMAL},
  248. {name: "企业管理费", value: getFee(AItem.data.fees, 'manage.tenderTotalFee'), type: TYPE.DECIMAL},
  249. {name: "规费", value: getFee(AItem.data.fees, 'force.tenderTotalFee'), type: TYPE.DECIMAL},
  250. {name: "利润", value: getFee(AItem.data.fees, 'profit.tenderTotalFee'), type: TYPE.DECIMAL},
  251. {name: "税金", value: getFee(AItem.data.fees, 'tax.tenderTotalFee'), type: TYPE.DECIMAL}
  252. );
  253. }
  254. vBillNode = new CreateNode('工程量清单明细', attrs);
  255. AXMLParent.children.push(vBillNode);
  256. if (calcTools.isLeafBill(AItem))
  257. addRations(AItem, vBillNode)
  258. }
  259. addBillNode();
  260. recursiveAddBills(AItem.children[0], vBillNode);
  261. recursiveAddBills(AItem.nextSibling, AXMLParent);
  262. }
  263. function createGCLQDB(Bid, gongCLQDB){
  264. vTree = tenderDetailMap[Bid.ID].mainTree;
  265. serialNo = 0;
  266. recursiveAddBills(vTree.roots[0].children[0], gongCLQDB);
  267. };
  268. function createJiRGXXB(Bid, jiRGXXB){
  269. let vJRG, vKind, vChild;
  270. let vJRGNode, vKindNode, vChildNode;
  271. vJRG = vTree.roots.find(function getElement(e) {return e.getFlag() == fixedFlag.DAYWORK_LABOR});
  272. let attrs = [
  273. { name: '序号', value: vJRG.row() },
  274. { name: '名称', value: vJRG.data.name },
  275. { name: '数据类型', value: 0 },
  276. { name: '合价', value: isBidInvitation ? 0 : ( vJRG.data.feesIndex && vJRG.data.feesIndex.common ? vJRG.data.feesIndex.common.tenderTotalFee : 0) },
  277. ];
  278. vJRGNode = new CreateNode('计日工信息标题', attrs);
  279. jiRGXXB.children.push(vJRGNode);
  280. function getDataType_JRG(name) {
  281. if (name.includes('劳务'))
  282. return 1
  283. else if (name.includes('材料'))
  284. return 2
  285. else if (name.includes('机械'))
  286. return 3
  287. else
  288. return 0;
  289. }
  290. for (let i = 0; i < vJRG.children.length; i++) {
  291. vKind = vJRG.children[i];
  292. let attrs = [
  293. { name: '序号', value: vKind.row() },
  294. { name: '名称', value: vKind.data.name },
  295. { name: '数据类型', value: getDataType_JRG(vKind.data.name) },
  296. { name: '合价', value: isBidInvitation ? 0 : (vKind.data.feesIndex && vKind.data.feesIndex.common ? vKind.data.feesIndex.common.tenderTotalFee : 0) },
  297. ];
  298. vKindNode = new CreateNode('计日工信息标题', attrs);
  299. jiRGXXB.children.push(vKindNode);
  300. for (let j = 0; j < vKind.children.length; i++) {
  301. vChild = vKind.children[j];
  302. let attrs = [
  303. { name: '编号', value: vChild.data.code },
  304. { name: '名称', value: vChild.data.name },
  305. { name: '数据类型', value: getDataType_JRG(vKind.data.name) + 3},
  306. { name: '单位', value: vChild.data.unit },
  307. { name: '暂定数量', value: vChild.data.quantity },
  308. { name: '单价', value: isBidInvitation ? 0 : (vChild.data.feesIndex && vChild.data.feesIndex.common ? vChild.data.feesIndex.common.tenderUnitFee : 0) },
  309. { name: '合价', value: isBidInvitation ? 0 : (vChild.data.feesIndex && vChild.data.feesIndex.common ? vChild.data.feesIndex.common.tenderTotalFee : 0) }
  310. ];
  311. vChildNode = new CreateNode('计日工信息明细', attrs);
  312. vKindNode.children.push(vChildNode);
  313. }
  314. }
  315. }
  316. function createZaoJHZB(Bid, ZaoJHZB) {
  317. const map_ZC_LB = [
  318. {key: '第100章至700章清单', zc: '', lb: '1'},
  319. {key: '已包含在清单合计中的材料', zc: '', lb: '2'},
  320. {key: '清单合计减去材料', zc: '', lb: '3'},
  321. {key: '计日工合计', zc: '', lb: '4'},
  322. {key: '暂列金额', zc: '', lb: '5'},
  323. {key: '投标报价', zc: '', lb: '6'},
  324. {key: '第100章 ', zc: '100', lb: '11'}, // 我们软件"章"字后面有2个空格!
  325. {key: '第200章 ', zc: '200', lb: '12'},
  326. {key: '第300章 ', zc: '300', lb: '13'},
  327. {key: '第400章 ', zc: '400', lb: '14'},
  328. {key: '第500章 ', zc: '500', lb: '15'},
  329. {key: '第600章 ', zc: '600', lb: '16'},
  330. {key: '第700章 ', zc: '700', lb: '17'}
  331. ]
  332. function getZCLB(name, kind){
  333. let rst = '';
  334. for (let i = 0; i < map_ZC_LB.length; i++){
  335. if (name.includes(map_ZC_LB[i].key)){
  336. if (kind == 1)
  337. rst = map_ZC_LB[i].zc
  338. else if (kind == 2)
  339. rst = map_ZC_LB[i].lb;
  340. break;
  341. }
  342. }
  343. return rst;
  344. }
  345. function getJE(node){
  346. if (isBidInvitation && ![fixedFlag.PROVISIONAL_TOTAL, fixedFlag.PROVISIONAL].includes(node.getFlag()))
  347. return 0
  348. else
  349. return (node.data.feesIndex && node.data.feesIndex.common ? node.data.feesIndex.common.tenderTotalFee : 0);
  350. }
  351. let nodes = [...vTree.roots, ...vTree.roots[0].children];
  352. for (let i = 0; i < nodes.length; i++){
  353. let node = nodes[i];
  354. let attrs = [
  355. { name: '序号', value: node.row() },
  356. { name: '章次', value: getZCLB(node.data.name, 1) },
  357. { name: '名称', value: node.data.name },
  358. { name: '金额', value: getJE(node) },
  359. { name: '类别', value: getZCLB(node.data.name, 2) },
  360. { name: '备注', value: node.data.remark }
  361. ];
  362. const zaoJHZMX = new CreateNode('造价汇总明细', attrs);
  363. ZaoJHZB.children.push(zaoJHZMX);
  364. };
  365. }
  366. function createRenCJHZ(Bid, RenCJHZ) {
  367. const pGLJs = tenderDetailMap[Bid.ID].projectGLJ.datas.gljList;
  368. for (let i = 0; i < pGLJs.length; i++){
  369. let pGLJ = pGLJs[i];
  370. let attrs = [
  371. { name: '人材机标识', value: pGLJ.glj_id },
  372. { name: '人材机编号', value: pGLJ.code },
  373. { name: '人材机名称', value: pGLJ.name },
  374. { name: '规格型号', value: pGLJ.specs },
  375. { name: '单位', value: pGLJ.unit },
  376. { name: '数量', value: pGLJ.quantity },
  377. { name: '单价', value: pGLJ.unit_price.market_price },
  378. { name: '人材机类别', value: pGLJ.type },
  379. { name: '是否主要材料', value: pGLJ.is_main_material }, // , type: TYPE.BOOL
  380. { name: '是否甲供', value: pGLJ.supply },
  381. { name: '是否暂估', value: pGLJ.is_evaluate },
  382. { name: '备注', value: pGLJ.remark }
  383. ];
  384. // if (pGLJ.type != 9){
  385. const renCJHZMXB = new CreateNode('人材机汇总明细表', attrs);
  386. RenCJHZ.children.push(renCJHZMXB);
  387. // }
  388. }
  389. }
  390. // 生成标段工程
  391. function createGLBDGC(Bid, gongLGCSJ, gongLGCHZ, Num){
  392. let attrs0 = [
  393. { name: '序号', value: Num },
  394. { name: '标段名称', value: Bid.name },
  395. { name: '金额', value: projectData.summaryInfo[Bid.ID].totalCost }
  396. ];
  397. const attrs1 = [{ name: '唯一标识-Guid', value: Bid._id }]; // 公路标段工程
  398. const gongLBDGC = new CreateNode('公路标段工程', attrs0.concat(attrs1));
  399. gongLGCSJ.children.push(gongLBDGC);
  400. const gongCLQDB = new CreateNode('工程量清单表');
  401. const jiRGXXB = new CreateNode('计日工信息表');
  402. const ZaoJHZB = new CreateNode('造价汇总表');
  403. const RenCJHZ = new CreateNode('人材机汇总');
  404. gongLBDGC.children = [gongCLQDB, jiRGXXB, ZaoJHZB, RenCJHZ];
  405. createGCLQDB(Bid, gongCLQDB);
  406. createJiRGXXB(Bid, jiRGXXB);
  407. createZaoJHZB(Bid, ZaoJHZB);
  408. createRenCJHZ(Bid, RenCJHZ);
  409. // 同步生成 公路工程汇总明细 数据
  410. const attrs2 = [{ name: '备注', value: '' }];
  411. const gongLGCHZMX = new CreateNode('公路工程汇总明细', attrs0.concat(attrs2));
  412. gongLGCHZ.children.push(gongLGCHZMX);
  413. }
  414. // 组装主体框架数据
  415. function setupConstruction() {
  416. const chiZGLGC = new CreateNode('池州公路工程');
  417. const gongCXX = new GongCXX(); // 工程信息
  418. const zhaoTBXX = new CreateNode('招投标信息');
  419. const gongLGCSJ = new CreateNode('公路工程数据');
  420. chiZGLGC.children = [gongCXX, zhaoTBXX, gongLGCSJ];
  421. if (isBidInvitation)
  422. zhaoTBXX.children.push(new ZhaoBiaoXX());
  423. else if (isControl)
  424. zhaoTBXX.children.push(new ZhaoBiaoKZJ());
  425. else
  426. zhaoTBXX.children.push(new TouBiaoXX());
  427. const gongLGCHZ = new CreateNode('公路工程汇总');
  428. gongLGCSJ.children.push(gongLGCHZ);
  429. let n = 0;
  430. for (const Bid of projectData.children) {
  431. n++;
  432. createGLBDGC(Bid, gongLGCSJ, gongLGCHZ, n);
  433. }
  434. gongLGCSJ.children.push(gongLGCSJ.children.shift());
  435. const suffix = INTERFACE_CONFIG[areaKey]['fileSuffix'][exportKind];
  436. return [{
  437. data: chiZGLGC,
  438. exportKind,
  439. fileName: `${projectData.name}${suffix}`
  440. }];
  441. }
  442. return setupConstruction();
  443. }
  444. return {
  445. entry
  446. };
  447. })();