hunan_2014.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. // 清单基数
  2. const progression = ['养护工程管理经费(大修工程)', '养护工程管理经费(中修工程)', '养护工程监理费(路线工程)', '养护工程监理费(桥梁及隧道工程)', '养护工程设计文件审查费', '工程设计费(路线工程)', '工程设计费(桥梁、隧道工程)'];
  3. const deficiency = { '养护工程设计文件审查费': 4500 };
  4. const beyond = { '养护工程设计文件审查费': 600000 };
  5. if (typeof baseFigureMap !== 'undefined') {
  6. const { fixedFlag } = commonConstants;
  7. const budgetMap = {
  8. // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示
  9. '公路养护工程费': {
  10. base: 'GLYHGCF',
  11. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  12. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  13. pick: false,
  14. },
  15. // 除清单固定类别是“建筑安装工程费”、“设备购置费”的以外部分可显示
  16. '设备购置费用': {
  17. base: 'SBGZFY',
  18. fixedFlag: fixedFlag.EQUIPMENT_ACQUISITION_FEE,
  19. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.EQUIPMENT_ACQUISITION_FEE],
  20. pick: false,
  21. },
  22. // 除清单固定类别是“建筑安装工程费”、“设备购置费”、“养护工程其他费用”的以外部分可显示
  23. '养护工程其他费用': {
  24. base: 'YHGCQTFY',
  25. fixedFlag: fixedFlag.MAINTENANCE_EXPENSES,
  26. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.EQUIPMENT_ACQUISITION_FEE, fixedFlag.MAINTENANCE_EXPENSES],
  27. pick: false,
  28. },
  29. // 只有清单固定类别是“养护工程其他费用”部分可显示
  30. '养护工程管理经费(大修工程)': {
  31. isProgressive: true,
  32. base: 'YHGCGLJFDXGC',
  33. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  34. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  35. pick: true,
  36. },
  37. // 只有清单固定类别是“养护工程其他费用”部分可显示
  38. '养护工程管理经费(中修工程)': {
  39. isProgressive: true,
  40. base: 'YHGCGLJFZXGC',
  41. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  42. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  43. pick: true,
  44. },
  45. // 只有清单固定类别是“养护工程其他费用”部分可显示
  46. '养护工程监理费(路线工程)': {
  47. isProgressive: true,
  48. base: 'YHGCJLFLXGC',
  49. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  50. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  51. pick: true,
  52. },
  53. // 只有清单固定类别是“养护工程其他费用”部分可显示
  54. '养护工程监理费(桥梁及隧道工程)': {
  55. isProgressive: true,
  56. base: 'YHGCJLFQLJSDGC',
  57. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  58. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  59. pick: true,
  60. },
  61. // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
  62. '养护工程设计文件审查费': {
  63. isProgressive: true,
  64. base: 'YHGCSJWJSCF',
  65. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  66. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  67. pick: true,
  68. },
  69. // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
  70. '工程设计费(路线工程)': {
  71. isProgressive: true,
  72. base: 'GCSJFLXGC',
  73. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  74. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  75. pick: true,
  76. },
  77. // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
  78. '工程设计费(桥梁、隧道工程)': {
  79. isProgressive: true,
  80. base: 'GCSJFQLSDGC',
  81. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  82. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  83. pick: true,
  84. },
  85. // 显示:仅“价差预备费”可显示
  86. '价差预备费': {
  87. base: 'JCYBF',
  88. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  89. filter: [fixedFlag.SPREAD_BUDGET_FEE],
  90. pick: true,
  91. },
  92. };
  93. const boqMap = {
  94. //仅允许用于固定类别是“第100章至700章清单”以外的清单
  95. '各章清单合计': {
  96. base: 'GZQDHJ',
  97. fixedFlag: fixedFlag.ONE_SEVEN_BILLS,
  98. filter: [fixedFlag.ONE_SEVEN_BILLS],
  99. pick: false
  100. },
  101. //仅允许用于固定类别是“第100章至700章清单”以外的清单
  102. '专项暂定合计': {
  103. base: 'ZXZDHJ',
  104. fixedFlag: null,
  105. filter: [fixedFlag.ONE_SEVEN_BILLS],
  106. pick: false
  107. },
  108. /*
  109. * 清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
  110. * 因此{100章以外合计}不设置关联的清单固定行
  111. * */
  112. //仅允许用于固定类别为“100章清单”引用
  113. '100章以外清单合计': {
  114. base: 'YBZYHQDHJ',
  115. fixedFlag: null,
  116. filter: [fixedFlag.ONE_HUNDRED_BILLS],
  117. pick: true
  118. }
  119. };
  120. baseFigureMap.budget = budgetMap;
  121. baseFigureMap.boq = boqMap;
  122. }
  123. if (typeof baseFigureTemplate !== 'undefined') {
  124. const { fixedFlag } = commonConstants;
  125. baseFigureTemplate.budget = {
  126. // 公路养护工程费 算法:取清单固定类别是“建筑安装工程费”的金额。
  127. GLYHGCF(tender) {
  128. return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'common');
  129. },
  130. // 设备购置费用:取清单固定类别是“设备购置费”的金额
  131. SBGZFY(tender) {
  132. return cbTools.getBaseFee(calcBase.fixedFlag.EQUIPMENT_ACQUISITION_FEE, tender, 'common');
  133. },
  134. // 养护工程其他费用: 取清单固定类别是“养护工程其他费用”的金额。
  135. YHGCQTFY(tender) {
  136. return cbTools.getBaseFee(calcBase.fixedFlag.MAINTENANCE_EXPENSES, tender, 'common');
  137. },
  138. // 养护工程管理经费(大修工程): 按“公路养护工程费”为基数,以累进办法计算。
  139. YHGCGLJFDXGC(tender) {
  140. const baseFee = this['GLYHGCF'](tender);
  141. if (!tender) {
  142. calcBase.baseProgressiveFee = baseFee;
  143. }
  144. return calculateUtil.getProgressiveFee(baseFee, '养护工程管理经费(大修工程)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  145. },
  146. // 养护工程管理经费(中修工程): 按“公路养护工程费”为基数,以累进办法计算。
  147. YHGCGLJFZXGC(tender) {
  148. const baseFee = this['GLYHGCF'](tender);
  149. if (!tender) {
  150. calcBase.baseProgressiveFee = baseFee;
  151. }
  152. return calculateUtil.getProgressiveFee(baseFee, '养护工程管理经费(中修工程)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  153. },
  154. // 养护工程监理费(路线工程): 按“公路养护工程费”为基数,以累进办法计算。
  155. YHGCJLFLXGC(tender) {
  156. const baseFee = this['GLYHGCF'](tender);
  157. if (!tender) {
  158. calcBase.baseProgressiveFee = baseFee;
  159. }
  160. return calculateUtil.getProgressiveFee(baseFee, '养护工程监理费(路线工程)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  161. },
  162. // 养护工程监理费(桥梁及隧道工程): 按“公路养护工程费”为基数,以累进办法计算。
  163. YHGCJLFQLJSDGC(tender) {
  164. const baseFee = this['GLYHGCF'](tender);
  165. if (!tender) {
  166. calcBase.baseProgressiveFee = baseFee;
  167. }
  168. return calculateUtil.getProgressiveFee(baseFee, '养护工程监理费(桥梁及隧道工程)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  169. },
  170. // 养护工程设计文件审查费: 按“公路养护工程费”为基数,以累进办法计算。
  171. YHGCSJWJSCF(tender) {
  172. const baseFee = this['GLYHGCF'](tender);
  173. if (!tender) {
  174. calcBase.baseProgressiveFee = baseFee;
  175. }
  176. return calculateUtil.getProgressiveFee(baseFee, '养护工程设计文件审查费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  177. },
  178. // 工程设计费(路线工程): 按“公路养护工程费”为基数,以累进办法计算。
  179. GCSJFLXGC(tender) {
  180. const baseFee = this['GLYHGCF'](tender);
  181. if (!tender) {
  182. calcBase.baseProgressiveFee = baseFee;
  183. }
  184. return calculateUtil.getProgressiveFee(baseFee, '工程设计费(路线工程)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  185. },
  186. // 工程设计费(桥梁、隧道工程): 按“公路养护工程费”为基数,以累进办法计算。
  187. GCSJFQLSDGC(tender) {
  188. const baseFee = this['GLYHGCF'](tender);
  189. if (!tender) {
  190. calcBase.baseProgressiveFee = baseFee;
  191. }
  192. return calculateUtil.getProgressiveFee(baseFee, '工程设计费(桥梁、隧道工程)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  193. },
  194. /* 价差预备费 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
  195. 价差预备费 P * [(1+i)^(n-1) -1]
  196. P——建筑安装工程费总额(元);
  197. i——年工程造价增涨率(%);
  198. n——设计文件编制年至养护项目开工年+养护项目建设期限(年)。
  199. */
  200. JCYBF(tender) {
  201. //建筑安装工程费作为基数
  202. const installFee = this['YHGCF'](tender);
  203. //年造价增涨
  204. const costGrowthRate = calcBase.project.property.costGrowthRate
  205. ? calcBase.project.property.costGrowthRate
  206. : 0;
  207. //增涨计费年限
  208. const growthPeriod = projectObj.project.property.growthPeriod
  209. ? calcBase.project.property.growthPeriod
  210. : 0;
  211. //= P * [(1+i)^(n-1) -1]
  212. return (installFee * (Math.pow(1 + costGrowthRate, growthPeriod - 1) - 1)).toDecimal(decimalObj.bills.totalPrice);
  213. }
  214. };
  215. baseFigureTemplate.boq = {
  216. //{各章清单合计}
  217. // 取清单固定类别是“第100章至700章清单”的金额
  218. 'GZQDHJ': function (tender) {
  219. return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, 'common');
  220. },
  221. //{专项暂定合计}
  222. // 第100章至700章清单行的暂估合价
  223. 'ZXZDHJ': function (tender) {
  224. return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, 'estimate');
  225. },
  226. //{100章以外清单合计}
  227. // 取清单固定清单[第100章至700章清单]的金额,但扣除清单100章下的金额。
  228. // 如果是固定清单[第100章至700章清单]下100章以外清单引用此基数,要排除自身(目前只允许100章的清单使用,所以暂时不需要此判断)
  229. 'YBZYHQDHJ': function (tender) {
  230. let oneToSeven = cbTools.findNodeByFlag(fixedFlag.ONE_SEVEN_BILLS);
  231. if (!oneToSeven) {
  232. return 0;
  233. }
  234. //100-700章固定节点的所有子节点
  235. let allChildren = [];
  236. function getChildren(nodes) {
  237. allChildren = allChildren.concat(nodes);
  238. for (let node of nodes) {
  239. if (node.children.length > 0) {
  240. getChildren(node.children);
  241. }
  242. }
  243. }
  244. getChildren(oneToSeven.children);
  245. //扣除的节点:100章的节点[100-200)
  246. let deductNodes = allChildren.filter(cbTools.withingOneHundred);
  247. //计算金额
  248. let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee';
  249. return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
  250. }
  251. };
  252. }
  253. //湖南2014工地转移费率值修改特殊处理
  254. if (typeof feeRateObject !== "undefined") {
  255. feeRateObject.feeRateSpecialHandle = function (subRate, value) {
  256. let result = {};
  257. if (subRate.name == "工地转移(km)" && value && value < 50) {
  258. //工地转移50km以内按0km算
  259. result.valueKey = "0";
  260. result.value = scMathUtil.roundForObj(value, getDecimal("feeRate")); //设置显示的节点值
  261. }
  262. return result;
  263. };
  264. }
  265. if (typeof electrovalenceObj !== 'undefined') {
  266. electrovalenceObj.options = [
  267. { code: "870", name: "电网电", specs: "", unit: "kW·h", type: "201" },
  268. { code: "1791", name: "5kw以内柴油发电机组", specs: "5GF1", unit: "台班", type: "301" },
  269. { code: "1792", name: "15kw以内柴油发电机组", specs: "12GF1", unit: "台班", type: "301" },
  270. { code: "1793", name: "30kw以内柴油发电机组", specs: "30GFY-2", unit: "台班", type: "301" },
  271. { code: "1794", name: "50kw以内柴油发电机组", specs: "50GFY-2", unit: "台班", type: "301" },
  272. { code: "1795", name: "75kw以内柴油发电机组", specs: "75GFY-4", unit: "台班", type: "301" },
  273. { code: "1796", name: "100kw以内柴油发电机组", specs: "90GFZ", unit: "台班", type: "301" },
  274. { code: "1797", name: "120kw以内柴油发电机组", specs: "120GFY-4", unit: "台班", type: "301" },
  275. { code: "1798", name: "160kw以内柴油发电机组", specs: "160GF", unit: "台班", type: "301" },
  276. { code: "1799", name: "200kw以内柴油发电机组", specs: "200GF", unit: "台班", type: "301" },
  277. { code: "1800", name: "250kw以内柴油发电机组", specs: "250GF4-4", unit: "台班", type: "301" },
  278. { code: "1801", name: "320kw以内柴油发电机组", specs: "320GF-2", unit: "台班", type: "301" }
  279. ]
  280. }
  281. if (typeof gljUtil !== 'undefined') {
  282. gljUtil.getCodeSortMath = getCodeSortMath;
  283. gljUtil.getElecCoe = function () {
  284. return 0.24;
  285. }
  286. }
  287. if (typeof module !== 'undefined') {
  288. module.exports = {
  289. progression,
  290. deficiency,
  291. beyond,
  292. getDefalutAssistProductionFeeRate: function () {
  293. return 5
  294. }
  295. };
  296. }