sichuan_2013.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. let isSC2013 = true;
  2. function overwriteRationCalcBases(taxType) {
  3. if (typeof rationCalcBases == 'undefined') return;
  4. for (let key in rationCalcBases) delete rationCalcBases[key];
  5. rationCalcBases['人工费'] = function (node, isTender) {
  6. return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptMarketPrice, isTender);
  7. };
  8. rationCalcBases['材料费'] = function (node, isTender) {
  9. return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptMarketPrice, isTender);
  10. };
  11. rationCalcBases['施工机械使用费'] = function (node, isTender) {
  12. return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptMarketPrice, isTender);
  13. };
  14. rationCalcBases['商品砼费'] = function (node, isTender) {
  15. return calcTools.rationBaseFee(node, [gljType.COMMERCIAL_CONCRETE, gljType.COMMERCIAL_MORTAR], priceTypes.ptMarketPrice, isTender);
  16. };
  17. rationCalcBases['外购砼构件费'] = function (node, isTender) {
  18. return calcTools.rationBaseFee(node, [gljType.PURCHASE_COMPONENT], priceTypes.ptMarketPrice, isTender);
  19. };
  20. };
  21. (function overwriteFeeTypes() {
  22. if (typeof cpFeeTypes == 'undefined') return;
  23. cpFeeTypes = [
  24. { type: 'marketDirect', name: '直接费' },
  25. { type: 'marketDirectWork', name: '直接工程费' },
  26. { type: 'marketLabour', name: '人工费' },
  27. { type: 'marketMaterial', name: '材料费' },
  28. { type: 'marketMachine', name: '施工机械使用费' },
  29. { type: 'otherFee', name: '其他工程费' },
  30. { type: 'otherFee1', name: '其他工程费I' },
  31. { type: 'otherFee2', name: '其他工程费II' },
  32. { type: "indirect", name: '间接费' },
  33. { type: 'manage', name: '企业管理费' },
  34. { type: 'force', name: '规费' },
  35. { type: 'profit', name: '利润' },
  36. { type: 'tax', name: '税金' },
  37. { type: 'common', name: '建安费' }
  38. ];
  39. })();
  40. if (typeof gljUtil !== "undefined") {
  41. gljUtil.getAssUsedPrice = function(g){//四川辅助生产人工费取市场价
  42. return g.marketPrice;
  43. }
  44. gljUtil.getElecCode = function () {
  45. return "865";
  46. }
  47. }
  48. // 清单基数
  49. const progression = [
  50. '养护单位管理费',
  51. ];
  52. const deficiency = {
  53. };
  54. if (typeof baseFigureMap !== 'undefined') {
  55. const { fixedFlag } = commonConstants;
  56. const budgetMap = {
  57. // 显示:除清单固定类别是“公路养护工程费”的以外部分可显示
  58. '公路养护工程费': {
  59. base: 'GLYHGCF',
  60. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  61. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  62. pick: false,
  63. },
  64. // 显示:除清单固定类别是“公路养护工程费”的以外部分可显示
  65. '定额公路养护工程费': {
  66. base: 'DEGLYHGCF',
  67. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  68. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  69. pick: false,
  70. },
  71. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  72. '养护单位管理费': {
  73. isProgressive: true,
  74. base: 'YHDWGLF',
  75. fixedFlag: null,
  76. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  77. pick: true,
  78. },
  79. // 显示:除清单固定类别是“公路养护工程费”、“设备购置费用”、“养护公路工程其他费用”、“一二三部分合计”的以外部分可显示
  80. '一、二、三部分合计': {
  81. base: 'YESBFHJ',
  82. fixedFlag: fixedFlag.ONE_TO_THREE_TOTAL,
  83. filter: [ fixedFlag.ONE_TO_THREE_TOTAL],
  84. pick: false,
  85. },
  86. // 显示:仅“价差预备费”可显示
  87. '价差预备费': {
  88. base: 'JCYBF',
  89. fixedFlag: null,
  90. filter: [fixedFlag.SPREAD_BUDGET_FEE],
  91. pick: true,
  92. },
  93. };
  94. const boqMap = {
  95. //四川2013读的是 建筑安装工程费行的值
  96. '各章清单合计': {
  97. base: 'GZQDHJ',
  98. fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
  99. filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
  100. pick: false
  101. },
  102. // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
  103. '养护单位管理费': {
  104. isProgressive: true,
  105. base: 'YHDWGLF',
  106. fixedFlag: null,
  107. filter: [fixedFlag.MAINTENANCE_EXPENSES],
  108. pick: true,
  109. },
  110. //仅允许用于固定类别是“第100章至700章清单”以外的清单
  111. /* '专项暂定合计': {
  112. base: 'ZXZDHJ',
  113. fixedFlag: null,
  114. filter: [fixedFlag.ONE_SEVEN_BILLS],
  115. pick: false
  116. }, */
  117. /*
  118. * 清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
  119. * 因此{100章以外合计}不设置关联的清单固定行
  120. * */
  121. //仅允许用于固定类别为“100章清单”引用
  122. '100章以外清单合计': {
  123. base: 'YBZYHQDHJ',
  124. fixedFlag: null,
  125. filter: [fixedFlag.ONE_HUNDRED_BILLS],
  126. pick: true
  127. }
  128. };
  129. baseFigureMap.budget = budgetMap;
  130. baseFigureMap.boq = boqMap;
  131. }
  132. if (typeof baseFigureTemplate !== 'undefined') {
  133. const { fixedFlag } = commonConstants;
  134. baseFigureTemplate.budget = {
  135. // 公路养护工程费 算法:取清单固定类别是“建筑安装工程费”的金额。
  136. GLYHGCF(tender) {
  137. return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'common');
  138. },
  139. // 定额公路养护工程费 算法:取清单固定类别是“建筑安装工程费”的金额。
  140. DEGLYHGCF(tender) {
  141. return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'rationCommon');
  142. },
  143. // 养护单位管理费 算法:以{公路养护工程费总额}为基数,采用累进办法计算
  144. YHDWGLF(tender) {
  145. const baseFee = this['GLYHGCF'](tender);
  146. if (!tender) {
  147. calcBase.baseProgressiveFee = baseFee;
  148. }
  149. return calculateUtil.getProgressiveFee(baseFee, '养护单位管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  150. },
  151. // 二三部分合计 算法:取清单固定类别是“一二三部分合计”的金额
  152. YESBFHJ(tender) {
  153. return cbTools.getBaseFee(fixedFlag.ONE_TO_THREE_TOTAL, tender, 'common');
  154. },
  155. // 基本预备费 算法:以第一、二、三部分费用之和为基数按3%计取
  156. JBYBF(tender) {
  157. const baseFee = this['YESBFHJ'](tender);
  158. return (baseFee * 0.03).toDecimal(decimalObj.bills.totalPrice);
  159. },
  160. /* 价差预备费 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
  161. 价差预备费 P * [(1+i)^(n-1) -1]
  162. P——建筑安装工程费总额(元);
  163. i——年工程造价增涨率(%);
  164. n——设计文件编制年至养护项目开工年+养护项目建设期限(年)。
  165. */
  166. JCYBF(tender) {
  167. //建筑安装工程费作为基数
  168. const installFee = this['JZAZGCF'](tender);
  169. //年造价增涨
  170. const costGrowthRate = calcBase.project.property.costGrowthRate
  171. ? calcBase.project.property.costGrowthRate
  172. : 0;
  173. //增涨计费年限
  174. const growthPeriod = projectObj.project.property.growthPeriod
  175. ? calcBase.project.property.growthPeriod
  176. : 0;
  177. //= P * [(1+i)^(n-1) -1]
  178. return (installFee * (Math.pow(1 + costGrowthRate, growthPeriod - 1) - 1)).toDecimal(decimalObj.bills.totalPrice);
  179. }
  180. };
  181. baseFigureTemplate.boq = {
  182. // 公路养护工程费 算法:取清单固定类别是“建筑安装工程费”的金额。
  183. 'GLYHGCF':function(tender) {
  184. return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'common');
  185. },
  186. //{各章清单合计}
  187. // 四川2013读的是 建筑安装工程费行的值
  188. 'GZQDHJ': function (tender) {
  189. return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'common');
  190. },
  191. // 养护单位管理费 算法:以{公路养护工程费总额}为基数,采用累进办法计算
  192. 'YHDWGLF':function(tender) {
  193. const baseFee = this['GLYHGCF'](tender);
  194. if (!tender) {
  195. calcBase.baseProgressiveFee = baseFee;
  196. }
  197. return calculateUtil.getProgressiveFee(baseFee, '养护单位管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
  198. },
  199. //{专项暂定合计}
  200. // 第100章至700章清单行的暂估合价
  201. 'ZXZDHJ': function (tender) {
  202. return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, 'estimate');
  203. },
  204. //{100章以外清单合计}
  205. // 取清单固定清单[第100章至700章清单]的金额,但扣除清单100章下的金额。
  206. // 如果是固定清单[第100章至700章清单]下100章以外清单引用此基数,要排除自身(目前只允许100章的清单使用,所以暂时不需要此判断)
  207. 'YBZYHQDHJ': function (tender) {
  208. let oneToSeven = cbTools.findNodeByFlag(fixedFlag.ONE_SEVEN_BILLS);
  209. if (!oneToSeven) {
  210. return 0;
  211. }
  212. //100-700章固定节点的所有子节点
  213. let allChildren = [];
  214. function getChildren(nodes) {
  215. allChildren = allChildren.concat(nodes);
  216. for (let node of nodes) {
  217. if (node.children.length > 0) {
  218. getChildren(node.children);
  219. }
  220. }
  221. }
  222. getChildren(oneToSeven.children);
  223. //扣除的节点:100章的节点[100-200)
  224. let deductNodes = allChildren.filter(cbTools.withingOneHundred);
  225. //计算金额
  226. let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee';
  227. return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
  228. }
  229. };
  230. }
  231. if (typeof feeRateObject !== 'undefined') {
  232. feeRateObject.feeRateSpecialHandle = function (subRate, value) {
  233. let result = {};
  234. if (subRate.name == "工地转移(km)" && value && value < 50) {//工地转移50km以内按不计算
  235. result.valueKey = "不计";
  236. result.value = scMathUtil.roundForObj(value, getDecimal("feeRate"));//设置显示的节点值
  237. }
  238. return result;
  239. }
  240. }
  241. if (typeof module !== 'undefined') {
  242. const defaultDecimal = {
  243. bills: {unitPrice: 2, totalPrice: 0},
  244. ration: {quantity: 3, unitPrice: 2, totalPrice: 0},
  245. glj: {quantity: 3, unitPriceHasMix: 2, unitPrice: 2},
  246. feeRate: 2,
  247. quantity_detail: 4,
  248. material:5,//三材系数
  249. process: 6,
  250. marketPriceProcess: 2,
  251. temProcess:6
  252. };
  253. module.exports = {
  254. getDefalutAssistProductionFeeRate: function () {
  255. return 5
  256. },
  257. progression,
  258. deficiency,
  259. defaultDecimal
  260. };
  261. }