guangdong_zhongshan.js 47 KB

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