guangdong_zhongshan.js 46 KB

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