anhui_2019.js 21 KB

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