|
|
@@ -176,7 +176,21 @@ let cbTools = {
|
|
|
}
|
|
|
},
|
|
|
getFigure: function (node) {
|
|
|
- return calcBase.baseFigures;
|
|
|
+ /*
|
|
|
+ * {专项暂定合计}需要特殊处理,专项暂定有值的节点不可用此基数,否则会引起循环计算
|
|
|
+ * */
|
|
|
+ if (node.data.specialProvisional) {
|
|
|
+ let filterMap = {};
|
|
|
+ for (let baseName in calcBase.baseFigures) {
|
|
|
+ if (baseName !== '专项暂定合计') {
|
|
|
+ filterMap[baseName] = calcBase.baseFigures[baseName];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return filterMap;
|
|
|
+ } else {
|
|
|
+ return calcBase.baseFigures;
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
getBaseBill: function (node) {
|
|
|
let calcBase = projectObj.project.calcBase;
|
|
|
@@ -353,7 +367,7 @@ let cbTools = {
|
|
|
//@param {Number}baseFee(相关基数金额) {String}name(使用累进计算的基数名称)
|
|
|
//@return {Number}
|
|
|
getProgressiveFee: function (baseFee, name) {
|
|
|
- let progressiveData = projectInfoObj.projectInfo.property.progressiveInterval;
|
|
|
+ let progressiveData = calcBase.project.property.progressiveInterval;
|
|
|
if (!progressiveData) {
|
|
|
throw '该项目不存在累进区间数据';
|
|
|
}
|
|
|
@@ -362,6 +376,7 @@ let cbTools = {
|
|
|
return cbAnalyzer.standar(data.name) === cbAnalyzer.standar(name);
|
|
|
});
|
|
|
if (!matchData) {
|
|
|
+ //return 0;
|
|
|
throw `计算基数{${name}}不存在累进区间数据`;
|
|
|
}
|
|
|
let progression = matchData.progression;
|
|
|
@@ -417,140 +432,222 @@ let cbTools = {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+
|
|
|
let baseFigureTemplate = {
|
|
|
- //{定额建筑安装工程费(不含定额设备购置费及专项费用)}
|
|
|
- //取清单固定类别是“建筑安装工程”的定额建安费,但要扣除清单固定类别是“设备购置费”、及“专项费用”的定额建安费
|
|
|
- 'DEJZAZGCFBHSBZX': function (tender) {
|
|
|
- let fullFeeField = tender ? 'rationCommon.tenderTotalFee' : 'rationCommon.totalFee',
|
|
|
- deductFlags = [fixedFlag.EQUIPMENT_ACQUISITION_FEE, fixedFlag.SPECIAL_COST];
|
|
|
- return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, deductFlags, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
|
|
|
- },
|
|
|
- //{定额建筑安装工程(其中定额设备购置费按 40%计)} (定额建筑安装工程设备四十)
|
|
|
- //扣除设备购置费,再加上设备购置费的40%,扣除汇总算法不四舍五入,相当于汇总当中定额设备购置费就按照了40%计
|
|
|
- 'DEJZAZGCSBSS': function (tender) {
|
|
|
- let feeField = 'rationCommon',
|
|
|
- subFeeField = tender ? 'tenderTotalFee' : 'totalFee',
|
|
|
- deductFlags = [fixedFlag.EQUIPMENT_ACQUISITION_FEE];
|
|
|
- //建安费扣除定额设备购置费
|
|
|
- let afterDeductFee = cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, deductFlags, `${feeField}.${subFeeField}`);
|
|
|
- //定额设备购置费
|
|
|
- let equipmentAcFee = cbTools.getBillsFee(deductFlags[0], feeField, subFeeField);
|
|
|
- return (afterDeductFee + equipmentAcFee * 0.4).toDecimal(decimalObj.bills.totalPrice);
|
|
|
- },
|
|
|
- //{建筑安装工程费(不含安全生产费)}
|
|
|
- // 取清单固定类别是“建筑安装工程”的金额,但要扣除清单固定类别是“安全生产费”的金额
|
|
|
- 'JZAZGCFBHSC': function (tender) {
|
|
|
- let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee',
|
|
|
- deductFlags = [fixedFlag.SAFE_COST];
|
|
|
- //建安费扣除安全生产费
|
|
|
- return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, deductFlags, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
|
|
|
- },
|
|
|
- //{建筑安装工程费(不含设备费)}
|
|
|
- // 取清单固定类别是“建筑安装工程”的金额,但要扣除清单固定类别是“设备购置费”的金额
|
|
|
- 'JZAZGCFBHSB': function (tender) {
|
|
|
- let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee',
|
|
|
- deductFlags = [fixedFlag.EQUIPMENT_ACQUISITION_FEE];
|
|
|
- //建安费扣除设备费
|
|
|
- return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, deductFlags, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
|
|
|
- },
|
|
|
- //{建筑安装工程费}
|
|
|
- // 取清单固定类别是“建筑安装工程”的金额
|
|
|
- 'JZAZGCF': function (tender) {
|
|
|
- let feeField = 'common',
|
|
|
- subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
- return cbTools.getBillsFee(calcBase.fixedFlag.CONSTRUCTION_INSTALL_FEE, feeField, subFeeField);
|
|
|
- },
|
|
|
- //{土地使用及拆迁补偿费}
|
|
|
- // 取清单固定类别是“土地使用及拆迁补偿费”的金额
|
|
|
- 'TDSYJCQBCF': function (tender) {
|
|
|
- let feeField = 'common',
|
|
|
- subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
- return cbTools.getBillsFee(calcBase.fixedFlag.LAND_USED_DEMOLITION, feeField, subFeeField);
|
|
|
- },
|
|
|
- //{养护工程其他费}
|
|
|
- // 取清单固定类别是“养护工程其他费”的金额
|
|
|
- 'YHGCQTF': function (tender) {
|
|
|
- let feeField = 'common',
|
|
|
- subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
- return cbTools.getBillsFee(calcBase.fixedFlag.MAINTENANCE_EXPENSES, feeField, subFeeField);
|
|
|
- },
|
|
|
- //{预备费}
|
|
|
- // 取清单固定类别是“预备费”的金额
|
|
|
- 'YBF': function(tender) {
|
|
|
- let feeField = 'common',
|
|
|
- subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
- return cbTools.getBillsFee(calcBase.fixedFlag.BUDGET_FEE, feeField, subFeeField);
|
|
|
- },
|
|
|
- //{施工场地建设费}
|
|
|
- //使用累进办法计算,基数为{定额建筑安装工程费(不含定额设备购置费及专项费用)}
|
|
|
- 'SGCDJSF': function (tender) {
|
|
|
- let baseFee = this['DEJZAZGCFBHSBZX'](tender);
|
|
|
- return cbTools.getProgressiveFee(baseFee, '施工场地建设费');
|
|
|
- },
|
|
|
- //{养护单位(业主)管理费}
|
|
|
- // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
- 'YHDWYZGLF': function (tender) {
|
|
|
- let baseFee = this['DEJZAZGCSBSS'](tender);
|
|
|
- return cbTools.getProgressiveFee(baseFee, '养护单位(业主)管理费');
|
|
|
- },
|
|
|
- //{信息化费}
|
|
|
- // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
- 'XXHF': function (tender) {
|
|
|
- let baseFee = this['DEJZAZGCSBSS'](tender);
|
|
|
- return cbTools.getProgressiveFee(baseFee, '信息化费');
|
|
|
- },
|
|
|
- //{路线工程监理费}
|
|
|
- //使用累进办法计算,不足2万按2万,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
- 'LXGCJLF': function (tender) {
|
|
|
- let baseFee = this['DEJZAZGCSBSS'](tender),
|
|
|
- fee = cbTools.getProgressiveFee(baseFee, '路线工程监理费');
|
|
|
- return fee < 20000 ? 20000 : fee;
|
|
|
- },
|
|
|
- //{独立桥梁隧道工程监理费}
|
|
|
- //使用累进办法计算,不足2万按2万,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
- 'QLSDGCJLF': function (tender) {
|
|
|
- let baseFee = this['DEJZAZGCSBSS'](tender),
|
|
|
- fee = cbTools.getProgressiveFee(baseFee, '独立桥梁隧道工程监理费');
|
|
|
- return fee < 20000 ? 20000 : fee;
|
|
|
- },
|
|
|
- //{设计文件审查费}
|
|
|
- // 使用累进办法计算,不足3千按3千,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
- 'SJWJSCF': function (tender) {
|
|
|
- let baseFee = this['DEJZAZGCSBSS'](tender),
|
|
|
- fee = cbTools.getProgressiveFee(baseFee, '设计文件审查费');
|
|
|
- return fee < 3000 ? 3000 : fee;
|
|
|
- },
|
|
|
- //{路线勘察设计费}
|
|
|
- // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
- 'LXKCSJF': function (tender) {
|
|
|
- let baseFee = this['DEJZAZGCSBSS'](tender);
|
|
|
- return cbTools.getProgressiveFee(baseFee, '路线勘察设计费');
|
|
|
- },
|
|
|
- //{独立桥梁隧道维修加固勘察设计费}
|
|
|
- // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
- 'QLSDKCSJF': function (tender) {
|
|
|
- let baseFee = this['DEJZAZGCSBSS'](tender);
|
|
|
- return cbTools.getProgressiveFee(baseFee, '独立桥梁隧道维修加固勘察设计费');
|
|
|
- },
|
|
|
- //{招标代理及标底(最高投标限价)编制费} (招标代理及标底编制费ZBDLJBDBZF)
|
|
|
- // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
- 'ZBDLJBDBZF': function (tender) {
|
|
|
- let baseFee = this['DEJZAZGCSBSS'](tender);
|
|
|
- return cbTools.getProgressiveFee(baseFee, '招标代理及标底(最高投标限价)编制费');
|
|
|
- },
|
|
|
- //价差预备费
|
|
|
- //以建筑安装工程费为基数
|
|
|
- 'JCYBF': function (tender) {
|
|
|
- //建筑安装工程费作为基数
|
|
|
- let installFee = this['JZAZGCF'](tender);
|
|
|
- //年造价增涨
|
|
|
- let costGrowthRate = projectObj.project.property.costGrowthRate ?
|
|
|
- projectObj.project.property.costGrowthRate : 0;
|
|
|
- //增涨计费年限
|
|
|
- let growthPeriod = projectObj.project.property.growthPeriod ?
|
|
|
- projectObj.project.property.growthPeriod : 0;
|
|
|
- //= P * [(1+i)^(n-1) -1]
|
|
|
- return (installFee * (Math.pow(1 + costGrowthRate, growthPeriod - 1) - 1)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ /*
|
|
|
+ * 预算项目
|
|
|
+ * */
|
|
|
+ 'budget': {
|
|
|
+ //{定额建筑安装工程费(不含定额设备购置费及专项费用)}
|
|
|
+ //取清单固定类别是“建筑安装工程”的定额建安费,但要扣除清单固定类别是“设备购置费”、及“专项费用”的定额建安费
|
|
|
+ 'DEJZAZGCFBHSBZX': function (tender) {
|
|
|
+ let fullFeeField = tender ? 'rationCommon.tenderTotalFee' : 'rationCommon.totalFee',
|
|
|
+ deductFlags = [fixedFlag.EQUIPMENT_ACQUISITION_FEE, fixedFlag.SPECIAL_COST];
|
|
|
+ return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, deductFlags, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ },
|
|
|
+ //{定额建筑安装工程(其中定额设备购置费按 40%计)} (定额建筑安装工程设备四十)
|
|
|
+ //扣除设备购置费,再加上设备购置费的40%,扣除汇总算法不四舍五入,相当于汇总当中定额设备购置费就按照了40%计
|
|
|
+ 'DEJZAZGCSBSS': function (tender) {
|
|
|
+ let feeField = 'rationCommon',
|
|
|
+ subFeeField = tender ? 'tenderTotalFee' : 'totalFee',
|
|
|
+ deductFlags = [fixedFlag.EQUIPMENT_ACQUISITION_FEE];
|
|
|
+ //建安费扣除定额设备购置费
|
|
|
+ let afterDeductFee = cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, deductFlags, `${feeField}.${subFeeField}`);
|
|
|
+ //定额设备购置费
|
|
|
+ let equipmentAcFee = cbTools.getBillsFee(deductFlags[0], feeField, subFeeField);
|
|
|
+ return (afterDeductFee + equipmentAcFee * 0.4).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ },
|
|
|
+ //{建筑安装工程费(不含安全生产费)}
|
|
|
+ // 取清单固定类别是“建筑安装工程”的金额,但要扣除清单固定类别是“安全生产费”的金额
|
|
|
+ 'JZAZGCFBHSC': function (tender) {
|
|
|
+ let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee',
|
|
|
+ deductFlags = [fixedFlag.SAFE_COST];
|
|
|
+ //建安费扣除安全生产费
|
|
|
+ return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, deductFlags, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ },
|
|
|
+ //{建筑安装工程费(不含设备费)}
|
|
|
+ // 取清单固定类别是“建筑安装工程”的金额,但要扣除清单固定类别是“设备购置费”的金额
|
|
|
+ 'JZAZGCFBHSB': function (tender) {
|
|
|
+ let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee',
|
|
|
+ deductFlags = [fixedFlag.EQUIPMENT_ACQUISITION_FEE];
|
|
|
+ //建安费扣除设备费
|
|
|
+ return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, deductFlags, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ },
|
|
|
+ //{建筑安装工程费}
|
|
|
+ // 取清单固定类别是“建筑安装工程”的金额
|
|
|
+ 'JZAZGCF': function (tender) {
|
|
|
+ let feeField = 'common',
|
|
|
+ subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
+ return cbTools.getBillsFee(calcBase.fixedFlag.CONSTRUCTION_INSTALL_FEE, feeField, subFeeField);
|
|
|
+ },
|
|
|
+ //{土地使用及拆迁补偿费}
|
|
|
+ // 取清单固定类别是“土地使用及拆迁补偿费”的金额
|
|
|
+ 'TDSYJCQBCF': function (tender) {
|
|
|
+ let feeField = 'common',
|
|
|
+ subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
+ return cbTools.getBillsFee(calcBase.fixedFlag.LAND_USED_DEMOLITION, feeField, subFeeField);
|
|
|
+ },
|
|
|
+ //{养护工程其他费}
|
|
|
+ // 取清单固定类别是“养护工程其他费”的金额
|
|
|
+ 'YHGCQTF': function (tender) {
|
|
|
+ let feeField = 'common',
|
|
|
+ subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
+ return cbTools.getBillsFee(calcBase.fixedFlag.MAINTENANCE_EXPENSES, feeField, subFeeField);
|
|
|
+ },
|
|
|
+ //{预备费}
|
|
|
+ // 取清单固定类别是“预备费”的金额
|
|
|
+ 'YBF': function(tender) {
|
|
|
+ let feeField = 'common',
|
|
|
+ subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
+ return cbTools.getBillsFee(calcBase.fixedFlag.BUDGET_FEE, feeField, subFeeField);
|
|
|
+ },
|
|
|
+ //{施工场地建设费}
|
|
|
+ //使用累进办法计算,基数为{定额建筑安装工程费(不含定额设备购置费及专项费用)}
|
|
|
+ 'SGCDJSF': function (tender) {
|
|
|
+ let baseFee = this['DEJZAZGCFBHSBZX'](tender);
|
|
|
+ return cbTools.getProgressiveFee(baseFee, '施工场地建设费');
|
|
|
+ },
|
|
|
+ //{养护单位(业主)管理费}
|
|
|
+ // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
+ 'YHDWYZGLF': function (tender) {
|
|
|
+ let baseFee = this['DEJZAZGCSBSS'](tender);
|
|
|
+ return cbTools.getProgressiveFee(baseFee, '养护单位(业主)管理费');
|
|
|
+ },
|
|
|
+ //{信息化费}
|
|
|
+ // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
+ 'XXHF': function (tender) {
|
|
|
+ let baseFee = this['DEJZAZGCSBSS'](tender);
|
|
|
+ return cbTools.getProgressiveFee(baseFee, '信息化费');
|
|
|
+ },
|
|
|
+ //{路线工程监理费}
|
|
|
+ //使用累进办法计算,不足2万按2万,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
+ 'LXGCJLF': function (tender) {
|
|
|
+ let baseFee = this['DEJZAZGCSBSS'](tender),
|
|
|
+ fee = cbTools.getProgressiveFee(baseFee, '路线工程监理费');
|
|
|
+ return fee < 20000 ? 20000 : fee;
|
|
|
+ },
|
|
|
+ //{独立桥梁隧道工程监理费}
|
|
|
+ //使用累进办法计算,不足2万按2万,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
+ 'QLSDGCJLF': function (tender) {
|
|
|
+ let baseFee = this['DEJZAZGCSBSS'](tender),
|
|
|
+ fee = cbTools.getProgressiveFee(baseFee, '独立桥梁隧道工程监理费');
|
|
|
+ return fee < 20000 ? 20000 : fee;
|
|
|
+ },
|
|
|
+ //{设计文件审查费}
|
|
|
+ // 使用累进办法计算,不足3千按3千,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
+ 'SJWJSCF': function (tender) {
|
|
|
+ let baseFee = this['DEJZAZGCSBSS'](tender),
|
|
|
+ fee = cbTools.getProgressiveFee(baseFee, '设计文件审查费');
|
|
|
+ return fee < 3000 ? 3000 : fee;
|
|
|
+ },
|
|
|
+ //{路线勘察设计费}
|
|
|
+ // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
+ 'LXKCSJF': function (tender) {
|
|
|
+ let baseFee = this['DEJZAZGCSBSS'](tender);
|
|
|
+ return cbTools.getProgressiveFee(baseFee, '路线勘察设计费');
|
|
|
+ },
|
|
|
+ //{独立桥梁隧道维修加固勘察设计费}
|
|
|
+ // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
+ 'QLSDKCSJF': function (tender) {
|
|
|
+ let baseFee = this['DEJZAZGCSBSS'](tender);
|
|
|
+ return cbTools.getProgressiveFee(baseFee, '独立桥梁隧道维修加固勘察设计费');
|
|
|
+ },
|
|
|
+ //{招标代理及标底(最高投标限价)编制费} (招标代理及标底编制费ZBDLJBDBZF)
|
|
|
+ // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
|
|
|
+ 'ZBDLJBDBZF': function (tender) {
|
|
|
+ let baseFee = this['DEJZAZGCSBSS'](tender);
|
|
|
+ return cbTools.getProgressiveFee(baseFee, '招标代理及标底(最高投标限价)编制费');
|
|
|
+ },
|
|
|
+ //{价差预备费}
|
|
|
+ //以建筑安装工程费为基数
|
|
|
+ 'JCYBF': function (tender) {
|
|
|
+ //建筑安装工程费作为基数
|
|
|
+ let installFee = this['JZAZGCF'](tender);
|
|
|
+ //年造价增涨
|
|
|
+ let costGrowthRate = calcBase.project.property.costGrowthRate ?
|
|
|
+ calcBase.project.property.costGrowthRate : 0;
|
|
|
+ //增涨计费年限
|
|
|
+ let growthPeriod = projectObj.project.property.growthPeriod ?
|
|
|
+ calcBase.project.property.growthPeriod : 0;
|
|
|
+ //= P * [(1+i)^(n-1) -1]
|
|
|
+ return (installFee * (Math.pow(1 + costGrowthRate, growthPeriod - 1) - 1)).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /*
|
|
|
+ * 工程量清单项目(bills of quantities)
|
|
|
+ * */
|
|
|
+ 'boq': {
|
|
|
+ //{各章清单合计}
|
|
|
+ // 取清单固定类别是“第100章至700章清单”的金额
|
|
|
+ 'GZQDHJ': function (tender) {
|
|
|
+ let feeField = 'common',
|
|
|
+ subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
+ return cbTools.getBillsFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, feeField, subFeeField);
|
|
|
+ },
|
|
|
+ //{专项暂定合计}
|
|
|
+ // 汇总专项暂定列有值的清单的金额
|
|
|
+ 'ZXZDHJ': function (tender) {
|
|
|
+ let rst = 0,
|
|
|
+ feeField = 'common',
|
|
|
+ subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
|
|
|
+ let billsData = calcBase.project.Bills.datas,
|
|
|
+ filterData = billsData.filter(function (data) {
|
|
|
+ return data.specialProvisional;
|
|
|
+ });
|
|
|
+ for (let data of filterData) {
|
|
|
+ if (cbTools.isUnDef(data.feesIndex) || _.isEmpty(data.feesIndex) ||
|
|
|
+ cbTools.isUnDef(data.feesIndex[feeField]) || cbTools.isUnDef(data.feesIndex[feeField][subFeeField])) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ rst += data.feesIndex[feeField][subFeeField];
|
|
|
+ }
|
|
|
+ return rst.toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ },
|
|
|
+ //{100章以外清单合计}
|
|
|
+ // 取清单固定类别是“第100章至700章清单”的金额,但扣除清单100章下的金额。
|
|
|
+ 'YBZYHQDHJ': function (tender) {
|
|
|
+ //获取清单100章下的节点(只需要找最底层的,排除了底层,父项金额即排除了子项)
|
|
|
+ /*
|
|
|
+ * 是否是100章下的节点
|
|
|
+ * 判定规则:
|
|
|
+ * 1.递归往上找父项,直至找到一个其父项没有编码的节点(基准节点)
|
|
|
+ * 2.判断递归找到的节点编码规则:
|
|
|
+ * ①其编码只有前三位是连续的数值 eg: 100s(属于) 101(属于) 10(不属于) 10001(不属于)
|
|
|
+ * ②其前三位连续的数值编码在区间[100, 200)中
|
|
|
+ * */
|
|
|
+ function isWithin(node) {
|
|
|
+ if (!node || node.sourceType !== calcBase.project.Bills.getSourceType() || node.source.children.length > 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //找判断基准节点
|
|
|
+ while (node.parent && node.parent.data.code) {
|
|
|
+ node = node.parent;
|
|
|
+ }
|
|
|
+ //判断编码规则
|
|
|
+ let reg = /^\d{3,}/;
|
|
|
+ let matchCode = node.data.code.match(reg);
|
|
|
+ return matchCode && matchCode[0].length === 3 && matchCode[0] >= 100 && matchCode[0] < 200;
|
|
|
+ }
|
|
|
+ let oneToSeven = cbTools.findNodeByFlag(fixedFlag.ONE_SEVEN_BILLS);
|
|
|
+ if (!oneToSeven) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ //100-700章固定节点的所有子节点
|
|
|
+ let allChildren = [];
|
|
|
+ function getChildren(nodes) {
|
|
|
+ allChildren = allChildren.concat(nodes);
|
|
|
+ for (let node of nodes) {
|
|
|
+ if (node.children.length > 0) {
|
|
|
+ getChildren(node.children);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getChildren(oneToSeven.children);
|
|
|
+ let deductNodes = allChildren.filter(isWithin);
|
|
|
+ //计算金额
|
|
|
+ let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee';
|
|
|
+ return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -560,33 +657,47 @@ let figureClassTemplate = {
|
|
|
//基数的值不是通过清单节点获得的,则该基数的fixedBill为空,如价差、甲供、分包; class:分类,用于基数选择界面分类显示
|
|
|
//基数本身不与清单节点关联、但是其由与清单关联的节点四则运算得到,则拥有字段multiRef: [flags...]
|
|
|
let baseFigureMap = {
|
|
|
- //与清单直接关联=======
|
|
|
- '定额建筑安装工程费(不含定额设备购置费及专项费用)': {base: 'DEJZAZGCFBHSBZX', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE}, //设备费及专项是其子节点,所以不需要用mulRef
|
|
|
- '定额建筑安装工程(其中定额设备购置费按40%计)': {base: 'DEJZAZGCSBSS', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE},
|
|
|
- '建筑安装工程费(不含安全生产费)': {base: 'JZAZGCFBHSC', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE},
|
|
|
- '建筑安装工程费(不含设备费)': {base: 'JZAZGCFBHSB', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE},
|
|
|
- '建筑安装工程费': {base: 'JZAZGCF', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE},
|
|
|
- '土地使用及拆迁补偿费': {base: 'TDSYJCQBCF', fixedFlag: fixedFlag.LAND_USED_DEMOLITION},
|
|
|
- '养护工程其他费': {base: 'YHGCQTF', fixedFlag: fixedFlag.MAINTENANCE_EXPENSES},
|
|
|
- '预备费': {base: 'YBF', fixedFlag: fixedFlag.BUDGET_FEE},
|
|
|
- '施工场地建设费': {base: 'SGCDJSF', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE},
|
|
|
- '养护单位(业主)管理费': {base: 'YHDWYZGLF',
|
|
|
- multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
- '信息化费': {base: 'XXHF',
|
|
|
- multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
- '路线工程监理费': {base: 'LXGCJLF',
|
|
|
- multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
- '独立桥梁隧道工程监理费': {base: 'QLSDGCJLF',
|
|
|
- multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
- '设计文件审查费': {base: 'SJWJSCF',
|
|
|
- multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
- '路线勘察设计费': {base: 'LXKCSJF',
|
|
|
- multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
- '独立桥梁隧道维修加固勘察设计费': {base: 'QLSDKCSJF',
|
|
|
- multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
- '招标代理及标底(最高投标限价)编制费': {base: 'ZBDLJBDBZF',
|
|
|
- multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
- '价差预备费': {base: 'JCYBF', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE}
|
|
|
+ /*
|
|
|
+ * 预算项目
|
|
|
+ * */
|
|
|
+ 'budget': {
|
|
|
+//与清单直接关联=======
|
|
|
+ '定额建筑安装工程费(不含定额设备购置费及专项费用)': {base: 'DEJZAZGCFBHSBZX', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE}, //设备费及专项是其子节点,所以不需要用mulRef
|
|
|
+ '定额建筑安装工程(其中定额设备购置费按40%计)': {base: 'DEJZAZGCSBSS', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE},
|
|
|
+ '建筑安装工程费(不含安全生产费)': {base: 'JZAZGCFBHSC', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE},
|
|
|
+ '建筑安装工程费(不含设备费)': {base: 'JZAZGCFBHSB', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE},
|
|
|
+ '建筑安装工程费': {base: 'JZAZGCF', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE},
|
|
|
+ '土地使用及拆迁补偿费': {base: 'TDSYJCQBCF', fixedFlag: fixedFlag.LAND_USED_DEMOLITION},
|
|
|
+ '养护工程其他费': {base: 'YHGCQTF', fixedFlag: fixedFlag.MAINTENANCE_EXPENSES},
|
|
|
+ '预备费': {base: 'YBF', fixedFlag: fixedFlag.BUDGET_FEE},
|
|
|
+ '施工场地建设费': {base: 'SGCDJSF', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE},
|
|
|
+ '养护单位(业主)管理费': {base: 'YHDWYZGLF',
|
|
|
+ multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
+ '信息化费': {base: 'XXHF',
|
|
|
+ multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
+ '路线工程监理费': {base: 'LXGCJLF',
|
|
|
+ multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
+ '独立桥梁隧道工程监理费': {base: 'QLSDGCJLF',
|
|
|
+ multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
+ '设计文件审查费': {base: 'SJWJSCF',
|
|
|
+ multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
+ '路线勘察设计费': {base: 'LXKCSJF',
|
|
|
+ multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
+ '独立桥梁隧道维修加固勘察设计费': {base: 'QLSDKCSJF',
|
|
|
+ multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
+ '招标代理及标底(最高投标限价)编制费': {base: 'ZBDLJBDBZF',
|
|
|
+ multiRef: [fixedFlag.CONSTRUCTION_INSTALL_FEE]},
|
|
|
+ '价差预备费': {base: 'JCYBF', fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE}
|
|
|
+ },
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 工程量清单项目
|
|
|
+ * */
|
|
|
+ 'boq': {
|
|
|
+ '各章清单合计': {base: 'GZQDHJ', fixedFlag: fixedFlag.ONE_SEVEN_BILLS},
|
|
|
+ '专项暂定合计': {base: 'ZXZDHJ', fixedFlag: null},
|
|
|
+ '100章以外清单合计': {base: 'YBZYHQDHJ', fixedFlag: fixedFlag.ONE_SEVEN_BILLS},
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
//输入式分析器
|
|
|
@@ -937,14 +1048,22 @@ let cbCalctor = {
|
|
|
if(figure === 'NONE'){
|
|
|
return 0;
|
|
|
}
|
|
|
- return baseFigureTemplate[calcBase.baseFigures[figure]['base']]();
|
|
|
+ if (calcBase.project.property.valuationType === 'bill') {//预算
|
|
|
+ return baseFigureTemplate.budget[calcBase.baseFigures[figure]['base']]();
|
|
|
+ } else {//工程量清单
|
|
|
+ return baseFigureTemplate.boq[calcBase.baseFigures[figure]['base']]();
|
|
|
+ }
|
|
|
},
|
|
|
//调价后计算基数
|
|
|
tenderBase: function (figure) {
|
|
|
if(figure === 'NONE'){
|
|
|
return 0;
|
|
|
}
|
|
|
- return baseFigureTemplate[calcBase.baseFigures[figure]['base']](true);
|
|
|
+ if (calcBase.project.property.valuationType === 'bill') {//预算
|
|
|
+ return baseFigureTemplate.budget[calcBase.baseFigures[figure]['base']](true);
|
|
|
+ } else {//工程量清单
|
|
|
+ return baseFigureTemplate.boq[calcBase.baseFigures[figure]['base']](true);
|
|
|
+ }
|
|
|
},
|
|
|
//ID引用
|
|
|
ref: function (fExp) {
|
|
|
@@ -981,7 +1100,11 @@ let calcBase = {
|
|
|
me.project = project;
|
|
|
me.fixedFlag = fixedFlag;
|
|
|
cbTools.setFixedBills(project, me.fixedBills, me.fixedFlag);
|
|
|
- me.baseFigures = baseFigureMap;
|
|
|
+ if (project.property.valuationType === 'bill') {//预算
|
|
|
+ me.baseFigures = baseFigureMap.budget;
|
|
|
+ } else {//工程量清单
|
|
|
+ me.baseFigures = baseFigureMap.boq;
|
|
|
+ }
|
|
|
cbTools.setBaseBills(me.baseFigures, me.fixedBills);
|
|
|
//cbTools.setBaseFigureClass(me.baseFigures, me.baseFigureClass);
|
|
|
},
|