소스 검색

使用overwirte的逻辑重构累进接口

vian 5 년 전
부모
커밋
8875d310c4
6개의 변경된 파일554개의 추가작업 그리고 460개의 파일을 삭제
  1. 14 14
      public/calculate_util.js
  2. 14 16
      web/building_saas/main/js/models/calc_base.js
  3. 186 159
      web/over_write/js/anhui_2019.js
  4. 32 13
      web/over_write/js/chongqing_2018.js
  5. 176 146
      web/over_write/js/neimeng_2019.js
  6. 132 112
      web/over_write/js/zhejiang_2005.js

+ 14 - 14
public/calculate_util.js

@@ -21,15 +21,17 @@
         exp = exp.replace(new RegExp('f', 'g'), 'F');
         return exp;
     }
+
     /**
      * 获取累进办法计算的金额
      * @param {Number} baseFee - 基准金额
      * @param {String} name - 使用累进计算的基数名称(需要与累进库中的名称匹配)
      * @param {Array} progressiveData - 项目的累进数据(property.progressiveInterval)
      * @param {Number} decimal - 精度
+     * @param {Object} deficiency - 不足处理映射 @example: {'路线工程监理费': 20000 } // 不足2万按2万
      * @return {Number}
      */
-    function getProgressiveFee(baseFee, name, progressiveData, decimal) {
+    function getProgressiveFee(baseFee, name, progressiveData, decimal, deficiency) {
         if (!progressiveData) {
             throw '该项目不存在累进区间数据';
         }
@@ -101,26 +103,24 @@
             fee += (perData.max - perData.min) * perData.feeRate * 0.01;
         }
         //累进所在区间
-        fee += (baseFee - withinData.min) * withinData.feeRate * 0.01;
-        return scMathUtil.roundForObj(fee, decimal);
+        fee = scMathUtil.roundForObj(fee + (baseFee - withinData.min) * withinData.feeRate * 0.01, decimal);
+        // 不足处理
+        const deficiencyFee = deficiency && deficiency[name] || 0;
+        return deficiencyFee
+            ? fee > 0 && fee < deficiencyFee
+                ? deficiencyFee
+                : fee
+            : fee;
     }
-    
-    // 所有编办的累进基数(如果以后编办基数有冲突,则此判断方法不可用了。如在编办A、B均有计算x,且A中x为累进基数,B中x为非累进基数)
-    const progression = [
-        '施工场地建设费', '养护单位(业主)管理费', '信息化费', '路线工程监理费', '独立桥梁隧道工程监理费', // 重庆2018
-        '设计文件审查费', '路线勘察设计费', '独立桥梁隧道维修加固勘察设计费', '招标代理及标底(最高投标限价)编制费',
-        '养护单位管理费', '养护项目信息化费', '工程监理费', '前期工作费', // 安徽2019
-        '养护单位项目管理费', // 内蒙2019
-        '养护工程管理费' // 浙江2005
-    ];
 
     /**
      * 判断该基数是否包含累进基数
      * @param {String} calcBase - 计算基数
+     * @param {Array} progression - 累进基数名称数组
      * @return {Boolean}
      */
