浏览代码

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/YangHuCost

TonyKang 4 年之前
父节点
当前提交
a07d6a434e

+ 8 - 0
web/building_saas/standard_interface/config.js

@@ -71,6 +71,14 @@ const INTERFACE_CONFIG = (() => {
         [CONTROL]: '.BZGLKZJ',
       },
     },
+    '安徽@六安': {
+      scriptName: 'anhui_maanshan.js',
+      fileSuffix: {
+        [BID_INVITATION]: '.LAGLZB',
+        [BID_SUBMISSION]: '.LAGLTB',
+        [CONTROL]: '.LAGLKZJ',
+      },
+    },
     '安徽@池州': {
       scriptName: 'anhui_chizhou.js',
       fileSuffix: {

+ 18 - 1
web/building_saas/standard_interface/export/anhui_maanshan.js

@@ -70,7 +70,7 @@ INTERFACE_EXPORT = (() => {
         { name: 'Jsdw', value: getValueByKey(information, 'constructingUnits') }, // 建设单位
         { name: 'Czzt', value: czzt[exportKind] }, // 操作状态:招标、投标、招标控制,即导出接口时,所选的文件类型
         { name: 'Jsfs', value: taxModeMap[getValueByKey(information, 'taxMode')] || '1', type: TYPE.INT }, // 计税方式,默认1。1=一般计税 2=简易计税
-        { name: 'Version', value: ['淮北', '铜陵', '亳州'].includes(subArea) ? '1.1' : '1.0' },
+        { name: 'Version', value: ['淮北', '铜陵', '亳州', '六安'].includes(subArea) ? '1.1' : '1.0' },
       ];
       Element.call(this, 'JingJiBiao', attrs);
     }
@@ -108,6 +108,12 @@ INTERFACE_EXPORT = (() => {
           { name: 'ZbrDbSfzh', value: getValueByKey(information, 'tenderAuthorizerIDNo') }, // 招标人法定代表人或其授权人身份证号
           { name: 'ZxrDbSfzh', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') }, // 造价咨询人法定代表或其授权人纳税识别号
         ],
+        '六安': [
+          { name: 'ZbrNssbh', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') }, // 招标人纳税识别号
+          { name: 'ZxrNssbh', value: getValueByKey(information, 'costConsultantTaxpayerIdentificationNo') }, // 造价咨询人纳税识别号
+          { name: 'ZbrDbSfzh', value: getValueByKey(information, 'tenderAuthorizerIDNo') }, // 招标人法定代表人或其授权人身份证号
+          { name: 'ZxrDbSfzh', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') }, // 造价咨询人法定代表或其授权人纳税识别号
+        ],
       };
       if (extraMap[subArea]) {
         attrs.push(...extraMap[subArea]);
@@ -148,6 +154,12 @@ INTERFACE_EXPORT = (() => {
           { name: 'ZbrDbSfzh', value: getValueByKey(information, 'tenderAuthorizerIDNo') }, // 招标人法定代表人或其授权人身份证号
           { name: 'ZxrDbSfzh', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') }, // 造价咨询人法定代表或其授权人纳税识别号
         ],
+        '六安': [
+          { name: 'ZbrNssbh', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') }, // 招标人纳税识别号
+          { name: 'ZxrNssbh', value: getValueByKey(information, 'costConsultantTaxpayerIdentificationNo') }, // 造价咨询人纳税识别号
+          { name: 'ZbrDbSfzh', value: getValueByKey(information, 'tenderAuthorizerIDNo') }, // 招标人法定代表人或其授权人身份证号
+          { name: 'ZxrDbSfzh', value: getValueByKey(information, 'consultantAuthorizerTaxpayerIdentificationNo') }, // 造价咨询人法定代表或其授权人纳税识别号
+        ],
       };
       if (extraMap[subArea]) {
         attrs.push(...extraMap[subArea]);
@@ -182,6 +194,11 @@ INTERFACE_EXPORT = (() => {
           { name: 'TbrNssbh', value: getValueByKey(information, 'bidderTaxpayerIdentificationNo') }, // 投标人纳税识别号
           { name: 'TbrDbSfzh', value: getValueByKey(information, 'bidderAuthorizerTaxpayerIdentificationNo') }, // 投标人法定代表或其授权人身份证号
         ],
+        '六安': [
+          { name: 'ZbrNssbh', value: getValueByKey(information, 'tendereeTaxpayerIdentificationNo') }, // 招标人纳税识别号
+          { name: 'TbrNssbh', value: getValueByKey(information, 'bidderTaxpayerIdentificationNo') }, // 投标人纳税识别号
+          { name: 'TbrDbSfzh', value: getValueByKey(information, 'bidderAuthorizerTaxpayerIdentificationNo') }, // 投标人法定代表或其授权人身份证号
+        ],
       };
       if (extraMap[subArea]) {
         attrs.push(...extraMap[subArea]);

+ 1 - 1
web/building_saas/standard_interface/export/guangdong_zhongshan.js

@@ -1119,7 +1119,7 @@ INTERFACE_EXPORT = (() => {
             },
             {
               name: "ChapterKind",
-              value: level,
+              value: level > 3 ? 3 : level,
             },
             {
               name: "CostKind",

+ 1 - 1
web/building_saas/standard_interface/import/anhui_maanshan.js

@@ -57,7 +57,7 @@ INTERFACE_IMPORT = (() => {
           info.push({ key: 'location', value: getValue(locationItem, ['_ShuZhi']) });
         }
       }
-      if (['淮北', '铜陵'].includes(subArea)) {
+      if (['淮北', '铜陵', '六安'].includes(subArea)) {
         const extraInfo = [
           { key: 'tendereeTaxpayerIdentificationNo', value: getValue(projectSrc, ['ZhaoBiaoXx', '_ZbrNssbh']) },
           { key: 'costConsultantTaxpayerIdentificationNo', value: getValue(projectSrc, ['ZhaoBiaoXx', '_ZxrNssbh']) },

+ 439 - 0
web/over_write/js/guangxi_2021.js

@@ -0,0 +1,439 @@
+// 清单基数
+const progression = [
+  '施工场地建设费',
+  '养护管理单位项目管理费',
+  '项目信息化费',
+  '工程监理费',
+  '设计文件审查费(一阶段)',
+  '设计文件审查费(二阶段)',
+  '采用一阶段设计的工程设计费',
+  '采用二阶段设计的工程设计费',
+  '独立立项进行维修、加固的一般桥梁工程设计费',
+  '独立立项进行维修、加固的技术复杂大桥工程设计费',
+  '独立立项进行维修、加固的隧道工程设计费',
+  '招标费',
+];
+const deficiency = {
+  '设计文件审查费(一阶段)': 4000,
+  '设计文件审查费(二阶段)': 4000,
+};
+if (typeof baseFigureMap !== 'undefined') {
+  const { fixedFlag } = commonConstants;
+  const budgetMap = {
+      // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
+      '建筑安装工程费': {
+          base: 'JZAZGCF',
+          fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+          filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+          pick: false,
+      },
+      // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
+      '定额建筑安装工程费': {
+          base: 'DEJZAZGCF',
+          fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+          filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+          pick: false,
+      },
+      // 显示:除“建筑安装工程费”以外部分可显示。
+      '建筑安装工程费(不含设备费)': {
+          base: 'JZAZGCFBHSB',
+          fixedFlag: null,
+          filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+          pick: false,
+      },
+      // 显示:仅清单固定类别是“专项费用”可显示
+      '定额建筑安装工程费(不含专项费用)': {
+          base: 'DEJZAZGCFBHZX',
+          fixedFlag: null,
+          filter: [fixedFlag.SPECIAL_COST],
+          pick: true,
+      },
+      // 显示:仅清单固定类别是“安全生产费”可显示。
+      '建筑安装工程费(不含安全生产费)': {
+          base: 'JZAZGCFBHSC',
+          fixedFlag: null,
+          filter: [fixedFlag.SAFE_COST],
+          pick: true
+      },
+      // 显示:仅清单固定类别是“专项费用”可显示。
+      '施工场地建设费': {
+        isProgressive: true,
+          base: 'SGCDJSF',
+          fixedFlag: null,
+          filter: [fixedFlag.SPECIAL_COST],
+          pick: true,
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '养护管理单位项目管理费': {
+        isProgressive: true,
+        base: 'YHGLDWXMGLF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '项目信息化费': {
+        isProgressive: true,
+        base: 'XMXXHF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '工程监理费': {
+        isProgressive: true,
+        base: 'GCJLF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '设计文件审查费(一阶段)': {
+        isProgressive: true,
+        deficiency: 4000,
+        base: 'SJWJSCFYJD',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '设计文件审查费(二阶段)': {
+        isProgressive: true,
+        deficiency: 4000,
+        base: 'SJWJSCFEJD',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '采用一阶段设计的工程设计费': {
+        isProgressive: true,
+        base: 'CQYJDSJDGCSJF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '采用二阶段设计的工程设计费': {
+        isProgressive: true,
+        base: 'CQEJDSJDGCSJF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '独立立项进行维修、加固的一般桥梁工程设计费': {
+        isProgressive: true,
+        base: 'DLLXJXWXJGDYBQLGCSJF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '独立立项进行维修、加固的技术复杂大桥工程设计费': {
+        isProgressive: true,
+        base: 'DLLXJXWXJGDJSFZDQGCSJF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '独立立项进行维修、加固的隧道工程设计费': {
+        isProgressive: true,
+        base: 'DLLXJXWXJGDSDGCSJF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '招标费': {
+        isProgressive: true,
+        base: 'ZBF',
+        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: 'YBZYWQDHJ',
+          fixedFlag: null,
+          filter: [fixedFlag.ONE_HUNDRED_BILLS],
+          pick: true
+      }
+  };
+  baseFigureMap.budget = budgetMap;
+  baseFigureMap.boq = boqMap;
+}
+
+if (typeof baseFigureTemplate !== 'undefined') {
+  const { fixedFlag } = commonConstants;
+  baseFigureTemplate.budget = {
+      // 建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的金额。
+      JZAZGCF(tender) {
+          return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'common');
+      },
+      // 定额建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的定额建安费。
+      DEJZAZGCF(tender) {
+          return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'rationCommon');
+      },
+      // 建筑安装工程费(不含设备费) 算法:取清单固定类别是“建筑安装工程费”的金额,扣除设备购置。
+      JZAZGCFBHSB(tender) {
+          return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.EQUIPMENT_ACQUISITION_FEE], tender, 'common');
+      },
+      // 定额建筑安装工程费(不含专项费用) 算法:取清单固定类别是“建筑安装工程费”的定额建安费,扣除“专项费用”行的定额建安费。
+      DEJZAZGCFBHZX(tender) {
+          return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SPECIAL_COST], tender, 'rationCommon');
+      },
+      // 建筑安装工程费(不含安全生产费) 算法:取清单固定类别是“建筑安装工程费”的金额,扣除“安全生产费”的金额。
+      JZAZGCFBHSC(tender) {
+          return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SAFE_COST], tender, 'common');
+      },
+      // 施工场地建设费 算法:按“定额建筑安装工程费(不含专项费用)”为基数,以累进办法计算。
+      SGCDJSF(tender) {
+          const baseFee = this['DEJZAZGCFBHZX'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '施工场地建设费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 养护管理单位项目管理费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
+      YHGLDWXMGLF(tender) {
+          const baseFee = this['DEJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '养护管理单位项目管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 项目信息化费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
+      XMXXHF(tender) {
+          const baseFee = this['DEJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '项目信息化费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 工程监理费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
+      GCJLF(tender) {
+          const baseFee = this['DEJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 设计文件审查费(一阶段) 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
+      SJWJSCFYJD(tender) {
+          const baseFee = this['DEJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '设计文件审查费(一阶段)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 设计文件审查费(二阶段) 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
+      SJWJSCFEJD(tender) {
+          const baseFee = this['DEJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '设计文件审查费(二阶段)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 采用一阶段设计的工程设计费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
+      CQYJDSJDGCSJF(tender) {
+          const baseFee = this['DEJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '采用一阶段设计的工程设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 采用二阶段设计的工程设计费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
+      CQEJDSJDGCSJF(tender) {
+          const baseFee = this['DEJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '采用二阶段设计的工程设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 独立立项进行维修、加固的一般桥梁工程设计费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
+      DLLXJXWXJGDYBQLGCSJF(tender) {
+          const baseFee = this['DEJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '独立立项进行维修、加固的一般桥梁工程设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 独立立项进行维修、加固的技术复杂大桥工程设计费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
+      DLLXJXWXJGDJSFZDQGCSJF(tender) {
+          const baseFee = this['DEJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '独立立项进行维修、加固的技术复杂大桥工程设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 独立立项进行维修、加固的隧道工程设计费 算法:按“定额建筑安装工程费”为基数,以累进办法计算。
+      DLLXJXWXJGDSDGCSJF(tender) {
+          const baseFee = this['DEJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '独立立项进行维修、加固的隧道工程设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 招标费 算法:按“指标建筑安装工程费”为基数,以累进办法计算。
+      ZBF(tender) {
+          const baseFee = this['ZBJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '招标费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      /*  价差预备费 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
+          价差预备费 P * [(1+i)^(n-1) -1]
+          P——建筑安装工程费总额(元);
+          i——年工程造价增涨率(%);
+          n——设计文件编制年至养护项目开工年+养护项目建设期限(年)。
+      */
+      JCYBF(tender) {
+          //建筑安装工程费作为基数
+          const installFee = this['JZAZGCF'](tender);
+          //年造价增涨
+          const costGrowthRate = calcBase.project.property.costGrowthRate
+              ? calcBase.project.property.costGrowthRate
+              : 0;
+          //增涨计费年限
+          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);
+      }
+
+  };
+
+  baseFigureTemplate.boq = {
+      //{各章清单合计}
+      // 取清单固定类别是“第100章至700章清单”的金额
+      'GZQDHJ': function (tender) {
+          return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, 'common');
+      },
+      //{专项暂定合计}
+      // 第100章至700章清单行的暂估合价
+      'ZXZDHJ': function (tender) {
+          return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, 'estimate');
+      },
+      //{100章以外清单合计}
+      // 取清单固定清单[第100章至700章清单]的金额,但扣除清单100章下的金额。
+      // 如果是固定清单[第100章至700章清单]下100章以外清单引用此基数,要排除自身(目前只允许100章的清单使用,所以暂时不需要此判断)
+      'YBZYWQDHJ': function (tender) {
+          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);
+          //扣除的节点:100章的节点[100-200)
+          let deductNodes = allChildren.filter(cbTools.withingOneHundred);
+          //计算金额
+          let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee';
+          return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
+      }
+  };
+}
+
+function overwriteRationCalcBases() {
+    if (typeof rationCalcBases == 'undefined') return;
+    for (let key in rationCalcBases) delete rationCalcBases[key];
+
+    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);
+    };
+    rationCalcBases['设备购置费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice, isTender);
+    };
+
+    rationCalcBases['定额人工费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['定额材料费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptBasePrice, isTender);
+    };
+    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.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);
+    };
+};
+
+(function overwriteFeeTypes() {
+    if (typeof cpFeeTypes == 'undefined') return;
+    cpFeeTypes = [
+        { type: 'marketDirect', name: '直接费' },
+        { type: 'marketLabour', name: '人工费' },
+        { type: 'marketMaterial', name: '材料费' },
+        { type: 'marketMachine', name: '施工机械使用费' },
+        { type: 'marketEquipment', 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: '定额建安费' }
+    ];
+})();

+ 252 - 0
web/over_write/js/guangxiyusuan_2021.js

@@ -0,0 +1,252 @@
+// 清单基数
+const progression = ['养护管理单位项目管理费', '工程监理费', '招标费'];
+const deficiency = {};
+if (typeof baseFigureMap !== 'undefined') {
+  const { fixedFlag } = commonConstants;
+  const budgetMap = {
+      // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
+      '建筑安装工程费': {
+          base: 'JZAZGCF',
+          fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+          filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+          pick: false,
+      },
+      // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
+      '指标建筑安装工程费': {
+          base: 'ZBJZAZGCF',
+          fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+          filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+          pick: false,
+      },
+      // 显示:除“建筑安装工程费”以外部分可显示。
+      '建筑安装工程费(不含设备费)': {
+          base: 'JZAZGCFBHSB',
+          fixedFlag: null,
+          filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+          pick: false,
+      },
+      // 显示:仅清单固定类别是“安全生产费”可显示。
+      '建筑安装工程费(不含安全生产费)': {
+          base: 'JZAZGCFBHSC',
+          fixedFlag: null,
+          filter: [fixedFlag.SAFE_COST],
+          pick: true
+      },
+      // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+      '养护管理单位项目管理费': {
+        isProgressive: true,
+        base: 'YHGLDWXMGLF',
+        fixedFlag: null,
+        filter: [fixedFlag.MAINTENANCE_EXPENSES],
+        pick: true,
+    },
+    // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+    '工程监理费': {
+      isProgressive: true,
+      base: 'GCJLF',
+      fixedFlag: null,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+    },
+    // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+    '招标费': {
+      isProgressive: true,
+      base: 'ZBF',
+      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: 'YBZYWQDHJ',
+          fixedFlag: null,
+          filter: [fixedFlag.ONE_HUNDRED_BILLS],
+          pick: true
+      }
+  };
+  baseFigureMap.budget = budgetMap;
+  baseFigureMap.boq = boqMap;
+}
+
+if (typeof baseFigureTemplate !== 'undefined') {
+  const { fixedFlag } = commonConstants;
+  baseFigureTemplate.budget = {
+      // 建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的金额。
+      JZAZGCF(tender) {
+          return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'common');
+      },
+      // 指标建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的指标建安费。
+      ZBJZAZGCF(tender) {
+          return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'rationCommon');
+      },
+      // 建筑安装工程费(不含设备费) 算法:取清单固定类别是“建筑安装工程费”的金额,扣除设备购置。
+      JZAZGCFBHSB(tender) {
+          return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.EQUIPMENT_ACQUISITION_FEE], tender, 'common');
+      },
+      // 建筑安装工程费(不含安全生产费) 算法:取清单固定类别是“建筑安装工程费”的金额,扣除“安全生产费”的金额。
+      JZAZGCFBHSC(tender) {
+          return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SAFE_COST], tender, 'common');
+      },
+      // 养护管理单位项目管理费 算法:按“指标建筑安装工程费”为基数,以累进办法计算。
+      YHGLDWXMGLF(tender) {
+          const baseFee = this['ZBJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '养护管理单位项目管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 工程监理费 算法:按“指标建筑安装工程费”为基数,以累进办法计算。
+      GCJLF(tender) {
+          const baseFee = this['ZBJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      // 招标费 算法:按“指标建筑安装工程费”为基数,以累进办法计算。
+      ZBF(tender) {
+          const baseFee = this['ZBJZAZGCF'](tender);
+          if (!tender) {
+              calcBase.baseProgressiveFee = baseFee;
+          }
+          return calculateUtil.getProgressiveFee(baseFee, '招标费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      },
+      /*  价差预备费 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
+          价差预备费 P * [(1+i)^(n-1) -1]
+          P——建筑安装工程费总额(元);
+          i——年工程造价增涨率(%);
+          n——设计文件编制年至养护项目开工年+养护项目建设期限(年)。
+      */
+      JCYBF(tender) {
+          //建筑安装工程费作为基数
+          const installFee = this['JZAZGCF'](tender);
+          //年造价增涨
+          const costGrowthRate = calcBase.project.property.costGrowthRate
+              ? calcBase.project.property.costGrowthRate
+              : 0;
+          //增涨计费年限
+          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);
+      }
+
+  };
+
+  baseFigureTemplate.boq = {
+      //{各章清单合计}
+      // 取清单固定类别是“第100章至700章清单”的金额
+      'GZQDHJ': function (tender) {
+          return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, 'common');
+      },
+      //{专项暂定合计}
+      // 第100章至700章清单行的暂估合价
+      'ZXZDHJ': function (tender) {
+          return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, 'estimate');
+      },
+      //{100章以外清单合计}
+      // 取清单固定清单[第100章至700章清单]的金额,但扣除清单100章下的金额。
+      // 如果是固定清单[第100章至700章清单]下100章以外清单引用此基数,要排除自身(目前只允许100章的清单使用,所以暂时不需要此判断)
+      'YBZYWQDHJ': function (tender) {
+          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);
+          //扣除的节点:100章的节点[100-200)
+          let deductNodes = allChildren.filter(cbTools.withingOneHundred);
+          //计算金额
+          let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee';
+          return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
+      }
+  };
+}
+
+function overwriteRationCalcBases() {
+    if (typeof rationCalcBases == 'undefined') return;
+    for (let key in rationCalcBases) delete rationCalcBases[key];
+
+    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);
+    };
+    rationCalcBases['设备购置费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice, isTender);
+    };
+    rationCalcBases['指标人工费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['指标材料费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['指标施工机械使用费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['指标设备购置费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptBasePrice, isTender);
+    };
+};
+
+(function overwriteFeeTypes() {
+    if (typeof cpFeeTypes == 'undefined') return;
+    cpFeeTypes = [
+        { type: 'marketLabour', name: '人工费' },
+        { type: 'marketMaterial', name: '材料费' },
+        { type: 'marketMachine', name: '施工机械使用费' },
+        { type: 'marketEquipment', name: '设备购置费' },
+        { type: 'labour', name: '指标人工费' },
+        { type: 'material', name: '指标材料费' },
+        { type: 'machine', name: '指标施工机械使用费' },
+        { type: 'equipment', name: '指标设备购置费' },
+        { type: 'direct', name: '指标直接费' },
+        { type: 'manage', name: '企业管理费' },
+        { type: 'force', name: '规费' },
+        { type: 'profit', name: '利润' },
+        { type: 'tax', name: '税金' },
+        { type: 'common', name: '建安费' },
+        { type: 'rationCommon', name: '指标建安费' }
+    ];
+})();