guangdong_zhongshan.js 49 KB

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