guangxi_2021.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. // 清单基数
  2. const progression = [
  3. '施工场地建设费',
  4. '养护管理单位项目管理费',
  5. '项目信息化费',
  6. '工程监理费',
  7. '设计文件审查费(一阶段)',
  8. '设计文件审查费(二阶段)',
  9. '采用一阶段设计的工程设计费',
  10. '采用二阶段设计的工程设计费',
  11. '独立立项进行维修、加固的一般桥梁工程设计费',
  12. '独立立项进行维修、加固的技术复杂大桥工程设计费',
  13. '独立立项进行维修、加固的隧道工程设计费',
  14. '招标费',
  15. ];
  16. const deficiency = {
  17. '设计文件审查费(一阶段)': 4000,
  18. '设计文件审查费(二阶段)': 4000,
  19. };
  20. if (typeof baseFigureMap !== 'undefined') {
  21. const { fixedFlag } = commonConstants;
  22. const budgetMap = {
  23. // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
  24. '建筑安装工程费': {
  25. base: 'JZAZGCF',
  26. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  27. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  28. pick: false,
  29. },
  30. // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
  31. '定额建筑安装工程费': {
  32. base: 'DEJZAZGCF',
  33. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  34. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  35. pick: false,
  36. },
  37. // 显示:除“建筑安装工程费”以外部分可显示。
  38. '建筑安装工程费(不含设备费)': {
  39. base: 'JZAZGCFBHSB',
  40. fixedFlag: null,
  41. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  42. pick: false,
  43. },
  44. // 显示:仅清单固定类别是“专项费用”可显示
  45. '定额建筑安装工程费(不含专项费用)': {
  46. base: 'DEJZAZGCFBHZX',
  47. fixedFlag: null,
  48. filter: [fixedFlag.SPECIAL_COST],
  49. pick: true,
  50. },
  51. // 显示:仅清单固定类别是“安全生产费”可显示。
  52. '建筑安装工程费(不含安全生产费)': {
  53. base: 'JZAZGCFBHSC',
  54. fixedFlag: null,
  55. filter: [fixedFlag.SAFE_COST],
  56. pick: true
  57. },
  58. // 显示:仅清单固定类别是“专项费用”可显示。
  59. '施工场地建设费': {
  60. isProgressive: true,
  61. base: 'SGCDJSF',
  62. fixedFlag: null,
  63. filter: [fixedFlag.SPECIAL_COST],
  64. pick: true,
  65. },
  66. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  67. '养护管理单位项目管理费': {
  68. isProgressive: true,
  69. base: 'YHGLDWXMGLF',
  70. fixedFlag: null,
  71. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  72. pick: true,
  73. },
  74. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  75. '项目信息化费': {
  76. isProgressive: true,
  77. base: 'XMXXHF',
  78. fixedFlag: null,
  79. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  80. pick: true,
  81. },
  82. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  83. '工程监理费': {
  84. isProgressive: true,
  85. base: 'GCJLF',
  86. fixedFlag: null,
  87. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  88. pick: true,
  89. },
  90. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  91. '设计文件审查费(一阶段)': {
  92. isProgressive: true,
  93. deficiency: 4000,
  94. base: 'SJWJSCFYJD',
  95. fixedFlag: null,
  96. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  97. pick: true,
  98. },
  99. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  100. '设计文件审查费(二阶段)': {
  101. isProgressive: true,
  102. deficiency: 4000,
  103. base: 'SJWJSCFEJD',
  104. fixedFlag: null,
  105. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  106. pick: true,
  107. },
  108. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  109. '采用一阶段设计的工程设计费': {
  110. isProgressive: true,
  111. base: 'CQYJDSJDGCSJF',
  112. fixedFlag: null,
  113. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  114. pick: true,
  115. },
  116. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  117. '采用二阶段设计的工程设计费': {
  118. isProgressive: true,
  119. base: 'CQEJDSJDGCSJF',
  120. fixedFlag: null,
  121. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  122. pick: true,
  123. },
  124. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  125. '独立立项进行维修、加固的一般桥梁工程设计费': {
  126. isProgressive: true,
  127. base: 'DLLXJXWXJGDYBQLGCSJF',
  128. fixedFlag: null,
  129. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  130. pick: true,
  131. },
  132. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  133. '独立立项进行维修、加固的技术复杂大桥工程设计费': {
  134. isProgressive: true,
  135. base: 'DLLXJXWXJGDJSFZDQGCSJF',
  136. fixedFlag: null,
  137. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  138. pick: true,
  139. },
  140. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  141. '独立立项进行维修、加固的隧道工程设计费': {
  142. isProgressive: true,
  143. base: 'DLLXJXWXJGDSDGCSJF',
  144. fixedFlag: null,
  145. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  146. pick: true,
  147. },
  148. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  149. '招标费': {
  150. isProgressive: true,
  151. base: 'ZBF',
  152. fixedFlag: null,
  153. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  154. pick: true,
  155. },
  156. // 显示:仅“价差预备费”可显示
  157. '价差预备费': {
  158. base: 'JCYBF',
  159. fixedFlag: null,
  160. filter: [fixedFlag.SPREAD_BUDGET_FEE],
  161. pick: true,
  162. },
  163. };
  164. const boqMap = {
  165. //仅允许用于固定类别是“第100章至700章清单”以外的清单
  166. '各章清单合计': {
  167. base: 'GZQDHJ',
  168. fixedFlag: fixedFlag.ONE_SEVEN_BILLS,
  169. filter: [fixedFlag.ONE_SEVEN_BILLS],
  170. pick: false
  171. },
  172. //仅允许用于固定类别是“第100章至700章清单”以外的清单
  173. '专项暂定合计': {
  174. base: 'ZXZDHJ',
  175. fixedFlag: null,
  176. filter: [fixedFlag.ONE_SEVEN_BILLS],
  177. pick: false
  178. },
  179. /*
  180. * 清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
  181. * 因此{100章以外合计}不设置关联的清单固定行
  182. * */
  183. //仅允许用于固定类别为“100章清单”引用
  184. '100章以外清单合计': {
  185. base: 'YBZYWQDHJ',
  186. fixedFlag: null,
  187. filter: [fixedFlag.ONE_HUNDRED_BILLS],
  188. pick: true
  189. }
  190. };
  191. baseFigureMap.budget = budgetMap;
  192. baseFigureMap.boq = boqMap;
  193. }
  194. if (typeof baseFigureTemplate !== 'undefined') {
  195. const { fixedFlag } = commonConstants;
  196. baseFigureTemplate.budget = {
  197. // 建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的金额。
  198. JZAZGCF(tender) {
  199. return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'common');
  200. },
  201. // 定额建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的定额建安费。
  202. DEJZAZGCF(tender) {
  203. return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'rationCommon');
  204. },
  205. // 建筑安装工程费(不含设备费) 算法:取清单固定类别是“建筑安装工程费”的金额,扣除设备购置。
  206. JZAZGCFBHSB(tender) {
  207. return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.EQUIPMENT_ACQUISITION_FEE], tender, 'common');
  208. },
  209. // 定额建筑安装工程费(不含专项费用) 算法:取清单固定类别是“建筑安装工程费”的定额建安费,扣除“专项费用”行的定额建安费。
  210. DEJZAZGCFBHZX(tender) {
  211. return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SPECIAL_COST], tender, 'rationCommon');
  212. },
  213. // 建筑安装工程费(不含安全生产费) 算法:取清单固定类别是“建筑安装工程费”的金额,扣除“安全生产费”的金额。
  214. JZAZGCFBHSC(tender) {
  215. return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SAFE_COST], tender, 'common');
  216. },
  217. // 施工场地建设费 算法:按“定额建筑安装工程费(不含专项费用)”为基数,以累进办法计算。
  218. SGCDJSF(tender) {
  219. const baseFee = this['DEJZAZGCFBHZX'](tender);
  220. if (!tender) {
  221. calcBase.baseProgressiveFee = baseFee;
  222. }
  223. return calculateUtil.getProgressiveFee(baseFee, '施工场地建设费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  224. },
  225. // 养护管理单位项目管理费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
  226. YHGLDWXMGLF(tender) {
  227. const baseFee = this['DEJZAZGCF'](tender);
  228. if (!tender) {
  229. calcBase.baseProgressiveFee = baseFee;
  230. }
  231. return calculateUtil.getProgressiveFee(baseFee, '养护管理单位项目管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  232. },
  233. // 项目信息化费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
  234. XMXXHF(tender) {
  235. const baseFee = this['DEJZAZGCF'](tender);
  236. if (!tender) {
  237. calcBase.baseProgressiveFee = baseFee;
  238. }
  239. return calculateUtil.getProgressiveFee(baseFee, '项目信息化费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  240. },
  241. // 工程监理费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
  242. GCJLF(tender) {
  243. const baseFee = this['DEJZAZGCF'](tender);
  244. if (!tender) {
  245. calcBase.baseProgressiveFee = baseFee;
  246. }
  247. return calculateUtil.getProgressiveFee(baseFee, '工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  248. },
  249. // 设计文件审查费(一阶段) 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
  250. SJWJSCFYJD(tender) {
  251. const baseFee = this['DEJZAZGCF'](tender);
  252. if (!tender) {
  253. calcBase.baseProgressiveFee = baseFee;
  254. }
  255. return calculateUtil.getProgressiveFee(baseFee, '设计文件审查费(一阶段)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  256. },
  257. // 设计文件审查费(二阶段) 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
  258. SJWJSCFEJD(tender) {
  259. const baseFee = this['DEJZAZGCF'](tender);
  260. if (!tender) {
  261. calcBase.baseProgressiveFee = baseFee;
  262. }
  263. return calculateUtil.getProgressiveFee(baseFee, '设计文件审查费(二阶段)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  264. },
  265. // 采用一阶段设计的工程设计费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
  266. CQYJDSJDGCSJF(tender) {
  267. const baseFee = this['DEJZAZGCF'](tender);
  268. if (!tender) {
  269. calcBase.baseProgressiveFee = baseFee;
  270. }
  271. return calculateUtil.getProgressiveFee(baseFee, '采用一阶段设计的工程设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  272. },
  273. // 采用二阶段设计的工程设计费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
  274. CQEJDSJDGCSJF(tender) {
  275. const baseFee = this['DEJZAZGCF'](tender);
  276. if (!tender) {
  277. calcBase.baseProgressiveFee = baseFee;
  278. }
  279. return calculateUtil.getProgressiveFee(baseFee, '采用二阶段设计的工程设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  280. },
  281. // 独立立项进行维修、加固的一般桥梁工程设计费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
  282. DLLXJXWXJGDYBQLGCSJF(tender) {
  283. const baseFee = this['DEJZAZGCF'](tender);
  284. if (!tender) {
  285. calcBase.baseProgressiveFee = baseFee;
  286. }
  287. return calculateUtil.getProgressiveFee(baseFee, '独立立项进行维修、加固的一般桥梁工程设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  288. },
  289. // 独立立项进行维修、加固的技术复杂大桥工程设计费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
  290. DLLXJXWXJGDJSFZDQGCSJF(tender) {
  291. const baseFee = this['DEJZAZGCF'](tender);
  292. if (!tender) {
  293. calcBase.baseProgressiveFee = baseFee;
  294. }
  295. return calculateUtil.getProgressiveFee(baseFee, '独立立项进行维修、加固的技术复杂大桥工程设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  296. },
  297. // 独立立项进行维修、加固的隧道工程设计费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
  298. DLLXJXWXJGDSDGCSJF(tender) {
  299. const baseFee = this['DEJZAZGCF'](tender);
  300. if (!tender) {
  301. calcBase.baseProgressiveFee = baseFee;
  302. }
  303. return calculateUtil.getProgressiveFee(baseFee, '独立立项进行维修、加固的隧道工程设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  304. },
  305. // 招标费 算法:按“指标建筑安装工程费”为基数,以累进办法计算。
  306. ZBF(tender) {
  307. const baseFee = this['ZBJZAZGCF'](tender);
  308. if (!tender) {
  309. calcBase.baseProgressiveFee = baseFee;
  310. }
  311. return calculateUtil.getProgressiveFee(baseFee, '招标费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  312. },
  313. /* 价差预备费 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
  314. 价差预备费 P * [(1+i)^(n-1) -1]
  315. P——建筑安装工程费总额(元);
  316. i——年工程造价增涨率(%);
  317. n——设计文件编制年至养护项目开工年+养护项目建设期限(年)。
  318. */
  319. JCYBF(tender) {
  320. //建筑安装工程费作为基数
  321. const installFee = this['JZAZGCF'](tender);
  322. //年造价增涨
  323. const costGrowthRate = calcBase.project.property.costGrowthRate
  324. ? calcBase.project.property.costGrowthRate
  325. : 0;
  326. //增涨计费年限
  327. const growthPeriod = projectObj.project.property.growthPeriod
  328. ? calcBase.project.property.growthPeriod
  329. : 0;
  330. //= P * [(1+i)^(n-1) -1]
  331. return (installFee * (Math.pow(1 + costGrowthRate, growthPeriod - 1) - 1)).toDecimal(decimalObj.bills.totalPrice);
  332. }
  333. };
  334. baseFigureTemplate.boq = {
  335. //{各章清单合计}
  336. // 取清单固定类别是“第100章至700章清单”的金额
  337. 'GZQDHJ': function (tender) {
  338. return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, 'common');
  339. },
  340. //{专项暂定合计}
  341. // 第100章至700章清单行的暂估合价
  342. 'ZXZDHJ': function (tender) {
  343. return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, 'estimate');
  344. },
  345. //{100章以外清单合计}
  346. // 取清单固定清单[第100章至700章清单]的金额,但扣除清单100章下的金额。
  347. // 如果是固定清单[第100章至700章清单]下100章以外清单引用此基数,要排除自身(目前只允许100章的清单使用,所以暂时不需要此判断)
  348. 'YBZYWQDHJ': function (tender) {
  349. let oneToSeven = cbTools.findNodeByFlag(fixedFlag.ONE_SEVEN_BILLS);
  350. if (!oneToSeven) {
  351. return 0;
  352. }
  353. //100-700章固定节点的所有子节点
  354. let allChildren = [];
  355. function getChildren(nodes) {
  356. allChildren = allChildren.concat(nodes);
  357. for (let node of nodes) {
  358. if (node.children.length > 0) {
  359. getChildren(node.children);
  360. }
  361. }
  362. }
  363. getChildren(oneToSeven.children);
  364. //扣除的节点:100章的节点[100-200)
  365. let deductNodes = allChildren.filter(cbTools.withingOneHundred);
  366. //计算金额
  367. let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee';
  368. return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
  369. }
  370. };
  371. }
  372. function overwriteRationCalcBases() {
  373. if (typeof rationCalcBases == 'undefined') return;
  374. for (let key in rationCalcBases) delete rationCalcBases[key];
  375. rationCalcBases['人工费'] = function (node, isTender) {
  376. return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptMarketPrice, isTender);
  377. };
  378. rationCalcBases['材料费'] = function (node, isTender) {
  379. return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptMarketPrice, isTender);
  380. };
  381. rationCalcBases['施工机械使用费'] = function (node, isTender) {
  382. return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptMarketPrice, isTender);
  383. };
  384. rationCalcBases['设备购置费'] = function (node, isTender) {
  385. return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice, isTender);
  386. };
  387. rationCalcBases['定额人工费'] = function (node, isTender) {
  388. return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice, isTender);
  389. };
  390. rationCalcBases['定额材料费'] = function (node, isTender) {
  391. return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptBasePrice, isTender);
  392. };
  393. rationCalcBases['定额施工机械使用费'] = function (node, isTender) {
  394. return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptBasePrice, isTender);
  395. };
  396. rationCalcBases['定额商品砼费'] = function (node, isTender) {
  397. return calcTools.rationBaseFee(node, [gljType.COMMERCIAL_CONCRETE, gljType.COMMERCIAL_MORTAR], priceTypes.ptBasePrice, isTender);
  398. };
  399. rationCalcBases['定额设备购置费'] = function (node, isTender) {
  400. return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptBasePrice, isTender);
  401. };
  402. rationCalcBases['定额外购砼构件费'] = function (node, isTender) {
  403. return calcTools.rationBaseFee(node, [gljType.PURCHASE_COMPONENT], priceTypes.ptBasePrice, isTender);
  404. };
  405. rationCalcBases['定额绿化苗木费'] = function (node, isTender) {
  406. return calcTools.rationBaseFee(node, [gljType.GREEN_SEEDLING], priceTypes.ptBasePrice, isTender);
  407. };
  408. };
  409. (function overwriteFeeTypes() {
  410. if (typeof cpFeeTypes == 'undefined') return;
  411. cpFeeTypes = [
  412. { type: 'marketDirect', name: '直接费' },
  413. { type: 'marketLabour', name: '人工费' },
  414. { type: 'marketMaterial', name: '材料费' },
  415. { type: 'marketMachine', name: '施工机械使用费' },
  416. { type: 'marketEquipment', name: '设备购置费' },
  417. { type: 'labour', name: '定额人工费' },
  418. { type: 'material', name: '定额材料费' },
  419. { type: 'machine', name: '定额施工机械使用费' },
  420. { type: 'equipment', name: '定额设备购置费' },
  421. { type: 'direct', name: '定额直接费' },
  422. { type: 'measure', name: '措施费' },
  423. { type: 'manage', name: '企业管理费' },
  424. { type: 'force', name: '规费' },
  425. { type: 'profit', name: '利润' },
  426. { type: 'tax', name: '税金' },
  427. { type: 'common', name: '建安费' },
  428. { type: 'rationCommon', name: '定额建安费' }
  429. ];
  430. })();