zhejiang_2005.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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 gljOprObj !== 'undefined') {
  135. // 添加、替换工料机界面工料机排序
  136. gljOprObj.sortSelectViewGLJ = function (data) {
  137. // 工料机编码:按“-”前的数值排序
  138. const reg = /[^-]+/;
  139. data.sort((a, b) => {
  140. const orgCodeA = a.code;
  141. const orgCodeB = b.code;
  142. const regCodeA = orgCodeA.match(reg);
  143. const regCodeB = orgCodeB.match(reg);
  144. const compareCodeA = regCodeA
  145. ? +regCodeA[0]
  146. ? +regCodeA[0]
  147. : regCodeA[0]
  148. : orgCodeA;
  149. const compareCodeB = regCodeB
  150. ? +regCodeB[0]
  151. ? +regCodeB[0]
  152. : regCodeB
  153. : orgCodeB;
  154. return isNaN(compareCodeA) && isNaN(compareCodeB)
  155. ? compareCodeA.localeCompare(compareCodeB)
  156. : compareCodeA - compareCodeB;
  157. });
  158. // 工料机类型排序:人工、机上人工、混凝土、砂浆、配合比、普通材料、商品混凝土、商品砂浆、外购砼构件、绿化苗木、机械台班、机械组成物、设备。
  159. const TypeMap = {
  160. 1: 1,
  161. 303: 2,
  162. 202: 3,
  163. 203: 4,
  164. 204: 5,
  165. 201: 6,
  166. 205: 7,
  167. 206: 8,
  168. 208: 9,
  169. 209: 10,
  170. 301: 11,
  171. 302: 12,
  172. 5: 13,
  173. };
  174. data.sort((a, b) => {
  175. const typeA = TypeMap[a.gljType];
  176. const typeB = TypeMap[b.gljType];
  177. return typeA - typeB;
  178. });
  179. }
  180. }
  181. if(typeof gljUtil !== 'undefined'){
  182. gljUtil.getCodeSortMath = getCodeSortMath;
  183. gljUtil.getElecCoe = function () {
  184. return 0.24;
  185. }
  186. gljUtil.getElecCode = function () {
  187. return "267";
  188. }
  189. }
  190. if(typeof electrovalenceObj !== 'undefined'){
  191. electrovalenceObj.options = [
  192. {code:"270",name:"电网电",specs:"",unit:"kW·h",type:"201"},
  193. {code:"905",name:"5kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
  194. {code:"906",name:"15kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
  195. {code:"907",name:"30kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
  196. {code:"908",name:"50kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
  197. {code:"909",name:"75kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
  198. {code:"910",name:"100kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
  199. {code:"911",name:"120kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
  200. {code:"912",name:"160kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
  201. {code:"913",name:"200kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
  202. {code:"914",name:"250kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
  203. {code:"915",name:"320kW以内柴油发电机组",specs:"",unit:"台班",type:"301"}
  204. ]
  205. }
  206. if(typeof materialCalcObj !== 'undefined'){
  207. materialCalcObj.getAssistProductionLabel = function () {
  208. return "辅助生产现场经费费率(%)";
  209. }
  210. }
  211. if(typeof projectObj !== 'undefined'){
  212. projectObj.isInsertEquipmentVisable = function(selected){
  213. return false; //浙江不管是预算或者工程量清单,都是隐藏
  214. }
  215. }
  216. if(typeof module !== 'undefined'){
  217. let _= require('lodash');
  218. module.exports = {
  219. sortRationGLJ: function(list){
  220. list = _.sortByAll(list, [function (item) {
  221. return getMainType(item.gljType?item.gljType:item.type);
  222. }, getCodeSortMath()]);
  223. return list;
  224. function getMainType(type) {
  225. let str = type + "";
  226. return parseInt(str.substr(0,1));
  227. }
  228. },
  229. getDefalutAssistProductionFeeRate:function () {
  230. return 15
  231. }
  232. };
  233. }
  234. function getCodeSortMath() {
  235. return function (item) {
  236. let arr = item.code.split('-');
  237. return parseInt(arr[0])
  238. }
  239. }