| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- /**
- * Created by CSL on 2019/09/11. 浙江计算程序、基数 等覆盖。
- */
- let isZJ2005 = true;
- // 一般计税取不含税市场价、不含税定额价。简易计税取含税市场价、含税定额价。打开项目时,4个价格根据计税类型只载入其二,所以这里可不作区分。
- function overwriteRationCalcBases (taxType){
- if (typeof rationCalcBases == 'undefined') return;
- for (let key in rationCalcBases) delete rationCalcBases[key];
- // let isJY = taxType == '2';
- rationCalcBases['人工费'] = function (node, isTender) {
- return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptMarketPrice, isTender);
- };
- rationCalcBases['材料费'] = function (node, isTender) {
- return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptMarketPrice, isTender);
- };
- rationCalcBases['施工机械使用费'] = function (node, isTender) {
- return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptMarketPrice, isTender);
- };
- };
- (function overwriteFeeTypes() {
- if (typeof cpFeeTypes == 'undefined') return;
- cpFeeTypes = [
- {type: 'directWork', name: '直接工程费'},
- {type: 'direct', name: '直接费'},
- {type: 'marketLabour', name: '人工费'},
- {type: 'marketMaterial', name: '材料费'},
- {type: 'marketMachine', name: '施工机械使用费'},
- {type: 'otherDirect', name: '其他直接费'},
- {type: 'local', name: '现场经费'},
- {type: 'indirect', name: '间接费'},
- {type: 'profit', name: '计划利润'},
- {type: 'tax', name: '税金'},
- {type: 'composite', name: '年度经费综合费'},
- {type: 'common', name: '养护工程费'}
- ];
- })();
- // 清单基数,工程量清单的基数没有变化,只修改预算的
- if (typeof baseFigureMap !== 'undefined' && baseFigureMap.budget) {
- baseFigureMap.budget = {
- // 除清单固定类别是“建筑安装工程费”的以外部分可显示
- '公路养护工程费': {
- base: 'GLYHGCF',
- fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
- filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
- pick: false,
- },
- // 除清单固定类别是“建筑安装工程费”、“设备购置费”的以外部分可显示
- '设备购置费用': {
- base: 'SBGZFY',
- fixedFlag: fixedFlag.EQUIPMENT_ACQUISITION_FEE,
- filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.EQUIPMENT_ACQUISITION_FEE],
- pick: false,
- },
- // 除清单固定类别是“建筑安装工程费”、“设备购置费”、“养护工程其他费用”的以外部分可显示
- '公路养护工程其他费用': {
- base: 'GLYHGCQTFY',
- fixedFlag: fixedFlag.MAINTENANCE_EXPENSES,
- filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.EQUIPMENT_ACQUISITION_FEE, fixedFlag.MAINTENANCE_EXPENSES],
- pick: false,
- },
- // 只有清单固定类别是“养护工程其他费用”部分可显示
- '养护工程管理经费': {
- base: 'YHGCGLJF',
- fixedFlag: null,
- filter: [fixedFlag.MAINTENANCE_EXPENSES],
- pick: true,
- },
- // 除清单固定类别是“建筑安装工程费”、“设备购置费”、“养护工程其他费用”、“一二三部分合计”的以外部分可显示
- '一二三部分合计': {
- base: 'YESBFHJ',
- fixedFlag: fixedFlag.ONE_TO_THREE_TOTAL,
- filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.EQUIPMENT_ACQUISITION_FEE, fixedFlag.MAINTENANCE_EXPENSES, fixedFlag.ONE_TO_THREE_TOTAL],
- pick: false,
- },
- // 只有清单固定类别是“预备费”部分可显示
- '工程造价增涨预留费': {
- base: 'GCZJZZYLF',
- fixedFlag: null,
- filter: [fixedFlag.BUDGET_FEE],
- pick: true,
- }
- }
- }
- // 清单基数,工程量清单的基数没有变化,只修改预算的
- if (typeof baseFigureTemplate !== 'undefined' && baseFigureTemplate.budget) {
- baseFigureTemplate.budget = {
- // 公路养护工程费:取清单固定类别是“建筑安装工程费”的金额
- GLYHGCF(tender) {
- const feeField = 'common';
- const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
- return cbTools.getBillsFee(calcBase.fixedFlag.CONSTRUCTION_INSTALL_FEE, feeField, subFeeField);
- },
- // 设备购置费用:取清单固定类别是“设备购置费”的金额
- SBGZFY(tender) {
- const feeField = 'common';
- const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
- return cbTools.getBillsFee(calcBase.fixedFlag.EQUIPMENT_ACQUISITION_FEE, feeField, subFeeField);
- },
- // 公路养护工程其他费用:取清单固定类别是“养护工程其他费用”的金额。
- GLYHGCQTFY(tender) {
- const feeField = 'common';
- const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
- return cbTools.getBillsFee(calcBase.fixedFlag.MAINTENANCE_EXPENSES, feeField, subFeeField);
- },
- // 养护工程管理经费:取清单固定类别是“建筑安装工程费”金额为基数,采用累进办法计算
- YHGCGLJF(tender) {
- const baseFee = this['GLYHGCF'](tender);
- return cbTools.getProgressiveFee(baseFee, '养护工程管理费');
- },
- // 一二三部分合计:取清单固定类别是“一二三部分合计”的金额
- YESBFHJ(tender) {
- const feeField = 'common';
- const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
- return cbTools.getBillsFee(calcBase.fixedFlag.ONE_TO_THREE_TOTAL, feeField, subFeeField);
- },
- // 工程造价增涨预留费:以{公路养护工程费}为基数,= P * [(1+i)^(n-1) -1]
- // P:公路养护工程费总额(元)
- // i:年造价增长率(%)(项目属性已有字段)
- // N:增涨计费年限(项目属性已有字段)
- GCZJZZYLF(tender) {
- const baseFee = this['GLYHGCF'](tender);
- //年造价增涨
- const costGrowthRate = calcBase.project.property.costGrowthRate
- ? calcBase.project.property.costGrowthRate
- : 0;
- //增涨计费年限
- const growthPeriod = projectObj.project.property.growthPeriod
- ? calcBase.project.property.growthPeriod
- : 0;
- return (baseFee * (Math.pow(1 + costGrowthRate, growthPeriod - 1) - 1)).toDecimal(decimalObj.bills.totalPrice);
- }
- };
- }
- if(typeof gljUtil !== 'undefined'){
- gljUtil.getCodeSortMath = getCodeSortMath
- }
- if(typeof module !== 'undefined'){
- let _= require('lodash');
- module.exports = {
- sortRationGLJ: function(list){
- list = _.sortByAll(list, [function (item) {
- return getMainType(item.gljType?item.gljType:item.type);
- }, getCodeSortMath()]);
- return list;
- function getMainType(type) {
- let str = type + "";
- return parseInt(str.substr(0,1));
- }
- }
- };
- }
- function getCodeSortMath() {
- return function (item) {
- let arr = item.code.split('-');
- return parseInt(arr[0])
- }
- }
|