guangdong_zhongshan.js 50 KB

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