guangdong_zhongshan.js 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470
  1. // INTERFACE_EXPORT =,必须这么写,这样才能在导出时动态加载脚本后,覆盖前端代码
  2. INTERFACE_EXPORT = (() => {
  3. "use strict";
  4. const feeRateMap = {
  5. 冬季施工增加费: "DJSGZJFFL",
  6. 冬季施工: "DJSGZJFFL",
  7. 雨季施工增加费: "YUJSGZJFFL",
  8. 雨季施工: "YUJSGZJFFL",
  9. 夜间施工增加费: "YEJSGZJFFL",
  10. 夜间施工: "YEJSGZJFFL",
  11. 高原地区施工增加费: "GYDQSGZJFFL",
  12. 高原施工: "GYDQSGZJFFL",
  13. 风沙地区施工增加费: "FSDQSGZJFFL",
  14. 风沙施工: "FSDQSGZJFFL",
  15. 沿海地区施工增加费: "YHDQSGZJFFL",
  16. 沿海施工: "YHDQSGZJFFL",
  17. 行车干扰施工增加费: "XCGRGCSGZJFFL",
  18. 行车干扰: "XCGRGCSGZJFFL",
  19. 工地转移费: "GDZYFFL",
  20. '工地转移(km)': "GDZYFFL",
  21. 施工辅助费: "SGFZFFL",
  22. 施工辅助: "SGFZFFL",
  23. 基本费用: "JBFYFL",
  24. 主副食运费补贴: "ZFSYFBTFL",
  25. '综合里程(km)': "ZFSYFBTFL",
  26. 职工探亲路费: "ZGTQLFFL",
  27. 职工探亲: "ZGTQLFFL",
  28. 职工取暖补贴: "ZGQNBTFL",
  29. 职工取暖: "ZGQNBTFL",
  30. 财务费用: "CWFYFL",
  31. 养老保险费: "YANGLBXFFL",
  32. 失业保险费: "SYBXFFL",
  33. 医疗保险费: "YILBXFFL",
  34. 工伤保险费: "GSBXFL",
  35. 养老保险: "YANGLBXFFL",
  36. 失业保险: "SYBXFFL",
  37. 医疗保险: "YILBXFFL",
  38. 工伤保险: "GSBXFL",
  39. 住房公积金: "ZFGJJFL",
  40. 规费: "GFZHFL",
  41. 利润: "LRL",
  42. 税金: "SL",
  43. 土方: "TF",
  44. 石方: "SF",
  45. 运输: "YS",
  46. 路面: "LM",
  47. "路面(不计雨)": "LM",
  48. 隧道: "SD",
  49. 构造物I: "GZW1",
  50. "构造物I(不计冬)": "GZW1",
  51. "构造物I(不计雨)": "GZW1",
  52. 构造物II: "GZW2",
  53. "构造物III(桥梁)": "GZW3",
  54. "构造物III(除桥以外)": "GZW3",
  55. "构造物III(除桥以外不计雨夜)": "GZW3",
  56. 技术复杂大桥: "JSFZDQ",
  57. "钢材及钢结构(桥梁)": "GJG",
  58. "钢材及钢结构(除桥以外)": "GJG",
  59. "钢材及钢结构(除桥以外不计夜)": "GJG",
  60. };
  61. //计算程序有,这里没有:施工机械使用费\施工机械人工费\定额人工费\定额材料费\定额施工机械使用费
  62. const itemFeeMap = {
  63. 'marketLabour': 'RGF',
  64. 'marketMaterial': 'CLF',
  65. 'marketMachine':'JXSYF',
  66. 'marketEquipment': 'SBGZF',
  67. 'direct': 'DEZJF',
  68. 'equipment': 'DESBF',
  69. 'marketDirect': 'ZJF',
  70. 'measure': 'CSF',
  71. 'measure1': 'CSF1',
  72. 'measure2': 'CSF2',
  73. 'manage': 'QYGLF',
  74. 'force': 'GF',
  75. 'profit': 'LR',
  76. 'tax': 'SJ',
  77. 'common': 'JAF',
  78. 'rationCommon': 'DEJAF'
  79. };
  80. const feeLibNoMap = {
  81. 'eba0e7c0-cfe6-11ea-ba15-739be477d1fe': 'GYSFL-000000-2018-86',
  82. '451d3180-e02e-11ea-8056-1514dfc2f39e': 'GYSFL-340000-2019-210'
  83. };
  84. const FixedCostMap = {
  85. //折旧费、检修费、维护费、安拆辅助费
  86. '折旧费': 1,
  87. '检修费': 1,
  88. '维护费': 1,
  89. '安拆辅助费':1
  90. }
  91. function getBasePrice(projectGLJID, tenderProject) {
  92. let glj = _.find(tenderProject.projectGLJ.datas.gljList, {
  93. id: projectGLJID
  94. })
  95. return glj ? gljUtil.getBasePrice(glj, null, null, null, decimalObj, false, _, scMathUtil) : 0;
  96. }
  97. function getFeeRate(programID, fieldName, tenderProject) {
  98. let rate = 0;
  99. let template = tenderProject.calcProgram.compiledTemplates;
  100. if (template[programID]) {
  101. let item = _.find(template[programID].calcItems, {
  102. fieldName: fieldName
  103. })
  104. if (item) rate = item.feeRate;
  105. }
  106. return rate
  107. }
  108. /**
  109. *
  110. * @param {String} areaKey - 地区标识,如:'安徽@马鞍山',有些地区的接口只是取值上有不同,共有一个接口脚本, 需要通过地区标识确定一些特殊处理
  111. * @param {Number} exportKind - 导出类型,招标、投标、控制价
  112. * @param {Object} projectData - 项目表数据:{ 建设项目Data, children: [单位工程...] }
  113. * @param {Object} tenderDetailMap - 单位工程ID与getData接口数据(projectObj.project的结构)的映射。
  114. * @return {Promise<Array>} - 返回的数据结构必须按照规定:[{ data, exportKind, fileName }],参考web\building_saas\standard_interface\index.js中的注释说明
  115. */
  116. async function entry(areaKey, exportKind, projectData, tenderDetailMap) {
  117. const {
  118. UTIL,
  119. Element
  120. } = INTERFACE_EXPORT_BASE;
  121. const {
  122. EXPORT_KIND: {
  123. BID_INVITATION,
  124. BID_SUBMISSION,
  125. CONTROL
  126. },
  127. fixedFlag,
  128. } = window.commonConstants;
  129. let cprjType = {
  130. 1: "ZBKZJ", // 招标
  131. 2: "TBBJ", // 投标
  132. 3: "GCLQD", // 控制价
  133. };
  134. const isBidInvitation = exportKind === BID_INVITATION; // 是否是招标
  135. const isBidSubmission = exportKind === BID_SUBMISSION; // 是否是投标
  136. const isControl = exportKind === CONTROL; // 是否是控制价
  137. function emptyElement(name) {
  138. this.name = name;
  139. this.attrs = [];
  140. this.children = [];
  141. }
  142. // 建设项目根节点信息
  143. function CprjInfo(projectName) {
  144. const attrs = [{
  145. name: "CprjName",
  146. value: projectName,
  147. },
  148. {
  149. name: "CprjType",
  150. value: cprjType[exportKind],
  151. },
  152. ];
  153. Element.call(this, "CprjInfo", attrs);
  154. }
  155. // 项目基本信息
  156. function SystemInfo(projectData) {
  157. let hardID = UTIL.generateHardwareId();
  158. let [cpuId, diskId, macId] = hardID.split(";");
  159. const attrs = [{
  160. name: "Name",
  161. value: "公路工程造价数据标准",
  162. },
  163. {
  164. name: "Version",
  165. value: "1.0",
  166. },
  167. {
  168. name: "SoftwareName",
  169. value: "纵横公路云造价",
  170. },
  171. {
  172. name: "SoftwareVer",
  173. value: "V" + VERSION,
  174. },
  175. {
  176. name: "SoftwareCompany",
  177. value: "珠海纵横创新软件有限公司",
  178. },
  179. {
  180. name: "MakeDate",
  181. value: UTIL.getNowFormatTime(),
  182. },
  183. {
  184. name: "Key1",
  185. value: window.btoa(VERSION),
  186. },
  187. {
  188. name: "Key2",
  189. value: window.btoa(diskId),
  190. },
  191. {
  192. name: "Key3",
  193. value: window.btoa(macId),
  194. },
  195. ];
  196. if (isBidSubmission)
  197. attrs.splice(6, 0, {
  198. name: "BidderVer",
  199. value: UTIL.getNowFormatTime(),
  200. });
  201. Element.call(this, "SystemInfo", attrs);
  202. }
  203. //造价依据
  204. function CostBasis() {
  205. // ItemStandardNo="GYSFX-000000-2018-86"
  206. const attrs = [{
  207. name: "MakeRuleNo",
  208. value: "GYSBB-000000-2018-86",
  209. },
  210. {
  211. name: "MakeRuleName",
  212. value: "公路工程建设项目概算预算编制办法",
  213. },
  214. {
  215. name: "ItemStandardNo",
  216. value: "GYSFX-000000-2018-86",
  217. },
  218. ];
  219. Element.call(this, "CostBasis", attrs);
  220. //定额库信息
  221. //to do 改成实际的值
  222. function NormLib() {
  223. const attrs = [{
  224. name: "NormLibNo",
  225. value: "YSDE-000000-2018-86",
  226. },
  227. {
  228. name: "NormLibName",
  229. value: "部颁公路工程预算定额(2018)",
  230. },
  231. {
  232. name: "Type",
  233. value: "ZDEK",
  234. },
  235. ];
  236. Element.call(this, "NormLib", attrs);
  237. }
  238. this.children.push(new NormLib());
  239. }
  240. function Rate(tenderProject, feeRateInfo, seirNo) {
  241. //RateNo="1" Name="纵横软件测试版本" RateLibNo="GYSFL-000000-2018-86"
  242. const attrs = [{
  243. name: "RateNo",
  244. value: seirNo,
  245. },
  246. {
  247. name: "Name",
  248. value: feeRateInfo.name,
  249. },
  250. {
  251. name: "RateLibNo",
  252. value: feeLibNoMap[feeRateInfo.libID],
  253. },
  254. ];
  255. Element.call(this, "Rate", attrs);
  256. let RateParams = new emptyElement("RateParams");
  257. let subRates = projectObj.project.FeeRate.getAllSubRates(feeRateInfo.rates);
  258. for (let s of subRates) {
  259. let sname = s.name.replace("(%)", "");
  260. sname = sname.replace("(%)", "");
  261. if (feeRateMap[sname]) {
  262. let value = "";
  263. if (s.editable) {
  264. let sel = _.find(s.optionList, {
  265. selected: true,
  266. });
  267. if (sel) {
  268. value = sel.name;
  269. } else if (gljUtil.isDef(s.value)) {
  270. value = s.value;
  271. }
  272. } else {
  273. value = _.findIndex(s.optionList, {
  274. selected: true,
  275. });
  276. if (value == -1) value = 0;
  277. }
  278. /* if (sname == '利润') tenderProject.ProfitRate = value;
  279. if (sname == '税金') tenderProject.TaxRate = value; */
  280. RateParams.children.push(new RateParam(feeRateMap[sname], value));
  281. }
  282. }
  283. this.children.push(RateParams);
  284. function RateParam(RateTypeNo, RateParamNo) {
  285. //<RateParam RateTypeNo="DJSGZJFFL" RateParamNo="0" Ratio="100"/>
  286. const attrs = [{
  287. name: "RateTypeNo",
  288. value: RateTypeNo,
  289. },
  290. {
  291. name: "RateParamNo",
  292. value: RateParamNo,
  293. },
  294. {
  295. name: "Ratio",
  296. value: "100",
  297. },
  298. ];
  299. Element.call(this, "RateParam", attrs);
  300. }
  301. let RateValues = new emptyElement("RateValues");
  302. function RateValue(CostTypeNo, RateTypeNo, value) {
  303. const attrs = [{
  304. name: "CostTypeNo",
  305. value: CostTypeNo,
  306. },
  307. {
  308. name: "RateTypeNo",
  309. value: RateTypeNo,
  310. },
  311. {
  312. name: "RateValue",
  313. value: value,
  314. },
  315. ];
  316. Element.call(this, "RateValue", attrs);
  317. }
  318. let prefix = "";
  319. for (let r of feeRateInfo.rates) {
  320. if (!r.ParentID && feeRateMap[r.name]) prefix = feeRateMap[r.name];
  321. if (feeRateMap[r.name] && r.ParentID) {
  322. RateValues.children.push(new RateValue(prefix, feeRateMap[r.name], r.rate));
  323. }
  324. }
  325. this.children.push(RateValues);
  326. }
  327. function Pract(tpdata, seriNo) {
  328. let pgljData = tpdata.projectGLJ.datas;
  329. let decimalObj = tpdata.property.decimal;
  330. const attrs = [{
  331. name: "PractNo",
  332. value: seriNo,
  333. },
  334. {
  335. name: "Name",
  336. value: pgljData.constData.usedUnitPriceInfo.name,
  337. },
  338. ];
  339. Element.call(this, "Pract", attrs);
  340. let Param = {
  341. name: "Param",
  342. attrs: [{
  343. name: "TaxLibNo",
  344. value: "CCSBZ-440000-2019-544",
  345. },
  346. {
  347. name: "AuxRate",
  348. value: pgljData.constData.assistProductionFeeRate,
  349. },
  350. ],
  351. children: [],
  352. };
  353. if (isBidSubmission) { //导出到招标、招标控制价文件中,不输出这一部分。
  354. let elecDatas = electrovalenceObj.getElectrovalenceDatas(null, pgljData.com_electrovalence, pgljData.gljList);
  355. electrovalenceObj.calcPertElectrovalenceMarketPrice(elecDatas);
  356. for (let e of elecDatas) {
  357. let Electro = {
  358. name: "Electro",
  359. attrs: [{
  360. name: "Code",
  361. value: e.code,
  362. },
  363. {
  364. name: "Price",
  365. value: e.electPrice,
  366. },
  367. {
  368. name: "Ratio",
  369. value: e.coe,
  370. },
  371. ],
  372. children: [],
  373. };
  374. Param.children.push(Electro);
  375. }
  376. }
  377. this.children.push(Param);
  378. function MP(g) {
  379. const attrs = [{
  380. name: "Code",
  381. value: g.code,
  382. },
  383. {
  384. name: "PractName",
  385. value: g.name,
  386. },
  387. {
  388. name: "Spec",
  389. value: g.specs,
  390. },
  391. {
  392. name: "Unit",
  393. value: g.unit,
  394. },
  395. {
  396. name: "BugetPrice",
  397. value: g.priceInfo.tenderPrice,
  398. },
  399. {
  400. name: "NormPrice",
  401. value: g.priceInfo.basePrice,
  402. },
  403. {
  404. name: "IsAdd",
  405. value: g.unit_price.is_add,
  406. },
  407. ];
  408. Element.call(this, "MP", attrs);
  409. }
  410. function Material(g) {
  411. const attrs = [{
  412. name: "Code",
  413. value: g.code,
  414. },
  415. {
  416. name: "PractName",
  417. value: g.name,
  418. },
  419. {
  420. name: "Spec",
  421. value: g.specs,
  422. },
  423. {
  424. name: "Unit",
  425. value: g.unit,
  426. },
  427. {
  428. name: "BugetPrice",
  429. value: g.priceInfo.tenderPrice,
  430. },
  431. {
  432. name: "NormPrice",
  433. value: g.priceInfo.basePrice,
  434. },
  435. {
  436. name: "IsAdd",
  437. value: g.unit_price.is_add,
  438. },
  439. {
  440. name: "OrgPrice",
  441. value: g.unit_price.originalPrice ? g.unit_price.originalPrice : 0,
  442. },
  443. {
  444. name: "TransFee",
  445. value: g.unit_price.unitFreight ? g.unit_price.unitFreight : 0,
  446. },
  447. {
  448. name: "GwRate",
  449. value: g.unit_price.grossWeightCoe_n ? g.unit_price.grossWeightCoe_n : 0,
  450. },
  451. {
  452. name: "OffSiteLf",
  453. value: g.unit_price.offSiteTransportLossRate_n ? g.unit_price.offSiteTransportLossRate_n : 0,
  454. },
  455. {
  456. name: "OnSiteLf",
  457. value: 0,
  458. },
  459. {
  460. name: "LoadLf",
  461. value: g.unit_price.handlingLossRate_n ? g.unit_price.handlingLossRate_n : 0,
  462. },
  463. {
  464. name: "StoreRate",
  465. value: g.unit_price.purchaseStorageRate_n ? g.unit_price.purchaseStorageRate_n : 0,
  466. },
  467. {
  468. name: "PackageRecycleFee",
  469. value: g.unit_price.packageRecoverValue ? g.unit_price.packageRecoverValue : 0,
  470. },
  471. ];
  472. Element.call(this, "Material", attrs);
  473. // if (g.unit_price.calcMaterial == 1) { //有材料计算
  474. // let index = gljUtil.getIndex(g);
  475. // let orList = [];
  476. // for (let o of pgljData.originalList) {
  477. // if (o.connect_key == index) orList.push(new OrgPrices(o));
  478. // }
  479. // if (orList.length > 0) this.children = orList;
  480. // }
  481. function CostStructure(r) {
  482. //待获取
  483. this.name = "CostStructure";
  484. this.attrs = [];
  485. this.children = [];
  486. }
  487. function Consume(r, o) {
  488. this.name = "Consume";
  489. this.attrs = [];
  490. this.children = [];
  491. for (let g of o.ration_gljs) {
  492. if (g.rationID == r.ID) {
  493. let r_quantity = scMathUtil.roundForObj(r.quantity, tpdata.property.decimal.ration.quantity);
  494. this.children.push(new ConsumeItem(g, r_quantity));
  495. }
  496. }
  497. }
  498. function ConsumeItem(g, ration_quantity) {
  499. const attrs = [{
  500. name: "Code", //待获取
  501. value: g.code,
  502. },
  503. {
  504. name: "Consumption",
  505. value: scMathUtil.roundForObj(ration_quantity * parseFloat(g.quantity), tpdata.property.decimal.glj.quantity),
  506. },
  507. ];
  508. Element.call(this, "ConsumeItem", attrs);
  509. }
  510. function Norm(r, o) {
  511. const attrs = [{
  512. name: "NormLibNo", //待获取
  513. value: "",
  514. },
  515. {
  516. name: "DisplayCode",
  517. value: r.code,
  518. },
  519. {
  520. name: "Name",
  521. value: r.name,
  522. },
  523. {
  524. name: "Unit",
  525. value: r.unit,
  526. },
  527. {
  528. name: "Num",
  529. value: r.quantity,
  530. },
  531. {
  532. name: "CostTypeNo",
  533. value: "", //待获取
  534. },
  535. {
  536. name: "FabricationCost", //待获取
  537. value: "",
  538. },
  539. {
  540. name: "AdjustStatus",
  541. value: "",
  542. },
  543. ];
  544. Element.call(this, "Norm", attrs);
  545. this.children.push(new CostStructure(r));
  546. this.children.push(new Consume(r, o));
  547. }
  548. function SelfCollect(o) {
  549. const attrs = [{
  550. name: "OtherCost",
  551. value: 0,
  552. }, ];
  553. Element.call(this, "SelfCollect", attrs);
  554. for (let r of o.rations) {
  555. this.children.push(new Norm(r, o));
  556. }
  557. }
  558. function OrgPrices(o) {
  559. const attrs = [{
  560. name: "OrgPricevalue",
  561. value: o.supplyPrice,
  562. },
  563. {
  564. name: "Ratio",
  565. value: o.coe,
  566. },
  567. ];
  568. Element.call(this, "OrgPrices", attrs);
  569. if (!o.rations) return;
  570. this.children.push(new SelfCollect(o));
  571. }
  572. }
  573. function Mech(g,gljKeyMap) {
  574. const attrs = [{
  575. name: "Code",
  576. value: g.code,
  577. },
  578. {
  579. name: "PractName",
  580. value: g.name,
  581. },
  582. {
  583. name: "Spec",
  584. value: g.specs,
  585. },
  586. {
  587. name: "Unit",
  588. value: g.unit,
  589. },
  590. {
  591. name: "BugetPrice",
  592. value: g.priceInfo.tenderPrice,
  593. },
  594. {
  595. name: "NormPrice",
  596. value: g.priceInfo.basePrice,
  597. },
  598. {
  599. name: "IsAdd",
  600. value: g.unit_price.is_add,
  601. },
  602. ];
  603. Element.call(this, "Mech", attrs);
  604. let FixedCostItems = [];
  605. let fcsum = 0;
  606. let VariableCostItems = [];
  607. let vcsum = 0;
  608. if (g.ratio_data && g.ratio_data.length > 0) {
  609. for (let ratio of g.ratio_data) {
  610. let rIndex = gljUtil.getIndex(ratio);
  611. let rglj = gljKeyMap[rIndex];
  612. let ts = scMathUtil.roundForObj(parseFloat(ratio.consumption) * rglj.priceInfo.tenderPrice, decimalObj.glj.unitPrice);
  613. if (FixedCostMap[ratio.name]) {
  614. FixedCostItems.push(new FixedCostItem(ratio));
  615. fcsum = scMathUtil.roundForObj(fcsum + ts, decimalObj.glj.unitPrice);
  616. } else {
  617. VariableCostItems.push(new VariableCostItem(ratio));
  618. vcsum = scMathUtil.roundForObj(vcsum + ts, decimalObj.glj.unitPrice);
  619. }
  620. }
  621. }
  622. if (FixedCostItems.length > 0) {
  623. let fc = new FixedCost(fcsum);
  624. fc.children = FixedCostItems;
  625. this.children.push(fc);
  626. }
  627. if (VariableCostItems.length > 0) {
  628. let vc = new VariableCost(vcsum);
  629. vc.children = VariableCostItems;
  630. this.children.push(vc);
  631. }
  632. function VariableCost(sum) {
  633. const attrs = [{
  634. name: "VariableCostSum",
  635. value: sum,
  636. }];
  637. Element.call(this, "VariableCost", attrs);
  638. }
  639. function VariableCostItem(item) {
  640. const attrs = [{
  641. name: "VariableCostNo",
  642. value: item.code,
  643. },{
  644. name: "Consumption",
  645. value: item.consumption,
  646. }]
  647. Element.call(this, "VariableCostItem", attrs);
  648. }
  649. function FixedCost(sum) {
  650. const attrs = [{
  651. name: "FixedCostSum",
  652. value: sum,
  653. }, {
  654. name: "FixedRate",
  655. value: 1,
  656. }];
  657. Element.call(this, "FixedCost", attrs);
  658. }
  659. function FixedCostItem(item) {
  660. const attrs = [{
  661. name: "FixedCostNo",
  662. value: item.code,
  663. },{
  664. name: "Sum",
  665. value: item.consumption,
  666. }]
  667. Element.call(this, "FixedCostItem", attrs);
  668. }
  669. }
  670. let Mps = new emptyElement("Mps");
  671. let Materials = new emptyElement("Materials");
  672. let Mechs = new emptyElement("Mechs");
  673. let gljKeyMap = {};
  674. let temMechs = [];
  675. if (isBidSubmission) { //导出到招标、招标控制价文件中,不输出这一部分。
  676. for (let g of pgljData.gljList) {
  677. let type = g.type + "";
  678. gljKeyMap[gljUtil.getIndex(g)] = g;
  679. type = type.charAt(0);
  680. if (type == "1") {
  681. Mps.children.push(new MP(g));
  682. } else if (type == "2" || type == 5) {
  683. Materials.children.push(new Material(g));
  684. } else if (type == "3") {
  685. temMechs.push(g);
  686. }
  687. }
  688. for (let t of temMechs) {
  689. Mechs.children.push(new Mech(t,gljKeyMap));
  690. }
  691. }
  692. this.children.push(Mps);
  693. this.children.push(Materials);
  694. this.children.push(Mechs);
  695. }
  696. function EprjInfo(tenderProject) {
  697. let bills = tenderProject.Bills.datas;
  698. let feature = tenderProject.property.projectFeature ? tenderProject.property.projectFeature : [];
  699. let totalItem = null;
  700. let proItem = null; //暂列金额项
  701. for (let b of bills) {
  702. if (b.flagsIndex && b.flagsIndex.fixed && b.flagsIndex.fixed.flag == fixedFlag.TOTAL_COST) totalItem = b;
  703. if (b.flagsIndex && b.flagsIndex.fixed && b.flagsIndex.fixed.flag == fixedFlag.PROVISIONAL) proItem = b;
  704. }
  705. const attrs = [{
  706. name: "Name",
  707. value: tenderProject.projectInfo.name,
  708. },
  709. {
  710. name: "Sums",
  711. value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
  712. },
  713. ];
  714. Element.call(this, "EprjInfo", attrs);
  715. this.children.push(new SummaryOfCost(totalItem, proItem,feature));
  716. this.children.push(new MakeInfo(tenderProject));
  717. this.children.push(new Params(tenderProject));
  718. this.children.push(new getBillsItems(tenderProject));
  719. this.children.push(new getIndexs(tenderProject));
  720. let bidEvaluationMainMaterials = getBidEvaluationMainMaterial(tenderProject);
  721. if(bidEvaluationMainMaterials.length > 0) this.children.push(...bidEvaluationMainMaterials);
  722. }
  723. function getBidEvaluationMainMaterial(tenderProject) {
  724. let bidMaterials = [];
  725. let i = 1;
  726. for (let b of tenderProject.bidMaterialData) {
  727. bidMaterials.push(new BidEvaluationMainMaterial(b, i));
  728. i++
  729. }
  730. return bidMaterials;
  731. function BidEvaluationMainMaterial(b, index) {
  732. const attrs = [{
  733. name: "Code",
  734. value: index,
  735. },
  736. {
  737. name: "Number",
  738. value: b.code
  739. },
  740. {
  741. name: "Name",
  742. value: b.name
  743. },
  744. {
  745. name: "Specification",
  746. value: b.specs
  747. },
  748. {
  749. name: "Unit",
  750. value: b.unit
  751. },
  752. {
  753. name: "Price",
  754. value: b.tenderPrice
  755. },
  756. {
  757. name: "LimitedPrice",
  758. value: b.tenderPrice
  759. },
  760. {
  761. name: "Quantity",
  762. value: 0//b.quantity
  763. },
  764. {
  765. name: "Total",
  766. value: 0//b.totalPrice
  767. },
  768. {
  769. name: "Remark",
  770. value: b.remark
  771. }
  772. ];
  773. if (isBidSubmission) {
  774. attrs[7].value = b.quantity;
  775. attrs[8].value = b.totalPrice;
  776. }
  777. Element.call(this, "BidEvaluationMainMaterial", attrs);
  778. }
  779. }
  780. function getIndexs(tenderProject) {
  781. let Indexs = new emptyElement('Indexs');
  782. let feature = tenderProject.property.projectFeature ? tenderProject.property.projectFeature : [];
  783. for (let f of feature) {
  784. if (f.code) Indexs.children.push(new IndexItem(f))
  785. }
  786. return Indexs;
  787. function IndexItem(fea) {
  788. const attrs = [{
  789. name: "Code",
  790. value: fea.code,
  791. },
  792. {
  793. name: "Name",
  794. value: fea.dispName,
  795. },
  796. {
  797. name: "Unit",
  798. value: fea.unit,
  799. },
  800. {
  801. name: "Value",
  802. value: fea.value,
  803. },
  804. {
  805. name: "Remark",
  806. value: fea.remark,
  807. }
  808. ]
  809. Element.call(this, "IndexItem", attrs);
  810. }
  811. }
  812. function getBillsItems(tenderProject) {
  813. let items = new emptyElement("Items");
  814. let rootNodes = tenderProject.mainTree.roots;
  815. for (let r of rootNodes) {
  816. setItem(r, -1, items.children);
  817. }
  818. return items;
  819. function setItem(bNode, level, list) {
  820. if (bNode.sourceType == ModuleNames.ration) return;
  821. let item = new bill(bNode, level);
  822. if (bNode.children && bNode.children.length > 0) {
  823. level += 1;
  824. for (let c of bNode.children) {
  825. setItem(c, level, item.children);
  826. }
  827. }
  828. list.push(item);
  829. function bill(bNode, level) {
  830. let data = bNode.data;
  831. let CostKind = 3;
  832. if (data.name.indexOf("安全生产费") != -1) CostKind = 1;
  833. if (data.name.indexOf("暂列金额") != -1) CostKind = 2;
  834. //1 = 工程量×综合单价;2 = 计算基数×费率;3 = 工程量×单价。
  835. let CalcType = 2;
  836. if (data.calcFlag == 2) CalcType = 3;
  837. if (data.calcFlag == 1) CalcType = 1;
  838. //取暂估价类型。读取造价书界面的专项暂定列。0=材料暂估价,1=工程设备暂估价,2=专业工程暂估价,没有选的输出为空。
  839. let ProvisionalType = "";
  840. if (data.specialProvisional == "材料") ProvisionalType = 0;
  841. if (data.specialProvisional == "工程设备") ProvisionalType = 1;
  842. if (data.specialProvisional == "专业工程") ProvisionalType = 2;
  843. //MpRatio
  844. let MpRatio = "";
  845. let MaterialRatio = "";
  846. let MechRatio = "";
  847. if (data.quantityCoe) {
  848. if (data.quantityCoe["labour"]) MpRatio = data.quantityCoe["labour"];
  849. if (data.quantityCoe["material"]) MaterialRatio = data.quantityCoe["material"];
  850. if (data.quantityCoe["machine"]) MechRatio = data.quantityCoe["machine"];
  851. }
  852. const attrs = [{
  853. name: "ListCode",
  854. value: data.code,
  855. },
  856. {
  857. name: "ListName",
  858. value: data.name,
  859. },
  860. {
  861. name: "Unit",
  862. value: data.unit,
  863. },
  864. {
  865. name: "Num",
  866. value: data.quantity,
  867. },
  868. {
  869. name: "QtyFormula",
  870. value: data.calcBase //data.calcBase ? cbParser.toFExpr(data.calcBase, tenderProject.mainTree.items) : "",
  871. },
  872. {
  873. name: "Price",
  874. value: 0//data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "",
  875. },
  876. {
  877. name: "Rate",
  878. value: 100,
  879. },
  880. {
  881. name: "Sum",
  882. value: 0//data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderTotalFee : "",
  883. },
  884. {
  885. name: "ChapterKind",
  886. value: level,
  887. },
  888. {
  889. name: "CostKind",
  890. value: CostKind,
  891. },
  892. {
  893. name: "CalcType",
  894. value: CalcType,
  895. },
  896. {
  897. name: "ProvisionalType",
  898. value: ProvisionalType,
  899. },
  900. {
  901. name: "MeterRules",
  902. value: "",
  903. },
  904. {
  905. name: "Content",
  906. value: data.jobContentText,
  907. },
  908. {
  909. name: "Remarks",
  910. value: data.remark,
  911. },
  912. {
  913. name: "MpRatio",
  914. value: MpRatio,
  915. },
  916. {
  917. name: "MaterialRatio",
  918. value: MaterialRatio,
  919. },
  920. {
  921. name: "MechRatio",
  922. value: MechRatio,
  923. },
  924. {
  925. name: "AdjustedPrice",
  926. value: data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "",
  927. },
  928. {
  929. name: "AdjustedSums",
  930. value: data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderTotalFee : "",
  931. },
  932. {
  933. name: "ItemType",
  934. value: 1,
  935. },
  936. {
  937. name: "FomulaCode",
  938. value: "",
  939. },
  940. ];
  941. if (isBidSubmission) {
  942. attrs[5].value = data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "";
  943. attrs[7].value = data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderTotalFee : "";
  944. }
  945. Element.call(this, "Item", attrs);
  946. let cc = CostComposition(bNode);
  947. if (cc) this.children.push(cc);
  948. this.children.push(CostStructure(data))
  949. function CostComposition(bNode) {
  950. if (isControl || isBidInvitation) return null;
  951. let CostComposition = new emptyElement('CostComposition');
  952. let Norms = [];
  953. let Costs = [];
  954. if (bNode.children && bNode.children.length > 0 && bNode.children[0].sourceType == ModuleNames.ration) {
  955. for (let r of bNode.children) {
  956. if (r.data.type == rationType.ration) {
  957. Norms.push(new Ration(r.data));
  958. } else {
  959. Costs.push(new Cost(r.data));
  960. }
  961. }
  962. }
  963. if (Norms.length > 0) CostComposition.children.push(...Norms);
  964. if (Costs.length > 0) CostComposition.children.push(...Costs);
  965. if (bNode.data.calcBase) CostComposition.children.push(new Formula(bNode.data));
  966. return CostComposition.children.length > 0 ? CostComposition : null;
  967. function Formula(bills) {
  968. const attrs = [{
  969. name: "Name",
  970. value: bills.name
  971. },
  972. {
  973. name: "Formulas",
  974. value: bills.calcBase
  975. },
  976. {
  977. name: "Ratio",
  978. value: 1
  979. },
  980. {
  981. name: "Sum",
  982. value: bills.feesIndex && bills.feesIndex.common ? bills.feesIndex.common.tenderTotalFee : "",
  983. },
  984. {
  985. name: "Remarks",
  986. value: bills.remark
  987. }
  988. ]
  989. Element.call(this, "Formula", attrs);
  990. // 1.Name
  991. // 名称/描述。取清单的名称。
  992. // 2.Formulas
  993. // 计算式。读取计算基数的文本。
  994. // 取基数计算窗口内容,基数直接转换为金额?参考标准文档的 7.11 及 7.12 节。
  995. // 7.11是定额的费用,7.12是清单累进基数,主要是估概预算中用到,清单里的不同,所以中山的接口直接输出基数文本。
  996. // 3.Ratio
  997. // 系数。输出为1,非必填。
  998. // 4.Sum
  999. // 取金额。
  1000. // 5.Remarks
  1001. }
  1002. function Cost(item) {
  1003. let BasePrice = 0;
  1004. if (item.type == rationType.volumePrice) { // 当插入的是量价时,基价读取单价列。
  1005. BasePrice = item.feesIndex && item.feesIndex.common ? item.feesIndex.common.tenderUnitFee : 0
  1006. } else {
  1007. BasePrice = getBasePrice(item.projectGLJID, tenderProject)
  1008. }
  1009. let calcMap = tenderProject.calcProgram.compiledTemplateMaps
  1010. let CostTypeNo = '';
  1011. if (feeRateMap[calcMap[item.programID]]) CostTypeNo = feeRateMap[calcMap[item.programID]];
  1012. const attrs = [{
  1013. name: "Code",
  1014. value: item.code,
  1015. }, {
  1016. name: 'Name',
  1017. value: item.name
  1018. }, {
  1019. name: 'Spec',
  1020. value: item.specs
  1021. }, {
  1022. name: 'Unit',
  1023. value: item.unit
  1024. }, {
  1025. name: 'Num',
  1026. value: item.tenderQuantity
  1027. }, {
  1028. name: 'BasePrice',
  1029. value: BasePrice
  1030. }, {
  1031. name: 'Price',
  1032. value: item.feesIndex && item.feesIndex.common ? item.feesIndex.common.tenderUnitFee : 0
  1033. }, {
  1034. name: 'IsEquipment',
  1035. value: item.subType == gljType.EQUIPMENT ? 1 : 0
  1036. }, {
  1037. name: 'CostTypeNo',
  1038. value: CostTypeNo
  1039. }, {
  1040. name: 'ProfitRate',
  1041. value: getFeeRate(item.programID, 'profit', tenderProject)
  1042. },
  1043. {
  1044. name: 'TaxRate',
  1045. value: getFeeRate(item.programID, 'tax', tenderProject)
  1046. },
  1047. {
  1048. name: 'MpRatio',
  1049. value: item.subType == gljType.LABOUR ? 100 : 0
  1050. },
  1051. {
  1052. name: 'MaterialRatio',
  1053. value: item.subType == gljType.GENERAL_MATERIAL ? 100 : 0
  1054. },
  1055. {
  1056. name: 'MechRatio',
  1057. value: item.subType == gljType.GENERAL_MACHINE ? 100 : 0
  1058. }
  1059. ]
  1060. Element.call(this, "Cost", attrs);
  1061. this.children.push(CostStructure(item));
  1062. }
  1063. function Ration(ration) {
  1064. let calcMap = tenderProject.calcProgram.compiledTemplateMaps
  1065. let CostTypeNo = '';
  1066. if (feeRateMap[calcMap[ration.programID]]) CostTypeNo = feeRateMap[calcMap[ration.programID]];
  1067. const attrs = [{
  1068. name: "NormLibNo",
  1069. value: 'YSDE-000000-2018-86',
  1070. }, {
  1071. name: 'DisplayCode',
  1072. value: ration.code
  1073. }, {
  1074. name: 'Name',
  1075. value: ration.name
  1076. }, {
  1077. name: 'Unit',
  1078. value: ration.unit
  1079. }, {
  1080. name: 'Num',
  1081. value: ration.tenderQuantity
  1082. },
  1083. {
  1084. name: 'CostTypeNo',
  1085. value: CostTypeNo
  1086. },
  1087. {
  1088. name: 'ProfitRate',
  1089. value: getFeeRate(ration.programID, 'profit', tenderProject) //tenderProject.ProfitRate
  1090. },
  1091. {
  1092. name: 'TaxRate',
  1093. value: getFeeRate(ration.programID, 'tax', tenderProject) //tenderProject.TaxRate
  1094. },
  1095. {
  1096. name: 'FabricationCost',
  1097. value: ration.feesIndex && ration.feesIndex.common ? ration.feesIndex.common.tenderTotalFee : 0
  1098. },
  1099. {
  1100. name: 'AdjustStatus',
  1101. value: ration.adjustState
  1102. }
  1103. ]
  1104. Element.call(this, "Norm", attrs);
  1105. this.children.push(CostStructure(ration));
  1106. this.children.push(Consume(ration));
  1107. }
  1108. }
  1109. function Consume(ration) {
  1110. let consume = new emptyElement('Consume');
  1111. for (let rg of ration.rationGLJList) {
  1112. consume.children.push(new ConsumeItem(rg));
  1113. }
  1114. return consume;
  1115. function ConsumeItem(rg) {
  1116. const attrs = [{
  1117. name: "Code",
  1118. value: rg.code,
  1119. }, {
  1120. name: "Consumption",
  1121. value: rg.tenderQuantity
  1122. }];
  1123. Element.call(this, "ConsumeItem", attrs);
  1124. }
  1125. }
  1126. function CostStructure(item) {
  1127. let CostStructure = new emptyElement('CostStructure');
  1128. for (let f of cpFeeTypes) {
  1129. if (item.feesIndex && item.feesIndex[f.type] && itemFeeMap[f.type]) CostStructure.children.push(new CostItem(item.feesIndex[f.type]));
  1130. }
  1131. function CostItem(fee) {
  1132. const attrs = [{
  1133. name: "ItemNo",
  1134. value: itemFeeMap[fee.fieldName],
  1135. }, {
  1136. name: 'Sum',
  1137. value: 0 //fee.tenderTotalFee
  1138. }]
  1139. if (isBidSubmission) attrs[1].value = fee.tenderTotalFee;
  1140. Element.call(this, "CostItem", attrs);
  1141. }
  1142. return CostStructure;
  1143. }
  1144. }
  1145. }
  1146. }
  1147. function Params(tenderProject) {
  1148. let feature = tenderProject.property.projectFeature ? tenderProject.property.projectFeature : [];
  1149. let featrueMap = {};
  1150. for (let f of feature) {
  1151. featrueMap[f.dispName] = f;
  1152. }
  1153. let BuildType = "";
  1154. if (featrueMap["建设性质"] == 0) BuildType = "新建";
  1155. if (featrueMap["建设性质"] == 1) BuildType = "改(扩)建";
  1156. let Terrain = "";
  1157. if (featrueMap["地形类别"] == 0) Terrain = "平原微丘陵区";
  1158. if (featrueMap["地形类别"] == 1) Terrain = "山岭重丘陵区";
  1159. let DesignSpeed = "";
  1160. if (featrueMap["设计时速"] == 0) DesignSpeed = "高速公路";
  1161. if (featrueMap["设计时速"] == 1) DesignSpeed = "一级公路";
  1162. if (featrueMap["设计时速"] == 2) DesignSpeed = "二级公路";
  1163. if (featrueMap["设计时速"] == 3) DesignSpeed = "三级公路";
  1164. if (featrueMap["设计时速"] == 4) DesignSpeed = "四级公路";
  1165. let Structure = "";
  1166. if (featrueMap["路面结构"] == 0) Structure = "沥青路面";
  1167. if (featrueMap["路面结构"] == 1) Structure = "水泥混凝土路面";
  1168. if (featrueMap["路面结构"] == 2) Structure = "其他类型路面";
  1169. const attrs = [{
  1170. name: "PrjArea",
  1171. value: featrueMap["工程所在地"] ? featrueMap["工程所在地"].value : "",
  1172. },
  1173. {
  1174. name: "StartPileNo",
  1175. value: featrueMap["起点桩号"] ? featrueMap["起点桩号"].value : "",
  1176. },
  1177. {
  1178. name: "EndPileNo",
  1179. value: featrueMap["终点桩号"] ? featrueMap["终点桩号"].value : "",
  1180. },
  1181. {
  1182. name: "BuildType",
  1183. value: BuildType,
  1184. },
  1185. {
  1186. name: "Terrain",
  1187. value: Terrain,
  1188. },
  1189. {
  1190. name: "RoadGrade",
  1191. value: featrueMap["公路等级"] ? featrueMap["公路等级"].value : "",
  1192. },
  1193. {
  1194. name: "DesignSpeed",
  1195. value: DesignSpeed,
  1196. },
  1197. {
  1198. name: "Structure",
  1199. value: Structure,
  1200. },
  1201. {
  1202. name: "SubgradeWidth",
  1203. value: featrueMap["路基宽度"] ? featrueMap["路基宽度"].value : "",
  1204. },
  1205. {
  1206. name: "RoadLength",
  1207. value: featrueMap["路线长度"] ? featrueMap["路线长度"].value : "",
  1208. },
  1209. {
  1210. name: "BridgeLength",
  1211. value: featrueMap["桥梁长度"] ? featrueMap["桥梁长度"].value : "",
  1212. },
  1213. {
  1214. name: "TunnelLength",
  1215. value: featrueMap["隧道长度"] ? featrueMap["隧道长度"].value : "",
  1216. },
  1217. {
  1218. name: "BriTunRate",
  1219. value: featrueMap["桥隧比"] ? featrueMap["桥隧比"].value : "",
  1220. },
  1221. {
  1222. name: "InterchangeNum",
  1223. value: featrueMap["互通式立交数"] ? featrueMap["互通式立交数"].value : "",
  1224. },
  1225. {
  1226. name: "StubLengths",
  1227. value: featrueMap["支线、联络线长度"] ? featrueMap["支线、联络线长度"].value : "",
  1228. },
  1229. {
  1230. name: "LaneLength",
  1231. value: featrueMap["辅道、连接线长度"] ? featrueMap["辅道、连接线长度"].value : "",
  1232. },
  1233. ];
  1234. Element.call(this, "Params", attrs);
  1235. }
  1236. function SummaryOfCost(totalItem, proItem,feature) {
  1237. let attrs = [{
  1238. name: "TenderSumLimit",
  1239. value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
  1240. },
  1241. {
  1242. name: "BidTotal",
  1243. value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
  1244. },
  1245. {
  1246. name: "BillTotal",
  1247. value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
  1248. },
  1249. {
  1250. name: "CostForHSE",
  1251. value: 0,
  1252. },
  1253. {
  1254. name: "ProvisionalSums",
  1255. value: proItem.feesIndex && proItem.feesIndex.common && proItem.feesIndex.common.tenderTotalFee ? proItem.feesIndex.common.tenderTotalFee : 0,
  1256. },
  1257. {
  1258. name: "Appraisal",
  1259. value: totalItem.feesIndex && totalItem.feesIndex.estimate && totalItem.feesIndex.estimate.tenderTotalFee ? totalItem.feesIndex.estimate.tenderTotalFee : 0,
  1260. },
  1261. ];
  1262. if(isBidInvitation) attrs = [] //招标
  1263. if (isControl) attrs.splice(1, 5); //控制价
  1264. if (isBidSubmission) { //投标文件时,读工程特征中的 招标控制价 值
  1265. let tenderSumLimit = _.find(feature, { "dispName": "招标控制价" });
  1266. if(tenderSumLimit) attrs[0].value = tenderSumLimit.value
  1267. }
  1268. Element.call(this, "SummaryOfCost", attrs);
  1269. }
  1270. function MakeInfo(tenderProject) {
  1271. let property = tenderProject.property;
  1272. let baseMap = {};
  1273. let baseInfo = _.find(property.basicInformation, {
  1274. dispName: "基本信息",
  1275. });
  1276. for (let i of baseInfo.items) {
  1277. let key = i.dispName;
  1278. if (i.dispName == "编制日期") key = "编制时间";
  1279. baseMap[key] = i;
  1280. }
  1281. const attrs = [{
  1282. name: "ValuationModel",
  1283. value: property.taxType,
  1284. },
  1285. {
  1286. name: "Manage",
  1287. value: baseMap["建设单位"] ? baseMap["建设单位"].value : "",
  1288. },
  1289. {
  1290. name: "Designer",
  1291. value: baseMap["设计单位"] ? baseMap["设计单位"].value : "",
  1292. },
  1293. {
  1294. name: "Compile",
  1295. value: baseMap["编制单位"] ? baseMap["编制单位"].value : "",
  1296. },
  1297. {
  1298. name: "CompileApprover",
  1299. value: baseMap["编制人"] ? baseMap["编制人"].value : "",
  1300. },
  1301. {
  1302. name: "CompileCertNo",
  1303. value: baseMap["编制人证书号"] ? baseMap["编制人证书号"].value : "",
  1304. },
  1305. {
  1306. name: "CompileDate",
  1307. value: baseMap["编制时间"] ? baseMap["编制时间"].value : "",
  1308. },
  1309. {
  1310. name: "Review",
  1311. value: baseMap["复核单位"] ? baseMap["复核单位"].value : "",
  1312. },
  1313. {
  1314. name: "ReviewApprover",
  1315. value: baseMap["复核人"] ? baseMap["复核人"].value : "",
  1316. },
  1317. {
  1318. name: "ReviewCertNo",
  1319. value: baseMap["复核人证书"] ? baseMap["复核人证书"].value : "",
  1320. },
  1321. {
  1322. name: "ReviewDate",
  1323. value: baseMap["复核日期"] ? baseMap["复核日期"].value : "",
  1324. },
  1325. {
  1326. name: "Examine",
  1327. value: baseMap["审核单位"] ? baseMap["审核单位"].value : "",
  1328. },
  1329. {
  1330. name: "ExamineApprover",
  1331. value: baseMap["审核人"] ? baseMap["审核人"].value : "",
  1332. },
  1333. {
  1334. name: "ExamineCertNo",
  1335. value: baseMap["审核人证书"] ? baseMap["审核人证书"].value : "",
  1336. },
  1337. {
  1338. name: "ExamineDate",
  1339. value: baseMap["审核日期"] ? baseMap["审核日期"].value : "",
  1340. },
  1341. {
  1342. name: "CompileExplain",
  1343. value: baseMap["编制说明"] ? baseMap["编制说明"].value : "",
  1344. },
  1345. {
  1346. name: "ExamineExplain",
  1347. value: baseMap["审核说明"] ? baseMap["审核说明"].value : "",
  1348. },
  1349. {
  1350. name: "ProjectExplain",
  1351. value: baseMap["工程说明"] ? baseMap["工程说明"].value : "",
  1352. },
  1353. ];
  1354. if (isControl || isBidInvitation) { //招标、招标控制价文件,则以下的8、12~18则不输出
  1355. attrs.splice(11, 7);
  1356. attrs.splice(7, 1);
  1357. }
  1358. Element.call(this, "MakeInfo", attrs);
  1359. }
  1360. let data = new CprjInfo(projectData.name);
  1361. data.children.push(new SystemInfo());
  1362. data.children.push(new CostBasis());
  1363. let seriNo = 1;
  1364. let Rates = [];
  1365. let Practs = [];
  1366. let EprjInfos = [];
  1367. for (let c of projectData.children) {
  1368. let tenderProject = tenderDetailMap[c.ID];
  1369. let feeRataDatas = tenderProject.FeeRate.datas;
  1370. Rates.push(new Rate(tenderProject, feeRataDatas, seriNo));
  1371. Practs.push(new Pract(tenderProject, seriNo));
  1372. EprjInfos.push(new EprjInfo(tenderProject));
  1373. seriNo++;
  1374. }
  1375. data.children.push(...Rates,...Practs,...EprjInfos);
  1376. return [{
  1377. data: data,
  1378. exportKind: exportKind,
  1379. fileName: projectData.name + INTERFACE_CONFIG[areaKey]["fileSuffix"][exportKind],
  1380. }, ];
  1381. }
  1382. return {
  1383. entry,
  1384. };
  1385. })();