-    function isProgressive(calcBase) {
-        if (typeof calcBase !== 'string') {
+    function isProgressive(calcBase, progression) {
+        if (typeof calcBase !== 'string' || !progression) {
             return false;
         }
         const reg = /{[^}]+}/g;

+ 14 - 16
web/building_saas/main/js/models/calc_base.js

@@ -604,7 +604,7 @@ let baseFigureTemplate = {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '施工场地建设费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '施工场地建设费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         //{养护单位(业主)管理费}
         // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
@@ -613,7 +613,7 @@ let baseFigureTemplate = {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '养护单位(业主)管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '养护单位(业主)管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         //{信息化费}
         // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
@@ -622,37 +622,34 @@ let baseFigureTemplate = {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '信息化费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '信息化费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         //{路线工程监理费}
         //使用累进办法计算,不足2万按2万,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
         'LXGCJLF': function (tender) {
-            let baseFee = this['DEJZAZGCSBSS'](tender),
-                fee = calculateUtil.getProgressiveFee(baseFee, '路线工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            let baseFee = this['DEJZAZGCSBSS'](tender);
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return fee > 0 && fee < 20000 ? 20000 : fee;
+            return calculateUtil.getProgressiveFee(baseFee, '路线工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         //{独立桥梁隧道工程监理费}
         //使用累进办法计算,不足2万按2万,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
         'QLSDGCJLF': function (tender) {
-            let baseFee = this['DEJZAZGCSBSS'](tender),
-                fee = calculateUtil.getProgressiveFee(baseFee, '独立桥梁隧道工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            let baseFee = this['DEJZAZGCSBSS'](tender);
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return fee > 0 && fee < 20000 ? 20000 : fee;
+            return calculateUtil.getProgressiveFee(baseFee, '独立桥梁隧道工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         //{设计文件审查费}
         // 使用累进办法计算,不足3千按3千,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
         'SJWJSCF': function (tender) {
-            let baseFee = this['DEJZAZGCSBSS'](tender),
-                fee = calculateUtil.getProgressiveFee(baseFee, '设计文件审查费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            let baseFee = this['DEJZAZGCSBSS'](tender);
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return fee > 0 && fee < 3000 ? 3000 : fee;
+            return calculateUtil.getProgressiveFee(baseFee, '设计文件审查费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         //{路线勘察设计费}
         // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
@@ -661,7 +658,7 @@ let baseFigureTemplate = {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '路线勘察设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '路线勘察设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         //{独立桥梁隧道维修加固勘察设计费}
         // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
@@ -670,7 +667,7 @@ let baseFigureTemplate = {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '独立桥梁隧道维修加固勘察设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '独立桥梁隧道维修加固勘察设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         //{招标代理及标底(最高投标限价)编制费} (招标代理及标底编制费ZBDLJBDBZF)
         // 使用累进办法计算,计算基数为{定额建筑安装工程(其中定额设备购置费按 40%计)}
@@ -679,7 +676,7 @@ let baseFigureTemplate = {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '招标代理及标底(最高投标限价)编制费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '招标代理及标底(最高投标限价)编制费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         //{价差预备费}
         //以建筑安装工程费为基数
@@ -1403,12 +1400,13 @@ let calcBase = {
             node.updateData.calcBase = exp;
             node.updateData.calcBaseValue = parseFloat(calcBaseValue).toDecimal(decimalObj.decimal('totalPrice', node));
             node.updateData.tenderCalcBaseValue = parseFloat(tenderCalcBaseValue).toDecimal(decimalObj.decimal('totalPrice', node));
-            if (calculateUtil.isProgressive(exp)) {
+            if (calculateUtil.isProgressive(exp, progression)) {
                 node.updateData.baseProgressiveFee = me.baseProgressiveFee;
             }
             node.changed = true;
         }
         catch (err){
+            console.log(err);
             if(typeof err === 'object'){
                 err = '表达式不正确'
             }

+ 186 - 159
web/over_write/js/anhui_2019.js

@@ -33,18 +33,18 @@ function overwriteRationCalcBases() {
     rationCalcBases['定额施工机械使用费'] = function (node, isTender) {
         return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptBasePrice, isTender);
     };
-	rationCalcBases['定额商品砼费'] = function (node, isTender) {
-		return calcTools.rationBaseFee(node, [gljType.COMMERCIAL_CONCRETE, gljType.COMMERCIAL_MORTAR], priceTypes.ptBasePrice, isTender);
-	};
+    rationCalcBases['定额商品砼费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.COMMERCIAL_CONCRETE, gljType.COMMERCIAL_MORTAR], priceTypes.ptBasePrice, isTender);
+    };
     rationCalcBases['定额设备费'] = function (node, isTender) {
         return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptBasePrice, isTender);
     };
     rationCalcBases['定额外购砼构件费'] = function (node, isTender) {
-		return calcTools.rationBaseFee(node, [gljType.PURCHASE_COMPONENT], priceTypes.ptBasePrice, isTender);
-	};
-	rationCalcBases['定额绿化苗木费'] = function (node, isTender) {
-		return calcTools.rationBaseFee(node, [gljType.GREEN_SEEDLING], priceTypes.ptBasePrice, isTender);
-	};
+        return calcTools.rationBaseFee(node, [gljType.PURCHASE_COMPONENT], priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['定额绿化苗木费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.GREEN_SEEDLING], priceTypes.ptBasePrice, isTender);
+    };
 };
 
 (function overwriteFeeTypes() {
@@ -54,13 +54,13 @@ function overwriteRationCalcBases() {
         { type: 'marketMaterial', name: '材料费' },
         { type: 'marketMachine', name: '施工机械使用费' },
         { type: 'marketMachineLabour', name: '施工机械人工费' },
-        {type: 'marketEquipment', name: '设备购置费'},
+        { type: 'marketEquipment', name: '设备购置费' },
         { type: 'marketDirect', name: '直接费' },
 
         { type: 'labour', name: '定额人工费' },
         { type: 'material', name: '定额材料费' },
         { type: 'machine', name: '定额施工机械使用费' },
-        {type: 'equipment', name: '定额设备费'},
+        { type: 'equipment', name: '定额设备费' },
         { type: 'direct', name: '定额直接费' },
 
         { type: 'measure', name: '措施费' },
@@ -75,142 +75,165 @@ function overwriteRationCalcBases() {
 })();
 
 // 清单基数
-if (typeof baseFigureMap !== 'undefined') {
-    baseFigureMap.budget = {
-        // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
-        '建筑安装工程费': {
-            base: 'JZAZGCF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
-            pick: false,
-        },
-        // 显示:仅清单固定类别是“安全生产费”的可显示。
-        '建筑安装工程费(不含安全生产费)': {
-            base: 'JZAZGCFBHSC',
-            fixedFlag: null,
-            filter: [fixedFlag.SAFE_COST],
-            pick: true
-        },
-        // 显示:仅清单固定类别是“安全生产费”的可显示。
-        '建筑安装工程费(不含设备费)': {
-            base: 'JZAZGCFBHSB',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.SAFE_COST],
-            pick: true
-        },
-        // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
-        '定额建筑安装工程费': {
-            base: 'DEJZAZGCF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
-            pick: false
-        },
-        // 显示:仅清单固定类别是“施工场地建设费”的可显示。
-        '定额建筑安装工程费(不含定额设备购置费及专项管理费)': {
-            base: 'DEJZAZGCFBHSBZXGLF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.CONSTRUCTION_PLANT_COST],
-            pick: true,
-        },
-        // 显示:仅清单固定类别是“养护工程其他费用”的可显示。
-        '定额建筑安装工程费(不含专项管理费)': {
-            base: 'DEJZAZGCFBHZXGLF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:除清单固定类别是“建筑安装工程费”、“土地使用及拆迁补偿费”的以外部分可显示。
-        '土地使用及拆迁补偿费': {
-            base: 'TDSYJCQBCF',
-            fixedFlag: fixedFlag.LAND_USED_DEMOLITION,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.LAND_USED_DEMOLITION],
-            pick: false,
-        },
-        // 显示:除清单固定类别是“建筑安装工程费”、“土地使用及拆迁补偿费”、“工程建设其他费用”的以外部分可显示。
-        '工程建设其他费用': {
-            base: 'GCJSQTFY',
-            fixedFlag: fixedFlag.MAINTENANCE_EXPENSES,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.LAND_USED_DEMOLITION, fixedFlag.MAINTENANCE_EXPENSES],
-            pick: false,
-        },
-        // 显示:仅清单固定类别是“施工场地建设费”的可显示。
-        '施工场地建设费': {
-            base: 'SGCDJSF',
-            fixedFlag: null,
-            filter: [fixedFlag.CONSTRUCTION_PLANT_COST],
-            pick: true,
-        },
-        // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
-        '养护单位管理费': {
-            base: 'YHDWGLF',
-            fixedFlag: null,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
-        '养护项目信息化费': {
-            base: 'YHXMXXHF',
-            fixedFlag: null,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
-        '工程监理费': {
-            base: 'GCJLF',
-            fixedFlag: null,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
-        '设计文件审查费': {
-            base: 'SJWJSCF',
-            fixedFlag: null,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
-        '前期工作费': {
-            base: 'QQGZF',
-            fixedFlag: null,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:仅“价差预备费”可显示
-        '价差预备费': {
-            base: 'JCYBF',
-            fixedFlag: null,
-            filter: [fixedFlag.SPREAD_BUDGET_FEE],
-            pick: true,
-        },
-    };
+const budgetMap = {
+    // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
+    '建筑安装工程费': {
+        base: 'JZAZGCF',
+        fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+        filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+        pick: false,
+    },
+    // 显示:仅清单固定类别是“安全生产费”的可显示。
+    '建筑安装工程费(不含安全生产费)': {
+        base: 'JZAZGCFBHSC',
+        fixedFlag: null,
+        filter: [fixedFlag.SAFE_COST],
+        pick: true
+    },
+    // 显示:仅清单固定类别是“安全生产费”的可显示。
+    '建筑安装工程费(不含设备费)': {
+        base: 'JZAZGCFBHSB',
+        fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+        filter: [fixedFlag.SAFE_COST],
+        pick: true
+    },
+    // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
+    '定额建筑安装工程费': {
+        base: 'DEJZAZGCF',
+        fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+        filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+        pick: false
+    },
+    // 显示:仅清单固定类别是“施工场地建设费”的可显示。
+    '定额建筑安装工程费(不含定额设备购置费及专项管理费)': {
+        base: 'DEJZAZGCFBHSBZXGLF',
+        fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+        filter: [fixedFlag.CONSTRUCTION_PLANT_COST],
+        pick: true,
+    },
+    // 显示:仅清单固定类别是“养护工程其他费用”的可显示。
+    '定额建筑安装工程费(不含专项管理费)': {
+        base: 'DEJZAZGCFBHZXGLF',
+        fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+    },
+    // 显示:除清单固定类别是“建筑安装工程费”、“土地使用及拆迁补偿费”的以外部分可显示。
+    '土地使用及拆迁补偿费': {
+        base: 'TDSYJCQBCF',
+        fixedFlag: fixedFlag.LAND_USED_DEMOLITION,
+        filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.LAND_USED_DEMOLITION],
+        pick: false,
+    },
+    // 显示:除清单固定类别是“建筑安装工程费”、“土地使用及拆迁补偿费”、“工程建设其他费用”的以外部分可显示。
+    '工程建设其他费用': {
+        base: 'GCJSQTFY',
+        fixedFlag: fixedFlag.MAINTENANCE_EXPENSES,
+        filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.LAND_USED_DEMOLITION, fixedFlag.MAINTENANCE_EXPENSES],
+        pick: false,
+    },
+    // 显示:仅清单固定类别是“施工场地建设费”的可显示。
+    '施工场地建设费': {
+        isProgressive: true,
+        base: 'SGCDJSF',
+        fixedFlag: null,
+        filter: [fixedFlag.CONSTRUCTION_PLANT_COST],
+        pick: true,
+    },
+    // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+    '养护单位管理费': {
+        isProgressive: true,
+        base: 'YHDWGLF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+    },
+    // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+    '养护项目信息化费': {
+        isProgressive: true,
+        deficiency: 20000,
+        base: 'YHXMXXHF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+    },
+    // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+    '工程监理费': {
+        isProgressive: true,
+        deficiency: 20000,
+        base: 'GCJLF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+    },
+    // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
+    '设计文件审查费': {
+        isProgressive: true,
+        base: 'SJWJSCF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+    },
+    // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
+    '前期工作费': {
+        isProgressive: true,
+        deficiency: 30000,
+        base: 'QQGZF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+    },
+    // 显示:仅“价差预备费”可显示
+    '价差预备费': {
+        base: 'JCYBF',
+        fixedFlag: null,
+        filter: [fixedFlag.SPREAD_BUDGET_FEE],
+        pick: true,
+    },
+};
+const boqMap = {
+    //仅允许用于固定类别是“第100章至700章清单”以外的清单
+    '各章清单合计': {
+        base: 'GZQDHJ',
+        fixedFlag: fixedFlag.ONE_SEVEN_BILLS,
+        filter: [fixedFlag.ONE_SEVEN_BILLS],
+        pick: false
+    },
+    //仅允许用于固定类别是“第100章至700章清单”以外的清单
+    '专项暂定合计': {
+        base: 'ZXZDHJ',
+        fixedFlag: null,
+        filter: [fixedFlag.ONE_SEVEN_BILLS],
+        pick: false
+    },
+    /*
+    *  清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
+    *  因此{100章以外合计}不设置关联的清单固定行
+    * */
+    //仅允许用于固定类别为“100章清单”引用
+    '100章以外清单合计': {
+        base: 'YBZYHQDHJ',
+        fixedFlag: null,
+        filter: [fixedFlag.ONE_HUNDRED_BILLS],
+        pick: true
+    }
+};
 
-    baseFigureMap.boq = {
-        //仅允许用于固定类别是“第100章至700章清单”以外的清单
-        '各章清单合计': {
-            base: 'GZQDHJ',
-            fixedFlag: fixedFlag.ONE_SEVEN_BILLS,
-            filter: [fixedFlag.ONE_SEVEN_BILLS],
-            pick: false
-        },
-        //仅允许用于固定类别是“第100章至700章清单”以外的清单
-        '专项暂定合计': {
-            base: 'ZXZDHJ',
-            fixedFlag: null,
-            filter: [fixedFlag.ONE_SEVEN_BILLS],
-            pick: false
-        },
-        /*
-        *  清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
-        *  因此{100章以外合计}不设置关联的清单固定行
-        * */
-        //仅允许用于固定类别为“100章清单”引用
-        '100章以外清单合计': {
-            base: 'YBZYHQDHJ',
-            fixedFlag: null,
-            filter: [fixedFlag.ONE_HUNDRED_BILLS],
-            pick: true
-        }
-    };
+const progression = [];
+const deficiency = {};
+for (const name in budgetMap) {
+    const item = budgetMap[name];
+    if (item.isProgressive) {
+        progression.push(item.progressiveName || name);
+    }
+    if (item.deficiency) {
+        deficiency[item.progressiveName || name] = item.deficiency;
+    }
+}
+
+if (typeof baseFigureMap !== 'undefined') {
+    baseFigureMap.budget = budgetMap;
+    baseFigureMap.boq = boqMap;
 }
 
 if (typeof baseFigureTemplate !== 'undefined') {
@@ -271,7 +294,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '施工场地建设费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '施工场地建设费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         // 养护单位管理费 算法:以{定额建筑安装工程费(不含专项管理费) }为基数,采用累进办法计算。
         YHDWGLF(tender) {
@@ -279,7 +302,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '养护单位管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '养护单位管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         // 养护项目信息化费 算法:以{定额建筑安装工程费}为基数,采用累进办法计算。(不足20000元时按20000元计算)
         YHXMXXHF(tender) {
@@ -287,8 +310,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            const fee = calculateUtil.getProgressiveFee(baseFee, '养护项目信息化费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
-            return fee > 0 && fee < 20000 ? 20000 : fee;
+            return calculateUtil.getProgressiveFee(baseFee, '养护项目信息化费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         // 工程监理费 算法:以{定额建筑安装工程费(不含专项管理费) }为基数,采用累进办法计算。(不足20000元时按20000元计算)
         GCJLF(tender) {
@@ -296,8 +318,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            const fee = calculateUtil.getProgressiveFee(baseFee, '工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
-            return fee > 0 && fee < 20000 ? 20000 : fee;
+            return calculateUtil.getProgressiveFee(baseFee, '工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         // 设计文件审查费 算法:以{定额建筑安装工程费(不含专项管理费) }为基数,采用累进办法计算。
         SJWJSCF(tender) {
@@ -305,7 +326,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '设计文件审查费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '设计文件审查费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         // 前期工作费 算法:以{定额建筑安装工程费(不含专项管理费) }为基数,采用累进办法计算。(不足30000元时按30000元计算)
         QQGZF(tender) {
@@ -313,8 +334,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            const fee = calculateUtil.getProgressiveFee(baseFee, '前期工作费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
-            return fee > 0 && fee < 30000 ? 30000 : fee;
+            return calculateUtil.getProgressiveFee(baseFee, '前期工作费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         /*  价差预备费 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
             价差预备费 P * [(1+i)^(n-1) -1]
@@ -326,12 +346,12 @@ if (typeof baseFigureTemplate !== 'undefined') {
             //建筑安装工程费作为基数
             const installFee = this['JZAZGCF'](tender);
             //年造价增涨
-            const costGrowthRate = calcBase.project.property.costGrowthRate 
-                ? calcBase.project.property.costGrowthRate 
+            const costGrowthRate = calcBase.project.property.costGrowthRate
+                ? calcBase.project.property.costGrowthRate
                 : 0;
             //增涨计费年限
-            const growthPeriod = projectObj.project.property.growthPeriod 
-                ? calcBase.project.property.growthPeriod 
+            const 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);
@@ -396,8 +416,15 @@ if (typeof baseFigureTemplate !== 'undefined') {
 
 // 安徽养护在新建分段的时候需要隐藏养护类别和费用标准
 if (typeof $ !== 'undefined') { // 后端也有引用这个文件,后端引用时$没有定义会报错
-    $(document).ready(function() {
+    $(document).ready(function () {
         $('#tender-engineering-group').hide();
         $('#tender-feeStandard-group').hide();
     });
+}
+
+if (typeof module !== 'undefined') {
+    module.exports = {
+        progression,
+        deficiency
+    };
 }

+ 32 - 13
web/over_write/js/chongqing_2018.js

@@ -5,17 +5,36 @@
 
 //重庆综合里程、工地转移费率值修改特殊处理
 
-if(typeof feeRateObject !== 'undefined'){
-   feeRateObject.feeRateSpecialHandle = function (subRate,value) {
-       let result = {};
-       if(subRate.name == "工地转移(km)"&& value && value < 50){//工地转移50km以内按50km算
-           result.valueKey = "50";
-           result.value = scMathUtil.roundForObj(value,getDecimal("feeRate")) ;//设置显示的节点值
-       }
-       if(subRate.name == "综合里程(km)"&& value && value < 3){//综合里程3km以内按3km算
-           result.valueKey = "3";
-           result.value = scMathUtil.roundForObj(value,getDecimal("feeRate")) ;//设置显示的节点值
-       }
-       return result;
-   }
+if (typeof feeRateObject !== 'undefined') {
+    feeRateObject.feeRateSpecialHandle = function (subRate, value) {
+        let result = {};
+        if (subRate.name == "工地转移(km)" && value && value < 50) {//工地转移50km以内按50km算
+            result.valueKey = "50";
+            result.value = scMathUtil.roundForObj(value, getDecimal("feeRate"));//设置显示的节点值
+        }
+        if (subRate.name == "综合里程(km)" && value && value < 3) {//综合里程3km以内按3km算
+            result.valueKey = "3";
+            result.value = scMathUtil.roundForObj(value, getDecimal("feeRate"));//设置显示的节点值
+        }
+        return result;
+    }
 }
+
+// 累进的基数名称
+const progression = [
+    '施工场地建设费', '养护单位(业主)管理费', '信息化费', '路线工程监理费', '独立桥梁隧道工程监理费',
+    '设计文件审查费', '路线勘察设计费', '独立桥梁隧道维修加固勘察设计费', '招标代理及标底(最高投标限价)编制费'
+];
+// 累进计算金额不足时的处理映射
+const deficiency = {
+    '路线工程监理费': 20000, // 不足2万按2万
+    '独立桥梁隧道工程监理费': 20000,
+    '设计文件审查费': 3000
+};
+
+if (typeof module !== 'undefined') {
+    module.exports = {
+        progression,
+        deficiency
+    };
+}

+ 176 - 146
web/over_write/js/neimeng_2019.js

@@ -50,144 +50,168 @@ function overwriteRationCalcBases() {
 (function overwriteFeeTypes() {
     if (typeof cpFeeTypes == 'undefined') return;
     cpFeeTypes = [
-        {type: 'marketLabour', name: '人工费'},
-        {type: 'marketMaterial', name: '材料费'},
-        {type: 'marketMachine', name: '施工机械使用费'},
-        {type: 'marketMachineLabour', name: '施工机械人工费'},
-        {type: 'marketEquipment', name: '设备购置费'},
-        {type: 'marketDirect', name: '直接费'},
+        { type: 'marketLabour', name: '人工费' },
+        { type: 'marketMaterial', name: '材料费' },
+        { type: 'marketMachine', name: '施工机械使用费' },
+        { type: 'marketMachineLabour', name: '施工机械人工费' },
+        { type: 'marketEquipment', name: '设备购置费' },
+        { type: 'marketDirect', name: '直接费' },
 
-        {type: 'labour', name: '定额人工费'},
-        {type: 'material', name: '定额材料费'},
-        {type: 'machine', name: '定额施工机械使用费'},
-        {type: 'equipment', name: '定额设备购置费'},
-        {type: 'direct', name: '定额直接费'},
+        { type: 'labour', name: '定额人工费' },
+        { type: 'material', name: '定额材料费' },
+        { type: 'machine', name: '定额施工机械使用费' },
+        { type: 'equipment', name: '定额设备购置费' },
+        { type: 'direct', name: '定额直接费' },
 
-        {type: 'measure', name: '措施费'},
-        {type: 'manage', name: '企业管理费'},
-        {type: 'force', name: '规费'},
-        {type: 'profit', name: '利润'},
-        {type: 'tax', name: '税金'},
-        {type: 'common', name: '建安费'},
-        {type: 'rationCommon', name: '定额建安费'},
-        {type: 'safeProduce', name: '安全生产费'}
+        { type: 'measure', name: '措施费' },
+        { type: 'manage', name: '企业管理费' },
+        { type: 'force', name: '规费' },
+        { type: 'profit', name: '利润' },
+        { type: 'tax', name: '税金' },
+        { type: 'common', name: '建安费' },
+        { type: 'rationCommon', name: '定额建安费' },
+        { type: 'safeProduce', name: '安全生产费' }
     ];
 })();
 
 // 清单基数
+const budgetMap = {
+    // 清单固定类别是“建筑安装工程费”的以外部分可显示
+    '定额建筑安装工程费(定额设备购置费按40%计)': {
+        base: 'DEJZAZGCFSBSS',
+        fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+        filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+        pick: false,
+    },
+    // 清单固定类别是“建筑安装工程费”的以外部分可显示
+    '建筑安装工程费(不含设备费)': {
+        base: 'JZAZGCFBHSB',
+        fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+        filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+        pick: false,
+    },
+    // 清单固定类别是“建筑安装工程费”的以外部分可显示
+    '建筑安装工程费': {
+        base: 'JZAZGCF',
+        fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+        filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+        pick: false,
+    },
+    // “建筑安装工程费”、“土地使用及拆迁补偿费”以外部分可显示
+    '土地使用及拆迁补偿费': {
+        base: 'TDSYJCQBCF',
+        fixedFlag: fixedFlag.LAND_USED_DEMOLITION,
+        filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.LAND_USED_DEMOLITION],
+        pick: false,
+    },
+    // “建筑安装工程费”、“土地使用及拆迁补偿费”、“养护工程其他费用”以外部分可显示
+    '养护工程其他费用': {
+        base: 'YHGCQTFY',
+        fixedFlag: fixedFlag.MAINTENANCE_EXPENSES,
+        filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.LAND_USED_DEMOLITION, fixedFlag.MAINTENANCE_EXPENSES],
+        pick: false,
+    },
+    // “建筑安装工程费”、“土地使用及拆迁补偿费”、“养护工程其他费用”以外部分可显示
+    '预备费': {
+        base: 'YBF',
+        fixedFlag: fixedFlag.BUDGET_FEE,
+        filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.LAND_USED_DEMOLITION, fixedFlag.MAINTENANCE_EXPENSES, fixedFlag.BUDGET_FEE],
+        pick: false,
+    },
+    // 仅在清单固定类别是“养护单位项目管理费”的清单显示
+    '养护单位项目管理费': {
+        isProgressive: true,
+        base: 'YHDWXMGLF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_MANAGENENT_FEE],
+        pick: true,
+    },
+    // 仅在清单固定类别是“信息化费”的清单显示
+    '信息化费': {
+        isProgressive: true,
+        base: 'XXHF',
+        fixedFlag: null,
+        filter: [fixedFlag.INFORMATIZATION_FEE],
+        pick: true,
+    },
+    // 仅在清单固定类别是“工程监理费”的清单显示
+    '工程监理费': {
+        isProgressive: true,
+        base: 'GCJLF',
+        fixedFlag: null,
+        filter: [fixedFlag.ENGINEERING_SUP_FEE],
+        pick: true,
+    },
+    // 仅在清单固定类别是“设计文件审查费”的清单显示
+    '设计文件审查费': {
+        isProgressive: true,
+        deficiency: 3000,
+        base: 'SJWJSCF',
+        fixedFlag: null,
+        filter: [fixedFlag.DOCUMENT_REVIEW_FEE],
+        pick: true,
+    },
+    '前期工作费': {
+        isProgressive: true,
+        base: 'QQGZF',
+        fixedFlag: null,
+        filter: [fixedFlag.PRELIMINARY_WORK],
+        pick: true,
+    },
+    '价差预备费': {
+        base: 'JCYBF',
+        fixedFlag: null,
+        filter: [fixedFlag.SPREAD_BUDGET_FEE],
+        pick: true,
+    },
+};
+const boqMap = {
+    //仅允许用于固定类别是“第100章至700章清单”以外的清单
+    '各章清单合计': {
+        base: 'GZQDHJ',
+        fixedFlag: fixedFlag.ONE_SEVEN_BILLS,
+        filter: [fixedFlag.ONE_SEVEN_BILLS],
+        pick: false
+    },
+    //仅允许用于固定类别是“第100章至700章清单”以外的清单
+    '专项暂定合计': {
+        base: 'ZXZDHJ',
+        fixedFlag: null,
+        filter: [fixedFlag.ONE_SEVEN_BILLS],
+        pick: false
+    },
+    /*
+    *  清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
+    *  因此{100章以外合计}不设置关联的清单固定行
+    * */
+    //仅允许用于固定类别为“100章清单”引用
+    '100章以外清单合计': {
+        base: 'YBZYHQDHJ',
+        fixedFlag: null,
+        filter: [fixedFlag.ONE_HUNDRED_BILLS],
+        pick: true
+    }
+};
+
+const progression = [];
+const deficiency = {};
+for (const name in budgetMap) {
+    const item = budgetMap[name];
+    if (item.isProgressive) {
+        progression.push(item.progressiveName || name);
+    }
+    if (item.deficiency) {
+        deficiency[item.progressiveName || name] = item.deficiency;
+    }
+}
+
+if (typeof baseFigureMap !== 'undefined') {
+    baseFigureMap.budget = budgetMap;
+    baseFigureMap.boq = boqMap;
+}
 if (typeof baseFigureMap !== 'undefined' && baseFigureMap.budget) {
-    baseFigureMap.budget = {
-        // 清单固定类别是“建筑安装工程费”的以外部分可显示
-        '定额建筑安装工程费(定额设备购置费按40%计)': {
-            base: 'DEJZAZGCFSBSS',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
-            pick: false,
-        },
-        // 清单固定类别是“建筑安装工程费”的以外部分可显示
-        '建筑安装工程费(不含设备费)': {
-            base: 'JZAZGCFBHSB',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
-            pick: false,
-        },
-        // 清单固定类别是“建筑安装工程费”的以外部分可显示
-        '建筑安装工程费': {
-            base: 'JZAZGCF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
-            pick: false,
-        },
-        // “建筑安装工程费”、“土地使用及拆迁补偿费”以外部分可显示
-        '土地使用及拆迁补偿费': {
-            base: 'TDSYJCQBCF',
-            fixedFlag: fixedFlag.LAND_USED_DEMOLITION,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.LAND_USED_DEMOLITION],
-            pick: false,
-        },
-        // “建筑安装工程费”、“土地使用及拆迁补偿费”、“养护工程其他费用”以外部分可显示
-        '养护工程其他费用': {
-            base: 'YHGCQTFY',
-            fixedFlag: fixedFlag.MAINTENANCE_EXPENSES,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.LAND_USED_DEMOLITION, fixedFlag.MAINTENANCE_EXPENSES],
-            pick: false,
-        },
-        // “建筑安装工程费”、“土地使用及拆迁补偿费”、“养护工程其他费用”以外部分可显示
-        '预备费': {
-            base: 'YBF',
-            fixedFlag: fixedFlag.BUDGET_FEE,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE, fixedFlag.LAND_USED_DEMOLITION, fixedFlag.MAINTENANCE_EXPENSES, fixedFlag.BUDGET_FEE],
-            pick: false,
-        },
-        // 仅在清单固定类别是“养护单位项目管理费”的清单显示
-        '养护单位项目管理费': {
-            base: 'YHDWXMGLF',
-            fixedFlag: null,
-            filter: [fixedFlag.MAINTENANCE_MANAGENENT_FEE],
-            pick: true,
-        },
-        // 仅在清单固定类别是“信息化费”的清单显示
-        '信息化费': {
-            base: 'XXHF',
-            fixedFlag: null,
-            filter: [fixedFlag.INFORMATIZATION_FEE],
-            pick: true,
-        },
-        // 仅在清单固定类别是“工程监理费”的清单显示
-        '工程监理费': {
-            base: 'GCJLF',
-            fixedFlag: null,
-            filter: [fixedFlag.ENGINEERING_SUP_FEE],
-            pick: true,
-        },
-        // 仅在清单固定类别是“设计文件审查费”的清单显示
-        '设计文件审查费': {
-            base: 'SJWJSCF',
-            fixedFlag: null,
-            filter: [fixedFlag.DOCUMENT_REVIEW_FEE],
-            pick: true,
-        },
-        '前期工作费': {
-            base: 'QQGZF',
-            fixedFlag: null,
-            filter: [fixedFlag.PRELIMINARY_WORK],
-            pick: true,
-        },
-        '价差预备费': {
-            base: 'JCYBF',
-            fixedFlag: null,
-            filter: [fixedFlag.SPREAD_BUDGET_FEE],
-            pick: true,
-        },
-    };
-    
-    baseFigureMap.boq = {
-        //仅允许用于固定类别是“第100章至700章清单”以外的清单
-        '各章清单合计': {
-            base: 'GZQDHJ',
-            fixedFlag: fixedFlag.ONE_SEVEN_BILLS,
-            filter: [fixedFlag.ONE_SEVEN_BILLS],
-            pick: false
-        },
-        //仅允许用于固定类别是“第100章至700章清单”以外的清单
-        '专项暂定合计': {
-            base: 'ZXZDHJ',
-            fixedFlag: null,
-            filter: [fixedFlag.ONE_SEVEN_BILLS],
-            pick: false
-        },
-        /*
-        *  清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
-        *  因此{100章以外合计}不设置关联的清单固定行
-        * */
-        //仅允许用于固定类别为“100章清单”引用
-        '100章以外清单合计': {
-            base: 'YBZYHQDHJ',
-            fixedFlag: null,
-            filter: [fixedFlag.ONE_HUNDRED_BILLS],
-            pick: true
-        }
-    };
+    baseFigureMap.budget = budgetMap;
+    baseFigureMap.boq = boqMap;
 }
 
 // 清单基数
@@ -241,7 +265,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '养护单位项目管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '养护单位项目管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         // 信息化费:以累进办法计算,计算基数为“定额建筑安装工程费(定额设备购置费按40%计)”
         XXHF(tender) {
@@ -249,7 +273,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '信息化费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '信息化费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         // 工程监理费:以累进办法计算,计算基数为“定额建筑安装工程费(定额设备购置费按40%计)
         GCJLF(tender) {
@@ -257,7 +281,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         // 设计文件审查费:以累进办法计算,计算基数为“定额建筑安装工程费(定额设备购置费按40%计)”;设计文件审查费不足3000元的,按3000元计算
         SJWJSCF(tender) {
@@ -265,8 +289,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            const fee = calculateUtil.getProgressiveFee(baseFee, '设计文件审查费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
-            return fee > 0 && fee < 3000 ? 3000 : fee;
+            return calculateUtil.getProgressiveFee(baseFee, '设计文件审查费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         // 前期工作费:以累进办法计算,计算基数为“定额建筑安装工程费(定额设备购置费按40%计)
         QQGZF(tender) {
@@ -274,7 +297,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '前期工作费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '前期工作费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         // 价差预备费
         JCYBF(tender) {
@@ -346,23 +369,30 @@ if (typeof baseFigureTemplate !== 'undefined') {
     };
 }
 
-if(typeof materialCalcObj !== 'undefined' && materialCalcObj.rationSetting){
-    let h =_.find(materialCalcObj.rationSetting.header,{"dataCode":"feeType"});
-    if(h) h.visible = true;
-    let mt = _.find(materialCalcObj.freightSetting.header,{"dataCode":"materialType"});
-    if(mt) mt.visible = true;
+if (typeof materialCalcObj !== 'undefined' && materialCalcObj.rationSetting) {
+    let h = _.find(materialCalcObj.rationSetting.header, { "dataCode": "feeType" });
+    if (h) h.visible = true;
+    let mt = _.find(materialCalcObj.freightSetting.header, { "dataCode": "materialType" });
+    if (mt) mt.visible = true;
 }
 
 
 //内蒙施工进出场(km)费率值修改特殊处理
 
-if(typeof feeRateObject !== 'undefined'){
-    feeRateObject.feeRateSpecialHandle = function (subRate,value) {
+if (typeof feeRateObject !== 'undefined') {
+    feeRateObject.feeRateSpecialHandle = function (subRate, value) {
         let result = {};
-        if(subRate.name == "施工进出场(km)"&& value && value < 5){//输入的数值(公里数)< 5时,该项费用不计取。
+        if (subRate.name == "施工进出场(km)" && value && value < 5) {//输入的数值(公里数)< 5时,该项费用不计取。
             result.valueKey = "0";
-            result.value = scMathUtil.roundForObj(value,getDecimal("feeRate")) ;//设置显示的节点值
+            result.value = scMathUtil.roundForObj(value, getDecimal("feeRate"));//设置显示的节点值
         }
         return result;
     }
+}
+
+if (typeof module !== 'undefined') {
+    module.exports = {
+        progression,
+        deficiency
+    };
 }

+ 132 - 112
web/over_write/js/zhejiang_2005.js

@@ -5,7 +5,7 @@
 let isZJ2005 = true;
 
 // 一般计税取不含税市场价、不含税定额价。简易计税取含税市场价、含税定额价。打开项目时,4个价格根据计税类型只载入其二,所以这里可不作区分。
-function overwriteRationCalcBases (taxType){
+function overwriteRationCalcBases(taxType) {
     if (typeof rationCalcBases == 'undefined') return;
     for (let key in rationCalcBases) delete rationCalcBases[key];
     // let isJY = taxType == '2';
@@ -24,96 +24,111 @@ function overwriteRationCalcBases (taxType){
 (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: '养护工程费'}
+        { 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 = {
-        // 除清单固定类别是“建筑安装工程费”的以外部分可显示
-        '公路养护工程费': {
-            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,
+const budgetMap = {
+    // 除清单固定类别是“建筑安装工程费”的以外部分可显示
+    '公路养护工程费': {
+        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,
+    },
+    // 只有清单固定类别是“养护工程其他费用”部分可显示
+    '养护工程管理经费': {
+        progressiveName: '养护工程管理费', // 累进库里配置的名称与基数名称应该是一样的,但是这里不一样且已经在yun上线。特殊处理
+        isProgressive: true,
+        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,
 
-        }
-    };
+    }
+};
+const boqMap = {
+    //仅允许用于固定类别是“第100章至700章清单”以外的清单
+    '各章清单合计': {
+        base: 'GZQDHJ',
+        fixedFlag: fixedFlag.ONE_SEVEN_BILLS,
+        filter: [fixedFlag.ONE_SEVEN_BILLS],
+        pick: false
+    },
+    //仅允许用于固定类别是“第100章至700章清单”以外的清单
+    '专项暂定合计': {
+        base: 'ZXZDHJ',
+        fixedFlag: null,
+        filter: [fixedFlag.ONE_SEVEN_BILLS],
+        pick: false
+    },
+    /*
+    *  清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
+    *  因此{100章以外合计}不设置关联的清单固定行
+    * */
+    //仅允许用于固定类别为“100章清单”引用
+    '100章以外清单合计': {
+        base: 'YBZYHQDHJ',
+        fixedFlag: null,
+        filter: [fixedFlag.ONE_HUNDRED_BILLS],
+        pick: true
+    }
+};
 
-    baseFigureMap.boq = {
-        //仅允许用于固定类别是“第100章至700章清单”以外的清单
-        '各章清单合计': {
-            base: 'GZQDHJ',
-            fixedFlag: fixedFlag.ONE_SEVEN_BILLS,
-            filter: [fixedFlag.ONE_SEVEN_BILLS],
-            pick: false
-        },
-        //仅允许用于固定类别是“第100章至700章清单”以外的清单
-        '专项暂定合计': {
-            base: 'ZXZDHJ',
-            fixedFlag: null,
-            filter: [fixedFlag.ONE_SEVEN_BILLS],
-            pick: false
-        },
-        /*
-        *  清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
-        *  因此{100章以外合计}不设置关联的清单固定行
-        * */
-        //仅允许用于固定类别为“100章清单”引用
-        '100章以外清单合计': {
-            base: 'YBZYHQDHJ',
-            fixedFlag: null,
-            filter: [fixedFlag.ONE_HUNDRED_BILLS],
-            pick: true
-        }
-    };
+const progression = [];
+const deficiency = {};
+for (const name in budgetMap) {
+    const item = budgetMap[name];
+    if (item.isProgressive) {
+        progression.push(item.progressiveName || name);
+    }
+    if (item.deficiency) {
+        deficiency[item.progressiveName || name] = item.deficiency;
+    }
+}
+if (typeof baseFigureMap !== 'undefined') {
+    baseFigureMap.budget = budgetMap;
+    baseFigureMap.boq = boqMap;
 }
 
 if (typeof baseFigureTemplate !== 'undefined') {
@@ -142,7 +157,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
             if (!tender) {
                 calcBase.baseProgressiveFee = baseFee;
             }
-            return calculateUtil.getProgressiveFee(baseFee, '养护工程管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice);
+            return calculateUtil.getProgressiveFee(baseFee, '养护工程管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
         },
         // 一二三部分合计:取清单固定类别是“一二三部分合计”的金额
         YESBFHJ(tender) {
@@ -272,7 +287,7 @@ if (typeof gljOprObj !== 'undefined') {
 
 }
 
-if(typeof gljUtil !== 'undefined'){
+if (typeof gljUtil !== 'undefined') {
     gljUtil.getCodeSortMath = getCodeSortMath;
     gljUtil.getElecCoe = function () {
         return 0.24;
@@ -283,54 +298,54 @@ if(typeof gljUtil !== 'undefined'){
 }
 
 
-if(typeof electrovalenceObj !== 'undefined'){
+if (typeof electrovalenceObj !== 'undefined') {
     electrovalenceObj.options = [
-        {code:"270",name:"电网电",specs:"",unit:"kW·h",type:"201"},
-        {code:"905",name:"5kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
-        {code:"906",name:"15kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
-        {code:"907",name:"30kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
-        {code:"908",name:"50kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
-        {code:"909",name:"75kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
-        {code:"910",name:"100kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
-        {code:"911",name:"120kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
-        {code:"912",name:"160kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
-        {code:"913",name:"200kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
-        {code:"914",name:"250kW以内柴油发电机组",specs:"",unit:"台班",type:"301"},
-        {code:"915",name:"320kW以内柴油发电机组",specs:"",unit:"台班",type:"301"}
+        { code: "270", name: "电网电", specs: "", unit: "kW·h", type: "201" },
+        { code: "905", name: "5kW以内柴油发电机组", specs: "", unit: "台班", type: "301" },
+        { code: "906", name: "15kW以内柴油发电机组", specs: "", unit: "台班", type: "301" },
+        { code: "907", name: "30kW以内柴油发电机组", specs: "", unit: "台班", type: "301" },
+        { code: "908", name: "50kW以内柴油发电机组", specs: "", unit: "台班", type: "301" },
+        { code: "909", name: "75kW以内柴油发电机组", specs: "", unit: "台班", type: "301" },
+        { code: "910", name: "100kW以内柴油发电机组", specs: "", unit: "台班", type: "301" },
+        { code: "911", name: "120kW以内柴油发电机组", specs: "", unit: "台班", type: "301" },
+        { code: "912", name: "160kW以内柴油发电机组", specs: "", unit: "台班", type: "301" },
+        { code: "913", name: "200kW以内柴油发电机组", specs: "", unit: "台班", type: "301" },
+        { code: "914", name: "250kW以内柴油发电机组", specs: "", unit: "台班", type: "301" },
+        { code: "915", name: "320kW以内柴油发电机组", specs: "", unit: "台班", type: "301" }
     ]
 }
 
-if(typeof materialCalcObj !== 'undefined'){
+if (typeof materialCalcObj !== 'undefined') {
     materialCalcObj.getAssistProductionLabel = function () {
         return "辅助生产现场经费费率(%)";
     }
 }
 
-if(typeof projectObj !== 'undefined'){
-  projectObj.isInsertEquipmentVisable = function(selected){
-    return false;   //浙江不管是预算或者工程量清单,都是隐藏   
-  }
+if (typeof projectObj !== 'undefined') {
+    projectObj.isInsertEquipmentVisable = function (selected) {
+        return false;   //浙江不管是预算或者工程量清单,都是隐藏   
+    }
 
 }
 
 
 
-if(typeof module !== 'undefined'){
-    let _= require('lodash');
+if (typeof module !== 'undefined') {
+    let _ = require('lodash');
 
     module.exports = {
-        sortRationGLJ: function(list){
+        sortRationGLJ: function (list) {
             list = _.sortByAll(list, [function (item) {
-                return getMainType(item.gljType?item.gljType:item.type);
+                return getMainType(item.gljType ? item.gljType : item.type);
             }, getCodeSortMath()]);
             return list;
 
             function getMainType(type) {
                 let str = type + "";
-                return parseInt(str.substr(0,1));
+                return parseInt(str.substr(0, 1));
             }
         },
-        getDefalutAssistProductionFeeRate:function () {
+        getDefalutAssistProductionFeeRate: function () {
             return 15
         }
     };
@@ -343,4 +358,9 @@ function getCodeSortMath() {
     }
 }
 
-
+if (typeof module !== 'undefined') {
+    module.exports = {
+        progression,
+        deficiency
+    };
+}