gansu_2021.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. if (typeof feeRateObject !== 'undefined') {
  2. feeRateObject.feeRateSpecialHandle = function (subRate, value) {
  3. let result = {};
  4. if (subRate.name == "综合里程(km)" && value && value < 3) {//综合里程3km以内按3km算
  5. result.valueKey = "3";
  6. result.value = scMathUtil.roundForObj(value, getDecimal("feeRate"));//设置显示的节点值
  7. }
  8. if (subRate.name == "工地转移(km)" && value && value < 50) {//工地转移50km以内按50km算
  9. result.valueKey = "50";
  10. result.value = scMathUtil.roundForObj(value, getDecimal("feeRate"));//设置显示的节点值
  11. }
  12. if (subRate.name == "施工进出场(km)" && value && value < 5) {//施工进出场5km以内按5km算
  13. result.valueKey = "5";
  14. result.value = scMathUtil.roundForObj(value, getDecimal("feeRate"));//设置显示的节点值
  15. }
  16. return result;
  17. }
  18. }
  19. // 清单基数
  20. const progression = ['养护单位(业主)管理费', '养护单位(业主)管理费(未单独设置)', '养护项目审计费', '养护工程监理费(路线工程)', '养护工程监理费(桥梁及隧道工程)', '设计文件审查费', '养护工程设计费(路线工程)', '养护工程设计费(独立桥梁、隧道工程)', '施工场地建设费'];
  21. const deficiency = {};
  22. if (typeof baseFigureMap !== 'undefined') {
  23. const { fixedFlag } = commonConstants;
  24. const budgetMap = {
  25. // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
  26. '建筑安装工程费': {
  27. base: 'JZAZGCF',
  28. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  29. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  30. pick: false,
  31. },
  32. // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示
  33. '建筑安装工程费(不含设备费)': {
  34. base: 'JZAZGCFBHSB',
  35. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  36. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  37. pick: false
  38. },
  39. // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示
  40. '定额建筑安装工程费': {
  41. base: 'DEJZAZGCF',
  42. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  43. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  44. pick: false
  45. },
  46. '设备费': {
  47. base: 'SBF',
  48. fixedFlag: fixedFlag.EQUIPMENT_ACQUISITION_FEE,
  49. filter: [fixedFlag.EQUIPMENT_ACQUISITION_FEE],
  50. pick: false
  51. },
  52. '定额设备费': {
  53. base: 'DESBF',
  54. fixedFlag: fixedFlag.EQUIPMENT_ACQUISITION_FEE,
  55. filter: [fixedFlag.EQUIPMENT_ACQUISITION_FEE],
  56. pick: false
  57. },
  58. // 显示:除清单固定类别是“养护工程费”的以外部分可显示
  59. '养护工程费': {
  60. base: 'YHGCF',
  61. fixedFlag: fixedFlag.MAINTENANCE_FEE,
  62. filter: [fixedFlag.MAINTENANCE_FEE],
  63. pick: false
  64. },
  65. // 显示:除清单固定类别是“养护工程费”的以外部分可显示。
  66. '定额养护工程费': {
  67. base: 'DEYHGCF',
  68. fixedFlag: fixedFlag.MAINTENANCE_FEE,
  69. filter: [fixedFlag.MAINTENANCE_FEE],
  70. pick: false
  71. },
  72. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  73. '养护单位(业主)管理费': {
  74. isProgressive: true,
  75. base: 'YHDWYZGLF',
  76. fixedFlag: null,
  77. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  78. pick: true,
  79. },
  80. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  81. '养护单位(业主)管理费(未单独设置)': {
  82. isProgressive: true,
  83. base: 'YHDWYZGLFWDDSZ',
  84. fixedFlag: null,
  85. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  86. pick: true,
  87. },
  88. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  89. '养护项目审计费': {
  90. isProgressive: true,
  91. base: 'YHXMSJF',
  92. fixedFlag: null,
  93. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  94. pick: true,
  95. },
  96. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  97. '养护工程监理费(路线工程)': {
  98. isProgressive: true,
  99. base: 'YHGCJLFLXGC',
  100. fixedFlag: null,
  101. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  102. pick: true,
  103. },
  104. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  105. '养护工程监理费(桥梁及隧道工程)': {
  106. isProgressive: true,
  107. base: 'YHGCJLFQLJSDGC',
  108. fixedFlag: null,
  109. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  110. pick: true,
  111. },
  112. // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
  113. '设计文件审查费': {
  114. isProgressive: true,
  115. base: 'SJWJSCF',
  116. fixedFlag: null,
  117. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  118. pick: true,
  119. },
  120. // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
  121. '养护工程设计费(路线工程)': {
  122. isProgressive: true,
  123. base: 'YHGCSJFLXGC',
  124. fixedFlag: null,
  125. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  126. pick: true,
  127. },
  128. // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
  129. '养护工程设计费(独立桥梁、隧道工程)': {
  130. isProgressive: true,
  131. base: 'YHGCSJFQLSDGC',
  132. fixedFlag: null,
  133. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  134. pick: true,
  135. },
  136. '施工场地建设费': {
  137. isProgressive: true,
  138. base: 'SGCDJSF',
  139. fixedFlag: null,
  140. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  141. pick: true,
  142. },
  143. // 显示:除清单固定类别是“一二三四部分合计”的以外部分可显示。
  144. '一二三四部分合计': {
  145. base: 'YESSBFHJ',
  146. fixedFlag: fixedFlag.ONE_TO_FOUR_TOTAL,
  147. filter: [fixedFlag.ONE_TO_FOUR_TOTAL],
  148. pick: false,
  149. },
  150. // 显示:仅“价差预备费”可显示
  151. '价差预备费': {
  152. base: 'JCYBF',
  153. fixedFlag: null,
  154. filter: [fixedFlag.SPREAD_BUDGET_FEE],
  155. pick: true,
  156. },
  157. };
  158. const boqMap = {
  159. //仅允许用于固定类别是“第100章至700章清单”以外的清单
  160. '专项暂定合计': {
  161. base: 'ZXZDHJ',
  162. fixedFlag: null,
  163. filter: [fixedFlag.ONE_SEVEN_BILLS],
  164. pick: false
  165. },
  166. /*
  167. * 清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
  168. * 因此{100章以外合计}不设置关联的清单固定行
  169. * */
  170. //仅允许用于固定类别为“100章清单”引用
  171. '100章以外清单合计': {
  172. base: 'YBZYHQDHJ',
  173. fixedFlag: null,
  174. filter: [fixedFlag.ONE_HUNDRED_BILLS],
  175. pick: true
  176. }
  177. };
  178. baseFigureMap.budget = budgetMap;
  179. baseFigureMap.boq = boqMap;
  180. }
  181. if (typeof baseFigureTemplate !== 'undefined') {
  182. const { fixedFlag } = commonConstants;
  183. baseFigureTemplate.budget = {
  184. // 建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的建安费。
  185. JZAZGCF(tender) {
  186. return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'common');
  187. },
  188. // 建筑安装工程费(不含设备费)算法:取清单固定类别是“建筑安装工程费”的金额 - {设备费}。
  189. JZAZGCFBHSB(tender) {
  190. return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.EQUIPMENT_ACQUISITION_FEE], tender, 'common');
  191. },
  192. // 定额建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的定额建安费(其中定额设备费按40%计算)。
  193. DEJZAZGCF(tender) {
  194. const feeField = 'rationCommon';
  195. const deductFlags = [fixedFlag.EQUIPMENT_ACQUISITION_FEE];
  196. //建安费扣除定额设备购置费
  197. const afterDeductFee = cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, deductFlags, tender, feeField, false);
  198. //定额设备购置费
  199. const equipmentAcFee = cbTools.getBaseFee(deductFlags[0], tender, feeField);
  200. return (afterDeductFee + equipmentAcFee * 0.4).toDecimal(decimalObj.bills.totalPrice);
  201. },
  202. // 设备费 算法:取清单固定类别是“设备购置”的建安费
  203. SBF(tender) {
  204. return cbTools.getBaseFee(fixedFlag.EQUIPMENT_ACQUISITION_FEE, tender, 'common');
  205. },
  206. // 设备费 算法:取清单固定类别是“设备购置”的定额建安费
  207. DESBF(tender) {
  208. return cbTools.getBaseFee(fixedFlag.EQUIPMENT_ACQUISITION_FEE, tender, 'rationCommon');
  209. },
  210. // 养护工程费 算法:取清单固定类别是“养护工程费”的金额。
  211. YHGCF(tender) {
  212. return cbTools.getBaseFee(fixedFlag.MAINTENANCE_FEE, tender, 'common');
  213. },
  214. // 定额养护工程费 算法:取清单固定类别是“养护工程费”的定额建安费(其中定额设备费按40%计算)。
  215. DEYHGCF(tender) {
  216. const feeField = 'rationCommon';
  217. const deductFlags = [fixedFlag.EQUIPMENT_ACQUISITION_FEE];
  218. //建安费扣除定额设备购置费
  219. const afterDeductFee = cbTools.getFeeWithDeduction(fixedFlag.MAINTENANCE_FEE, deductFlags, tender, feeField, false);
  220. //定额设备购置费
  221. const equipmentAcFee = cbTools.getBaseFee(deductFlags[0], tender, feeField);
  222. return (afterDeductFee + equipmentAcFee * 0.4).toDecimal(decimalObj.bills.totalPrice);
  223. },
  224. // 养护单位(业主)管理费 算法:以{定额建筑安装工程费}为基数,采用累进办法计算。。
  225. YHDWYZGLF(tender) {
  226. const baseFee = this['DEJZAZGCF'](tender);
  227. if (!tender) {
  228. calcBase.baseProgressiveFee = baseFee;
  229. }
  230. return calculateUtil.getProgressiveFee(baseFee, '养护单位(业主)管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  231. },
  232. // 养护单位(业主)管理费(未单独设置) 算法:以{定额建筑安装工程费}为基数,采用累进办法计算。
  233. YHDWYZGLFWDDSZ(tender) {
  234. const baseFee = this['DEJZAZGCF'](tender);
  235. if (!tender) {
  236. calcBase.baseProgressiveFee = baseFee;
  237. }
  238. return calculateUtil.getProgressiveFee(baseFee, '养护单位(业主)管理费(未单独设置)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  239. },
  240. // 养护项目审计费 算法:以{定额建筑安装工程费}为基数,采用累进办法计算。
  241. YHXMSJF(tender) {
  242. const baseFee = this['DEJZAZGCF'](tender);
  243. if (!tender) {
  244. calcBase.baseProgressiveFee = baseFee;
  245. }
  246. return calculateUtil.getProgressiveFee(baseFee, '养护项目审计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  247. },
  248. // 养护工程监理费(路线工程) 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
  249. YHGCJLFLXGC(tender) {
  250. const baseFee = this['DEJZAZGCF'](tender);
  251. if (!tender) {
  252. calcBase.baseProgressiveFee = baseFee;
  253. }
  254. return calculateUtil.getProgressiveFee(baseFee, '养护工程监理费(路线工程)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  255. },
  256. // 养护工程监理费(桥梁及隧道工程) 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
  257. YHGCJLFQLJSDGC(tender) {
  258. const baseFee = this['DEJZAZGCF'](tender);
  259. if (!tender) {
  260. calcBase.baseProgressiveFee = baseFee;
  261. }
  262. return calculateUtil.getProgressiveFee(baseFee, '养护工程监理费(桥梁及隧道工程)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  263. },
  264. // 设计文件审查费 算法:以{定额建筑安装工程费}为基数,采用累进办法计算。
  265. SJWJSCF(tender) {
  266. const baseFee = this['DEJZAZGCF'](tender);
  267. if (!tender) {
  268. calcBase.baseProgressiveFee = baseFee;
  269. }
  270. return calculateUtil.getProgressiveFee(baseFee, '设计文件审查费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  271. },
  272. // 养护工程设计费(路线工程) 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
  273. YHGCSJFLXGC(tender) {
  274. const baseFee = this['DEJZAZGCF'](tender);
  275. if (!tender) {
  276. calcBase.baseProgressiveFee = baseFee;
  277. }
  278. return calculateUtil.getProgressiveFee(baseFee, '养护工程设计费(路线工程)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  279. },
  280. // 养护工程设计费(独立桥梁、隧道工程) 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
  281. YHGCSJFQLSDGC(tender) {
  282. const baseFee = this['DEJZAZGCF'](tender);
  283. if (!tender) {
  284. calcBase.baseProgressiveFee = baseFee;
  285. }
  286. return calculateUtil.getProgressiveFee(baseFee, '养护工程设计费(独立桥梁、隧道工程)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  287. },
  288. // 施工场地建设费 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
  289. SGCDJSG(tender) {
  290. const baseFee = this['DEJZAZGCF'](tender);
  291. if (!tender) {
  292. calcBase.baseProgressiveFee = baseFee;
  293. }
  294. return calculateUtil.getProgressiveFee(baseFee, '施工场地建设费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  295. },
  296. // 一二三四部分合计 算法:取清单固定类别是“一二三四部分合计”的金额
  297. YESSBFHJ(tender) {
  298. return cbTools.getBaseFee(fixedFlag.ONE_TO_FOUR_TOTAL, tender, 'common');
  299. },
  300. /* 价差预备费 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
  301. 价差预备费 P * [(1+i)^(n-1) -1]
  302. P——建筑安装工程费总额(元);
  303. i——年工程造价增涨率(%);
  304. n——设计文件编制年至养护项目开工年+养护项目建设期限(年)。
  305. */
  306. JCYBF(tender) {
  307. //建筑安装工程费作为基数
  308. const installFee = this['JZAZGCF'](tender);
  309. //年造价增涨
  310. const costGrowthRate = calcBase.project.property.costGrowthRate
  311. ? calcBase.project.property.costGrowthRate
  312. : 0;
  313. //增涨计费年限
  314. const growthPeriod = projectObj.project.property.growthPeriod
  315. ? calcBase.project.property.growthPeriod
  316. : 0;
  317. //= P * [(1+i)^(n-1) -1]
  318. return (installFee * (Math.pow(1 + costGrowthRate, growthPeriod - 1) - 1)).toDecimal(decimalObj.bills.totalPrice);
  319. }
  320. };
  321. baseFigureTemplate.boq = {
  322. //{专项暂定合计}
  323. // 第100章至700章清单行的暂估合价
  324. 'ZXZDHJ': function (tender) {
  325. return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, 'estimate');
  326. },
  327. //{100章以外清单合计}
  328. // 取清单固定清单[第100章至700章清单]的金额,但扣除清单100章下的金额。
  329. // 如果是固定清单[第100章至700章清单]下100章以外清单引用此基数,要排除自身(目前只允许100章的清单使用,所以暂时不需要此判断)
  330. 'YBZYHQDHJ': function (tender) {
  331. let oneToSeven = cbTools.findNodeByFlag(fixedFlag.ONE_SEVEN_BILLS);
  332. if (!oneToSeven) {
  333. return 0;
  334. }
  335. //100-700章固定节点的所有子节点
  336. let allChildren = [];
  337. function getChildren(nodes) {
  338. allChildren = allChildren.concat(nodes);
  339. for (let node of nodes) {
  340. if (node.children.length > 0) {
  341. getChildren(node.children);
  342. }
  343. }
  344. }
  345. getChildren(oneToSeven.children);
  346. //扣除的节点:100章的节点[100-200)
  347. let deductNodes = allChildren.filter(cbTools.withingOneHundred);
  348. //计算金额
  349. let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee';
  350. return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
  351. }
  352. };
  353. }
  354. if (typeof module !== 'undefined') {
  355. module.exports = {
  356. progression,
  357. deficiency,
  358. };
  359. }
  360. // 不显示但可的基数
  361. const invisibleBases = ['设备费', '定额设备费'];