فهرست منبع

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

TonyKang 5 سال پیش
والد
کامیت
9f4254a9bf

+ 0 - 73
modules/common/const/bills_fixed.js

@@ -1,73 +0,0 @@
-/**
- * Created by Zhong on 2017/12/18.
- */
-const fixedFlag = {
-    // 建筑安装工程费
-    CONSTRUCTION_INSTALL_FEE: 1,
-    // 土地使用及拆迁补偿费
-    LAND_USED_DEMOLITION: 2,
-    // 养护工程其他费用
-    MAINTENANCE_EXPENSES: 3,
-    // 预备费
-    BUDGET_FEE: 4,
-    // 基本预备费
-    BASE_BUDGET_FEE: 5,
-    // 价差预备费
-    SPREAD_BUDGET_FEE: 6,
-    // 一二三四部分合计
-    ONE_TO_FOUR_TOTAL: 7,
-    // 贷款利息
-    LOAN_INTEREST: 8,
-    // 总造价
-    TOTAL_COST: 9,
-    // 设备购置费
-    EQUIPMENT_ACQUISITION_FEE: 10,
-    // 专项费用 Special cost
-    SPECIAL_COST: 11,
-    // 施工场地建设费
-    CONSTRUCTION_PLANT_COST: 12,
-    // 养护单位(业主)管理费
-    MAINTENANCE_MANAGENENT_FEE: 13,
-    // 信息化费 Informatization fee
-    INFORMATIZATION_FEE: 14,
-    // 工程监理费 Engineering supervision fee
-    ENGINEERING_SUP_FEE: 15,
-    // 设计文件审查费 Design Document Review Fee
-    DOCUMENT_REVIEW_FEE: 16,
-    // 勘察设计费 Survey and design fees
-    SURVEY_DESIGN_FEE: 17,
-    // 招标代理及标底编制费 Bidding Agent and Preparing Fee of Bid Base
-    AGENT_BASE_FEE: 18,
-    //第100章至700章清单
-    ONE_SEVEN_BILLS: 19,
-    //专项暂定合计
-    PROVISIONAL_TOTAL: 20,
-    //清单合计扣除专项暂定合计
-    BILLS_TOTAL_WT_PROV: 21,
-    //计日工 daywork labor
-    DAYWORK_LABOR: 22,
-    //劳务
-    LABOUR_SERVICE: 23,
-    //材料
-    MATERIAL: 24,
-    //施工机械
-    CONSTRUCTION_MACHINE: 25,
-    //暂列金额
-    PROVISIONAL: 26,
-    //安全生产费
-    SAFE_COST: 27,
-    //100章清单
-    ONE_HUNDRED_BILLS: 28,
-    // 一二三部分合计
-    ONE_TO_THREE_TOTAL: 29,
-    // 前期工作费
-    PRELIMINARY_WORK: 30,
-    // 小修费
-    MINOR_REPAIR_FEE: 31,
-    // 预防养护费
-    PREVENTIVE_MAINTENANCE_FEE: 32,
-    // 修复养护费
-    REPAIR_MAINTENANCE_FEE: 33,
-};
-
-export default fixedFlag;

+ 15 - 12
modules/main/facade/project_facade.js

@@ -338,15 +338,15 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal,isP
     let datas = [],totalItem = null;
     let overWrite = null;
     if(overWriteUrl && overWriteUrl!=""){
-      overWrite = require("../../.."+compilation.overWriteUrl);
+      overWrite = require("../../.."+overWriteUrl);
     }
     setChildrenDatas(items,datas);
     let totalExp = totalItem.calcBase;
     if(isProgressiveType&&progressiveInterval){
       for(let t of datas){
-        totalExp.replace(t.ID,t.billsTtlPrice+"");
+        totalExp = totalExp.replace(t.ID,t.billsTtlPrice+"");
       }
-      totalExp.replace(/@/g,"");
+      totalExp = totalExp.replace(/@/g,"");
       let nTotal = eval(totalExp);
       totalItem.billsTtlPrice = scMathUtil.roundForObj(nTotal,decimal.bills.totalPrice);
     }
