guangdong_zhongshan.js 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476
  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. let safeItem = null;
  702. for (let b of bills) {
  703. if (b.flagsIndex && b.flagsIndex.fixed && b.flagsIndex.fixed.flag == fixedFlag.TOTAL_COST) totalItem = b;
  704. if (b.flagsIndex && b.flagsIndex.fixed && b.flagsIndex.fixed.flag == fixedFlag.PROVISIONAL) proItem = b;
  705. if(b.code == "102-3" && b.name=="安全生产费") safeItem = b;
  706. }
  707. const attrs = [{
  708. name: "Name",
  709. value: tenderProject.projectInfo.name,
  710. },
  711. {
  712. name: "Sums",
  713. value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
  714. },
  715. ];
  716. //输出控制价、投标文件时,取调价后的标段总造价。
  717. //输出招标文件时,取0
  718. if (isBidInvitation) attrs[1].value = 0;
  719. Element.call(this, "EprjInfo", attrs);
  720. this.children.push(new SummaryOfCost(totalItem, proItem,safeItem,feature));
  721. this.children.push(new MakeInfo(tenderProject));
  722. this.children.push(new Params(tenderProject));
  723. this.children.push(new getBillsItems(tenderProject));
  724. this.children.push(new getIndexs(tenderProject));
  725. let bidEvaluationMainMaterials = getBidEvaluationMainMaterial(tenderProject);
  726. if(bidEvaluationMainMaterials.length > 0) this.children.push(...bidEvaluationMainMaterials);
  727. }
  728. function getBidEvaluationMainMaterial(tenderProject) {
  729. let bidMaterials = [];
  730. let i = 1;
  731. for (let b of tenderProject.bidMaterialData) {
  732. bidMaterials.push(new BidEvaluationMainMaterial(b, i));
  733. i++
  734. }
  735. return bidMaterials;
  736. function BidEvaluationMainMaterial(b, index) {
  737. const attrs = [{
  738. name: "Code",
  739. value: index,
  740. },
  741. {
  742. name: "Number",
  743. value: b.code
  744. },
  745. {
  746. name: "Name",
  747. value: b.name
  748. },
  749. {
  750. name: "Specification",
  751. value: b.specs
  752. },
  753. {
  754. name: "Unit",
  755. value: b.unit
  756. },
  757. {
  758. name: "Price",
  759. value: b.tenderPrice
  760. },
  761. {
  762. name: "LimitedPrice",
  763. value: b.tenderPrice
  764. },
  765. {
  766. name: "Quantity",
  767. value: 0//b.quantity
  768. },
  769. {
  770. name: "Total",
  771. value: 0//b.totalPrice
  772. },
  773. {
  774. name: "Remark",
  775. value: b.remark
  776. }
  777. ];
  778. if (isBidSubmission) {
  779. attrs[7].value = b.quantity;
  780. attrs[8].value = b.totalPrice;
  781. }
  782. Element.call(this, "BidEvaluationMainMaterial", attrs);
  783. }
  784. }
  785. function getIndexs(tenderProject) {
  786. let Indexs = new emptyElement('Indexs');
  787. let feature = tenderProject.property.projectFeature ? tenderProject.property.projectFeature : [];
  788. for (let f of feature) {
  789. if (f.code) Indexs.children.push(new IndexItem(f))
  790. }
  791. return Indexs;
  792. function IndexItem(fea) {
  793. const attrs = [{
  794. name: "Code",
  795. value: fea.code,
  796. },
  797. {
  798. name: "Name",
  799. value: fea.dispName,
  800. },
  801. {
  802. name: "Unit",
  803. value: fea.unit,
  804. },
  805. {
  806. name: "Value",
  807. value: fea.value,
  808. },
  809. {
  810. name: "Remark",
  811. value: fea.remark,
  812. }
  813. ]
  814. Element.call(this, "IndexItem", attrs);
  815. }
  816. }
  817. function getBillsItems(tenderProject) {
  818. let items = new emptyElement("Items");
  819. let rootNodes = tenderProject.mainTree.roots;
  820. for (let r of rootNodes) {
  821. setItem(r, -1, items.children);
  822. }
  823. return items;
  824. function setItem(bNode, level, list) {
  825. if (bNode.sourceType == ModuleNames.ration) return;
  826. let item = new bill(bNode, level);
  827. if (bNode.children && bNode.children.length > 0) {
  828. level += 1;
  829. for (let c of bNode.children) {
  830. setItem(c, level, item.children);
  831. }
  832. }
  833. list.push(item);
  834. function bill(bNode, level) {
  835. let data = bNode.data;
  836. let CostKind = 3;
  837. if (data.name.indexOf("安全生产费") != -1) CostKind = 1;
  838. if (data.name.indexOf("暂列金额") != -1) CostKind = 2;
  839. //1 = 工程量×综合单价;2 = 计算基数×费率;3 = 工程量×单价。
  840. let CalcType = 2;
  841. if (data.calcFlag == 2) CalcType = 3;
  842. if (data.calcFlag == 1) CalcType = 1;
  843. //取暂估价类型。读取造价书界面的专项暂定列。0=材料暂估价,1=工程设备暂估价,2=专业工程暂估价,没有选的输出为空。
  844. let ProvisionalType = "";
  845. if (data.specialProvisional == "材料") ProvisionalType = 0;
  846. if (data.specialProvisional == "工程设备") ProvisionalType = 1;
  847. if (data.specialProvisional == "专业工程") ProvisionalType = 2;
  848. //MpRatio
  849. let MpRatio = "";
  850. let MaterialRatio = "";
  851. let MechRatio = "";
  852. if (data.quantityCoe) {
  853. if (data.quantityCoe["labour"]) MpRatio = data.quantityCoe["labour"];
  854. if (data.quantityCoe["material"]) MaterialRatio = data.quantityCoe["material"];
  855. if (data.quantityCoe["machine"]) MechRatio = data.quantityCoe["machine"];
  856. }
  857. //fail: { hint: '错误提示', type: '提示所属(基本就是单位工程名称)' }
  858. const attrs = [{
  859. name: "ListCode",
  860. value: data.code,
  861. },
  862. {
  863. name: "ListName",
  864. value: data.name,
  865. },
  866. {
  867. name: "Unit",
  868. value: data.unit,
  869. },
  870. {
  871. name: "Num",
  872. value: data.quantity,
  873. },
  874. {
  875. name: "QtyFormula",
  876. value: data.calcBase //data.calcBase ? cbParser.toFExpr(data.calcBase, tenderProject.mainTree.items) : "",
  877. },
  878. {
  879. name: "Price",
  880. value: 0//data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "",
  881. },
  882. {
  883. name: "Rate",
  884. value: 100,
  885. },
  886. {
  887. name: "Sum",
  888. value: 0//data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderTotalFee : "",
  889. },
  890. {
  891. name: "ChapterKind",
  892. value: level,
  893. },
  894. {
  895. name: "CostKind",
  896. value: CostKind,
  897. },
  898. {
  899. name: "CalcType",
  900. value: CalcType,
  901. },
  902. {
  903. name: "ProvisionalType",
  904. value: ProvisionalType,
  905. },
  906. {
  907. name: "MeterRules",
  908. value: "",
  909. },
  910. {
  911. name: "Content",
  912. value: data.jobContentText,
  913. },
  914. {
  915. name: "Remarks",
  916. value: data.remark,
  917. },
  918. {
  919. name: "MpRatio",
  920. value: MpRatio,
  921. },
  922. {
  923. name: "MaterialRatio",
  924. value: MaterialRatio,
  925. },
  926. {
  927. name: "MechRatio",
  928. value: MechRatio,
  929. },
  930. {
  931. name: "AdjustedPrice",
  932. value: data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "",
  933. },
  934. {
  935. name: "AdjustedSums",
  936. value: data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderTotalFee : "",
  937. },
  938. {
  939. name: "ItemType",
  940. value: 1,
  941. },
  942. {
  943. name: "FomulaCode",
  944. value: ""
  945. },
  946. ];
  947. if (isBidSubmission) {
  948. attrs[5].value = data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "";
  949. attrs[7].value = data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderTotalFee : "";
  950. }
  951. Element.call(this, "Item", attrs);
  952. let cc = CostComposition(bNode);
  953. if (cc) this.children.push(cc);
  954. this.children.push(CostStructure(data))
  955. function CostComposition(bNode) {
  956. if (isControl || isBidInvitation) return null;
  957. let CostComposition = new emptyElement('CostComposition');
  958. let Norms = [];
  959. let Costs = [];
  960. if (bNode.children && bNode.children.length > 0 && bNode.children[0].sourceType == ModuleNames.ration) {
  961. for (let r of bNode.children) {
  962. if (r.data.type == rationType.ration) {
  963. Norms.push(new Ration(r.data));
  964. } else {
  965. Costs.push(new Cost(r.data));
  966. }
  967. }
  968. }
  969. if (Norms.length > 0) CostComposition.children.push(...Norms);
  970. if (Costs.length > 0) CostComposition.children.push(...Costs);
  971. if (bNode.data.calcBase) CostComposition.children.push(new Formula(bNode.data));
  972. return CostComposition.children.length > 0 ? CostComposition : null;
  973. function Formula(bills) {
  974. const attrs = [{
  975. name: "Name",
  976. value: bills.name
  977. },
  978. {
  979. name: "Formulas",
  980. value: bills.calcBase
  981. },
  982. {
  983. name: "Ratio",
  984. value: 1
  985. },
  986. {
  987. name: "Sum",
  988. value: bills.feesIndex && bills.feesIndex.common ? bills.feesIndex.common.tenderTotalFee : "",
  989. },
  990. {
  991. name: "Remarks",
  992. value: bills.remark
  993. }
  994. ]
  995. Element.call(this, "Formula", attrs);
  996. // 1.Name
  997. // 名称/描述。取清单的名称。
  998. // 2.Formulas
  999. // 计算式。读取计算基数的文本。
  1000. // 取基数计算窗口内容,基数直接转换为金额?参考标准文档的 7.11 及 7.12 节。
  1001. // 7.11是定额的费用,7.12是清单累进基数,主要是估概预算中用到,清单里的不同,所以中山的接口直接输出基数文本。
  1002. // 3.Ratio
  1003. // 系数。输出为1,非必填。
  1004. // 4.Sum
  1005. // 取金额。
  1006. // 5.Remarks
  1007. }
  1008. function Cost(item) {
  1009. let BasePrice = 0;
  1010. if (item.type == rationType.volumePrice) { // 当插入的是量价时,基价读取单价列。
  1011. BasePrice = item.feesIndex && item.feesIndex.common ? item.feesIndex.common.tenderUnitFee : 0
  1012. } else {
  1013. BasePrice = getBasePrice(item.projectGLJID, tenderProject)
  1014. }
  1015. let calcMap = tenderProject.calcProgram.compiledTemplateMaps
  1016. let CostTypeNo = '';
  1017. if (feeRateMap[calcMap[item.programID]]) CostTypeNo = feeRateMap[calcMap[item.programID]];
  1018. const attrs = [{
  1019. name: "Code",
  1020. value: item.code,
  1021. }, {
  1022. name: 'Name',
  1023. value: item.name
  1024. }, {
  1025. name: 'Spec',
  1026. value: item.specs
  1027. }, {
  1028. name: 'Unit',
  1029. value: item.unit
  1030. }, {
  1031. name: 'Num',
  1032. value: item.tenderQuantity
  1033. }, {
  1034. name: 'BasePrice',
  1035. value: BasePrice
  1036. }, {
  1037. name: 'Price',
  1038. value: item.feesIndex && item.feesIndex.common ? item.feesIndex.common.tenderUnitFee : 0
  1039. }, {
  1040. name: 'IsEquipment',
  1041. value: item.subType == gljType.EQUIPMENT ? 1 : 0
  1042. }, {
  1043. name: 'CostTypeNo',
  1044. value: CostTypeNo
  1045. }, {
  1046. name: 'ProfitRate',
  1047. value: getFeeRate(item.programID, 'profit', tenderProject)
  1048. },
  1049. {
  1050. name: 'TaxRate',
  1051. value: getFeeRate(item.programID, 'tax', tenderProject)
  1052. },
  1053. {
  1054. name: 'MpRatio',
  1055. value: item.subType == gljType.LABOUR ? 100 : 0
  1056. },
  1057. {
  1058. name: 'MaterialRatio',
  1059. value: item.subType == gljType.GENERAL_MATERIAL ? 100 : 0
  1060. },
  1061. {
  1062. name: 'MechRatio',
  1063. value: item.subType == gljType.GENERAL_MACHINE ? 100 : 0
  1064. }
  1065. ]
  1066. Element.call(this, "Cost", attrs);
  1067. this.children.push(CostStructure(item));
  1068. }
  1069. function Ration(ration) {
  1070. let calcMap = tenderProject.calcProgram.compiledTemplateMaps
  1071. let CostTypeNo = '';
  1072. if (feeRateMap[calcMap[ration.programID]]) CostTypeNo = feeRateMap[calcMap[ration.programID]];
  1073. const attrs = [{
  1074. name: "NormLibNo",
  1075. value: 'YSDE-000000-2018-86',
  1076. }, {
  1077. name: 'DisplayCode',
  1078. value: ration.code
  1079. }, {
  1080. name: 'Name',
  1081. value: ration.name
  1082. }, {
  1083. name: 'Unit',
  1084. value: ration.unit
  1085. }, {
  1086. name: 'Num',
  1087. value: ration.tenderQuantity
  1088. },
  1089. {
  1090. name: 'CostTypeNo',
  1091. value: CostTypeNo
  1092. },
  1093. {
  1094. name: 'ProfitRate',
  1095. value: getFeeRate(ration.programID, 'profit', tenderProject) //tenderProject.ProfitRate
  1096. },
  1097. {
  1098. name: 'TaxRate',
  1099. value: getFeeRate(ration.programID, 'tax', tenderProject) //tenderProject.TaxRate
  1100. },
  1101. {
  1102. name: 'FabricationCost',
  1103. value: ration.feesIndex && ration.feesIndex.common ? ration.feesIndex.common.tenderTotalFee : 0
  1104. },
  1105. {
  1106. name: 'AdjustStatus',
  1107. value: ration.adjustState
  1108. }
  1109. ]
  1110. Element.call(this, "Norm", attrs);
  1111. this.children.push(CostStructure(ration));
  1112. this.children.push(Consume(ration));
  1113. }
  1114. }
  1115. function Consume(ration) {
  1116. let consume = new emptyElement('Consume');
  1117. for (let rg of ration.rationGLJList) {
  1118. consume.children.push(new ConsumeItem(rg));
  1119. }
  1120. return consume;
  1121. function ConsumeItem(rg) {
  1122. const attrs = [{
  1123. name: "Code",
  1124. value: rg.code,
  1125. }, {
  1126. name: "Consumption",
  1127. value: rg.tenderQuantity
  1128. }];
  1129. Element.call(this, "ConsumeItem", attrs);
  1130. }
  1131. }
  1132. function CostStructure(item) {
  1133. let CostStructure = new emptyElement('CostStructure');
  1134. for (let f of cpFeeTypes) {
  1135. if(itemFeeMap[f.type]) CostStructure.children.push(new CostItem(item,f.type))
  1136. }
  1137. if (CostStructure.children.length == 0) CostStructure.children.push(new CostItem({},""))
  1138. function CostItem(item,type) {
  1139. const attrs = [{
  1140. name: "ItemNo",
  1141. value: itemFeeMap[type],
  1142. }, {
  1143. name: 'Sum',
  1144. value: 0 //fee.tenderTotalFee
  1145. }]
  1146. if (isBidSubmission && item.feesIndex && item.feesIndex[type]) attrs[1].value = item.feesIndex[type].tenderTotalFee;
  1147. Element.call(this, "CostItem", attrs);
  1148. }
  1149. return CostStructure;
  1150. }
  1151. }
  1152. }
  1153. }
  1154. function Params(tenderProject) {
  1155. let feature = tenderProject.property.projectFeature ? tenderProject.property.projectFeature : [];
  1156. let featrueMap = {};
  1157. for (let f of feature) {
  1158. featrueMap[f.key] = f;
  1159. }
  1160. let BuildType = "";
  1161. if (featrueMap["buildType"] == 0) BuildType = "新建";
  1162. if (featrueMap["buildType"] == 1) BuildType = "改(扩)建";
  1163. let Terrain = "";
  1164. if (featrueMap["terrainCategory"] == 0) Terrain = "平原微丘陵区";
  1165. if (featrueMap["terrainCategory"] == 1) Terrain = "山岭重丘陵区";
  1166. let DesignSpeed = "";
  1167. if (featrueMap["designSpeed"] == 0) DesignSpeed = "高速公路";
  1168. if (featrueMap["designSpeed"] == 1) DesignSpeed = "一级公路";
  1169. if (featrueMap["designSpeed"] == 2) DesignSpeed = "二级公路";
  1170. if (featrueMap["designSpeed"] == 3) DesignSpeed = "三级公路";
  1171. if (featrueMap["designSpeed"] == 4) DesignSpeed = "四级公路";
  1172. let Structure = "";
  1173. if (featrueMap["structure"] == 0) Structure = "沥青路面";
  1174. if (featrueMap["structure"] == 1) Structure = "水泥混凝土路面";
  1175. if (featrueMap["structure"] == 2) Structure = "其他类型路面";
  1176. const attrs = [{
  1177. name: "PrjArea",
  1178. value: featrueMap["projAddress"] ? featrueMap["projAddress"].value : "",
  1179. },
  1180. {
  1181. name: "StartPileNo",
  1182. value: featrueMap["startStation"] ? featrueMap["startStation"].value : "",
  1183. },
  1184. {
  1185. name: "EndPileNo",
  1186. value: featrueMap["endingStation"] ? featrueMap["endingStation"].value : "",
  1187. },
  1188. {
  1189. name: "BuildType",
  1190. value: BuildType,
  1191. },
  1192. {
  1193. name: "Terrain",
  1194. value: Terrain,
  1195. },
  1196. {
  1197. name: "RoadGrade",
  1198. value: featrueMap["roadGrade"] ? featrueMap["roadGrade"].value : "",
  1199. },
  1200. {
  1201. name: "DesignSpeed",
  1202. value: DesignSpeed,
  1203. },
  1204. {
  1205. name: "Structure",
  1206. value: Structure,
  1207. },
  1208. {
  1209. name: "SubgradeWidth",
  1210. value: featrueMap["subgradeWidth"] ? featrueMap["subgradeWidth"].value : "",
  1211. },
  1212. {
  1213. name: "RoadLength",
  1214. value: featrueMap["roadLength"] ? featrueMap["roadLength"].value : "",
  1215. },
  1216. {
  1217. name: "BridgeLength",
  1218. value: featrueMap["bridgeLength"] ? featrueMap["bridgeLength"].value : "",
  1219. },
  1220. {
  1221. name: "TunnelLength",
  1222. value: featrueMap["tunnelLength"] ? featrueMap["tunnelLength"].value : "",
  1223. },
  1224. {
  1225. name: "BriTunRate",
  1226. value: featrueMap["briTunRate"] ? featrueMap["briTunRate"].value : "",
  1227. },
  1228. {
  1229. name: "InterchangeNum",
  1230. value: featrueMap["interchangeNum"] ? featrueMap["interchangeNum"].value : "",
  1231. },
  1232. {
  1233. name: "StubLengths",
  1234. value: featrueMap["stubLengths"] ? featrueMap["stubLengths"].value : "",
  1235. },
  1236. {
  1237. name: "LaneLength",
  1238. value: featrueMap["laneLength"] ? featrueMap["laneLength"].value : "",
  1239. },
  1240. ];
  1241. Element.call(this, "Params", attrs);
  1242. }
  1243. function SummaryOfCost(totalItem, proItem,safeItem,feature) {
  1244. let attrs = [{
  1245. name: "TenderSumLimit",
  1246. value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
  1247. },
  1248. {
  1249. name: "BidTotal",
  1250. value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
  1251. },
  1252. {
  1253. name: "BillTotal",
  1254. value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
  1255. },
  1256. {
  1257. name: "CostForHSE",
  1258. value: safeItem&&safeItem.feesIndex && safeItem.feesIndex.common && safeItem.feesIndex.common.tenderTotalFee ? safeItem.feesIndex.common.tenderTotalFee : 0,
  1259. },
  1260. {
  1261. name: "ProvisionalSums",
  1262. value: proItem.feesIndex && proItem.feesIndex.common && proItem.feesIndex.common.tenderTotalFee ? proItem.feesIndex.common.tenderTotalFee : 0,
  1263. },
  1264. {
  1265. name: "Appraisal",
  1266. value: totalItem.feesIndex && totalItem.feesIndex.estimate && totalItem.feesIndex.estimate.tenderTotalFee ? totalItem.feesIndex.estimate.tenderTotalFee : 0,
  1267. },
  1268. ];
  1269. if(isBidInvitation) attrs = [] //招标
  1270. if (isControl) attrs.splice(1, 5); //控制价
  1271. if (isBidSubmission) { //投标文件时,读工程特征中的 招标控制价 值
  1272. let tenderSumLimit = _.find(feature, { "dispName": "招标控制价" });
  1273. if(tenderSumLimit) attrs[0].value = tenderSumLimit.value
  1274. }
  1275. Element.call(this, "SummaryOfCost", attrs);
  1276. }
  1277. function MakeInfo(tenderProject) {
  1278. let property = tenderProject.property;
  1279. let baseMap = {};
  1280. let baseInfo = _.find(property.basicInformation, {
  1281. dispName: "基本信息",
  1282. });
  1283. for (let i of baseInfo.items) {
  1284. let key = i.key;
  1285. //if (i.dispName == "编制日期") key = "编制时间";
  1286. baseMap[key] = i;
  1287. }
  1288. const attrs = [{
  1289. name: "ValuationModel",
  1290. value: property.taxType,
  1291. },
  1292. {
  1293. name: "Manage",
  1294. value: baseMap["constructingUnits"] ? baseMap["constructingUnits"].value : "",
  1295. },
  1296. {
  1297. name: "Designer",
  1298. value: baseMap["designUnits"] ? baseMap["designUnits"].value : "",
  1299. },
  1300. {
  1301. name: "Compile",
  1302. value: baseMap["establishUnit"] ? baseMap["establishUnit"].value : "",
  1303. },
  1304. {
  1305. name: "CompileApprover",
  1306. value: baseMap["tenderCompiler"] ? baseMap["tenderCompiler"].value : "",
  1307. },
  1308. {
  1309. name: "CompileCertNo",
  1310. value: baseMap["authorNo"] ? baseMap["authorNo"].value : "",
  1311. },
  1312. {
  1313. name: "CompileDate",
  1314. value: baseMap["establishDate"] ? baseMap["establishDate"].value : "",
  1315. },
  1316. {
  1317. name: "Review",
  1318. value: baseMap["reviewUnit"] ? baseMap["reviewUnit"].value : "",
  1319. },
  1320. {
  1321. name: "ReviewApprover",
  1322. value: baseMap["tenderExaminer"] ? baseMap["tenderExaminer"].value : "",
  1323. },
  1324. {
  1325. name: "ReviewCertNo",
  1326. value: baseMap["certificateReviewer"] ? baseMap["certificateReviewer"].value : "",
  1327. },
  1328. {
  1329. name: "ReviewDate",
  1330. value: baseMap["reviewTime"] ? baseMap["reviewTime"].value : "",
  1331. },
  1332. {
  1333. name: "Examine",
  1334. value: baseMap["auditUnit"] ? baseMap["auditUnit"].value : "",
  1335. },
  1336. {
  1337. name: "ExamineApprover",
  1338. value: baseMap["auditor"] ? baseMap["auditor"].value : "",
  1339. },
  1340. {
  1341. name: "ExamineCertNo",
  1342. value: baseMap["auditorNo"] ? baseMap["auditorNo"].value : "",
  1343. },
  1344. {
  1345. name: "ExamineDate",
  1346. value: baseMap["reviewTime"] ? baseMap["reviewTime"].value : "",
  1347. },
  1348. {
  1349. name: "CompileExplain",
  1350. value: baseMap["preparationInstructions"] ? baseMap["preparationInstructions"].value : "",
  1351. },
  1352. {
  1353. name: "ExamineExplain",
  1354. value: baseMap["auditInstructions"] ? baseMap["auditInstructions"].value : "",
  1355. },
  1356. {
  1357. name: "ProjectExplain",
  1358. value: baseMap["auditInstructions"] ? baseMap["auditInstructions"].value : "",
  1359. },
  1360. ];
  1361. if (isControl || isBidInvitation) { //招标、招标控制价文件,则以下的8、12~18则不输出
  1362. attrs.splice(11, 7);
  1363. attrs.splice(7, 1);
  1364. }
  1365. Element.call(this, "MakeInfo", attrs);
  1366. }
  1367. let data = new CprjInfo(projectData.name);
  1368. data.children.push(new SystemInfo());
  1369. data.children.push(new CostBasis());
  1370. let seriNo = 1;
  1371. let Rates = [];
  1372. let Practs = [];
  1373. let EprjInfos = [];
  1374. for (let c of projectData.children) {
  1375. let tenderProject = tenderDetailMap[c.ID];
  1376. let feeRataDatas = tenderProject.FeeRate.datas;
  1377. Rates.push(new Rate(tenderProject, feeRataDatas, seriNo));
  1378. Practs.push(new Pract(tenderProject, seriNo));
  1379. EprjInfos.push(new EprjInfo(tenderProject));
  1380. seriNo++;
  1381. }
  1382. data.children.push(...Rates,...Practs,...EprjInfos);
  1383. return [{
  1384. data: data,
  1385. exportKind: exportKind,
  1386. fileName: projectData.name + INTERFACE_CONFIG[areaKey]["fileSuffix"][exportKind],
  1387. }, ];
  1388. }
  1389. return {
  1390. entry,
  1391. };
  1392. })();