Explorar o código

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

Tony Kang %!s(int64=3) %!d(string=hai) anos
pai
achega
237f408d09

+ 25 - 20
web/building_saas/main/js/models/calc_base.js

@@ -160,6 +160,21 @@ let cbTools = {
   //设置清单固定行下可用的基数映射
   //@param {Object}baseFigures(当前项目可用总基数配置表) {Object}mapping(可用基数映射,初始为空object,目标:{flag: Array(baseList)}) eg: {'1': ['xx费']}
   setValidBaseMapping: function (baseFigures, mapping) {
+    let baseFigures2 = {};
+    if (typeof filterByProjectKind !== "undefined") {
+      const engName = projectObj.project.property.engineeringName;
+      for (let baseName in baseFigures) {
+        const calcBase = baseFigures[baseName];
+        if (calcBase.projectKind) {
+          if (calcBase.projectKind.includes(engName)) baseFigures2[baseName] = calcBase;
+        } else {
+          baseFigures2[baseName] = calcBase;
+        }
+      }
+    } else {
+      baseFigures2 = baseFigures;
+    }
+
     //清单固定行数组[1, 2...]
     let allFlags = [];
     //清单固定行与子清单固定行映射
@@ -170,10 +185,11 @@ let cbTools = {
       let subFlagList = this.getSubFlagList(flag);
       subFlagMapping[flag] = subFlagList;
     }
-    for (let baseName in baseFigures) {
-      let calcBase = baseFigures[baseName],
+    for (let baseName in baseFigures2) {
+      let calcBase = baseFigures2[baseName],
         filter = calcBase.filter || Object.values(fixedFlag), // filter为空则全部部分都可用该基数
         pick = calcBase.pick; //挑选或过滤
+
       /* if (!filter) {
           continue;
       } */
@@ -834,24 +850,13 @@ let baseFigureTemplate = {
       let fullFeeField = tender ? "common.tenderTotalFee" : "common.totalFee";
       return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
     },
-    // {定额建安费(不含定额设备购置费)} 汇总非设备类型的定额的定额建安费
-    DEJAFBHDESBGZF: function (tender) {
-      debugger;
-      if (isLowVer(historyVer1)) {
-        const feeField = "rationCommon";
-        const subFeeField = tender ? "tenderTotalFee" : "totalFee";
-        let rations = projectObj.project.Ration.datas.filter((ration) => !(ration.type === rationType.gljRation && ration.subType === gljType.EQUIPMENT));
-        const summaryFee = rations.reduce((total, ration) => {
-          const fee = cbTools.getFee(ration, feeField, subFeeField);
-          return (total += fee);
-        }, 0);
-        return summaryFee.toDecimal(decimalObj.bills.totalPrice);
-      } else {
-        const baseFee = cbTools.getBaseFee(fixedFlag.ONE_SEVEN_BILLS, tender, "rationCommon");
-        const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.ONE_SEVEN_BILLS);
-        const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "rationCommon");
-        return (baseFee - equipmentFee).toDecimal(decimalObj.bills.totalPrice);
-      }
+    // 清单项目基数:{定额建筑安装工程费} 算法:取清单固定类别是“第100章至700章清单”的定额建安费(其中定额设备费按40%计算,税金是全额计算。公路云默认要使用此算法)。
+    // 显示:只有清单固定类别是“第100章清单总则”的部分可显示。
+    DEJZAZGCF(tender) {
+      const baseFee = cbTools.getBaseFee(fixedFlag.ONE_SEVEN_BILLS, tender, "rationCommon");
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.ONE_SEVEN_BILLS);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
+      return (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.bills.totalPrice);
     },
   },
 };

+ 31 - 18
web/building_saas/main/js/models/calc_program.js

@@ -290,6 +290,26 @@ let calcTools = {
       treeNode.changed = true;
     }
   },