@@ -393,6 +393,7 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal,isP
             billsAmounts:[],
             '技术经济指标':[],
             billsLevel:level,
+            calcBase:bills.calcBase,
             billsMemos:bills.remark
         };
         let total = 0;
@@ -429,14 +430,16 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal,isP
               }
             }
         }
-        if(progressiveInterval && isProgressiveType&&calcUtil.isProgressive(bills.calcBase,overWrite?overWrite.progression:undefined) && rootFlag == fixedFlag.MAINTENANCE_EXPENSES){
-          let calcTotal = calcUtil.getProgressiveFee(baseTotal,bills.calcBase,progressiveInterval,decimal.bills.totalPrice,overWrite?overWrite.deficiency:undefined);
-          tem.billsTtlPrice = calcTotal;
-          let rate =  scMathUtil.roundForObj(calcTotal * 100/baseTotal,decimal.feeRate);
-          tem.billsMemos = "费率:"+rate+"%"; 
-          //“费率:n%”,n为汇总后重算的金额/汇总后的基数
-        }else{
-          tem.billsTtlPrice = scMathUtil.roundForObj(total,decimal.bills.totalPrice);
+        tem.billsTtlPrice = scMathUtil.roundForObj(total,decimal.bills.totalPrice);
+        if(progressiveInterval && isProgressiveType  && rootFlag == fixedFlag.MAINTENANCE_EXPENSES){
+          let baseArr =  calcUtil.getProgressive(bills.calcBase,overWrite?overWrite.progression:undefined);
+          if(baseArr.length > 0){
+            let calcTotal = calcUtil.getProgressiveFee(baseTotal,baseArr[0],progressiveInterval,decimal.bills.totalPrice,overWrite?overWrite.deficiency:undefined);
+            tem.billsTtlPrice = calcTotal;
+            let rate =  scMathUtil.roundForObj(calcTotal * 100/baseTotal,decimal.feeRate);
+            tem.billsMemos = "费率:"+rate+"%"; 
+            //“费率:n%”,n为汇总后重算的金额/汇总后的基数
+          }
         }
         tem.rationTotal =  scMathUtil.roundForObj(rationTotal,decimal.bills.totalPrice);//定额总建安费
         tem['技术经济综合指标'] = (tem.billsTtlAmt && parseFloat(tem.billsTtlAmt) !== 0)?scMathUtil.roundForObj(tem.billsTtlPrice/tem.billsTtlAmt,2):scMathUtil.roundForObj(tem.billsTtlPrice,2);
@@ -583,7 +586,7 @@ async function getBillsByProjectID(projectID){
        if(commonFee&&commonFee.totalFee) prices[projectName] =  commonFee.totalFee;
        if(commonFee&&commonFee.unitFee) unitPrices[projectName] = commonFee.unitFee;
        if(rationFee&&rationFee.totalFee) rationCommons[projectName] = rationFee.totalFee;
-       baseProgressiveFees = baseProgressiveFees[projectName] = b.baseProgressiveFee;
+       baseProgressiveFees[projectName] = b.baseProgressiveFee;
 
        quantityMap[projectName] = b.quantity;
        let flagIndex = _.find(b._doc.flags,{'fieldName':'fixed'});

+ 20 - 6
public/calculate_util.js

@@ -114,25 +114,39 @@
     }
 
     /**
-     * 判断该基数是否包含累进基数
+     * 该基数包含累进基数
      * @param {String} calcBase - 计算基数
      * @param {Array} progression - 累进基数名称数组
-     * @return {Boolean}
+     * @return {Array}
      */
-    function isProgressive(calcBase, progression) {
+    function getProgressive(calcBase, progression) {
         if (typeof calcBase !== 'string' || !progression) {
-            return false;
+            return [];
         }
         const reg = /{[^}]+}/g;
         const matched = calcBase.match(reg);
         if (!matched) {
-            return false;
+            return [];
         }
-        return matched.some(mStr => progression.some(pStr => `{${pStr}}` === mStr));
+        return matched
+            .filter(mStr => progression.some(pStr => `{${pStr}}` === mStr))
+            .map(mStr => mStr.replace(/[{}]/g, ''));
+    }
+
+    /**
+     * 该基数是否含有累进基数
+     * @param {String} calcBase - 计算基数
+     * @param {Array} progression - 累进基数名称数组
+     * @return {Boolean}
+     */
+    function isProgressive(calcBase, progression) {
+        const progressiveBase = getProgressive(calcBase, progression);
+        return !!progressiveBase.length;
     }
 
     return {
         getProgressiveFee,
         isProgressive,
+        getProgressive,
     };
 });

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

