zhejiang_2005.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. <<<<<<< HEAD
  38. if(typeof gljUtil !== 'undefined'){
  39. gljUtil.getCodeSortMath = getCodeSortMath
  40. =======
  41. // 清单基数,工程量清单的基数没有变化,只修改预算的
  42. if (typeof baseFigureMap !== 'undefined' && baseFigureMap.budget) {
  43. baseFigureMap.budget = {
  44. // 除清单固定类别是“建筑安装工程费”的以外部分可显示
  45. '公路养护工程费': {
  46. base: 'GLYHGCF',
  47. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  48. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  49. pick: false,
  50. },
  51. // 除清单固定类别是“建筑安装工程费”、“设备购置费”的以外部分可显示
  52. '设备购置费用': {
  53. base: 'SBGZFY',
  54. fixedFlag: fixedFlag.EQUIPMENT_ACQUISITION_FEE,
  55. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.EQUIPMENT_ACQUISITION_FEE],
  56. pick: false,
  57. },
  58. // 除清单固定类别是“建筑安装工程费”、“设备购置费”、“养护工程其他费用”的以外部分可显示
  59. '公路养护工程其他费用': {
  60. base: 'GLYHGCQTFY',
  61. fixedFlag: fixedFlag.MAINTENANCE_EXPENSES,
  62. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.EQUIPMENT_ACQUISITION_FEE, fixedFlag.MAINTENANCE_EXPENSES],
  63. pick: false,
  64. },
  65. // 只有清单固定类别是“养护工程其他费用”部分可显示
  66. '养护工程管理经费': {
  67. base: 'YHGCGLJF',
  68. fixedFlag: null,
  69. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  70. pick: true,
  71. },
  72. // 除清单固定类别是“建筑安装工程费”、“设备购置费”、“养护工程其他费用”、“一二三部分合计”的以外部分可显示
  73. '一二三部分合计': {
  74. base: 'YESBFHJ',
  75. fixedFlag: fixedFlag.ONE_TO_THREE_TOTAL,
  76. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.EQUIPMENT_ACQUISITION_FEE, fixedFlag.MAINTENANCE_EXPENSES, fixedFlag.ONE_TO_THREE_TOTAL],
  77. pick: false,
  78. },
  79. // 只有清单固定类别是“预备费”部分可显示
  80. '工程造价增涨预留费': {
  81. base: 'GCZJZZYLF',
  82. fixedFlag: null,
  83. filter: [fixedFlag.BUDGET_FEE],
  84. pick: true,
  85. }
  86. }
  87. }
  88. // 清单基数,工程量清单的基数没有变化,只修改预算的
  89. if (typeof baseFigureTemplate !== 'undefined' && baseFigureTemplate.budget) {
  90. baseFigureTemplate.budget = {
  91. // 公路养护工程费:取清单固定类别是“建筑安装工程费”的金额
  92. GLYHGCF(tender) {
  93. const feeField = 'common';
  94. const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
  95. return cbTools.getBillsFee(calcBase.fixedFlag.CONSTRUCTION_INSTALL_FEE, feeField, subFeeField);
  96. },
  97. // 设备购置费用:取清单固定类别是“设备购置费”的金额
  98. SBGZFY(tender) {
  99. const feeField = 'common';
  100. const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
  101. return cbTools.getBillsFee(calcBase.fixedFlag.EQUIPMENT_ACQUISITION_FEE, feeField, subFeeField);
  102. },
  103. // 公路养护工程其他费用:取清单固定类别是“养护工程其他费用”的金额。
  104. GLYHGCQTFY(tender) {
  105. const feeField = 'common';
  106. const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
  107. return cbTools.getBillsFee(calcBase.fixedFlag.MAINTENANCE_EXPENSES, feeField, subFeeField);
  108. },
  109. // 养护工程管理经费:取清单固定类别是“建筑安装工程费”金额为基数,采用累进办法计算
  110. YHGCGLJF(tender) {
  111. const baseFee = this['GLYHGCF'](tender);
  112. return cbTools.getProgressiveFee(baseFee, '养护工程管理费');
  113. },
  114. // 一二三部分合计:取清单固定类别是“一二三部分合计”的金额
  115. YESBFHJ(tender) {
  116. const feeField = 'common';
  117. const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
  118. return cbTools.getBillsFee(calcBase.fixedFlag.ONE_TO_THREE_TOTAL, feeField, subFeeField);
  119. },
  120. // 工程造价增涨预留费:以{公路养护工程费}为基数,= P * [(1+i)^(n-1) -1]
  121. // P:公路养护工程费总额(元)
  122. // i:年造价增长率(%)(项目属性已有字段)
  123. // N:增涨计费年限(项目属性已有字段)
  124. GCZJZZYLF(tender) {
  125. const baseFee = this['GLYHGCF'](tender);
  126. //年造价增涨
  127. const costGrowthRate = calcBase.project.property.costGrowthRate
  128. ? calcBase.project.property.costGrowthRate
  129. : 0;
  130. //增涨计费年限
  131. const growthPeriod = projectObj.project.property.growthPeriod
  132. ? calcBase.project.property.growthPeriod
  133. : 0;
  134. return (baseFee * (Math.pow(1 + costGrowthRate, growthPeriod - 1) - 1)).toDecimal(decimalObj.bills.totalPrice);
  135. }
  136. };
  137. >>>>>>> 80e8fe33e0df952bcebe60ae109f467c547f0ad5
  138. }
  139. if(typeof module !== 'undefined'){
  140. let _= require('lodash');
  141. module.exports = {
  142. sortRationGLJ: function(list){
  143. list = _.sortByAll(list, [function (item) {
  144. return getMainType(item.gljType?item.gljType:item.type);
  145. }, getCodeSortMath()]);
  146. return list;
  147. function getMainType(type) {
  148. let str = type + "";
  149. return parseInt(str.substr(0,1));
  150. }
  151. }
  152. };
  153. }
  154. function getCodeSortMath() {
  155. return function (item) {
  156. let arr = item.code.split('-');
  157. return parseInt(arr[0])
  158. }
  159. }