+
+  checkRationCommon: function (treeNode, obj) {
+    // rationCommon 定额建安费一定要搞,因为很多清单基数都以它为基数进行计算。
+    let commonFields = ["rationCommon", "indexCommon"];
+    for (const cf of commonFields) {
+      let need = false;
+      if (cf === "rationCommon") need = true;
+      else if (cpFeeTypes.find((e) => e.type === cf)) need = true;
+      if (need) {
+        calcTools.checkFeeField(treeNode, {
+          fieldName: cf,
+          unitFee: obj.unitFee,
+          totalFee: obj.totalFee,
+          tenderUnitFee: obj.tenderUnitFee,
+          tenderTotalFee: obj.tenderTotalFee,
+        });
+      }
+    }
+  },
+
   setFieldValue: function (treeNode, fieldName, value) {
     if (value == null) value = 0;
     if (fieldName.includes("feesIndex")) {
@@ -1971,11 +1991,8 @@ class CalcProgram {
           bttf = sum_rttf;
         }
 
-        /*  if (
-          calcTools.isBillProject() &&
-          (ft.type == "common" || ft.type == "rationCommon")
-        )  */
-        if (me.project.property.billsCalcMode == leafBillGetFeeType.rationPriceConverse && (ft.type == "common" || ft.type == "rationCommon")) {
+        debugger;
+        if (me.project.property.billsCalcMode == leafBillGetFeeType.rationPriceConverse && ["common", "rationCommon", "indexCommon"].includes(ft.type)) {
           // 招投标项目, 还要反算
           // 9-24 新需求 开放正算反算选项,按选项判断
           buf = buf.toDecimal(decimalObj.bills.unitPrice);
@@ -2006,7 +2023,7 @@ class CalcProgram {
     delete treeNode.data.gljList;
     let me = this;
     me.deleteProperties(treeNode, ["programID"]);
-    me.deleteUselessFees(treeNode, ["common", "rationCommon"]);
+    me.deleteUselessFees(treeNode, ["common", "rationCommon", "indexCommon"]);
 
     let nQ = calcTools.uiNodeQty(treeNode);
     let nTQ = calcTools.uiNodeTenderQty(treeNode);
@@ -2032,14 +2049,10 @@ class CalcProgram {
     }
     calcTools.checkFeeField(treeNode, feeItem);
     //第一部分建安费下,使用基数计算的清单,定额建安费应=金额
-    if (cbTools.getBelongFlagList(treeNode).includes(fixedFlag.CONSTRUCTION_INSTALL_FEE))
-      calcTools.checkFeeField(treeNode, {
-        fieldName: "rationCommon",
-        unitFee: uf,
-        totalFee: tf,
-        tenderUnitFee: tuf,
-        tenderTotalFee: ttf,
-      });
+    if (cbTools.getBelongFlagList(treeNode).includes(fixedFlag.CONSTRUCTION_INSTALL_FEE)) {
+      let obj = { unitFee: uf, totalFee: tf, tenderUnitFee: tuf, tenderTotalFee: ttf };
+      calcTools.checkRationCommon(treeNode, obj);
+    }
 
     // 总造价清单还要做单项工程、建设项目的四大项金额汇总
     if (calcTools.isTotalCostBill(treeNode)) {
@@ -2049,6 +2062,7 @@ class CalcProgram {
       //     treeNode.data.summaryFees.totalFee = tf;
       //     treeNode.data.summaryFees.estimateFee = calcTools.getFee(treeNode, 'estimate.totalFee');
     }
+
     treeNode.data.calcTemplate = {
       calcItems: [],
     };
@@ -2058,7 +2072,7 @@ class CalcProgram {
     let me = this;
     delete treeNode.data.gljList;
     me.deleteProperties(treeNode, ["calcBase", "calcBaseValue", "tenderCalcBaseValue", "programID"]);
-    me.deleteUselessFees(treeNode, ["common", "rationCommon"]);
+    me.deleteUselessFees(treeNode, ["common", "rationCommon", "indexCommon"]);
 
     if (treeNode.data.feesIndex && treeNode.data.feesIndex.common) {
       let ftObj = {
@@ -2097,14 +2111,13 @@ class CalcProgram {
       )
         need = true;
       if (need) {
-        let ftObj2 = {
-          fieldName: "rationCommon",
+        let obj = {
           unitFee: ftObj.unitFee,
           totalFee: ftObj.totalFee,
           tenderUnitFee: ftObj.tenderUnitFee,
           tenderTotalFee: ftObj.tenderTotalFee,
         };
-        calcTools.checkFeeField(treeNode, ftObj2);
+        calcTools.checkRationCommon(treeNode, obj);
       }
     }
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3429 - 3325
web/building_saas/main/js/views/project_view.js


+ 101 - 102
web/building_saas/standard_interface/import/base.js

@@ -1,40 +1,38 @@
-
 /*
  * @Descripttion: 导入通用代码
  * @Author: vian
  * @Date: 2020-09-09 10:45:54
  */
-const XML_RN_STR = '@-@';
+const XML_RN_STR = "@-@";
 const INTERFACE_EXPORT_BASE = (() => {
-
   // xml字符实体
   const XMLEntity = {
-    ' ': 'escape{space}',
-    ' ': 'escape{simpleSpace}',
-    '	': 'escape{tab}',
-    '	': 'escape{simpleTab}',
-    '
': 'escape{return}',
-    '
': 'escape{simpleReturn}',
-    '&#000A;': 'escape{newLine}',
-    '
': 'escape{simpleNewLine}',
-    '<': 'escape{less}',
-    '>': 'escape{greater}',
-    '&': 'escape{and}',
-    '"': 'escape{quot}',
-    ''': 'escape{apos}'
+    " ": "escape{space}",
+    " ": "escape{simpleSpace}",
+    "	": "escape{tab}",
+    "	": "escape{simpleTab}",
+    "
": "escape{return}",
+    "
": "escape{simpleReturn}",
+    "&#000A;": "escape{newLine}",
+    "
": "escape{simpleNewLine}",
+    "<": "escape{less}",
+    ">": "escape{greater}",
+    "&": "escape{and}",
+    """: "escape{quot}",
+    "'": "escape{apos}",
   };
 
   // 避免字符实体进行转义。原文本中含有xml字符实体,转换为其他字符。
   function escapeXMLEntity(str) {
     for (const [key, value] of Object.entries(XMLEntity)) {
-      str = str.replace(new RegExp(key, 'g'), value);
+      str = str.replace(new RegExp(key, "g"), value);
     }
     return str;
   }
   // 将文本还原为字符实体
   function restoreXMLEntity(str) {
     for (const [key, value] of Object.entries(XMLEntity)) {
-      str = str.replace(new RegExp(value, 'g'), key);
+      str = str.replace(new RegExp(value, "g"), key);
     }
     return str;
   }
@@ -52,19 +50,19 @@ const INTERFACE_EXPORT_BASE = (() => {
     let cur = source;
     for (const field of fields) {
       if (!cur[field]) {
-        return '';
+        return "";
       }
       cur = cur[field];
     }
-    if (typeof cur === 'string') {
-      cur = cur.replace(new RegExp(XML_RN_STR, 'g'), '\r\n');
+    if (typeof cur === "string") {
+      cur = cur.replace(new RegExp(XML_RN_STR, "g"), "\r\n");
     }
-    return cur || '';
+    return cur || "";
   }
 
   // 获取布尔型的数据
   function getBool(source, fields) {
-    return getValue(source, fields) === 'true' ? true : false;
+    return getValue(source, fields) === "true" ? true : false;
   }
 
   // 获取数据类型
@@ -81,10 +79,10 @@ const INTERFACE_EXPORT_BASE = (() => {
    * */
   function arrayValue(source, fields) {
     let target = getValue(source, fields);
-    if (_plainType(target) === 'Object') {
+    if (_plainType(target) === "Object") {
       target = [target];
-    } else if (_plainType(target) !== 'Array') {
-      target = []
+    } else if (_plainType(target) !== "Array") {
+      target = [];
     }
     return target;
   }
@@ -92,10 +90,10 @@ const INTERFACE_EXPORT_BASE = (() => {
   // 获取费用
   function getFee(fees, fields) {
     if (!Array.isArray(fees) || !fees.length) {
-      return '0';
+      return "0";
     }
-    const feeData = fees.find(fee => fee.fieldName === fields[0]);
-    return feeData && feeData[fields[1]] || '0';
+    const feeData = fees.find((fee) => fee.fieldName === fields[0]);
+    return (feeData && feeData[fields[1]]) || "0";
   }
 
   // 合并价格
@@ -106,8 +104,8 @@ const INTERFACE_EXPORT_BASE = (() => {
     if (!feesB) {
       return [];
     }
-    feesB.forEach(feeB => {
-      const sameKindFee = feesA.find(feeA => feeA.fieldName === feeB.fieldName);
+    feesB.forEach((feeB) => {
+      const sameKindFee = feesA.find((feeA) => feeA.fieldName === feeB.fieldName);
       if (sameKindFee) {
         Object.assign(sameKindFee, feeB);
       } else {
@@ -125,26 +123,27 @@ const INTERFACE_EXPORT_BASE = (() => {
     const sourceAttrs = attrs || Object.keys(source);
     for (const attr of sourceAttrs) {
       // 如果值是undefined,则不进行赋值覆盖处理
-      if (attr === 'children' || source[attr] === undefined) {
+      if (attr === "children" || source[attr] === undefined) {
         continue;
       }
-      target[attr] = attr === 'fees'
-        ? mergeFees(target[attr], source[attr]) // 如果是价格,不能简单地覆盖,要合并两个对象的价格
-        : source[attr];
+      target[attr] =
+        attr === "fees"
+          ? mergeFees(target[attr], source[attr]) // 如果是价格,不能简单地覆盖,要合并两个对象的价格
+          : source[attr];
     }
   }
 
   // 获取固定ID
   function getFlag(data) {
-    return data.flags && data.flags[0] && data.flags[0].flag || 0;
+    return (data.flags && data.flags[0] && data.flags[0].flag) || 0;
   }
 
   // 设置成树结构数据
   function setTreeData(data, parent, next) {
     const defalutID = -1;
     data.ID = uuid.v1();
-    data.ParentID = parent && parent.ID || defalutID;
-    data.NextSiblingID = next && next.ID || defalutID;
+    data.ParentID = (parent && parent.ID) || defalutID;
+    data.NextSiblingID = (next && next.ID) || defalutID;
   }
 
   // 递归设置树结构数据,并返回设置好的数据,递归items数组
@@ -175,7 +174,7 @@ const INTERFACE_EXPORT_BASE = (() => {
           return obj;
         }); */
         const items = [];
-        itemsSrc.forEach(itemSrc => {
+        itemsSrc.forEach((itemSrc) => {
           const obj = extractFuc(itemSrc, field[0]);
           if (obj) {
             if (!obj.children || obj.children.length === 0) {
@@ -183,7 +182,7 @@ const INTERFACE_EXPORT_BASE = (() => {
             }
             items.push(obj);
           }
-        })
+        });
         rst.push(...items);
       }
     }
@@ -212,7 +211,7 @@ const INTERFACE_EXPORT_BASE = (() => {
    * @return {Array}
    */
   function mergeInfo(source, target) {
-    source.forEach(item => mergeChild(item, target));
+    source.forEach((item) => mergeChild(item, target));
     return target;
 
     function mergeChild(item, target) {
@@ -242,7 +241,7 @@ const INTERFACE_EXPORT_BASE = (() => {
     4: fixedFlag.DAYWORK_LABOR,
     5: fixedFlag.PROVISIONAL,
     6: fixedFlag.TOTAL_COST,
-  }
+  };
 
   /**
    * 将提取出来的清单合并进清单模板
@@ -258,33 +257,33 @@ const INTERFACE_EXPORT_BASE = (() => {
       if (!parent) {
         bills.seq = index;
       }
-      const simpleName = bills.name ? bills.name.replace(/\s/g, '') : '';
-      const titleType = bills.titleType || '0';
+      const simpleName = bills.name ? bills.name.replace(/\s/g, "") : "";
+      const titleType = bills.titleType || "0";
       let matched;
       if (!parent) {
         if (titleTypeToFlag[titleType] === fixedFlag.ONE_SEVEN_BILLS || /100章.*章|100章.*700章|100章.*900章/.test(simpleName)) {
-          matched = target.find(bills => getFlag(bills) === fixedFlag.ONE_SEVEN_BILLS);
+          matched = target.find((bills) => getFlag(bills) === fixedFlag.ONE_SEVEN_BILLS);
         } else if (titleTypeToFlag[titleType] === fixedFlag.PROVISIONAL_TOTAL || /包含在清单合计中的材料、工程设备、专业工程暂估/.test(simpleName)) {
-          matched = target.find(bills => getFlag(bills) === fixedFlag.PROVISIONAL_TOTAL);
+          matched = target.find((bills) => getFlag(bills) === fixedFlag.PROVISIONAL_TOTAL);
         } else if (titleTypeToFlag[titleType] === fixedFlag.BILLS_TOTAL_WT_PROV || /清单合计减去材料、工程设备、专业工程暂估价/.test(simpleName)) {
-          matched = target.find(bills => getFlag(bills) === fixedFlag.BILLS_TOTAL_WT_PROV);
+          matched = target.find((bills) => getFlag(bills) === fixedFlag.BILLS_TOTAL_WT_PROV);
         } else if (titleTypeToFlag[titleType] === fixedFlag.DAYWORK_LABOR || /计日工合计/.test(simpleName)) {
-          matched = target.find(bills => getFlag(bills) === fixedFlag.DAYWORK_LABOR);
+          matched = target.find((bills) => getFlag(bills) === fixedFlag.DAYWORK_LABOR);
         } else if (titleTypeToFlag[titleType] === fixedFlag.PROVISIONAL || /暂列金额[((]不含/.test(simpleName)) {
-          matched = target.find(bills => getFlag(bills) === fixedFlag.PROVISIONAL);
+          matched = target.find((bills) => getFlag(bills) === fixedFlag.PROVISIONAL);
         } else if (titleTypeToFlag[titleType] === fixedFlag.TOTAL_COST || /报价/.test(simpleName)) {
-          matched = target.find(bills => getFlag(bills) === fixedFlag.TOTAL_COST);
+          matched = target.find((bills) => getFlag(bills) === fixedFlag.TOTAL_COST);
         }
       } else {
-        const parentSimpleName = parent.name ? parent.name.replace(/\s/g, '') : '';
+        const parentSimpleName = parent.name ? parent.name.replace(/\s/g, "") : "";
         if (/100章.*章|100章.*700章|100章.*900章/.test(parentSimpleName) && /100章总则/.test(simpleName)) {
-          matched = target.find(bills => getFlag(bills) === fixedFlag.ONE_HUNDRED_BILLS);
+          matched = target.find((bills) => getFlag(bills) === fixedFlag.ONE_HUNDRED_BILLS);
         } else if (/计日工合计/.test(parentSimpleName) && /劳务/.test(simpleName)) {
-          matched = target.find(bills => getFlag(bills) === fixedFlag.LABOUR_SERVICE);
+          matched = target.find((bills) => getFlag(bills) === fixedFlag.LABOUR_SERVICE);
         } else if (/计日工合计/.test(parentSimpleName) && /材料/.test(simpleName)) {
-          matched = target.find(bills => getFlag(bills) === fixedFlag.MATERIAL);
+          matched = target.find((bills) => getFlag(bills) === fixedFlag.MATERIAL);
         } else if (/计日工合计/.test(parentSimpleName) && /机械/.test(simpleName)) {
-          matched = target.find(bills => getFlag(bills) === fixedFlag.CONSTRUCTION_MACHINE);
+          matched = target.find((bills) => getFlag(bills) === fixedFlag.CONSTRUCTION_MACHINE);
         }
       }
       if (matched) {
@@ -316,7 +315,7 @@ const INTERFACE_EXPORT_BASE = (() => {
     // 如果只导入文件中有的清单,除100-700/900章清单、报价清单外,其他未匹配到的固定清单模板,均不导入
     function removeNotMatchFlagBills(bills) {
       const rst = [];
-      bills.forEach(item => {
+      bills.forEach((item) => {
         const flag = getFlag(item);
         if (!flag || [fixedFlag.ONE_SEVEN_BILLS, fixedFlag.TOTAL_COST].includes(flag) || matchedFlags.includes(flag)) {
           rst.push(item);
@@ -328,7 +327,7 @@ const INTERFACE_EXPORT_BASE = (() => {
       return rst;
     }
     if (onlyImportMatchBills) {
-      billsTarget = removeNotMatchFlagBills(billsTarget)
+      billsTarget = removeNotMatchFlagBills(billsTarget);
     }
 
     // 大项费用按照清单标题排序
@@ -356,7 +355,7 @@ const INTERFACE_EXPORT_BASE = (() => {
         }
         if (child.rowCode) {
           const regStr = /{[^{}]+}/.test(child.rowCode) ? child.rowCode : `\\b${child.rowCode}\\b`;
-          rowCodeData.push({ reg: new RegExp(regStr, 'g'), ID: child.ID, rowCode: child.rowCode });
+          rowCodeData.push({ reg: new RegExp(regStr, "g"), ID: child.ID, rowCode: child.rowCode });
         }
         if (child.tempCalcBase) {
           toBeTransformBills.push(child);
@@ -368,7 +367,7 @@ const INTERFACE_EXPORT_BASE = (() => {
     }
     setBills(billsTarget, -1);
     // 转换计算基数
-    toBeTransformBills.forEach(bills => {
+    toBeTransformBills.forEach((bills) => {
       rowCodeData.forEach(({ reg, ID, rowCode }) => {
         const rowCodeReg = new RegExp(`{${rowCode}}`);
         // 替换行号
@@ -378,26 +377,28 @@ const INTERFACE_EXPORT_BASE = (() => {
           bills.tempCalcBase = bills.tempCalcBase.replace(reg, `@${ID}`);
         }
         // 替换基数,防止其他公司的软件导出没有{}
-        bills.tempCalcBase = bills.tempCalcBase.replace(/.?专项暂定合计.?/g, '{专项暂定合计}');
-        bills.tempCalcBase = bills.tempCalcBase.replace(/.?各章清单合计.?/g, '{各章清单合计}');
+        bills.tempCalcBase = bills.tempCalcBase.replace(/.?专项暂定合计.?/g, "{专项暂定合计}");
+        bills.tempCalcBase = bills.tempCalcBase.replace(/.?各章清单合计.?/g, "{各章清单合计}");
       });
 
       /* 检查基数有效性,无效则使用模板的基数 */
       // 消除ID引用对基数分割的影响
       const IDs = bills.tempCalcBase.match(/@[\da-zA-Z-]{36}/g) || [];
       const bases = [...IDs];
-      const str = bills.tempCalcBase.replace(/@[\da-zA-Z-]{36}/g, '');
-      const otherBases = str.split(/[+-/*]/).filter(item => !!item);
+      const str = bills.tempCalcBase.replace(/@[\da-zA-Z-]{36}/g, "");
+      const otherBases = str.split(/[+-/*]/).filter((item) => !!item);
       bases.push(...otherBases);
       // 判定基数有效性
-      const isValid = bases.every(base => {
-        if (base === '{专项暂定合计}' || base === '{各章清单合计}') {
+      const isValid = bases.every((base) => {
+        if (base === "{专项暂定合计}" || base === "{各章清单合计}") {
           return true;
         }
-        if (/^(\d+(\.\d+)?)%?$/.test(base)) { // 数值+%(可有可无)
+        if (/^(\d+(\.\d+)?)%?$/.test(base)) {
+          // 数值+%(可有可无)
           return true;
         }
-        if (/[\da-zA-Z-]{36}/.test(base)) { // ID引用
+        if (/[\da-zA-Z-]{36}/.test(base)) {
+          // ID引用
           return true;
         }
         return false;
@@ -406,7 +407,7 @@ const INTERFACE_EXPORT_BASE = (() => {
         bills.calcBase = bills.tempCalcBase;
       }
     });
-    rst.forEach(bills => delete bills.children);
+    rst.forEach((bills) => delete bills.children);
     return rst;
   }
 
@@ -437,22 +438,22 @@ const INTERFACE_EXPORT_BASE = (() => {
       tender.projType = projectType.tender;
       const featureTarget = _.cloneDeep(templateData.feature); // 必须拷贝出一份新数据,否则会被下一个单位工程覆盖
       if (!engineeringLib) {
-        throw '不存在可用工程专业。';
+        throw "不存在可用工程专业。";
       }
       const taxData = engineeringLib.lib.tax_group[0];
       const featureSource = [
         ...(tender.feature || []),
-        { key: 'valuationType', value: '工程量清单' }, // 导入的时候以下项不一定有数据,但是需要自动生成
-        { key: 'feeStandard', value: engineeringLib.lib.feeName },
+        { key: "valuationType", value: "工程量清单" }, // 导入的时候以下项不一定有数据,但是需要自动生成
+        { key: "feeStandard", value: engineeringLib.lib.feeName },
       ];
-      const needEngineering = featureTarget && featureTarget.find(item => item.key === 'engineering');
+      const needEngineering = featureTarget && featureTarget.find((item) => item.key === "engineering");
       if (needEngineering) {
-        featureSource.push({ key: 'engineering', value: engineeringLib.lib.name });
+        featureSource.push({ key: "engineering", value: engineeringLib.lib.name });
       }
       tender.property = {
         areaKey,
         rootProjectID: tender.ParentID,
-        region: '全省',
+        region: "全省",
         engineering_id: engineeringLib.engineering_id,
         engineeringName: engineeringLib.lib.name,
         feeStandardName: engineeringLib.lib.feeName,
@@ -465,21 +466,21 @@ const INTERFACE_EXPORT_BASE = (() => {
         boqType: commonConstants.BOQType.BID_SUBMISSION, // 导入后必为投标
         taxType: taxData.taxType,
         projectFeature: mergeInfo(featureSource, featureTarget),
-        featureLibID: engineeringLib.lib.feature_lib[0] && engineeringLib.lib.feature_lib[0].id || '',
+        featureLibID: (engineeringLib.lib.feature_lib[0] && engineeringLib.lib.feature_lib[0].id) || "",
         calcProgram: { name: taxData.program_lib.name, id: taxData.program_lib.id },
         colLibID: taxData.col_lib.id,
         templateLibID: taxData.template_lib.id,
         unitPriceFile: { name: tender.name, id: templateData.unitPriceFileBeginID + index }, // 新建单价文件
-        feeFile: { name: tender.name, id: `newFeeRate@@${taxData.fee_lib.id}` } // 新建费率文件
+        feeFile: { name: tender.name, id: `newFeeRate@@${taxData.fee_lib.id}` }, // 新建费率文件
       };
       delete tender.feature;
       const tenderDataBills = getTemplateBillsTarget(templateData.bills);
       tender.bills = handleBills(tender.bills, tenderDataBills, tender.ID, onlyImportMatchBills); // 必须要拷贝一份,否则多单位工程情况下,前单位工程的清单数据会被后单位工程的覆盖
       // 给暂估材料和评标材料设置项目数据
-      const setGLJRefFunc = glj => {
+      const setGLJRefFunc = (glj) => {
         glj.ID = uuid.v1();
         glj.projectID = tender.ID;
-      }
+      };
       if (tender.evaluationList && tender.evaluationList.length) {
         tender.evaluationList.forEach(setGLJRefFunc);
       }
@@ -501,27 +502,26 @@ const INTERFACE_EXPORT_BASE = (() => {
   async function handleImportData(importData, areaKey, onlyImportMatchBills) {
     const valuationID = compilationData.ration_valuation[0].id;
     if (!Array.isArray(importData.tenders) && !importData.tenders.length) {
-      throw '导入的文件中不存在有效的标段数据。';
+      throw "导入的文件中不存在有效的标段数据。";
     }
     const projectCount = 1 + importData.tenders.length;
     // const feeName = compilationData.name === '安徽养护(2018)' ? '安徽养护' : '公路工程';
     // 一些接口需要根据导入文件,匹配工程专业库
-    debugger;
     const rationValuationData = rationValuation && JSON.parse(rationValuation)[0]; // 只有工程量清单才能导入接口
     if (!rationValuationData) {
-      throw '无法获取工程量清单计价数据';
+      throw "无法获取工程量清单计价数据";
     }
-    const engineeringList = (rationValuationData.engineering_list || []).filter(item => item.lib.visible);
+    const engineeringList = (rationValuationData.engineering_list || []).filter((item) => item.lib.visible);
     let engineeringLib = engineeringList[0];
     if (importData.engineeringName && importData.feeName) {
-      const matchLibs = engineeringList.filter(item => item.lib && item.lib.name === importData.engineeringName);
-      engineeringLib = matchLibs.find(item => item.lib.feeName === importData.feeName) || matchLibs[0] || engineeringList[0];
+      const matchLibs = engineeringList.filter((item) => item.lib && item.lib.name === importData.engineeringName);
+      engineeringLib = matchLibs.find((item) => item.lib.feeName === importData.feeName) || matchLibs[0] || engineeringList[0];
     }
     const engineeringID = engineeringLib.engineering_id || null;
 
-    const templateData = await ajaxPost('/pm/api/getImportTemplateData', { user_id: userID, valuationID, engineeringID, projectCount });
+    const templateData = await ajaxPost("/pm/api/getImportTemplateData", { user_id: userID, valuationID, engineeringID, projectCount });
     if (!templateData) {
-      throw '无法获取有效模板数据。';
+      throw "无法获取有效模板数据。";
     }
     console.log(templateData);
     // 处理建设项目数据
@@ -543,7 +543,7 @@ const INTERFACE_EXPORT_BASE = (() => {
     importData.property = {
       valuationType: commonConstants.ValuationType.BOQ, // 必为工程量清单
       boqType: commonConstants.BOQType.BID_SUBMISSION, // 导入后必为投标
-      basicInformation: mergeInfo(importData.info, templateData.basicInfo) // 将提取的基本信息数据与标准基本信息数据进行合并(目前只赋值,没有匹配到的不追加)
+      basicInformation: mergeInfo(importData.info, templateData.basicInfo), // 将提取的基本信息数据与标准基本信息数据进行合并(目前只赋值,没有匹配到的不追加)
     };
     delete importData.info;
     // 处理单位工程数据
@@ -552,25 +552,25 @@ const INTERFACE_EXPORT_BASE = (() => {
   }
 
   /*
-  * 读取文件转换为utf-8编码的字符串
-  * @param {Blob} file
-  * @return {Promise}
-  * */
+   * 读取文件转换为utf-8编码的字符串
+   * @param {Blob} file
+   * @return {Promise}
+   * */
   function readAsTextSync(file) {
     return new Promise((resolve, reject) => {
       const fr = new FileReader();
-      fr.readAsText(file);    // 默认utf-8,如果出现乱码,得看导入文件是什么编码
+      fr.readAsText(file); // 默认utf-8,如果出现乱码,得看导入文件是什么编码
       fr.onload = function () {
         resolve(this.result);
       };
       fr.onerror = function () {
-        reject('读取文件失败,请重试。');
-      }
+        reject("读取文件失败,请重试。");
+      };
     });
   }
 
   /**
-   * 
+   *
    * @param {Function} entryFunc - 各导入接口提取导入数据方法
    * @param {File} file - 导入的文件
    * @param {String} areaKey - 地区标识,如:'安徽@马鞍山'
@@ -586,10 +586,10 @@ const INTERFACE_EXPORT_BASE = (() => {
       xmlStr = escapeXMLEntity(xmlStr);
     }
 
-    let reg1 = new RegExp('>\r\n', 'g');
-    xmlStr = xmlStr.replace(reg1, '>');
+    let reg1 = new RegExp(">\r\n", "g");
+    xmlStr = xmlStr.replace(reg1, ">");
 
-    let reg2 = new RegExp('\r\n', 'g');
+    let reg2 = new RegExp("\r\n", "g");
     xmlStr = xmlStr.replace(reg2, XML_RN_STR);
 
     // reg = /(?<=子目名称).+(?=单位)/g;
@@ -605,7 +605,7 @@ const INTERFACE_EXPORT_BASE = (() => {
     xmlObj = JSON.parse(restoreXMLEntity(JSON.stringify(xmlObj)));
     console.log(xmlObj);
     if (!xmlObj) {
-      throw '无有效数据。';
+      throw "无有效数据。";
     }
     const importData = await entryFunc(areaKey, xmlObj);
     console.log(areaKey);
@@ -616,6 +616,5 @@ const INTERFACE_EXPORT_BASE = (() => {
   return {
     UTIL,
     extractImportData,
-  }
-
-})();
+  };
+})();

+ 15 - 2
web/over_write/js/anhui_2019.js

@@ -219,7 +219,13 @@ if (typeof baseFigureMap !== 'undefined') {
             fixedFlag: null,
             filter: [fixedFlag.ONE_HUNDRED_BILLS],
             pick: true
-        }
+        },
+        '定额建筑安装工程费(不含定额设备购置费)': {
+            base: "DEJZAZGCF",
+            fixedFlag: null,
+            filter: [fixedFlag.ONE_HUNDRED_BILLS],
+            pick: true,
+          },
     };
     baseFigureMap.budget = budgetMap;
     baseFigureMap.boq = boqMap;
@@ -369,7 +375,14 @@ if (typeof baseFigureTemplate !== 'undefined') {
             //计算金额
             let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee';
             return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
-        }
+        },
+        // 清单项目基数:{定额建筑安装工程费(不含定额设备购置费)} 算法:取清单固定类别是“第100章至700章清单”的定额建安费(扣除定额设备购置费+税金),同重庆。显示:只有清单固定类别是“第100章清单总则”的部分可显示。
+        DEJZAZGCF(tender) {
+            const baseFee = cbTools.getBaseFee(fixedFlag.ONE_SEVEN_BILLS, tender, "rationCommon");
+            const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.ONE_SEVEN_BILLS);
+            const equipmentTaxFee = cbTools.getEquipmentFee(fixedNode, tender, "rationCommon");
+            return (baseFee - equipmentTaxFee).toDecimal(decimalObj.bills.totalPrice);
+        },
     };
 }
 

+ 55 - 24
web/over_write/js/chongqing_2018.js

@@ -2,39 +2,70 @@
  * Created by zhang on 2018/8/14.
  */
 
-
 //重庆综合里程、工地转移费率值修改特殊处理
 
-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
+  路线工程监理费: 20000, // 不足2万按2万
+  独立桥梁隧道工程监理费: 20000,
+  设计文件审查费: 3000,
 };
 
-if (typeof module !== 'undefined') {
-    module.exports = {
-        progression,
-        deficiency
-    };
-}
+if (typeof module !== "undefined") {
+  module.exports = {
+    progression,
+    deficiency,
+  };
+}
+
+// {定额建安费(不含定额设备购置费)}
+if (typeof baseFigureTemplate !== "undefined") {
+  baseFigureTemplate.boq.DEJAFBHDESBGZF = function (tender) {
+    // 旧:汇总定额的定额建安费(不含设备类型的定额、不含工料机定额、不含量x价清单)。因缺少量x价清单的定额建安费,新版本不再使用。
+    if (isLowVer(historyVer1)) {
+      const feeField = "rationCommon";
+      const subFeeField = tender ? "tenderTotalFee" : "totalFee";
+      let rations = projectObj.project.Ration.datas.filter((ration) => !(ration.type === rationType.gljRation && ration.subType === gljType.EQUIPMENT));
+      const summaryFee = rations.reduce((total, ration) => {
+        const fee = cbTools.getFee(ration, feeField, subFeeField);
+        return (total += fee);
+      }, 0);
+      return summaryFee.toDecimal(decimalObj.bills.totalPrice);
+    } else {
+      // 新:根结点的定额建安费(含 量x价清单的定额建安费),扣除定额设备费+税金。其中,设备费:传入rationCommon时,表示定额设备费+税金。传入equipment表示定额设备费
+      const baseFee = cbTools.getBaseFee(fixedFlag.ONE_SEVEN_BILLS, tender, "rationCommon");
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.ONE_SEVEN_BILLS);
+      const equipmentTaxFee = cbTools.getEquipmentFee(fixedNode, tender, "rationCommon");
+      return (baseFee - equipmentTaxFee).toDecimal(decimalObj.bills.totalPrice);
+    }
+  };
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 537 - 461
web/over_write/js/gansu_2021.js


+ 496 - 433
web/over_write/js/guangxi_2021.js

@@ -1,473 +1,536 @@
 // 清单基数
 const progression = [
-  '施工场地建设费',
-  '养护管理单位项目管理费',
-  '项目信息化费',
-  '工程监理费',
-  '设计文件审查费(一阶段)',
-  '设计文件审查费(二阶段)',
-  '采用一阶段设计的工程设计费',
-  '采用二阶段设计的工程设计费',
-  '独立立项进行维修、加固的一般桥梁工程设计费',
-  '独立立项进行维修、加固的技术复杂大桥工程设计费',
-  '独立立项进行维修、加固的隧道工程设计费',
-  '招标费',
+  "施工场地建设费",
+  "养护管理单位项目管理费",
+  "项目信息化费",
+  "工程监理费",
+  "设计文件审查费(一阶段)",
+  "设计文件审查费(二阶段)",
+  "采用一阶段设计的工程设计费",
+  "采用二阶段设计的工程设计费",
+  "独立立项进行维修、加固的一般桥梁工程设计费",
+  "独立立项进行维修、加固的技术复杂大桥工程设计费",
+  "独立立项进行维修、加固的隧道工程设计费",
+  "招标费",
 ];
 const deficiency = {
-  '设计文件审查费(一阶段)': 4000,
-  '设计文件审查费(二阶段)': 4000,
+  "设计文件审查费(一阶段)": 4000,
+  "设计文件审查费(二阶段)": 4000,
 };
-if (typeof baseFigureMap !== 'undefined') {
+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,
-      },
+    // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
+    建筑安装工程费: {
+      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
-      }
+    //仅允许用于固定类别是“第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,
+    },
+    定额建筑安装工程费: {
+      base: "DEJZAZGCF",
+      fixedFlag: null,
+      filter: [fixedFlag.ONE_HUNDRED_BILLS],
+      pick: true,
+    },
   };
   baseFigureMap.budget = budgetMap;
   baseFigureMap.boq = boqMap;
 }
 
-if (typeof baseFigureTemplate !== 'undefined') {
+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) {
-          let baseFee = this['JZAZGCF'](tender);
-          const fixedNode = projectObj.project.mainTree.roots.find(node => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
-          const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender);
-          baseFee = (baseFee - equipmentFee).toDecimal(decimalObj.process);
-          return baseFee.toDecimal(decimalObj.bills.totalPrice);
-      },
-      // 定额建筑安装工程费(不含专项费用) 算法:取清单固定类别是“建筑安装工程费”的定额建安费,扣除“专项费用”行的定额建安费。
-      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['DEJZAZGCF'](tender);
-          if (!tender) {
-              calcBase.baseProgressiveFee = baseFee;
-          }
-          return calculateUtil.getProgressiveFee(baseFee, '招标费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
-      },
-      /*  价差预备费 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
+    // 建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的金额。
+    JZAZGCF(tender) {
+      return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, "common");
+    },
+    // 定额建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的定额建安费。
+    DEJZAZGCF(tender) {
+      return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, "rationCommon");
+    },
+    // 建筑安装工程费(不含设备费) 算法:取清单固定类别是“建筑安装工程费”的金额,扣除设备购置。
+    JZAZGCFBHSB(tender) {
+      let baseFee = this["JZAZGCF"](tender);
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender);
+      baseFee = (baseFee - equipmentFee).toDecimal(decimalObj.process);
+      return baseFee.toDecimal(decimalObj.bills.totalPrice);
+    },
+    // 定额建筑安装工程费(不含专项费用) 算法:取清单固定类别是“建筑安装工程费”的定额建安费,扣除“专项费用”行的定额建安费。
+    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["DEJZAZGCF"](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);
-      }
-
+    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);
-                  }
-              }
+    //{各章清单合计}
+    // 取清单固定类别是“第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);
+        }
       }
+      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);
+    },
+    // 清单项目基数:{定额建筑安装工程费} 算法:取清单固定类别是“第100章至700章清单”的定额建安费(其中定额设备费按40%计算,税金是全额计算)。显示:只有清单固定类别是“第100章清单总则”的部分可显示。
+    DEJZAZGCF(tender) {
+      const baseFee = cbTools.getBaseFee(fixedFlag.ONE_SEVEN_BILLS, tender, "rationCommon");
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.ONE_SEVEN_BILLS);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
+      return (baseFee - equipmentFee * 0.6).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.machineDetailFee(node, node.data.gljList, [], gljType.MACHINE_LABOUR, 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);
-    };
-};
+  if (typeof rationCalcBases == "undefined") return;
+  for (let key in rationCalcBases) delete rationCalcBases[key];
 
-if (typeof projectObj !== 'undefined') {
-    projectObj.isInsertEquipmentVisable = function (selected) {
-        return true;   //广西不管是预算或者工程量清单,都是显示
-    }
-  }
+  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.machineDetailFee(node, node.data.gljList, [], gljType.MACHINE_LABOUR, 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);
+  };
+}
 
+if (typeof projectObj !== "undefined") {
+  projectObj.isInsertEquipmentVisable = function (selected) {
+    return true; //广西不管是预算或者工程量清单,都是显示
+  };
+}
 
-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"));//设置显示的节点值
-        }
-        if (subRate.name == "施工进出场(km)" && value && value < 5) {//施工进出场5km以内按3km算
-            result.valueKey = "5";
-            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")); //设置显示的节点值
     }
+    if (subRate.name == "施工进出场(km)" && value && value < 5) {
+      //施工进出场5km以内按3km算
+      result.valueKey = "5";
+      result.value = scMathUtil.roundForObj(value, getDecimal("feeRate")); //设置显示的节点值
+    }
+    return result;
+  };
 }
 
-
 (function overwriteFeeTypes() {
-    if (typeof cpFeeTypes == 'undefined') return;
-    cpFeeTypes = [
-        { type: 'marketDirect', name: '直接费' },
-        { type: 'marketLabour', name: '人工费' },
-        { type: 'marketMaterial', name: '材料费' },
-        { type: 'marketMachine', name: '施工机械使用费' },
-        { type: 'marketMachineLabour', name: '施工机械人工费' },
-        { type: 'marketEquipment', name: '设备购置费' },
+  if (typeof cpFeeTypes == "undefined") return;
+  cpFeeTypes = [
+    { type: "marketDirect", name: "直接费" },
+    { type: "marketLabour", name: "人工费" },
+    { type: "marketMaterial", name: "材料费" },
+    { type: "marketMachine", name: "施工机械使用费" },
+    { type: "marketMachineLabour", name: "施工机械人工费" },
+    { type: "marketEquipment", 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: "measure", name: "措施费" },
+    { type: "manage", name: "企业管理费" },
+    { type: "force", name: "规费" },
+    { type: "profit", name: "利润" },
+    { type: "tax", name: "税金" },
+    { type: "common", name: "建安费" },
+    { type: "rationCommon", name: "定额建安费" },
+  ];
 })();

+ 17 - 13
web/over_write/js/henan_2022.js

@@ -174,6 +174,13 @@ if (typeof baseFigureMap !== "undefined") {
       filter: [fixedFlag.ONE_HUNDRED_BILLS],
       pick: true,
     },
+
+    定额建筑安装工程费: {
+      base: "DEJZAZGCF",
+      fixedFlag: null,
+      filter: [fixedFlag.ONE_HUNDRED_BILLS],
+      pick: true,
+    },
   };
   baseFigureMap.budget = budgetMap;
   baseFigureMap.boq = boqMap;
@@ -210,27 +217,17 @@ if (typeof baseFigureTemplate !== "undefined") {
     },
     // 定额建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的定额建安费(其中定额设备费按40%计算)。
     DEJZAZGCF(tender) {
-      // const engName = projectObj.project.property.engineeringName;
       const feeField = "rationCommon";
-      // if (isLittleFix(engName)) {
-      // 小修的没有设备购置固定行
       const baseFee = cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, feeField);
       const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
       const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
       return (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.bills.totalPrice);
-      // } else {
-      //   const deductFlags = [fixedFlag.EQUIPMENT_ACQUISITION_FEE];
-      //   //建安费扣除定额设备购置费
-      //   const afterDeductFee = cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, deductFlags, tender, feeField, false);
-      //   //定额设备购置费
-      //   const equipmentAcFee = cbTools.getBaseFee(deductFlags[0], tender, "equipment");
-      //   const equipmentAcTaxFee = cbTools.getBaseFee(deductFlags[0], tender, "tax");
-      //   return (afterDeductFee + equipmentAcFee * 0.4 + equipmentAcTaxFee).toDecimal(decimalObj.bills.totalPrice);
-      // }
     },
     DEJZAZGCFBHZXF(tender) {
       // 定额建筑安装工程费(不含专项费用)
-      return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SPECIAL_COST], tender, "rationCommon", true);
+      const baseFee = this["DEJZAZGCF"](tender);
+      const zxf = cbTools.getBaseFee(fixedFlag.SPECIAL_COST, tender, "rationCommon");
+      return (baseFee - zxf).toDecimal(decimalObj.bills.totalPrice);
     },
     // 设备费 算法:取清单固定类别是“设备购置”的建安费
     SBF(tender) {
@@ -518,6 +515,13 @@ if (typeof baseFigureTemplate !== "undefined") {
       let fullFeeField = tender ? "common.tenderTotalFee" : "common.totalFee";
       return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
     },
+    // 清单项目基数:{定额建筑安装工程费} 算法:取清单固定类别是“第100章至700章清单”的定额建安费(其中定额设备费按40%计算,税金是全额计算)。显示:只有清单固定类别是“第100章清单总则”的部分可显示。
+    DEJZAZGCF(tender) {
+      const baseFee = cbTools.getBaseFee(fixedFlag.ONE_SEVEN_BILLS, tender, "rationCommon");
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.ONE_SEVEN_BILLS);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
+      return (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.bills.totalPrice);
+    },
   };
 }
 

+ 250 - 206
web/over_write/js/henan_richang_2022.js

@@ -1,4 +1,107 @@
 // 河南日常养护(2022)
+let filterByProjectKind = true;
+
+function overwriteRationCalcBases() {
+  if (typeof rationCalcBases == "undefined") return;
+
+  rationCalcBases = {
+    人工费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptMarketPrice, isTender);
+    },
+    材料费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptMarketPrice, isTender);
+    },
+    施工机械使用费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.GENERAL_MACHINE], priceTypes.ptMarketPrice, isTender);
+    },
+    施工机械人工费: function (node, isTender) {
+      return calcTools.machineDetailFee(node, node.data.gljList, [], gljType.MACHINE_LABOUR, isTender);
+    },
+    定额商品砼费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.COMMERCIAL_CONCRETE, gljType.COMMERCIAL_MORTAR], priceTypes.ptBasePrice, isTender);
+    },
+    定额外购砼构件费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.PURCHASE_COMPONENT], priceTypes.ptBasePrice, isTender);
+    },
+    定额绿化苗木费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.GREEN_SEEDLING], priceTypes.ptBasePrice, isTender);
+    },
+    设备购置费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice, isTender);
+    },
+    定额人工费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice, isTender);
+    },
+    定额材料费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptBasePrice, isTender);
+    },
+    定额施工机械使用费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.GENERAL_MACHINE], priceTypes.ptBasePrice, isTender);
+    },
+    定额设备购置费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptBasePrice, isTender);
+    },
+    指标人工费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice, isTender);
+    },
+    指标材料费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptBasePrice, isTender);
+    },
+    指标施工机械使用费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.GENERAL_MACHINE], priceTypes.ptBasePrice, isTender);
+    },
+    指标设备购置费: function (node, isTender) {
+      return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptBasePrice, isTender);
+    },
+  };
+}
+
+function overwriteFeeTypesWhenHasProperty(engineeringName) {
+  if (typeof cpFeeTypes == "undefined") return;
+
+  cpFeeTypes = [
+    { type: "marketLabour", name: "人工费" },
+    { type: "marketMaterial", name: "材料费" },
+    { type: "marketMachine", name: "施工机械使用费" },
+    { type: "marketMachineLabour", name: "施工机械人工费" },
+    { type: "marketEquipment", name: "设备购置费" },
+    { type: "marketDirect", name: "直接费" },
+  ];
+
+  if (engineeringName === "日常养护") {
+    cpFeeTypes.push(
+      { type: "labour", name: "定额人工费" },
+      { type: "material", name: "定额材料费" },
+      { type: "machine", name: "定额施工机械使用费" },
+      { type: "equipment", name: "定额设备费" },
+      { type: "direct", name: "定额直接费" }
+    );
+  } else {
+    cpFeeTypes.push(
+      { type: "indexLabour", name: "指标人工费" },
+      { type: "indexMaterial", name: "指标材料费" },
+      { type: "indexMachine", name: "指标施工机械使用费" },
+      { type: "indexEquipment", name: "指标设备购置费" },
+      { type: "indexDirect", name: "指标直接费" }
+    );
+  }
+
+  cpFeeTypes.push(
+    { type: "measure", name: "措施费" },
+    { type: "manage", name: "企业管理费" },
+    { type: "force", name: "规费" },
+    { type: "profit", name: "利润" },
+    { type: "tax", name: "税金" },
+    { type: "common", name: "建安费" }
+  );
+
+  if (engineeringName === "日常养护") {
+    cpFeeTypes.push({ type: "rationCommon", name: "定额建安费" });
+  } else {
+    cpFeeTypes.push({ type: "indexCommon", name: "指标建安费" });
+  }
+}
+
 if (typeof feeRateObject !== "undefined") {
   feeRateObject.feeRateSpecialHandle = function (subRate, value) {
     let result = {};
@@ -26,16 +129,15 @@ const littleFixNames = ["小修", "养护检查预算", "日常养护预算"];
 const progression = ["养护管理单位项目管理费", "工程监理费", "设计文件审查费"];
 const deficiency = { 工程监理费: 10000, 设计文件审查费: 10000 };
 if (typeof baseFigureMap !== "undefined") {
+  // projectKind: ["日常养护"], 有指定这个属性的,表示只有“日常养护”养护类别的项目显示。没有指定这个属性的,大家都显示。
   const { fixedFlag } = commonConstants;
   const budgetMap = {
-    // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示。
     建筑安装工程费: {
       base: "JZAZGCF",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
       pick: false,
     },
-    // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示
     "建筑安装工程费(不含设备费)": {
       base: "JZAZGCFBHSB",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
@@ -49,69 +151,128 @@ if (typeof baseFigureMap !== "undefined") {
       filter: [fixedFlag.SAFE_COST],
       pick: true,
     },
-    // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示
     定额建筑安装工程费: {
       base: "DEJZAZGCF",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
       pick: false,
+      projectKind: ["日常养护"],
     },
     "定额建筑安装工程费(不含专项费用)": {
       base: "DEJZAZGCFBHZXF",
       fixedFlag: null,
       filter: [fixedFlag.SPECIAL_COST],
       pick: true,
+      projectKind: ["日常养护"],
+    },
+    施工场地建设费: {
+      isProgressive: true,
+      base: "SGCDJSF",
+      fixedFlag: null,
+      filter: [fixedFlag.CONSTRUCTION_PLANT_COST],
+      pick: true,
+      projectKind: ["日常养护"],
     },
-    // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
     养护管理单位项目管理费: {
       isProgressive: true,
       base: "YHGLDWXMGLF",
       fixedFlag: null,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
+      projectKind: ["日常养护"],
     },
     信息化费: {
       isProgressive: true,
-      base: "YHXMXXHF",
+      base: "XXHF",
       fixedFlag: null,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
+      projectKind: ["日常养护"],
     },
     工程监理费: {
       isProgressive: true,
-      base: "YHGCJLF",
+      base: "GCJLF",
       fixedFlag: null,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
+      projectKind: ["日常养护"],
     },
-    前期工作费: {
+    /*     前期工作费: {
       isProgressive: true,
       base: "QQGZF",
       fixedFlag: null,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
-    },
-    施工场地建设费: {
-      isProgressive: true,
-      base: "SGCDJSF",
-      fixedFlag: null,
-      filter: [fixedFlag.CONSTRUCTION_PLANT_COST],
-      pick: true,
-    },
-    // 显示:除清单固定类别是“一二三四部分合计”的以外部分可显示。
+      projectKind: ["日常养护"],
+    }, */
     一二三四部分合计: {
       base: "YESSBFHJ",
       fixedFlag: fixedFlag.ONE_TO_FOUR_TOTAL,
       filter: [fixedFlag.ONE_TO_FOUR_TOTAL],
       pick: false,
     },
-    // 显示:仅“价差预备费”可显示
     价差预备费: {
       base: "JCYBF",
       fixedFlag: null,
       filter: [fixedFlag.SPREAD_BUDGET_FEE],
       pick: true,
     },
+
+    // 以下是 河南日常养护-日常养护年度预算 用到的基数。和“指标”相关
+    "施工场地建设费(指标)": {
+      isProgressive: true,
+      base: "ZBSGCDJSF",
+      fixedFlag: null,
+      filter: [fixedFlag.CONSTRUCTION_PLANT_COST],
+      pick: true,
+      projectKind: ["日常养护年度预算"],
+    },
+    "养护管理单位项目管理费(指标)": {
+      isProgressive: true,
+      base: "ZBYHGLDWXMGLF",
+      fixedFlag: null,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+      projectKind: ["日常养护年度预算"],
+    },
+    "信息化费(指标)": {
+      isProgressive: true,
+      base: "ZBXXHF",
+      fixedFlag: null,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+      projectKind: ["日常养护年度预算"],
+    },
+    "工程监理费(指标)": {
+      isProgressive: true,
+      base: "ZBGCJLF",
+      fixedFlag: null,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+      projectKind: ["日常养护年度预算"],
+    },
+    /* "前期工作费(指标)": {
+      isProgressive: true,
+      base: "ZBQQGZF",
+      fixedFlag: null,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+      projectKind: ["日常养护年度预算"],
+    }, */
+    指标建筑安装工程费: {
+      base: "ZBJZAZGCF",
+      fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+      filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+      pick: false,
+      projectKind: ["日常养护年度预算"],
+    },
+    "指标建筑安装工程费(不含专项费用)": {
+      base: "ZBJZAZGCFBHZXF",
+      fixedFlag: null,
+      filter: [fixedFlag.SPECIAL_COST],
+      pick: true,
+      projectKind: ["日常养护年度预算"],
+    },
   };
   const boqMap = {
     //仅允许用于固定类别是“第100章至700章清单”以外的清单
@@ -132,6 +293,12 @@ if (typeof baseFigureMap !== "undefined") {
       filter: [fixedFlag.ONE_HUNDRED_BILLS],
       pick: true,
     },
+    /*     定额建筑安装工程费: {
+      base: "DEJZAZGCF",
+      fixedFlag: null,
+      filter: [fixedFlag.ONE_HUNDRED_BILLS],
+      pick: true,
+    }, */
   };
   baseFigureMap.budget = budgetMap;
   baseFigureMap.boq = boqMap;
@@ -145,11 +312,11 @@ const isLittleFix = (engName) => {
 if (typeof baseFigureTemplate !== "undefined") {
   const { fixedFlag } = commonConstants;
   baseFigureTemplate.budget = {
-    // 建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的建安费。
+    // {建筑安装工程费} 算法:取清单固定类别是“建筑安装工程费”的建安费。
     JZAZGCF(tender) {
       return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, "common");
     },
-    // 建筑安装工程费(不含设备费)算法:取清单固定类别是“建筑安装工程费”的金额 - {设备费}。
+    // {建筑安装工程费(不含设备费)} 算法:取清单固定类别是“建筑安装工程费”的金额 - {设备费}。
     JZAZGCFBHSB(tender) {
       // const engName = projectObj.project.property.engineeringName;
       // if (isLittleFix(engName)) {
@@ -162,197 +329,81 @@ if (typeof baseFigureTemplate !== "undefined") {
       //   return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.EQUIPMENT_ACQUISITION_FEE], tender, "common");
       // }
     },
+    // {建筑安装工程费(不含安全生产费)}
     JZAZGCFBHAQSCF(tender) {
       return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SAFE_COST], tender, "common");
     },
-    // 定额建筑安装工程费 算法:取清单固定类别是“建筑安装工程费”的定额建安费(其中定额设备费按40%计算)。
+    // {定额建筑安装工程费} 算法:取清单固定类别是“建筑安装工程费”的定额建安费(其中定额设备费按40%计算,税金按全额计算)。
     DEJZAZGCF(tender) {
-      // const engName = projectObj.project.property.engineeringName;
       const feeField = "rationCommon";
-      // if (isLittleFix(engName)) {
-      // 小修的没有设备购置固定行
       const baseFee = cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, feeField);
       const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
       const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
       return (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.bills.totalPrice);
-      // } else {
-      //   const deductFlags = [fixedFlag.EQUIPMENT_ACQUISITION_FEE];
-      //   //建安费扣除定额设备购置费
-      //   const afterDeductFee = cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, deductFlags, tender, feeField, false);
-      //   //定额设备购置费
-      //   const equipmentAcFee = cbTools.getBaseFee(deductFlags[0], tender, "equipment");
-      //   const equipmentAcTaxFee = cbTools.getBaseFee(deductFlags[0], tender, "tax");
-      //   return (afterDeductFee + equipmentAcFee * 0.4 + equipmentAcTaxFee).toDecimal(decimalObj.bills.totalPrice);
-      // }
     },
+    // {定额建筑安装工程费(不含专项费用)}
     DEJZAZGCFBHZXF(tender) {
-      // 定额建筑安装工程费(不含专项费用)
-      return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SPECIAL_COST], tender, "rationCommon", true);
-    },
-    // 设备费 算法:取清单固定类别是“设备购置”的建安费
-    SBF(tender) {
-      return cbTools.getBaseFee(fixedFlag.EQUIPMENT_ACQUISITION_FEE, tender, "common");
-    },
-    // 设备费 算法:取清单固定类别是“设备购置”的定额建安费
-    DESBF(tender) {
-      return cbTools.getBaseFee(fixedFlag.EQUIPMENT_ACQUISITION_FEE, tender, "rationCommon");
-    },
-    // 养护工程费 算法:取清单固定类别是“养护工程费”的金额。
-    YHGCF(tender) {
-      return cbTools.getBaseFee(fixedFlag.MAINTENANCE_FEE, tender, "common");
-    },
-    // 定额养护工程费 算法:取清单固定类别是“养护工程费”的定额建安费(其中定额设备费按40%计算)。
-    DEYHGCF(tender) {
-      // const engName = projectObj.project.property.engineeringName;
-      const feeField = "rationCommon";
-      // if (isLittleFix(engName)) {
-      // 小修的没有设备购置固定行
-      const baseFee = cbTools.getBaseFee(fixedFlag.MAINTENANCE_FEE, tender, feeField);
-      const fixedNode = projectObj.project.mainTree.items.find((node) => node.getFlag() === fixedFlag.MAINTENANCE_FEE);
-      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
-      return (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.bills.totalPrice);
-      // } else {
-      //   const deductFlags = [fixedFlag.EQUIPMENT_ACQUISITION_FEE];
-      //   //建安费扣除定额设备购置费
-      //   const afterDeductFee = cbTools.getFeeWithDeduction(fixedFlag.MAINTENANCE_FEE, deductFlags, tender, feeField, false);
-      //   //定额设备购置费
-      //   const equipmentAcFee = cbTools.getBaseFee(deductFlags[0], tender, "equipment");
-      //   const equipmentAcTaxFee = cbTools.getBaseFee(deductFlags[0], tender, "tax");
-      //   return (afterDeductFee + equipmentAcFee * 0.4 + equipmentAcTaxFee).toDecimal(decimalObj.bills.totalPrice);
-      // }
-    },
-    // 养护管理单位项目管理费 算法:以{定额建筑安装工程费}为基数,采用累进办法计算。。
-    YHGLDWXMGLF(tender) {
       const baseFee = this["DEJZAZGCF"](tender);
-      if (!tender) {
-        calcBase.baseProgressiveFee = baseFee;
-      }
-      return calculateUtil.getProgressiveFee(
-        baseFee,
-        "养护管理单位项目管理费",
-        projectObj.project.property.progressiveInterval,
-        decimalObj.bills.totalPrice,
-        deficiency
-      );
+      const zxf = cbTools.getBaseFee(fixedFlag.SPECIAL_COST, tender, "rationCommon");
+      return (baseFee - zxf).toDecimal(decimalObj.bills.totalPrice);
     },
-    // 工程监理费 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
-    YHGCJLF(tender) {
-      const baseFee = this["DEJZAZGCF"](tender);
-      if (!tender) {
-        calcBase.baseProgressiveFee = baseFee;
-      }
-      return calculateUtil.getProgressiveFee(baseFee, "工程监理费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
-    },
-    // 前期工作费 以{定额建筑安装工程费}为基数,采用累进办法计算。仅清单固定类别是“养护工程其他费”部分可显示。
-    QQGZF(tender) {
-      const baseFee = this["DEJZAZGCF"](tender);
-      if (!tender) {
-        calcBase.baseProgressiveFee = baseFee;
-      }
-      return calculateUtil.getProgressiveFee(baseFee, "前期工作费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
-    },
-    // 养护工程监理费(路线工程) 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
-    YHGCJLFLXGC(tender) {
-      const baseFee = this["DEJZAZGCF"](tender);
-      if (!tender) {
-        calcBase.baseProgressiveFee = baseFee;
-      }
-      return calculateUtil.getProgressiveFee(
-        baseFee,
-        "养护工程监理费(路线工程)",
-        projectObj.project.property.progressiveInterval,
-        decimalObj.bills.totalPrice,
-        deficiency
-      );
-    },
-    // 养护工程监理费(桥梁及隧道工程) 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
-    YHGCJLFQLJSDGC(tender) {
-      const baseFee = this["DEJZAZGCF"](tender);
+    // {施工场地建设费} 算法:以{定额养护工程费}为基数,采用累进办法计算
+    SGCDJSF(tender) {
+      const baseFee = this["DEJZAZGCFBHZXF"](tender);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
       return calculateUtil.getProgressiveFee(
         baseFee,
-        "养护工程监理费(桥梁及隧道工程)",
+        "施工场地建设费",
         projectObj.project.property.progressiveInterval,
         decimalObj.bills.totalPrice,
         deficiency
       );
     },
-    // 设计文件审查费 算法:以{定额建筑安装工程费}为基数,采用累进办法计算。
-    SJWJSCF(tender) {
+    // {养护管理单位项目管理费} 算法:以{定额建筑安装工程费}为基数,采用累进办法计算。。
+    YHGLDWXMGLF(tender) {
       const baseFee = this["DEJZAZGCF"](tender);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
       return calculateUtil.getProgressiveFee(
         baseFee,
-        "设计文件审查费",
+        "养护管理单位项目管理费",
         projectObj.project.property.progressiveInterval,
         decimalObj.bills.totalPrice,
         deficiency
       );
     },
     // {信息化费} 算法:以{定额建筑安装工程费}为基数,采用累进办法计算。仅清单固定类别是“养护工程其他费”部分可显示。(计算结果去掉不足10000元时按10000元计取)
-    YHXMXXHF(tender) {
+    XXHF(tender) {
       const baseFee = this["DEJZAZGCF"](tender);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
       return calculateUtil.getProgressiveFee(baseFee, "信息化费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
     },
-    // 养护工程设计费(路线工程) 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
-    YHGCSJFLXGC(tender) {
+    // {工程监理费} 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
+    GCJLF(tender) {
       const baseFee = this["DEJZAZGCF"](tender);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(
-        baseFee,
-        "养护工程设计费(路线工程)",
-        projectObj.project.property.progressiveInterval,
-        decimalObj.bills.totalPrice,
-        deficiency
-      );
+      return calculateUtil.getProgressiveFee(baseFee, "工程监理费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
     },
-    // 养护工程设计费(独立桥梁、隧道工程) 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
-    YHGCSJFQLSDGC(tender) {
+    // {前期工作费} 以{定额建筑安装工程费}为基数,采用累进办法计算。仅清单固定类别是“养护工程其他费”部分可显示。
+    QQGZF(tender) {
       const baseFee = this["DEJZAZGCF"](tender);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(
-        baseFee,
-        "养护工程设计费(独立桥梁、隧道工程)",
-        projectObj.project.property.progressiveInterval,
-        decimalObj.bills.totalPrice,
-        deficiency
-      );
-    },
-    // 施工场地建设费 算法:以{定额养护工程费}为基数,采用累进办法计算
-    SGCDJSF(tender) {
-      const baseFee = this["DEJZAZGCFBHZXF"](tender);
-      // 小修保养类别,施工场地建设费的计算基数定额建筑安装工程费超过30000000元时,不进行累进计算,直接按500000元计取。
-      // const engName = projectObj.project.property.engineeringName;
-      // if (isLittleFix(engName) && baseFee > 30000000) {
-      //   return 500000;
-      // }
-      if (!tender) {
-        calcBase.baseProgressiveFee = baseFee;
-      }
-      return calculateUtil.getProgressiveFee(
-        baseFee,
-        "施工场地建设费",
-        projectObj.project.property.progressiveInterval,
-        decimalObj.bills.totalPrice,
-        deficiency
-      );
+      return calculateUtil.getProgressiveFee(baseFee, "前期工作费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
     },
-    // 一二三四部分合计 算法:取清单固定类别是“一二三四部分合计”的金额
+    // {一二三四部分合计} 算法:取清单固定类别是“一二三四部分合计”的金额
     YESSBFHJ(tender) {
       return cbTools.getBaseFee(fixedFlag.ONE_TO_FOUR_TOTAL, tender, "common");
     },
-    /*  价差预备费 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
+    /*  {价差预备费} 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
             价差预备费 P * [(1+i)^(n-1) -1]
             P——建筑安装工程费总额(元);
             i——年工程造价增涨率(%);
@@ -368,87 +419,73 @@ if (typeof baseFigureTemplate !== "undefined") {
       //= P * [(1+i)^(n-1) -1]
       return (installFee * (Math.pow(1 + costGrowthRate, growthPeriod - 1) - 1)).toDecimal(decimalObj.bills.totalPrice);
     },
-    // 设计文件审查费(一阶段) 算法:以{定额建筑安装工程费}为基数,采用累进办法计算。
-    // 设计文件审查费(一阶段)和 设计文件审查费(二阶段)两个基数计算后金额不满2000元均应按2000元计。
-    SJWJSCFYJD(tender) {
-      const baseFee = this["DEJZAZGCF"](tender);
-      if (!tender) {
-        calcBase.baseProgressiveFee = baseFee;
-      }
-      const rst = calculateUtil.getProgressiveFee(
-        baseFee,
-        "设计文件审查费(一阶段)",
-        projectObj.project.property.progressiveInterval,
-        decimalObj.bills.totalPrice,
-        deficiency
-      );
-      return Math.max(rst, 2000);
+
+    // 以下是 河南日常养护-日常养护年度预算 用到的基数。和“指标”相关
+    // {指标建筑安装工程费}
+    ZBJZAZGCF(tender) {
+      const feeField = "indexCommon";
+      const baseFee = cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, feeField);
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "indexEquipment");
+      return (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.bills.totalPrice);
     },
-    SJWJSCFEJD(tender) {
-      const baseFee = this["DEJZAZGCF"](tender);
+    // {指标建筑安装工程费(不含专项费用)} 取清单固定类别是“建筑安装工程费”的指标建安费(其中指标设备费按40%计算+全额设备税金),扣除“专项费用”行的指标建安费。
+    ZBJZAZGCFBHZXF(tender) {
+      const baseFee = this["ZBJZAZGCF"](tender);
+      const zxf = cbTools.getBaseFee(fixedFlag.SPECIAL_COST, tender, "indexCommon");
+      return (baseFee - zxf).toDecimal(decimalObj.bills.totalPrice);
+    },
+    // {指标施工场地建设费}
+    ZBSGCDJSF(tender) {
+      const baseFee = this["ZBJZAZGCFBHZXF"](tender);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      const rst = calculateUtil.getProgressiveFee(
+      return calculateUtil.getProgressiveFee(
         baseFee,
-        "设计文件审查费(二阶段)",
+        "施工场地建设费",
         projectObj.project.property.progressiveInterval,
         decimalObj.bills.totalPrice,
         deficiency
       );
-      return Math.max(rst, 2000);
     },
-    GCSJFYJD(tender) {
-      const baseFee = this["DEJZAZGCF"](tender);
+    // {指标养护管理单位项目管理费}
+    ZBYHGLDWXMGLF(tender) {
+      const baseFee = this["ZBJZAZGCF"](tender);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
       return calculateUtil.getProgressiveFee(
         baseFee,
-        "工程设计费(一阶段)",
+        "养护管理单位项目管理费",
         projectObj.project.property.progressiveInterval,
         decimalObj.bills.totalPrice,
         deficiency
       );
     },
-    GCSJFEJD(tender) {
-      const baseFee = this["DEJZAZGCF"](tender);
+    // {指标信息化费}
+    ZBXXHF(tender) {
+      const baseFee = this["ZBJZAZGCF"](tender);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(
-        baseFee,
-        "工程设计费(二阶段)",
-        projectObj.project.property.progressiveInterval,
-        decimalObj.bills.totalPrice,
-        deficiency
-      );
+      return calculateUtil.getProgressiveFee(baseFee, "信息化费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
     },
-    ZBDLFJBDBZF(tender) {
-      const baseFee = this["DEJZAZGCF"](tender);
+    // {指标工程监理费}
+    ZBGCJLF(tender) {
+      const baseFee = this["ZBJZAZGCF"](tender);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(
-        baseFee,
-        "招标代理费及标底编制费",
-        projectObj.project.property.progressiveInterval,
-        decimalObj.bills.totalPrice,
-        deficiency
-      );
+      return calculateUtil.getProgressiveFee(baseFee, "工程监理费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
     },
-    ZBDLFJBDBZFWSXZBDL(tender) {
-      const baseFee = this["DEJZAZGCF"](tender);
+    // {指标前期工作费}
+    ZBQQGZF(tender) {
+      const baseFee = this["ZBJZAZGCF"](tender);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(
-        baseFee,
-        "招标代理费及标底编制费(未实行招标代理)",
-        projectObj.project.property.progressiveInterval,
-        decimalObj.bills.totalPrice,
-        deficiency
-      );
+      return calculateUtil.getProgressiveFee(baseFee, "前期工作费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
     },
   };
 
@@ -483,6 +520,13 @@ if (typeof baseFigureTemplate !== "undefined") {
       let fullFeeField = tender ? "common.tenderTotalFee" : "common.totalFee";
       return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
     },
+    // 清单项目基数:{定额建筑安装工程费} 算法:取清单固定类别是“第100章至700章清单”的定额建安费(其中定额设备费按40%计算,税金是全额计算)。显示:只有清单固定类别是“第100章清单总则”的部分可显示。
+    DEJZAZGCF(tender) {
+      const baseFee = cbTools.getBaseFee(fixedFlag.ONE_SEVEN_BILLS, tender, "rationCommon");
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.ONE_SEVEN_BILLS);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
+      return (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.bills.totalPrice);
+    },
   };
 }
 

+ 449 - 397
web/over_write/js/hunan_2020.js

@@ -6,434 +6,486 @@ let isHN2020 = true;
 
 // 一般计税取不含税市场价、不含税定额价。简易计税取含税市场价、含税定额价。打开项目时,4个价格根据计税类型只载入其二,所以这里可不作区分。
 function overwriteRationCalcBases(taxType) {
-    if (typeof rationCalcBases == 'undefined') return;
-    for (let key in rationCalcBases) delete rationCalcBases[key];
-    // let isJY = taxType == '2';
+  if (typeof rationCalcBases == "undefined") return;
+  for (let key in rationCalcBases) delete rationCalcBases[key];
+  // let isJY = taxType == '2';
 
-    rationCalcBases['人工费'] = function (node, isTender) {
-        return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptMarketPrice, isTender);
-    };
-    rationCalcBases['材料费'] = function (node, isTender) {
-        return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptMarketPrice, isTender);
-    };
-    rationCalcBases['施工机械使用费'] = function (node, isTender) {
-        return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptMarketPrice, isTender);
-    };
-    rationCalcBases['施工机械人工费'] = function (node, isTender) {
-        return calcTools.machineDetailFee(node, node.data.gljList, [], gljType.MACHINE_LABOUR, 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);
-    }
-};
+  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.machineDetailFee(node, node.data.gljList, [], gljType.MACHINE_LABOUR, 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: 'marketLabour', name: '人工费' },
-        { type: 'marketMaterial', name: '材料费' },
-        { type: 'marketMachine', name: '施工机械使用费' },
-        { type: 'marketMachineLabour', name: '施工机械人工费' },
-        { type: 'marketEquipment', name: '设备购置费' },
-        { type: 'marketDirect', name: '直接费' },
+  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: '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: 'measure1', name: '措施费I' },
-        { type: 'measure2', name: '措施费II' },
-        { type: 'manage', name: '企业管理费' },
-        { type: 'force', name: '规费' },
-        { type: 'profit', name: '利润' },
-        { type: 'tax', name: '税金' },
-        { type: 'common', name: '建安费' },
-        { type: 'rationCommon', name: '定额建安费' }
-    ];
+    { type: "measure", name: "措施费" },
+    { type: "measure1", name: "措施费I" },
+    { type: "measure2", name: "措施费II" },
+    { type: "manage", name: "企业管理费" },
+    { type: "force", name: "规费" },
+    { type: "profit", name: "利润" },
+    { type: "tax", name: "税金" },
+    { type: "common", name: "建安费" },
+    { type: "rationCommon", name: "定额建安费" },
+  ];
 })();
 
 // 清单基数
-const progression = ['施工场地建设费', '养护单位项目管理费', '养护单位项目管理费(未单独设置项目部)', '工程监理费', '工程监理费(未实行社会监理)', '设计文件审查费', '工程设计费'];
+const progression = [
+  "施工场地建设费",
+  "养护单位项目管理费",
+  "养护单位项目管理费(未单独设置项目部)",
+  "工程监理费",
+  "工程监理费(未实行社会监理)",
+  "设计文件审查费",
+  "工程设计费",
+];
 const deficiency = {};
-if (typeof baseFigureMap !== 'undefined') {
-    const { fixedFlag } = commonConstants;
-    const budgetMap = {
-        // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示
-        '养护工程费': {
-            base: 'YHGCF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
-            pick: false,
-        },
-        // 显示:仅清单固定类别是“安全生产费”的可显示
-        '养护工程费(不含安全生产费)': {
-            base: 'YHGCFBHSC',
-            fixedFlag: null,
-            filter: [fixedFlag.SAFE_COST],
-            pick: true
-        },
-        // 显示:仅清单固定类别是“养护工程其他费用”部分可显示
-        '养护工程费(不含设备费)': {
-            base: 'YHGCFBHSB',
-            fixedFlag: null,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true
-        },
-        // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示
-        '定额养护工程费': {
-            base: 'DEYHGCF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
-            pick: false
-        },
-        // 显示:仅清单固定类别是“养护工程其他费用”、“施工场地建设费”的可显示
-        '定额养护工程费(不含专项费用)': {
-            base: 'DEYHGCFBHZXFY',
-            fixedFlag: null,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES, fixedFlag.CONSTRUCTION_PLANT_COST],
-            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: 'YHDWXMGLF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
-        '养护单位项目管理费(未单独设置项目部)': {
-            isProgressive: true,
-            base: 'YHDWXMGLFWSXMB',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
-        '工程监理费': {
-            isProgressive: true,
-            base: 'GCJLF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
-        '工程监理费(未实行社会监理)': {
-            isProgressive: true,
-            base: 'GCJLFWSXSHJL',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
-        '设计文件审查费': {
-            isProgressive: true,
-            base: 'SJWJSCF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
-        '工程设计费': {
-            isProgressive: true,
-            base: 'GCSJF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            filter: [fixedFlag.MAINTENANCE_EXPENSES],
-            pick: true,
-        },
-        // 显示:仅“价差预备费”可显示
-        '价差预备费': {
-            base: 'JCYBF',
-            fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-            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.budget = budgetMap;
-    baseFigureMap.boq = boqMap;
+if (typeof baseFigureMap !== "undefined") {
+  const { fixedFlag } = commonConstants;
+  const budgetMap = {
+    // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示
+    养护工程费: {
+      base: "YHGCF",
+      fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+      filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+      pick: false,
+    },
+    // 显示:仅清单固定类别是“安全生产费”的可显示
+    "养护工程费(不含安全生产费)": {
+      base: "YHGCFBHSC",
+      fixedFlag: null,
+      filter: [fixedFlag.SAFE_COST],
+      pick: true,
+    },
+    // 显示:仅清单固定类别是“养护工程其他费用”部分可显示
+    "养护工程费(不含设备费)": {
+      base: "YHGCFBHSB",
+      fixedFlag: null,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+    },
+    // 显示:除清单固定类别是“建筑安装工程费”的以外部分可显示
+    定额养护工程费: {
+      base: "DEYHGCF",
+      fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+      filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
+      pick: false,
+    },
+    // 显示:仅清单固定类别是“养护工程其他费用”、“施工场地建设费”的可显示
+    "定额养护工程费(不含专项费用)": {
+      base: "DEYHGCFBHZXFY",
+      fixedFlag: null,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES, fixedFlag.CONSTRUCTION_PLANT_COST],
+      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: "YHDWXMGLF",
+      fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+    },
+    // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+    "养护单位项目管理费(未单独设置项目部)": {
+      isProgressive: true,
+      base: "YHDWXMGLFWSXMB",
+      fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+    },
+    // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+    工程监理费: {
+      isProgressive: true,
+      base: "GCJLF",
+      fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+    },
+    // 显示:仅清单固定类别是“养护工程其他费用”部分可显示。
+    "工程监理费(未实行社会监理)": {
+      isProgressive: true,
+      base: "GCJLFWSXSHJL",
+      fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+    },
+    // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
+    设计文件审查费: {
+      isProgressive: true,
+      base: "SJWJSCF",
+      fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+    },
+    // 显示:只有清单固定类别是“养护工程其他费用”部分可显示。
+    工程设计费: {
+      isProgressive: true,
+      base: "GCSJF",
+      fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+      filter: [fixedFlag.MAINTENANCE_EXPENSES],
+      pick: true,
+    },
+    // 显示:仅“价差预备费”可显示
+    价差预备费: {
+      base: "JCYBF",
+      fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
+      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,
+    },
+    定额建筑安装工程费: {
+      base: "DEJZAZGCF",
+      fixedFlag: null,
+      filter: [fixedFlag.ONE_HUNDRED_BILLS],
+      pick: true,
+    },
+  };
+  baseFigureMap.budget = budgetMap;
+  baseFigureMap.boq = boqMap;
 }
 
-if (typeof baseFigureTemplate !== 'undefined') {
-    const { fixedFlag } = commonConstants;
-    baseFigureTemplate.budget = {
-        // 养护工程费 算法:取清单固定类别是“建筑安装工程费”的金额。
-        YHGCF(tender) {
-            return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'common');
-        },
-        // 养护工程费(不含安全生产费) 算法:取清单固定类别是“建筑安装工程费”的金额,扣除“安全生产费”的金额。
-        YHGCFBHSC(tender) {
-            return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SAFE_COST], tender, 'common');
-        },
-        // 养护工程费(不含设备费) 算法:取清单固定类别是“建筑安装工程费”的金额,扣除设备的金额(所有设备类型的人材机型定额)。
-        YHGCFBHSB(tender) {
-            let baseFee = this['YHGCF'](tender);
-            const fixedNode = projectObj.project.mainTree.roots.find(node => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
-            const allSubNodes = [];
-            projectObj.project.mainTree.getAllSubNode(fixedNode, allSubNodes);
-            const equipmentNodes = allSubNodes.filter(node => node.data.type === rationType.gljRation && node.data.subType === gljType.EQUIPMENT);
-            const feeField = 'common';
-            const subFeeField = tender ? 'tenderTotalFee' : 'totalFee';
-            for (const node of equipmentNodes) {
-                const data = node.data;
-                if (cbTools.isUnDef(data.feesIndex) || _.isEmpty(data.feesIndex) ||
-                    cbTools.isUnDef(data.feesIndex[feeField]) || cbTools.isUnDef(data.feesIndex[feeField][subFeeField])) {
-                    continue;
-                }
-                baseFee -= data.feesIndex[feeField][subFeeField];
-            }
-            return baseFee.toDecimal(decimalObj.bills.totalPrice);
-        },
-        // 定额养护工程费 取清单固定类别是“建筑安装工程费”的定额建安费。
-        DEYHGCF(tender) {
-            return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'rationCommon');
-        },
-        // 定额养护工程费(不含专项费用) 算法:取清单固定类别是“建筑安装工程费”的“定额建安费”,扣除“专项费用”的“定额建安费”。
-        DEYHGCFBHZXFY(tender) {
-            return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SPECIAL_COST], tender, 'rationCommon');
-        },
-        // 土地使用及拆迁补偿费 算法:取清单固定类别是“土地使用及拆迁补偿费”的金额。
-        TDSYJCQBCF(tender) {
-            return cbTools.getBaseFee(fixedFlag.LAND_USED_DEMOLITION, tender, 'common');
-        },
-        // 工程建设其他费用 算法:取清单固定类别是“养护工程其他费用”的金额。
-        GCJSQTFY(tender) {
-            return cbTools.getBaseFee(fixedFlag.MAINTENANCE_EXPENSES, tender, 'common');
-        },
-        // 施工场地建设费 算法:以{定额养护工程费(不含专项费用)}为基数,采用累进办法计算。
-        SGCDJSF(tender) {
-            const baseFee = this['DEYHGCFBHZXFY'](tender);
-            if (!tender) {
-                calcBase.baseProgressiveFee = baseFee;
-            }
-            return calculateUtil.getProgressiveFee(baseFee, '施工场地建设费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
-        },
-        // 养护单位项目管理费 算法:以{定额养护工程费}为基数,采用累进办法计算。
-        YHDWXMGLF(tender) {
-            const baseFee = this['DEYHGCF'](tender);
-            if (!tender) {
-                calcBase.baseProgressiveFee = baseFee;
-            }
-            return calculateUtil.getProgressiveFee(baseFee, '养护单位项目管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
-        },
-        // 养护单位项目管理费(未单独设置项目部) 算法:以{定额养护工程费}为基数,采用累进办法计算。
-        YHDWXMGLFWSXMB(tender) {
-            const baseFee = this['DEYHGCF'](tender);
-            if (!tender) {
-                calcBase.baseProgressiveFee = baseFee;
-            }
-            return calculateUtil.getProgressiveFee(baseFee, '养护单位项目管理费(未单独设置项目部)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
-        },
-        // 工程监理费 算法:以{定额养护工程费}为基数,采用累进办法计算。
-        GCJLF(tender) {
-            const baseFee = this['DEYHGCF'](tender);
-            if (!tender) {
-                calcBase.baseProgressiveFee = baseFee;
-            }
-            return calculateUtil.getProgressiveFee(baseFee, '工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
-        },
-        // 工程监理费(未实行社会监理) 算法:以{定额养护工程费}为基数,采用累进办法计算。
-        GCJLFWSXSHJL(tender) {
-            const baseFee = this['DEYHGCF'](tender);
-            if (!tender) {
-                calcBase.baseProgressiveFee = baseFee;
-            }
-            return calculateUtil.getProgressiveFee(baseFee, '工程监理费(未实行社会监理)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
-        },
-        // 设计文件审查费 算法:以{定额养护工程费}为基数,采用累进办法计算。
-        SJWJSCF(tender) {
-            const baseFee = this['DEYHGCF'](tender);
-            if (!tender) {
-                calcBase.baseProgressiveFee = baseFee;
-            }
-            return calculateUtil.getProgressiveFee(baseFee, '设计文件审查费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
-        },
-        // 工程设计费 算法:以{定额养护工程费}为基数,采用累进办法计算。
-        GCSJF(tender) {
-            const baseFee = this['DEYHGCF'](tender);
-            if (!tender) {
-                calcBase.baseProgressiveFee = baseFee;
-            }
-            return calculateUtil.getProgressiveFee(baseFee, '工程设计费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
-        },
-        /*  价差预备费 算法:以建筑安装工程费为基数,按设计文件编制年始至养护项目工程竣工年终的年数和年工程造价增涨率计算。
+if (typeof baseFigureTemplate !== "undefined") {
+  const { fixedFlag } = commonConstants;
+  baseFigureTemplate.budget = {
+    // 养护工程费 算法:取清单固定类别是“建筑安装工程费”的金额。
+    YHGCF(tender) {
+      return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, "common");
+    },
+    // 养护工程费(不含安全生产费) 算法:取清单固定类别是“建筑安装工程费”的金额,扣除“安全生产费”的金额。
+    YHGCFBHSC(tender) {
+      return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SAFE_COST], tender, "common");
+    },
+    // 养护工程费(不含设备费) 算法:取清单固定类别是“建筑安装工程费”的金额,扣除设备的金额(所有设备类型的人材机型定额)。
+    YHGCFBHSB(tender) {
+      let baseFee = this["YHGCF"](tender);
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      const allSubNodes = [];
+      projectObj.project.mainTree.getAllSubNode(fixedNode, allSubNodes);
+      const equipmentNodes = allSubNodes.filter((node) => node.data.type === rationType.gljRation && node.data.subType === gljType.EQUIPMENT);
+      const feeField = "common";
+      const subFeeField = tender ? "tenderTotalFee" : "totalFee";
+      for (const node of equipmentNodes) {
+        const data = node.data;
+        if (
+          cbTools.isUnDef(data.feesIndex) ||
+          _.isEmpty(data.feesIndex) ||
+          cbTools.isUnDef(data.feesIndex[feeField]) ||
+          cbTools.isUnDef(data.feesIndex[feeField][subFeeField])
+        ) {
+          continue;
+        }
+        baseFee -= data.feesIndex[feeField][subFeeField];
+      }
+      return baseFee.toDecimal(decimalObj.bills.totalPrice);
+    },
+    // 定额养护工程费 取清单固定类别是“建筑安装工程费”的定额建安费。
+    DEYHGCF(tender) {
+      return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, "rationCommon");
+    },
+    // 定额养护工程费(不含专项费用) 算法:取清单固定类别是“建筑安装工程费”的“定额建安费”,扣除“专项费用”的“定额建安费”。
+    DEYHGCFBHZXFY(tender) {
+      return cbTools.getFeeWithDeduction(fixedFlag.CONSTRUCTION_INSTALL_FEE, [fixedFlag.SPECIAL_COST], tender, "rationCommon");
+    },
+    // 土地使用及拆迁补偿费 算法:取清单固定类别是“土地使用及拆迁补偿费”的金额。
+    TDSYJCQBCF(tender) {
+      return cbTools.getBaseFee(fixedFlag.LAND_USED_DEMOLITION, tender, "common");
+    },
+    // 工程建设其他费用 算法:取清单固定类别是“养护工程其他费用”的金额。
+    GCJSQTFY(tender) {
+      return cbTools.getBaseFee(fixedFlag.MAINTENANCE_EXPENSES, tender, "common");
+    },
+    // 施工场地建设费 算法:以{定额养护工程费(不含专项费用)}为基数,采用累进办法计算。
+    SGCDJSF(tender) {
+      const baseFee = this["DEYHGCFBHZXFY"](tender);
+      if (!tender) {
+        calcBase.baseProgressiveFee = baseFee;
+      }
+      return calculateUtil.getProgressiveFee(
+        baseFee,
+        "施工场地建设费",
+        projectObj.project.property.progressiveInterval,
+        decimalObj.bills.totalPrice,
+        deficiency
+      );
+    },
+    // 养护单位项目管理费 算法:以{定额养护工程费}为基数,采用累进办法计算。
+    YHDWXMGLF(tender) {
+      const baseFee = this["DEYHGCF"](tender);
+      if (!tender) {
+        calcBase.baseProgressiveFee = baseFee;
+      }
+      return calculateUtil.getProgressiveFee(
+        baseFee,
+        "养护单位项目管理费",
+        projectObj.project.property.progressiveInterval,
+        decimalObj.bills.totalPrice,
+        deficiency
+      );
+    },
+    // 养护单位项目管理费(未单独设置项目部) 算法:以{定额养护工程费}为基数,采用累进办法计算。
+    YHDWXMGLFWSXMB(tender) {
+      const baseFee = this["DEYHGCF"](tender);
+      if (!tender) {
+        calcBase.baseProgressiveFee = baseFee;
+      }
+      return calculateUtil.getProgressiveFee(
+        baseFee,
+        "养护单位项目管理费(未单独设置项目部)",
+        projectObj.project.property.progressiveInterval,
+        decimalObj.bills.totalPrice,
+        deficiency
+      );
+    },
+    // 工程监理费 算法:以{定额养护工程费}为基数,采用累进办法计算。
+    GCJLF(tender) {
+      const baseFee = this["DEYHGCF"](tender);
+      if (!tender) {
+        calcBase.baseProgressiveFee = baseFee;
+      }
+      return calculateUtil.getProgressiveFee(baseFee, "工程监理费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+    },
+    // 工程监理费(未实行社会监理) 算法:以{定额养护工程费}为基数,采用累进办法计算。
+    GCJLFWSXSHJL(tender) {
+      const baseFee = this["DEYHGCF"](tender);
+      if (!tender) {
+        calcBase.baseProgressiveFee = baseFee;
+      }
+      return calculateUtil.getProgressiveFee(
+        baseFee,
+        "工程监理费(未实行社会监理)",
+        projectObj.project.property.progressiveInterval,
+        decimalObj.bills.totalPrice,
+        deficiency
+      );
+    },
+    // 设计文件审查费 算法:以{定额养护工程费}为基数,采用累进办法计算。
+    SJWJSCF(tender) {
+      const baseFee = this["DEYHGCF"](tender);
+      if (!tender) {
+        calcBase.baseProgressiveFee = baseFee;
+      }
+      return calculateUtil.getProgressiveFee(
+        baseFee,
+        "设计文件审查费",
+        projectObj.project.property.progressiveInterval,
+        decimalObj.bills.totalPrice,
+        deficiency
+      );
+    },
+    // 工程设计费 算法:以{定额养护工程费}为基数,采用累进办法计算。
+    GCSJF(tender) {
+      const baseFee = this["DEYHGCF"](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['YHGCF'](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);
-        }
+    JCYBF(tender) {
+      //建筑安装工程费作为基数
+      const installFee = this["YHGCF"](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章的清单使用,所以暂时不需要此判断)
-        'YBZYHQDHJ': 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);
+  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章的清单使用,所以暂时不需要此判断)
+    YBZYHQDHJ: 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);
+    },
+    // 清单项目基数:{定额建筑安装工程费} 算法:取清单固定类别是“第100章至700章清单”的定额建安费(其中定额设备费按40%计算,税金是全额计算)。显示:只有清单固定类别是“第100章清单总则”的部分可显示。
+    DEJZAZGCF(tender) {
+      const baseFee = cbTools.getBaseFee(fixedFlag.ONE_SEVEN_BILLS, tender, "rationCommon");
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.ONE_SEVEN_BILLS);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
+      return (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.bills.totalPrice);
+    },
+  };
 }
 
-if (typeof projectObj !== 'undefined') {
-    projectObj.isInsertEquipmentVisable = function (selected) {
-        if (projectObj.project.property.valuationType !== 'ration') {//预算项目中,右键“插入设备”,仅在第一部分中显示。
-            return projectObj.project.Bills.isConstructionInstall(selected);
-        }
-        return true;   //湖南不管是预算或者工程量清单,都显示   
+if (typeof projectObj !== "undefined") {
+  projectObj.isInsertEquipmentVisable = function (selected) {
+    if (projectObj.project.property.valuationType !== "ration") {
+      //预算项目中,右键“插入设备”,仅在第一部分中显示。
+      return projectObj.project.Bills.isConstructionInstall(selected);
     }
+    return true; //湖南不管是预算或者工程量清单,都显示
+  };
 }
 
 //湖南工地转移费率值修改特殊处理
-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"));//设置显示的节点值
-        }
-        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")); //设置显示的节点值
     }
+    return result;
+  };
 }
 
-if (typeof electrovalenceObj !== 'undefined') {
-    electrovalenceObj.options = [
-        { code: "3005003", name: "电网电", specs: "", unit: "kW·h", type: "201" },
-        { code: "8017001", name: "15kW以内柴油发电机组", specs: "12GF1", unit: "台班", type: "301" },
-        { code: "8017002", name: "30kW以内柴油发电机组", specs: "30GFY-2", unit: "台班", type: "301" },
-        { code: "8017003", name: "50kW以内柴油发电机组", specs: "50GFY-2", unit: "台班", type: "301" }
-    ]
+if (typeof electrovalenceObj !== "undefined") {
+  electrovalenceObj.options = [
+    { code: "3005003", name: "电网电", specs: "", unit: "kW·h", type: "201" },
+    { code: "8017001", name: "15kW以内柴油发电机组", specs: "12GF1", unit: "台班", type: "301" },
+    { code: "8017002", name: "30kW以内柴油发电机组", specs: "30GFY-2", unit: "台班", type: "301" },
+    { code: "8017003", name: "50kW以内柴油发电机组", specs: "50GFY-2", unit: "台班", type: "301" },
+  ];
 }
 
 // 在新建分段的时候需要隐藏养护类别和费用标准
-if (typeof $ !== 'undefined') { // 后端也有引用这个文件,后端引用时$没有定义会报错
-    $(document).ready(function () {
-        $('#tender-engineering-group').hide();
-        $('#tender-feeStandard-group').hide();
-    });
+if (typeof $ !== "undefined") {
+  // 后端也有引用这个文件,后端引用时$没有定义会报错
+  $(document).ready(function () {
+    $("#tender-engineering-group").hide();
+    $("#tender-feeStandard-group").hide();
+  });
 }
 
 // CommonJS module
-if (typeof module !== 'undefined' && !module.nodeType) { // 防止module是前端的一个html标签
-    module.exports = {
-        progression,
-        deficiency
-    };
+if (typeof module !== "undefined" && !module.nodeType) {
+  // 防止module是前端的一个html标签
+  module.exports = {
+    progression,
+    deficiency,
+  };
 }
-
-

+ 27 - 22
web/over_write/js/hunan_2022.js

@@ -70,9 +70,9 @@ if (typeof baseFigureMap !== "undefined") {
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
     },
-    '工程监理费(未实行社会监理)': {
+    "工程监理费(未实行社会监理)": {
       isProgressive: true,
-      base: 'GCJLFWSXSHJL',
+      base: "GCJLFWSXSHJL",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
@@ -91,9 +91,9 @@ if (typeof baseFigureMap !== "undefined") {
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
     },
-    '工程设计费': {
+    工程设计费: {
       isProgressive: true,
-      base: 'GCSJF',
+      base: "GCSJF",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
@@ -116,7 +116,7 @@ if (typeof baseFigureMap !== "undefined") {
       fixedFlag: null,
       filter: [fixedFlag.SPECIAL_COST],
       pick: true,
-    },    
+    },
     // 显示:除清单固定类别是“一二三四部分合计”的以外部分可显示。
     一二三四部分合计: {
       base: "YESSBFHJ",
@@ -131,7 +131,6 @@ if (typeof baseFigureMap !== "undefined") {
       filter: [fixedFlag.SPREAD_BUDGET_FEE],
       pick: true,
     },
-    
   };
   const boqMap = {
     //仅允许用于固定类别是“第100章至700章清单”以外的清单
@@ -247,24 +246,33 @@ if (typeof baseFigureTemplate !== "undefined") {
     // 工程监理费 算法:以{定额建筑安装工程费}为基数,采用累进办法计算
     GCJLF(tender) {
       const baseFee = this["DEJZAZGCF"](tender);
-      if ((baseFee > 0) && (baseFee < 1000000)) return 50000;
+      if (baseFee === 0) return 0;
+      if (baseFee > 0 && baseFee < 1000000) return 50000;
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
       return calculateUtil.getProgressiveFee(baseFee, "工程监理费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
     },
     GCJLFWSXSHJL(tender) {
-      const baseFee = this['DEJZAZGCF'](tender);
-      if ((baseFee > 0) && (baseFee < 1000000)) return 50000;
+      const baseFee = this["DEJZAZGCF"](tender);
+      if (baseFee === 0) return 0;
+      if (baseFee > 0 && baseFee < 1000000) return 50000;
       if (!tender) {
-          calcBase.baseProgressiveFee = baseFee;
+        calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(baseFee, '工程监理费(未实行社会监理)', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      return calculateUtil.getProgressiveFee(
+        baseFee,
+        "工程监理费(未实行社会监理)",
+        projectObj.project.property.progressiveInterval,
+        decimalObj.bills.totalPrice,
+        deficiency
+      );
     },
     // {信息化费} 算法:以{定额建筑安装工程费}为基数,采用累进办法计算。仅清单固定类别是“养护工程其他费”部分可显示。(计算结果去掉不足10000元时按10000元计取)
     YHXMXXHF(tender) {
       const baseFee = this["DEJZAZGCF"](tender);
-      if ((baseFee > 0) && (baseFee < 2000000)) return 100000;
+      if (baseFee === 0) return 0;
+      if (baseFee > 0 && baseFee < 2000000) return 100000;
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
@@ -309,7 +317,8 @@ if (typeof baseFigureTemplate !== "undefined") {
     // 设计文件审查费(一阶段)和 设计文件审查费(二阶段)两个基数计算后金额不满5000元均应按5000元计。
     SJWJSCFYJD(tender) {
       const baseFee = this["DEJZAZGCF"](tender);
-      if ((baseFee > 0) && (baseFee < 500000)) return 5000;
+      if (baseFee === 0) return 0;
+      if (baseFee > 0 && baseFee < 500000) return 5000;
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
@@ -323,7 +332,8 @@ if (typeof baseFigureTemplate !== "undefined") {
     },
     SJWJSCFEJD(tender) {
       const baseFee = this["DEJZAZGCF"](tender);
-      if ((baseFee > 0) && (baseFee < 500000)) return 5000;
+      if (baseFee === 0) return 0;
+      if (baseFee > 0 && baseFee < 500000) return 5000;
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
@@ -337,17 +347,12 @@ if (typeof baseFigureTemplate !== "undefined") {
     },
     GCSJF(tender) {
       const baseFee = this["DEJZAZGCF"](tender);
-      if ((baseFee > 0) && (baseFee < 500000)) return 35000;
+      if (baseFee === 0) return 0;
+      if (baseFee > 0 && baseFee < 500000) return 35000;
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(
-        baseFee,
-        "工程设计费",
-        projectObj.project.property.progressiveInterval,
-        decimalObj.bills.totalPrice,
-        deficiency
-      );
+      return calculateUtil.getProgressiveFee(baseFee, "工程设计费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
     },
   };
 

+ 15 - 2
web/over_write/js/neimeng_2019.js

@@ -193,7 +193,13 @@ if (typeof baseFigureMap !== 'undefined') {
             fixedFlag: null,
             filter: [fixedFlag.ONE_HUNDRED_BILLS],
             pick: true
-        }
+        },
+        '定额建筑安装工程费(定额设备购置费按40%计)': {
+            base: "DEJZAZGCF",
+            fixedFlag: null,
+            filter: [fixedFlag.ONE_HUNDRED_BILLS],
+            pick: true,
+          },
     };
     baseFigureMap.budget = budgetMap;
     baseFigureMap.boq = boqMap;
@@ -324,7 +330,14 @@ if (typeof baseFigureTemplate !== 'undefined') {
             //计算金额
             let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee';
             return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
-        }
+        },
+        // 清单项目基数:{定额建筑安装工程费(定额设备购置费按40%计)} 算法:取清单固定类别是“第100章至700章清单”的定额建安费(其中定额设备费+设备税金之和按40%计算)。显示:只有清单固定类别是“第100章清单总则”的部分可显示。
+        DEJZAZGCF(tender) {
+            const baseFee = cbTools.getBaseFee(fixedFlag.ONE_SEVEN_BILLS, tender, "rationCommon");
+            const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.ONE_SEVEN_BILLS);
+            const equipmentTaxFee = cbTools.getEquipmentFee(fixedNode, tender, "rationCommon");
+            return (baseFee - equipmentTaxFee * 0.6).toDecimal(decimalObj.bills.totalPrice); 
+        },
     };
 }
 

+ 255 - 213
web/over_write/js/quanguo_2018.js

@@ -1,212 +1,221 @@
+// 公路云
+
 let isQG2018 = true;
 
 function overwriteRationCalcBases() {
-  if (typeof rationCalcBases == 'undefined') return;
+  if (typeof rationCalcBases == "undefined") return;
   for (let key in rationCalcBases) delete rationCalcBases[key];
 
-  rationCalcBases['人工费'] = function (node, isTender) {
+  rationCalcBases["人工费"] = function (node, isTender) {
     return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptMarketPrice, isTender);
   };
-  rationCalcBases['材料费'] = function (node, isTender) {
+  rationCalcBases["材料费"] = function (node, isTender) {
     return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptMarketPrice, isTender);
   };
-  rationCalcBases['施工机械使用费'] = function (node, isTender) {
+  rationCalcBases["施工机械使用费"] = function (node, isTender) {
     return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptMarketPrice, isTender);
   };
-  rationCalcBases['施工机械人工费'] = function (node, isTender) {
+  rationCalcBases["施工机械人工费"] = function (node, isTender) {
     return calcTools.machineDetailFee(node, node.data.gljList, [], gljType.MACHINE_LABOUR, isTender);
   };
-  rationCalcBases['设备购置费'] = function (node, isTender) {
+  rationCalcBases["设备购置费"] = function (node, isTender) {
     return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice, isTender);
   };
 
-  rationCalcBases['定额人工费'] = function (node, isTender) {
+  rationCalcBases["定额人工费"] = function (node, isTender) {
     return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice, isTender);
   };
-  rationCalcBases['定额材料费'] = function (node, isTender) {
+  rationCalcBases["定额材料费"] = function (node, isTender) {
     return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptBasePrice, isTender);
   };
-  rationCalcBases['定额施工机械使用费'] = function (node, isTender) {
+  rationCalcBases["定额施工机械使用费"] = function (node, isTender) {
     return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptBasePrice, isTender);
   };
-  rationCalcBases['定额商品砼费'] = function (node, isTender) {
+  rationCalcBases["定额商品砼费"] = function (node, isTender) {
     return calcTools.rationBaseFee(node, [gljType.COMMERCIAL_CONCRETE, gljType.COMMERCIAL_MORTAR], priceTypes.ptBasePrice, isTender);
   };
-  rationCalcBases['定额设备费'] = function (node, isTender) {
+  rationCalcBases["定额设备费"] = function (node, isTender) {
     return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptBasePrice, isTender);
   };
-  rationCalcBases['定额外购砼构件费'] = function (node, isTender) {
+  rationCalcBases["定额外购砼构件费"] = function (node, isTender) {
     return calcTools.rationBaseFee(node, [gljType.PURCHASE_COMPONENT], priceTypes.ptBasePrice, isTender);
   };
-  rationCalcBases['定额绿化苗木费'] = function (node, isTender) {
+  rationCalcBases["定额绿化苗木费"] = function (node, isTender) {
     return calcTools.rationBaseFee(node, [gljType.GREEN_SEEDLING], priceTypes.ptBasePrice, isTender);
   };
-};
+}
 
 (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: '直接费'
-  },
+  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: '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: 'measure1',
-      name: '措施费I'
+      type: "measure",
+      name: "措施费",
+    },
+    {
+      type: "measure1",
+      name: "措施费I",
+    },
+    {
+      type: "measure2",
+      name: "措施费II",
+    },
+    {
+      type: "manage",
+      name: "企业管理费",
+    },
+    {
+      type: "force",
+      name: "规费",
     },
     {
-      type: 'measure2',
-      name: '措施费II'
-    },
-  {
-    type: 'manage',
-    name: '企业管理费'
-  },
-  {
-    type: 'force',
-    name: '规费'
-  },
-  {
-    type: 'profit',
-    name: '利润'
-  },
-  {
-    type: 'tax',
-    name: '税金'
-  },
-  {
-    type: 'common',
-    name: '建安费'
-  },
-  {
-    type: 'rationCommon',
-    name: '定额建安费'
-  }
+      type: "profit",
+      name: "利润",
+    },
+    {
+      type: "tax",
+      name: "税金",
+    },
+    {
+      type: "common",
+      name: "建安费",
+    },
+    {
+      type: "rationCommon",
+      name: "定额建安费",
+    },
   ];
 })();
 
 // 在新建分段的时候需要隐藏养护类别和费用标准
-if (typeof $ !== 'undefined') { // 后端也有引用这个文件,后端引用时$没有定义会报错
+if (typeof $ !== "undefined") {
+  // 后端也有引用这个文件,后端引用时$没有定义会报错
   $(document).ready(function () {
-    $('#tender-engineering-group').hide();
-    $('#tender-feeStandard-group').hide();
+    $("#tender-engineering-group").hide();
+    $("#tender-feeStandard-group").hide();
   });
 }
 
-
 //全国工地转移、综合里程费率值修改特殊处理
-if (typeof feeRateObject !== 'undefined') {
+if (typeof feeRateObject !== "undefined") {
   feeRateObject.feeRateSpecialHandle = function (subRate, value) {
     let result = {};
-    if (subRate.name == "工地转移(km)" && value && value < 50) { //工地转移50km以内按50km算
+    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算
+    if (subRate.name == "综合里程(km)" && value && value < 3) {
+      //综合里程3km以内按3km算
       result.valueKey = "3";
       result.value = scMathUtil.roundForObj(value, getDecimal("feeRate")); //设置显示的节点值
     }
     return result;
-  }
+  };
 }
 
 // 清单基数
-const progression = ['施工场地建设费', '建设单位(业主)管理费', '建设项目信息化费', '工程监理费', '设计文件审查费', '前期工作费'];
+const progression = ["施工场地建设费", "建设单位(业主)管理费", "建设项目信息化费", "工程监理费", "设计文件审查费", "前期工作费"];
 const deficiency = {};
-if (typeof baseFigureMap !== 'undefined') {
+if (typeof baseFigureMap !== "undefined") {
   const { fixedFlag } = commonConstants;
   const budgetMap = {
     // 显示:除清单固定类别是“建筑安装工程费”部分可显示
-    '建筑安装工程费': {
-      base: 'JZAZGCF',
+    建筑安装工程费: {
+      base: "JZAZGCF",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.CONSTRUCTION_INSTALL_FEE],
       pick: false,
     },
     // 显示:除清单固定类别是“建筑安装工程费”部分可显示
-    '定额建筑安装工程费': {
-      base: 'DEJZAZGCF',
+    定额建筑安装工程费: {
+      base: "DEJZAZGCF",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
-      filter: [/* fixedFlag.CONSTRUCTION_INSTALL_FEE */],
-      pick: true
+      filter: [
+        /* fixedFlag.CONSTRUCTION_INSTALL_FEE */
+      ],
+      pick: true,
     },
     // 显示:仅清单固定类别是“安全生产费”行可显示
-    '建筑安装工程费(不含安全生产费)': {
-      base: 'JZAZGCFBHSC',
+    "建筑安装工程费(不含安全生产费)": {
+      base: "JZAZGCFBHSC",
       fixedFlag: null, // 防止触发循环计算
       filter: [fixedFlag.SAFE_COST],
-      pick: true
+      pick: true,
     },
     // 显示:仅清单固定类别是“工程建设其他费”部分可显示
-    '建筑安装工程费(不含设备费)': {
-      base: 'JZAZGCFBHSB',
+    "建筑安装工程费(不含设备费)": {
+      base: "JZAZGCFBHSB",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
-      pick: true
+      pick: true,
     },
     // 显示:仅清单固定类别是“工程建设其他费”部分可显示
-    '定额建筑安装工程费(含定额设备购置费*40%)': {
-      base: 'DEJZAZGCFSBSS',
+    "定额建筑安装工程费(含定额设备购置费*40%)": {
+      base: "DEJZAZGCFSBSS",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
-      pick: true
+      pick: true,
     },
     // 显示:仅清单固定类别是“工程建设其他费”可显示
-    '定额建筑安装工程费(不含定额设备购置费、专项费用)': {
-      base: 'DEJZAZGCFBHSBZX',
+    "定额建筑安装工程费(不含定额设备购置费、专项费用)": {
+      base: "DEJZAZGCFBHSBZX",
       fixedFlag: null,
-      filter: [/* fixedFlag.MAINTENANCE_EXPENSES */],
+      filter: [
+        /* fixedFlag.MAINTENANCE_EXPENSES */
+      ],
       pick: true,
     },
     // 显示:仅清单固定类别是“施工场地建设费”的可显示
-    '施工场地建设费': {
+    施工场地建设费: {
       isProgressive: true,
-      base: 'SGCDJSF',
+      base: "SGCDJSF",
       // 虽然用到了定额建筑安装工程费一部分费用baseFee,但是是扣除了专项费用的。施工场地建设费清单为专项费用清单子项。
       // 当施工场地建设费清单使用此基数时,该清单的费用不会汇总到baseFee里,因此不会造成循环计算。如果fixedFlag设置成fixedFlag.CONSTRUCTION_INSTALL_FEE,则会造成循环计算
       fixedFlag: null,
@@ -214,48 +223,48 @@ if (typeof baseFigureMap !== 'undefined') {
       pick: true,
     },
     // 显示:仅清单固定类别是“工程建设其他费”部分可显示
-    '建设单位(业主)管理费': {
+    "建设单位(业主)管理费": {
       isProgressive: true,
-      base: 'JSDWYZGLF',
+      base: "JSDWYZGLF",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
     },
     // 显示:仅清单固定类别是“工程建设其他费”部分可显示
-    '建设项目信息化费': {
+    建设项目信息化费: {
       isProgressive: true,
-      base: 'JSXMXXHF',
+      base: "JSXMXXHF",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
     },
     // 显示:仅清单固定类别是“工程建设其他费”部分可显示
-    '工程监理费': {
+    工程监理费: {
       isProgressive: true,
-      base: 'GCJLF',
+      base: "GCJLF",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
     },
     // 显示:仅清单固定类别是“工程建设其他费”部分可显示
-    '设计文件审查费': {
+    设计文件审查费: {
       isProgressive: true,
-      base: 'SJWJSCF',
+      base: "SJWJSCF",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
     },
     // 显示:仅清单固定类别是“工程建设其他费”部分可显示
-    '前期工作费': {
+    前期工作费: {
       isProgressive: true,
-      base: 'QQGZF',
+      base: "QQGZF",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.MAINTENANCE_EXPENSES],
       pick: true,
     },
     // 显示:仅“价差预备费”可显示
-    '价差预备费': {
-      base: 'JCYBF',
+    价差预备费: {
+      base: "JCYBF",
       fixedFlag: fixedFlag.CONSTRUCTION_INSTALL_FEE,
       filter: [fixedFlag.SPREAD_BUDGET_FEE],
       pick: true,
@@ -263,74 +272,80 @@ if (typeof baseFigureMap !== 'undefined') {
   };
   const boqMap = {
     // 仅允许用于固定类别是“第100章至700章清单”以外的清单
-    '各章清单合计': {
-      base: 'GZQDHJ',
+    各章清单合计: {
+      base: "GZQDHJ",
       fixedFlag: fixedFlag.ONE_SEVEN_BILLS,
       filter: [fixedFlag.ONE_SEVEN_BILLS],
-      pick: false
+      pick: false,
     },
     // 仅允许用于固定类别是“第100章至700章清单”以外的清单
-    '专项暂定合计': {
-      base: 'ZXZDHJ',
+    专项暂定合计: {
+      base: "ZXZDHJ",
       fixedFlag: null,
       filter: [fixedFlag.ONE_SEVEN_BILLS],
-      pick: false
+      pick: false,
     },
     /*
-    *  清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
-    *  因此{100章以外合计}不设置关联的清单固定行
-    * */
+     *  清单固定行[第100章至700章清单]下的[第100章清单]需要允许清单可使用基数{100章以外合计}
+     *  因此{100章以外合计}不设置关联的清单固定行
+     * */
     // 仅允许用于固定类别为“100章清单”引用
-    '100章以外清单合计': {
-      base: 'YBZYHQDHJ',
+    "100章以外清单合计": {
+      base: "YBZYHQDHJ",
       fixedFlag: null,
       filter: [fixedFlag.ONE_HUNDRED_BILLS],
-      pick: true
-    }
+      pick: true,
+    },
+    定额建筑安装工程费: {
+      base: "DEJZAZGCF",
+      fixedFlag: null,
+      filter: [fixedFlag.ONE_HUNDRED_BILLS],
+      pick: true,
+    },
   };
   baseFigureMap.budget = budgetMap;
   baseFigureMap.boq = boqMap;
 }
 
-if (typeof baseFigureTemplate !== 'undefined') {
+if (typeof baseFigureTemplate !== "undefined") {
   const { fixedFlag } = commonConstants;
   baseFigureTemplate.budget = {
     // 建设安装工程费 算法:取“建筑安装工程费”的金额
     JZAZGCF(tender) {
-      return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'common');
+      return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, "common");
     },
-    // 定额建安装工程费 算法:取“定额建筑安装工程费”的金额
+    // 定额建安装工程费 算法:取“定额建筑安装工程费”的金额
     DEJZAZGCF(tender) {
-      return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'rationCommon');
+      return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, "rationCommon");
     },
     // 建筑安装工程费(不含安全生产费) 算法:取固定类别是“建筑安装工程费”的“建安费”,扣除固定类别是“安全生产费”的“建安费”
     JZAZGCFBHSC(tender) {
-      let baseFee = this['JZAZGCF'](tender);
-      const safeFee = cbTools.getBaseFee(fixedFlag.SAFE_COST, tender, 'common');
+      let baseFee = this["JZAZGCF"](tender);
+      const safeFee = cbTools.getBaseFee(fixedFlag.SAFE_COST, tender, "common");
       return (baseFee - safeFee).toDecimal(decimalObj.bills.totalPrice);
     },
     // 建设安装工程费(不含设备费) 算法:取固定类别是“建筑安装工程费”的建安费。扣除设备的定额设备费。(全国造价云版中,没有固定的设备购置行,需要扣除所有类别是“设备”的金额,仅指设备行,不包括定额工料机的设备)
     JZAZGCFBHSB(tender) {
-      let baseFee = this['JZAZGCF'](tender);
-      const fixedNode = projectObj.project.mainTree.roots.find(node => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      let baseFee = this["JZAZGCF"](tender);
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
       const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender);
       baseFee = (baseFee - equipmentFee).toDecimal(decimalObj.process);
       return baseFee.toDecimal(decimalObj.bills.totalPrice);
     },
     // 定额建筑安装工程费(含定额设备购置费*40%) 取固定类别是“建筑安装工程费”的定额建安费,扣除定额设备购置费*60%的定额设备费。
     DEJZAZGCFSBSS(tender) {
-      let baseFee = this['DEJZAZGCF'](tender);
-      const fixedNode = projectObj.project.mainTree.roots.find(node => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
-      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, 'equipment');
+      let baseFee = this["DEJZAZGCF"](tender);
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
       baseFee = (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.process);
       return baseFee.toDecimal(decimalObj.bills.totalPrice);
     },
     // 定额建筑安装工程费(不含定额设备购置费、专项费用) 算法:取固定类别是“建筑安装工程费”的定额建安费,扣除定额设备购置费和专项费用的建安费
     DEJZAZGCFBHSBZX(tender) {
-      let baseFee = this['DEJZAZGCF'](tender);
-      const fixedNode = projectObj.project.mainTree.roots.find(node => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
-      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, 'equipment');
-      const specialFee = cbTools.getBaseFee(fixedFlag.SPECIAL_COST, tender, 'rationCommon');
+      let baseFee = this["DEJZAZGCF"](tender);
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
+      const specialFee = cbTools.getBaseFee(fixedFlag.SPECIAL_COST, tender, "rationCommon");
       const diffFee = (equipmentFee + specialFee).toDecimal(decimalObj.process);
       baseFee = (baseFee - diffFee).toDecimal(decimalObj.process);
       return baseFee.toDecimal(decimalObj.bills.totalPrice);
@@ -338,76 +353,100 @@ if (typeof baseFigureTemplate !== 'undefined') {
     // 施工场地建设费 算法:按“定额建筑安装工程费”扣除专项费为基数,以累进办法计算
     // 【变更】:按【固定类别是“建筑安装工程费”的“定额建安费”,扣除固定类别是“专项费用”的“定额建安费”,扣除“设备”的“定额设备费”*60%】为基数,以累进办法计算
     SGCDJSF(tender) {
-      let baseFee = this['DEJZAZGCF'](tender);
-      const specialFee = cbTools.getBaseFee(fixedFlag.SPECIAL_COST, tender, 'rationCommon');
+      let baseFee = this["DEJZAZGCF"](tender);
+      const specialFee = cbTools.getBaseFee(fixedFlag.SPECIAL_COST, tender, "rationCommon");
       baseFee = (baseFee - specialFee).toDecimal(decimalObj.process);
-      const fixedNode = projectObj.project.mainTree.roots.find(node => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
-      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, 'equipment');
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
       baseFee = (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.process);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(baseFee, '施工场地建设费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      return calculateUtil.getProgressiveFee(
+        baseFee,
+        "施工场地建设费",
+        projectObj.project.property.progressiveInterval,
+        decimalObj.bills.totalPrice,
+        deficiency
+      );
     },
     // 建设单位(业主)管理费 算法:按“定额建筑安装工程费”总和为基数,以累进办法计算
     // 【变更】:算法:按【固定类别是“建筑安装工程费”的“定额建安费”,扣除“设备”的“定额设备费”*60%】为基数,以累进办法计算。
     JSDWYZGLF(tender) {
-      let baseFee = this['DEJZAZGCF'](tender);
-      const fixedNode = projectObj.project.mainTree.roots.find(node => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
-      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, 'equipment');
+      let baseFee = this["DEJZAZGCF"](tender);
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
       baseFee = (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.process);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(baseFee, '建设单位(业主)管理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      return calculateUtil.getProgressiveFee(
+        baseFee,
+        "建设单位(业主)管理费",
+        projectObj.project.property.progressiveInterval,
+        decimalObj.bills.totalPrice,
+        deficiency
+      );
     },
     // 建设项目信息化费 算法:按“定额建筑安装工程费”总和为基数,以累进办法计算
     // 【变更】:算法:按【固定类别是“建筑安装工程费”的“定额建安费”,扣除“设备”的“定额设备费”*60%】为基数,以累进办法计算。
     JSXMXXHF(tender) {
-      let baseFee = this['DEJZAZGCF'](tender);
-      const fixedNode = projectObj.project.mainTree.roots.find(node => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
-      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, 'equipment');
+      let baseFee = this["DEJZAZGCF"](tender);
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
       baseFee = (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.process);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(baseFee, '建设项目信息化费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      return calculateUtil.getProgressiveFee(
+        baseFee,
+        "建设项目信息化费",
+        projectObj.project.property.progressiveInterval,
+        decimalObj.bills.totalPrice,
+        deficiency
+      );
     },
     // 工程监理费 算法:按“定额建筑安装工程费”总和为基数,以累进办法计算
-    // 【变更】:算法:按【固定类别是“建筑安装工程费”的“定额建安费”,扣除“设备”的“定额设备费”*60%】为基数,以累进办法计算。 
+    // 【变更】:算法:按【固定类别是“建筑安装工程费”的“定额建安费”,扣除“设备”的“定额设备费”*60%】为基数,以累进办法计算。
     GCJLF(tender) {
-      let baseFee = this['DEJZAZGCF'](tender);
-      const fixedNode = projectObj.project.mainTree.roots.find(node => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
-      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, 'equipment');
+      let baseFee = this["DEJZAZGCF"](tender);
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
       baseFee = (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.process);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(baseFee, '工程监理费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      return calculateUtil.getProgressiveFee(baseFee, "工程监理费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
     },
     // 设计文件审查费 算法:按“定额建筑安装工程费”总和为基数,以累进办法计算
     // 【变更】:算法:按【固定类别是“建筑安装工程费”的“定额建安费”,扣除“设备”的“定额设备费”*60%】为基数,以累进办法计算。
     SJWJSCF(tender) {
-      let baseFee = this['DEJZAZGCF'](tender);
-      const fixedNode = projectObj.project.mainTree.roots.find(node => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
-      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, 'equipment');
+      let baseFee = this["DEJZAZGCF"](tender);
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
       baseFee = (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.process);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(baseFee, '设计文件审查费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      return calculateUtil.getProgressiveFee(
+        baseFee,
+        "设计文件审查费",
+        projectObj.project.property.progressiveInterval,
+        decimalObj.bills.totalPrice,
+        deficiency
+      );
     },
     // 前期工作费 算法:按“定额建筑安装工程费”总和为基数,以累进办法计算
     // 变更:【算法】:按【固定类别是“建筑安装工程费”的“定额建安费”,扣除“设备”的“定额设备费”*60%】为基数,以累进办法计算。
     QQGZF(tender) {
-      let baseFee = this['DEJZAZGCF'](tender);
-      const fixedNode = projectObj.project.mainTree.roots.find(node => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
-      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, 'equipment');
+      let baseFee = this["DEJZAZGCF"](tender);
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.CONSTRUCTION_INSTALL_FEE);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
       baseFee = (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.process);
       if (!tender) {
         calcBase.baseProgressiveFee = baseFee;
       }
-      return calculateUtil.getProgressiveFee(baseFee, '前期工作费', projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
+      return calculateUtil.getProgressiveFee(baseFee, "前期工作费", projectObj.project.property.progressiveInterval, decimalObj.bills.totalPrice, deficiency);
     },
     /*  价差预备费 算法:价差预备费以“建筑安装工程费”总额为基数,按设计文件编制年始至工程竣工年终的年数和年工程造价增涨费率计算
         价差预备费 P * [(1+i)^(n-1) -1]
@@ -417,36 +456,31 @@ if (typeof baseFigureTemplate !== 'undefined') {
     */
     JCYBF(tender) {
       // 建筑安装工程费作为基数
-      const installFee = this['JZAZGCF'](tender);
+      const installFee = this["JZAZGCF"](tender);
       // 年造价增涨
-      const costGrowthRate = calcBase.project.property.costGrowthRate
-        ? calcBase.project.property.costGrowthRate
-        : 0;
+      const costGrowthRate = calcBase.project.property.costGrowthRate ? calcBase.project.property.costGrowthRate : 0;
       // 增涨计费年限
-      const growthPeriod = projectObj.project.property.growthPeriod
-        ? calcBase.project.property.growthPeriod
-        : 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');
+    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');
+    ZXZDHJ: function (tender) {
+      return cbTools.getBaseFee(calcBase.fixedFlag.ONE_SEVEN_BILLS, tender, "estimate");
     },
     //{100章以外清单合计}
     // 取清单固定清单[第100章至700章清单]的金额,但扣除清单100章下的金额。
     // 如果是固定清单[第100章至700章清单]下100章以外清单引用此基数,要排除自身(目前只允许100章的清单使用,所以暂时不需要此判断)
-    'YBZYHQDHJ': function (tender) {
+    YBZYHQDHJ: function (tender) {
       let oneToSeven = cbTools.findNodeByFlag(fixedFlag.ONE_SEVEN_BILLS);
       if (!oneToSeven) {
         return 0;
@@ -465,26 +499,34 @@ if (typeof baseFigureTemplate !== 'undefined') {
       //扣除的节点:100章的节点[100-200)
       let deductNodes = allChildren.filter(cbTools.withingOneHundred);
       //计算金额
-      let fullFeeField = tender ? 'common.tenderTotalFee' : 'common.totalFee';
+      let fullFeeField = tender ? "common.tenderTotalFee" : "common.totalFee";
       return projectObj.project.calcProgram.getTotalFee([oneToSeven], deductNodes, fullFeeField).toDecimal(decimalObj.bills.totalPrice);
-    }
+    },
+    // 清单项目基数:{定额建筑安装工程费} 算法:取清单固定类别是“第100章至700章清单”的定额建安费(其中定额设备费按40%计算,税金是全额计算。公路云默认要使用此算法)。
+    // 显示:只有清单固定类别是“第100章清单总则”的部分可显示。
+    DEJZAZGCF(tender) {
+      const baseFee = cbTools.getBaseFee(fixedFlag.ONE_SEVEN_BILLS, tender, "rationCommon");
+      const fixedNode = projectObj.project.mainTree.roots.find((node) => node.getFlag() === fixedFlag.ONE_SEVEN_BILLS);
+      const equipmentFee = cbTools.getEquipmentFee(fixedNode, tender, "equipment");
+      return (baseFee - equipmentFee * 0.6).toDecimal(decimalObj.bills.totalPrice);
+    },
   };
 }
 
-if (typeof projectObj !== 'undefined') {
+if (typeof projectObj !== "undefined") {
   projectObj.isInsertEquipmentVisable = function (selected) {
-      return true;   //全国不管是预算或者工程量清单,都是显示   
-  }
+    return true; //全国不管是预算或者工程量清单,都是显示
+  };
 
-  projectObj.getSaveProductionCostCode = function(){  
+  projectObj.getSaveProductionCostCode = function () {
     //公路云里18的清单范本安全生产费是102-3的;养护云里浙江养护的安全生产费是102-4。
-    return '102-3'
-  }
+    return "102-3";
+  };
 }
 
-if (typeof module !== 'undefined' && !module.nodeType) {
+if (typeof module !== "undefined" && !module.nodeType) {
   module.exports = {
     progression,
-    deficiency
+    deficiency,
   };
-}
+}

+ 1 - 1
web/over_write/js/sichuan_2018.js

@@ -339,7 +339,7 @@ if (typeof baseFigureTemplate !== 'undefined') {
     JZAZGCF(tender) {
       return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'common');
     },
-    // 定额建安装工程费 算法:取“定额建筑安装工程费”的金额
+    // 定额建安装工程费 算法:取“定额建筑安装工程费”的金额
     DEJZAZGCF(tender) {
       return cbTools.getBaseFee(fixedFlag.CONSTRUCTION_INSTALL_FEE, tender, 'rationCommon');
     },