@@ -3,7 +3,6 @@
  */
 
 let isAH2019 = true;
-const { fixedFlag } = commonConstants;
 function overwriteRationCalcBases() {
     if (typeof rationCalcBases == 'undefined') return;
     for (let key in rationCalcBases) delete rationCalcBases[key];
@@ -75,8 +74,8 @@ function overwriteRationCalcBases() {
 })();
 
 // 清单基数
-const progression = [];
-const deficiency = {};
+const progression = ['施工场地建设费', '养护单位管理费', '养护项目信息化费', '工程监理费', '设计文件审查费', '前期工作费'];
+const deficiency = { '养护项目信息化费': 20000, '工程监理费': 20000, '前期工作费': 30000 };
 if (typeof baseFigureMap !== 'undefined') {
     const { fixedFlag } = commonConstants;
     const budgetMap = {
@@ -222,15 +221,6 @@ if (typeof baseFigureMap !== 'undefined') {
             pick: true
         }
     };
-    for (const name in budgetMap) {
-        const item = budgetMap[name];
-        if (item.isProgressive) {
-            progression.push(item.progressiveName || name);
-        }
-        if (item.deficiency) {
-            deficiency[item.progressiveName || name] = item.deficiency;
-        }
-    }
     baseFigureMap.budget = budgetMap;
     baseFigureMap.boq = boqMap;
 }

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

@@ -74,8 +74,8 @@ function overwriteRationCalcBases() {
 })();
 
 // 清单基数
-const progression = [];
-const deficiency = {};
+const progression = ['养护单位项目管理费', '信息化费', '工程监理费', '设计文件审查费', '前期工作费'];
+const deficiency = { '设计文件审查费': 3000 };
 if (typeof baseFigureMap !== 'undefined') {
     const { fixedFlag } = commonConstants;
     const budgetMap = {
@@ -195,15 +195,6 @@ if (typeof baseFigureMap !== 'undefined') {
             pick: true
         }
     };
-    for (const name in budgetMap) {
-        const item = budgetMap[name];
-        if (item.isProgressive) {
-            progression.push(item.progressiveName || name);
-        }
-        if (item.deficiency) {
-            deficiency[item.progressiveName || name] = item.deficiency;
-        }
-    }
     baseFigureMap.budget = budgetMap;
     baseFigureMap.boq = boqMap;
 }

+ 1 - 11
web/over_write/js/zhejiang_2005.js

@@ -3,7 +3,6 @@
  */
 
 let isZJ2005 = true;
-const { fixedFlag } = commonConstants;
 // 一般计税取不含税市场价、不含税定额价。简易计税取含税市场价、含税定额价。打开项目时,4个价格根据计税类型只载入其二,所以这里可不作区分。
 function overwriteRationCalcBases(taxType) {
     if (typeof rationCalcBases == 'undefined') return;
@@ -40,7 +39,7 @@ function overwriteRationCalcBases(taxType) {
 })();
 
 // 清单基数
-const progression = [];
+const progression = ['养护工程管理费'];
 const deficiency = {};
 if (typeof baseFigureMap !== 'undefined') {
     const { fixedFlag } = commonConstants;
@@ -118,15 +117,6 @@ if (typeof baseFigureMap !== 'undefined') {
             pick: true
         }
     };
-    for (const name in budgetMap) {
-        const item = budgetMap[name];
-        if (item.isProgressive) {
-            progression.push(item.progressiveName || name);
-        }
-        if (item.deficiency) {
-            deficiency[item.progressiveName || name] = item.deficiency;
-        }
-    }
     baseFigureMap.budget = budgetMap;
     baseFigureMap.boq = boqMap;
 }