zhejiang_2005.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /**
  2. * Created by CSL on 2019/09/11. 浙江计算程序、基数 等覆盖。
  3. */
  4. let isZJ2005 = true;
  5. // 一般计税取不含税市场价、不含税定额价。简易计税取含税市场价、含税定额价。打开项目时,4个价格根据计税类型只载入其二,所以这里可不作区分。
  6. function overwriteRationCalcBases (taxType){
  7. if (typeof rationCalcBases == 'undefined') return;
  8. for (let key in rationCalcBases) delete rationCalcBases[key];
  9. // let isJY = taxType == '2';
  10. rationCalcBases['人工费'] = function (node, isTender) {
  11. return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptMarketPrice, isTender);
  12. };
  13. rationCalcBases['材料费'] = function (node, isTender) {
  14. return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptMarketPrice, isTender);
  15. };
  16. rationCalcBases['施工机械使用费'] = function (node, isTender) {
  17. return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptMarketPrice, isTender);
  18. };
  19. };
  20. (function overwriteFeeTypes() {
  21. if (typeof cpFeeTypes == 'undefined') return;
  22. cpFeeTypes = [
  23. {type: 'directWork', name: '直接工程费'},
  24. {type: 'direct', name: '直接费'},
  25. {type: 'marketLabour', name: '人工费'},
  26. {type: 'marketMaterial', name: '材料费'},
  27. {type: 'marketMachine', name: '施工机械使用费'},
  28. {type: 'otherDirect', name: '其他直接费'},
  29. {type: 'local', name: '现场经费'},
  30. {type: 'indirect', name: '间接费'},
  31. {type: 'profit', name: '计划利润'},
  32. {type: 'tax', name: '税金'},
  33. {type: 'composite', name: '年度经费综合费'},
  34. {type: 'common', name: '养护工程费'}
  35. ];
  36. })();
  37. // 清单基数,工程量清单的基数没有变化,只修改预算的
  38. if (typeof baseFigureMap !== 'undefined' && baseFigureMap.budget) {
  39. baseFigureMap.budget = {
  40. // 除清单固定类别是“建筑安装工程费”的以外部分可显示
  41. '公路养护工程费': {
  42. base: 'GLYHGCF',
  43. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  44. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  45. pick: false,
  46. },
  47. // 除清单固定类别是“建筑安装工程费”、“设备购置费”的以外部分可显示
  48. '设备购置费用': {
  49. base: 'SBGZFY',
  50. fixedFlag: fixedFlag.EQUIPMENT_ACQUISITION_FEE,
  51. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.EQUIPMENT_ACQUISITION_FEE],
  52. pick: false,
  53. },
  54. // 除清单固定类别是“建筑安装工程费”、“设备购置费”、“养护工程其他费用”的以外部分可显示
  55. '公路养护工程其他费用': {
  56. base: 'GLYHGCQTFY',
  57. fixedFlag: fixedFlag.MAINTENANCE_EXPENSES,
  58. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.EQUIPMENT_ACQUISITION_FEE, fixedFlag.MAINTENANCE_EXPENSES],
  59. pick: false,
  60. },
  61. // 只有清单固定类别是“养护工程其他费用”部分可显示
  62. '养护工程管理经费': {
  63. base: 'YHGCGLJF',
  64. fixedFlag: null,
  65. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  66. pick: true,
  67. },
  68. // 除清单固定类别是“建筑安装工程费”、“设备购置费”、“养护工程其他费用”、“一二三部分合计”的以外部分可显示
  69. '一二三部分合计': {
  70. base: 'YESBFHJ',
  71. fixedFlag: fixedFlag.ONE_TO_THREE_TOTAL,
  72. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.EQUIPMENT_ACQUISITION_FEE, fixedFlag.MAINTENANCE_EXPENSES, fixedFlag.ONE_TO_THREE_TOTAL],
  73. pick: false,
  74. },
  75. // 只有清单固定类别是“预备费”部分可显示
  76. '工程造价增涨预留费': {
  77. base: 'GCZJZZYLF',
  78. fixedFlag: null,
  79. filter: [fixedFlag.BUDGET_FEE],
  80. pick: true,
  81. }
  82. }
  83. }
  84. // 清单基数,工程量清单的基数没有变化,只修改预算的
  85. if (typeof baseFigureTemplate !== 'undefined' && baseFigureTemplate.budget) {
  86. baseFigureTemplate.budget = {
  87. // 公路养护工程费:取清单固定类别是“建筑安装工程费”的金额
  88. GLYHGCF(tender) {
  89. const feeField = 'common';
  90. const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
  91. return cbTools.getBillsFee(calcBase.fixedFlag.CONSTRUCTION_INSTALL_FEE, feeField, subFeeField);
  92. },
  93. // 设备购置费用:取清单固定类别是“设备购置费”的金额
  94. SBGZFY(tender) {
  95. const feeField = 'common';
  96. const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
  97. return cbTools.getBillsFee(calcBase.fixedFlag.EQUIPMENT_ACQUISITION_FEE, feeField, subFeeField);
  98. },
  99. // 公路养护工程其他费用:取清单固定类别是“养护工程其他费用”的金额。
  100. GLYHGCQTFY(tender) {
  101. const feeField = 'common';
  102. const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
  103. return cbTools.getBillsFee(calcBase.fixedFlag.MAINTENANCE_EXPENSES, feeField, subFeeField);
  104. },
  105. // 养护工程管理经费:取清单固定类别是“建筑安装工程费”金额为基数,采用累进办法计算
  106. YHGCGLJF(tender) {
  107. const baseFee = this['GLYHGCF'](tender);
  108. return cbTools.getProgressiveFee(baseFee, '养护工程管理费');
  109. },
  110. // 一二三部分合计:取清单固定类别是“一二三部分合计”的金额
  111. YESBFHJ(tender) {
  112. const feeField = 'common';
  113. const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
  114. return cbTools.getBillsFee(calcBase.fixedFlag.ONE_TO_THREE_TOTAL, feeField, subFeeField);
  115. },
  116. // 工程造价增涨预留费:以{公路养护工程费}为基数,= P * [(1+i)^(n-1) -1]
  117. // P:公路养护工程费总额(元)
  118. // i:年造价增长率(%)(项目属性已有字段)
  119. // N:增涨计费年限(项目属性已有字段)
  120. GCZJZZYLF(tender) {
  121. const baseFee = this['GLYHGCF'](tender);
  122. //年造价增涨
  123. const costGrowthRate = calcBase.project.property.costGrowthRate
  124. ? calcBase.project.property.costGrowthRate
  125. : 0;
  126. //增涨计费年限
  127. const growthPeriod = projectObj.project.property.growthPeriod
  128. ? calcBase.project.property.growthPeriod
  129. : 0;
  130. return (baseFee * (Math.pow(1 + costGrowthRate, growthPeriod - 1) - 1)).toDecimal(decimalObj.bills.totalPrice);
  131. }
  132. };
  133. }
  134. if(typeof gljUtil !== 'undefined'){
  135. gljUtil.getCodeSortMath = getCodeSortMath
  136. }
  137. if(typeof module !== 'undefined'){
  138. let _= require('lodash');
  139. module.exports = {
  140. sortRationGLJ: function(list){
  141. list = _.sortByAll(list, [function (item) {
  142. return getMainType(item.gljType?item.gljType:item.type);
  143. }, getCodeSortMath()]);
  144. return list;
  145. function getMainType(type) {
  146. let str = type + "";
  147. return parseInt(str.substr(0,1));
  148. }
  149. }
  150. };
  151. }
  152. function getCodeSortMath() {
  153. return function (item) {
  154. let arr = item.code.split('-');
  155. return parseInt(arr[0])
  156. }
  157. }