瀏覽代碼

材料计算共享同步问题

zhangweicheng 6 年之前
父節點
當前提交
2a3c0b9248

+ 3 - 3
modules/glj/controllers/glj_controller.js

@@ -870,16 +870,16 @@ async function getGLJListByProjectID(projectId){
                 usedUnitPriceInfo.id = tmp.property.unitPriceFile.id;
             }
         }
+        responseData.data.originalList = await original_calc_model.find({"unit_price_file_id":unitPriceFileId}).lean();
+        responseData.data.freightList = await freight_calc_model .find({"unit_price_file_id":unitPriceFileId}).lean();
         // 先获取对应标段的项目工料机数据
         let gljListModel = new GLJListModel();
-        let [gljList, mixRatioConnectData,mixRatioMap,unitPriceMap] = await gljListModel.getListByProjectId(projectId, unitPriceFileId);
+        let [gljList, mixRatioConnectData,mixRatioMap,unitPriceMap] = await gljListModel.getListByProjectId(projectId, unitPriceFileId,responseData.data.freightList,responseData.data.originalList);
         responseData.data.gljList = gljList;
         responseData.data.mixRatioConnectData = mixRatioConnectData;
         responseData.data.mixRatioMap = mixRatioMap;
         responseData.data.usedTenderList = usedTenderList;
         responseData.data.unitPriceMap = unitPriceMap;
-        responseData.data.originalList = await original_calc_model.find({"unit_price_file_id":unitPriceFileId});
-        responseData.data.freightList = await freight_calc_model .find({"unit_price_file_id":unitPriceFileId});
         let gljTypeMap = glj_type_util.getStdGljTypeCacheObj().innerGljTypeObj;
         let unitPriceFileModel = new UnitPriceFileModel();
         let unitFileInfo =  await unitPriceFileModel.findDataByCondition({id: unitPriceFileId});

+ 105 - 34
modules/glj/models/glj_list_model.js

@@ -79,7 +79,7 @@ class GLJListModel extends BaseModel {
      * @param {Number} unitPriceFileId
      * @return {Promise}
      */
-    async getListByProjectId(projectId, unitPriceFileId) {
+    async getListByProjectId(projectId, unitPriceFileId,freightList,originalList) {
         let gljData = null;
         /*let decimal =await decimal_facade.getProjectDecimal(projectId);
         let quantity_decimal = decimal&&decimal.glj.quantity?decimal.glj.quantity:6;//取消耗量保留小数据位,默认6位*/
@@ -91,37 +91,31 @@ class GLJListModel extends BaseModel {
             // 首先获取对应标段下所有的项目工料机数据
             let condition = {project_id: projectId};
             let fields = {_id: 0};
-            gljData = await this.db.find(condition, fields);
+            gljData = await this.model.find(condition, fields).lean();
+            // 整理获取有组成物的项目工料机的数据
+            let connect_keys = [];
+            for(let tmp of gljData) {
+                let c_key = this.getIndex(tmp,['code','name','specs','unit','type']);
+                //把有组成物类型的连接字段挑出来
+                if(this.ownCompositionTypes.indexOf(tmp.type)!=-1){
+                    connect_keys.push(c_key);
+                }
+                keyMap[c_key] = tmp; //工料机连接key和工料机的对照表;
+            }
+
+            //检查自采材料和综合电价功能在共享单价文件时,项目文件中可能会缺少项目工料机的情况,如果缺少,则自动插入
+            if(freightList && freightList.length > 0)  await this.materialCalcProjectGLJChecking(freightList,keyMap,gljData,connect_keys,projectId,unitPriceFileId);
+            if(originalList && originalList.length > 0) await this.materialCalcProjectGLJChecking(originalList,keyMap,gljData,connect_keys,projectId,unitPriceFileId);
             // 没有数据则直接返回空
             if (gljData.length <= 0) {
                 throw '无数据';
             }
-
             // 获取标段设置的单价文件数据
             let unitPriceModel = new UnitPriceModel();
             unitPriceList = await unitPriceModel.getDataByFileId(unitPriceFileId);
-            // 整理获取工料机ID list
-            let gljIdList = [];
-            for(let tmp of gljData) {
-                gljIdList.push(tmp.id);
-                let c_key = this.getIndex(tmp,['code','name','specs','unit','type']);
-                keyMap[tmp.id] = c_key; //工料机ID和连接key的对照表;
-            }
-            // 从定额工料机库中获取消耗量
-            condition = {
-                projectID: projectId
-               // projectGLJIDList: gljIdList 这里是取所有项目工料机,所以也是取所有定额工料机,不需要根据项目工料机ID再过滤
-            };
+
             //为了提高性成计算消耗量功能改成了在前端计算
-            // 整理获取有组成物的项目工料机的数据
-            let connect_keys = [];
-            for(let tmp of gljData) {
-                // 有组成物的类型才查找
-                let key = keyMap[tmp.id];
-                if(this.ownCompositionTypes.indexOf(tmp.type)!=-1){
-                    connect_keys.push(key);
-                }
-            }
+
             // 查找组成物的消耗量
             let totalComposition = {};
             let mixRatioData = {};
@@ -132,15 +126,7 @@ class GLJListModel extends BaseModel {
                 for (let tmp of mixRatioList) {
                    let t_index = tmp.connect_key;
                    let m_index = this.getIndex(tmp,['code','name','specs','unit','type']);
-                   /*
-                    let consumption=parseFloat(tmp.consumption);
-                    let r_quantity = quantityList[t_index]?quantityList[t_index]:0;
-                   if(quantityList[m_index]!==undefined){
-                       quantityList[m_index]=quantityList[m_index]+r_quantity*consumption;
-                   }else {
-                       quantityList[m_index] = r_quantity*consumption;
-                   }
-                    quantityList[m_index] = scMathUtil.roundTo(quantityList[m_index],-quantity_decimal);*/
+
                     if (mixRatioData[t_index] !== undefined) {
                         mixRatioData[t_index].push(tmp);
                     } else {
@@ -174,6 +160,92 @@ class GLJListModel extends BaseModel {
 
         return [gljData, mixRatioConnectData,mixRationMap,unitPriceList];
     }
+
+    async materialCalcProjectGLJChecking(materialList,keyMap,gljData,connect_keys,projectId,unitPriceFileId){
+        let missGLJs = [];
+        for(let m of materialList){
+            if(m.ration_gljs){
+                for(let rg of m.ration_gljs){
+                    let key = this.getIndex(rg);
+                    if(keyMap[key])  continue; //如果已经存在,则跳过,不用添加
+                    missGLJs.push(rg)
+                }
+            }
+        }
+        if(missGLJs.length > 0)   await this.handleMissGLJs(missGLJs,keyMap,gljData,connect_keys,projectId,unitPriceFileId)
+    }
+
+    //处理综合电价或材料计算共享的时候项目工料机缺少的情况
+    async handleMissGLJs(missGLJs,keyMap,gljData,connect_keys,projectId,unitPriceFileId){
+        let new_connect_keys = [];
+        let oldProjectIDMap = {};//记录来源的项目工料机对应的项目编号
+        let projectGLJIDList = [];
+        let key_to_projectIDMap={};//记录5大项key对应来源的项目工料机ID
+        for(let rg of missGLJs){
+            projectGLJIDList.push(rg.projectGLJID);
+           if(this.ownCompositionTypes.indexOf(rg.type)!=-1){//有工料机的类型还要检查组成物是否存在
+               let newkey = this.getIndex(rg);
+                new_connect_keys.push(newkey);
+                connect_keys.push(newkey);
+                key_to_projectIDMap[newkey] = rg.projectGLJID;
+           }
+        }
+        let oldProjectGLJs =  await this.model.find({'id':{'$in':projectGLJIDList}},'-_id').lean();
+        let counterModel = new CounterModel();
+
+        //处理缺少的项目工料机
+        for(let g of oldProjectGLJs){
+            oldProjectIDMap[g.id] = g.project_id;
+            g.id = await counterModel.getId(gljCollectionName);
+            g.project_id = projectId;
+            keyMap[this.getIndex(g)] = g;
+        }
+
+        //处理缺少的项目工料机中的组成物
+        if(new_connect_keys.length > 0){
+            let mixRatioModel = new MixRatioModel();
+            let e_mList = await mixRatioModel.model.find({unit_price_file_id: unitPriceFileId,connect_key: {'$in':new_connect_keys}}).lean();
+            let p_m = {};//以项目工料机来分组
+            for(let m of e_mList) {
+                let mkey = this.getIndex(m);
+                if (keyMap[mkey]) continue; //如果已经存在了,不用再增加
+                let oldPID = key_to_projectIDMap[m.connect_key];
+                if (p_m[oldPID]) {
+                    p_m[oldPID].push(m);
+                } else {
+                    p_m[oldPID] = [m];
+                }
+                keyMap[mkey] = m;//处理过了就添加,避免重复
+            }
+            //按组来处理组成物信息
+            for(let t_pid in p_m){
+                let codeList = [];
+                let mkeyMap = [];
+                for(let m of p_m[t_pid]){
+                    codeList.push(m.code);
+                    mkeyMap[this.getIndex(m)] = m;
+                }
+                let projectID = oldProjectIDMap[t_pid];
+                let m_projectGLJs =  await this.model.find({'project_id':projectID,'code':{'$in':codeList}},'-_id').lean();
+                for(let mg of m_projectGLJs){
+                    if(mkeyMap[this.getIndex(mg)]){//过滤掉单按编号不准确的工料机
+                        mg.id = await counterModel.getId(gljCollectionName);
+                        mg.project_id = projectId;
+                        oldProjectGLJs.push(mg);
+                    }
+                }
+            }
+        }
+
+        if(oldProjectGLJs.length > 0){
+            await this.db.create(oldProjectGLJs);
+            for(let o of oldProjectGLJs){
+                gljData.push(o);
+            }
+        }
+    }
+
+
     /**
      * 组合工料机数据和单价文件数据
      *
@@ -329,7 +401,6 @@ class GLJListModel extends BaseModel {
             data.id = await counterModel.getId(gljCollectionName);
         }
 
-        this.setScene('add');
         let result = await this.db.create(data);
         return result;
     }

+ 0 - 1
modules/pm/models/project_model.js

@@ -117,7 +117,6 @@ ProjectsDAO.prototype.updateUserProjects = async function (userId, compilationId
             callback(1, '提交数据出错.', null);
         }
     };
-    console.log(datas);
     if (datas) {
         for (i = 0; i < datas.length && !hasError; i++) {
             data = datas[i];

+ 39 - 45
public/web/gljUtil.js

@@ -13,28 +13,21 @@ let gljUtil = {
         let rationGljGroup = _.groupBy(rationGLJDatas,'projectGLJID');
         let IDarray =  this.getSubdivisionAndTechBillsLeavesID(billsDatas);//分别取分部分项和技术措施项目的所有叶子清单ID
         let billIDs = IDarray[0],tech_billIDS = IDarray[1];
-        let sField = isTender==true?"tenderSubdivisionQuantity":"subdivisionQuantity";
-        let tField = isTender==true?"tenderTechQuantity":"techQuantity";
+
+        //养护没有分部分项消耗量这一说的所以不用管
+
         let qField = isTender==true?"tenderQuantity":"quantity";
         let mField = "materialQuantity"; //材料计算的工料机消耗量
 
         for(let pglj of project_gljs ){
             let pg_index = this.getIndex(pglj,this.gljKeyArray);
-            pglj[sField] = 0;
-            pglj[tField] = 0;
             pglj[qField] = 0;
             pglj[mField] = 0;
             let gljGroup = rationGljGroup[pglj.id]?rationGljGroup[pglj.id]:[];//定额工料机没有,有可能是定额类型的工料机
             let result = this.getQuantityPerGLJ(gljGroup,rations,rationMap,pglj,billIDs,tech_billIDS,q_decimal,_,scMathUtil,isTender);
-            pglj[sField] = result.subdivisionQuantity;
-            pglj[tField] = result.techQuantity;
             pglj[qField] = result.quantity;
             quantityMap[pg_index] = pglj;
         }
-        //材料计算中,工料机的消耗量
-        if(projectGLJDatas.freightList) this.setMaterialCalcQuantity(quantityMap,projectGLJDatas.freightList,q_decimal,_,scMathUtil); //运费计算中工料机的消耗量
-        if(projectGLJDatas.originalList) this.setMaterialCalcQuantity(quantityMap,projectGLJDatas.originalList,q_decimal,_,scMathUtil);//原价计算中工料机的消耗量
-
         //计算做为组成物的消耗量
         for(let pkey in mixRatioMap){
             let mixRatioList = mixRatioMap[pkey];
@@ -44,16 +37,30 @@ let gljUtil = {
                 let p_glj = quantityMap[pkey];
                 if(m_glj&&p_glj&&!gljUtil.isConcreteType(p_glj.type) ){//混凝土、砂浆、配合比组成物的消耗量在定额下已经有体现了,不用再计算进去
                     let quantity = scMathUtil.roundForObj(parseFloat(p_glj[qField])*parseFloat(m.consumption),q_decimal);
-                    let techQuantity = scMathUtil.roundForObj(parseFloat(p_glj[tField])*parseFloat(m.consumption),q_decimal);
-                    let subdivisionQuantity = scMathUtil.roundForObj(parseFloat(p_glj[sField])*parseFloat(m.consumption),q_decimal);
-                    let materialQuantity = scMathUtil.roundForObj(parseFloat(p_glj[mField])*parseFloat(m.consumption),q_decimal);
                     m_glj[qField] =  scMathUtil.roundForObj(parseFloat(m_glj[qField])+quantity,q_decimal);
-                    m_glj[tField] =  scMathUtil.roundForObj(parseFloat(m_glj[tField])+techQuantity,q_decimal);
-                    m_glj[sField] =  scMathUtil.roundForObj(parseFloat(m_glj[sField])+subdivisionQuantity,q_decimal);
+                }
+            }
+        }
+
+        //材料计算中,工料机的消耗量
+        if(projectGLJDatas.freightList) this.setMaterialCalcQuantity(quantityMap,projectGLJDatas.freightList,q_decimal,_,scMathUtil,isTender); //运费计算中工料机的消耗量
+        if(projectGLJDatas.originalList) this.setMaterialCalcQuantity(quantityMap,projectGLJDatas.originalList,q_decimal,_,scMathUtil,isTender);//原价计算中工料机的消耗量
+
+        //因为材料计算里自采材料产生的消耗量和进行材料计算的父工料机的消耗量有关,所以材料计算中的组成物的消耗量要在上一步的组成物计算完后,再计算自采材料里组成物的消耗量,所认两个组成物计算不能合并,而且乘的值也不同
+        for(let pkey in mixRatioMap){
+            let mixRatioList = mixRatioMap[pkey];
+            for(let m of mixRatioList){
+                let m_index = this.getIndex(m,this.gljKeyArray);
+                let m_glj = quantityMap[m_index];
+                let p_glj = quantityMap[pkey];
+                if(m_glj&&p_glj&&!gljUtil.isConcreteType(p_glj.type)&& p_glj[mField] > 0){//混凝土、砂浆、配合比组成物的消耗量在定额下已经有体现了,不用再计算进去
+                    let materialQuantity = scMathUtil.roundForObj(parseFloat(p_glj[mField])*parseFloat(m.consumption),q_decimal);
+                    m_glj[qField] =  scMathUtil.roundForObj(parseFloat(m_glj[qField])+materialQuantity,q_decimal);
                     m_glj[mField] =  scMathUtil.roundForObj(parseFloat(m_glj[mField])+materialQuantity,q_decimal);
                 }
             }
         }
+
         //计算经过场外运输损耗后的总消耗量
         for(let pglj of project_gljs ){
             let offSiteTransportLossRate = this.getOffSiteTransportLossRate(pglj);
@@ -63,20 +70,24 @@ let gljUtil = {
             pglj.quantity = scMathUtil.roundForObj(pglj.quantity +  pglj.transportLossQuantity ,q_decimal);
         }
     },
-    setMaterialCalcQuantity:function (quantityMap,calcList,q_decimal,_,scMathUtil) {
+    setMaterialCalcQuantity:function (quantityMap,calcList,q_decimal,_,scMathUtil,isTender) {
+        let qField = isTender==true?"tenderQuantity":"quantity";
         for(let t of calcList){
-            let rationIDMap = _.indexBy(t.rations,"ID");
-            if(t.ration_gljs){
-                for(let rg of t.ration_gljs){
-                    let rIndex = this.getIndex(rg);
-                    let pglj = quantityMap[rIndex];
-                    let ration = rationIDMap[rg.rationID];
-                    if(pglj && ration){
-                        let rg_quantity = scMathUtil.roundForObj(rg.quantity,q_decimal);
-                        let r_quantity = scMathUtil.roundForObj(ration.quantity,q_decimal);
-                        let result = scMathUtil.roundForObj(rg_quantity * r_quantity,q_decimal);
-                        pglj.quantity = scMathUtil.roundForObj(pglj.quantity + result,q_decimal);
-                        pglj.materialQuantity = scMathUtil.roundForObj(pglj.materialQuantity + result,q_decimal);
+            if(quantityMap[t.connect_key] && quantityMap[t.connect_key][qField] > 0){
+                let rationIDMap = _.indexBy(t.rations,"ID");
+                if(t.ration_gljs){
+                    for(let rg of t.ration_gljs){
+                        let rIndex = this.getIndex(rg);
+                        let pglj = quantityMap[rIndex];
+                        let ration = rationIDMap[rg.rationID];
+                        if(pglj && ration){
+                            let rg_quantity = scMathUtil.roundForObj(rg.quantity,q_decimal);
+                            let r_quantity = scMathUtil.roundForObj(ration.quantity,q_decimal);
+                            let result = scMathUtil.roundForObj(rg_quantity * r_quantity,q_decimal);
+                            result = scMathUtil.roundForObj(quantityMap[t.connect_key][qField] * result,q_decimal);
+                            pglj.quantity = scMathUtil.roundForObj(pglj.quantity + result,q_decimal);
+                            pglj.materialQuantity = scMathUtil.roundForObj(pglj.materialQuantity + result,q_decimal);
+                        }
                     }
                 }
             }
@@ -105,8 +116,6 @@ let gljUtil = {
     getQuantityPerGLJ : function (ration_glj_list,rations,rationMap,pglj,billIDs,tech_billIDS,q_decimal,_,scMathUtil,isTender) {
         let result={};
         let quantity_sum=0;//工料机汇总消耗量
-        let sum = 0;//分部分项总消耗量
-        let tech_sum = 0;//技术措施总消耗量
         for(let rg of ration_glj_list){
             let tem_ration = rationMap[rg.rationID];
             let r_quantity = tem_ration?scMathUtil.roundForObj(tem_ration.quantity,q_decimal):0;
@@ -120,12 +129,6 @@ let gljUtil = {
             }
             let total = scMathUtil.roundForObj(glj_quantity*r_quantity, q_decimal);
             quantity_sum = scMathUtil.roundForObj(quantity_sum+total,q_decimal);
-            if(_.includes(billIDs,rg.billsItemID)){//计算分部分项
-                sum = scMathUtil.roundForObj(sum+total,q_decimal);
-            }
-            if(_.includes(tech_billIDS,rg.billsItemID)){//计算技术措施项目消耗量
-                tech_sum = scMathUtil.roundForObj(tech_sum+total,q_decimal);
-            }
         }
         for(let ra of rations){//计算定额类型工料机的消耗量
             if(ra.type == this.rationType.gljRation&&ra.projectGLJID===pglj.id){
@@ -135,17 +138,8 @@ let gljUtil = {
                     r_quantity = this.getRationTenderQuantity(ra,q_decimal,scMathUtil);
                 }
                 quantity_sum = scMathUtil.roundForObj(quantity_sum+r_quantity,q_decimal);
-                if(_.includes(billIDs,ra.billsItemID)){//计算分部分项
-                    sum = scMathUtil.roundForObj(sum+r_quantity,q_decimal);
-                }
-                if(_.includes(tech_billIDS,ra.billsItemID)){//计算技术措施项目消耗量
-                    tech_sum = scMathUtil.roundForObj(tech_sum+r_quantity,q_decimal);
-                }
             }
-
         }
-        result.subdivisionQuantity = sum;
-        result.techQuantity = tech_sum;
         result.quantity = quantity_sum;
         return result;
     },

+ 4 - 2
public/web/sheet/sheet_common.js

@@ -184,7 +184,7 @@ var sheetCommonObj = {
                 this.setCheckBoxCell(row,col,sheet,val)
             }
             if(setting.header[col].cellType === "comboBox"){
-                this.setComboBox(row,col,sheet,setting.header[col].options,setting.header[col].editorValueType);
+                this.setComboBox(row,col,sheet,setting.header[col].options,setting.header[col].editorValueType,setting.header[col].editable,setting.header[col].maxDropDownItems);
             }
             if(setting.header[col].cellType === "selectButton"){
                 this.setSelectButton(row,col,sheet,setting.header[col]);
@@ -308,7 +308,7 @@ var sheetCommonObj = {
         sheet.getCell(row, col).hAlign(GC.Spread.Sheets.HorizontalAlign.center);
 
     },
-    setComboBox(row,col,sheet,options,editorValueType,editable){
+    setComboBox(row,col,sheet,options,editorValueType,editable,maxDropDownItems){
         //let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
         let dynamicCombo = sheetCommonObj.getDynamicCombo(true);
         if(options){
@@ -317,6 +317,8 @@ var sheetCommonObj = {
                 dynamicCombo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
             }
             if(editable) dynamicCombo.editable(true);
+            console.log(maxDropDownItems);
+            if(maxDropDownItems) dynamicCombo.maxDropDownItems(maxDropDownItems);
         }
         sheet.setCellType(row, col,dynamicCombo,GC.Spread.Sheets.SheetArea.viewport);
     },

+ 6 - 2
web/building_saas/main/js/models/project_glj.js

@@ -860,7 +860,11 @@ ProjectGLJ.prototype.calcEachFreightOrPrice = function (temp,type,priceMap) {//
          if(type == "freight" && temp.conveyance !="自办运输") return null;
         let sum =0;
         let gljMap = {};
-        let pgljMap =_.indexBy(this.datas.gljList, 'id');
+        //因为材料计算的数据是保存在单价文件里的,有可能存在共享的情况,这样的话就不能用单价文件里的项目工料机ID来匹配,要用5大项匹配
+        let pgljMap = {};
+        for(let pg of this.datas.gljList){
+            pgljMap[gljUtil.getIndex(pg)] = pg
+        }
         for(let g of temp.ration_gljs){
             gljMap[g.rationID]?gljMap[g.rationID].push(g):gljMap[g.rationID]=[g];
         }
@@ -884,7 +888,7 @@ ProjectGLJ.prototype.calcEachFreightOrPrice = function (temp,type,priceMap) {//
             let machineSum = 0;
             let rationQuantity = scMathUtil.roundForObj(ration.quantity,getDecimal("ration.quantity"));
             for(let g of gljs){
-                gljOprObj.setGLJPrice(g,pMap[g.projectGLJID]);
+                gljOprObj.setGLJPrice(g,pMap[gljUtil.getIndex(g)]);
                 if(priceMap && priceMap[g.projectGLJID]) g.marketPrice = scMathUtil.roundForObj(priceMap[g.projectGLJID]);
                 let quantity = scMathUtil.roundForObj(g.quantity,getDecimal("glj.quantity"));
                 let t = scMathUtil.roundForObj(quantity * g.marketPrice * rationQuantity,processDecimal);//市场价

+ 1 - 1
web/building_saas/main/js/views/material_calc_view.js

@@ -93,7 +93,7 @@ materialCalcObj = {
             {headerName: "名称", headerWidth: 160, dataCode: "name", dataType: "String"},
             {headerName: "单位", headerWidth: 100, dataCode: "unit", dataType: "String"},
             {headerName: "数量", headerWidth: 100, dataCode: "quantity", dataType: "String",hAlign: "right",validator:"number"},
-            {headerName: "高原取费类别", headerWidth: 100, dataCode: "feeType", dataType: "String",visible: false,cellType:"comboBox",options:[]}
+            {headerName: "高原取费类别", headerWidth: 100, dataCode: "feeType", dataType: "String",visible: false,cellType:"comboBox",options:[],maxDropDownItems:5}
         ],
         view: {
             lockColumns: ["unit"],

+ 0 - 168
web/over_write/js/chongqing_2018.js

@@ -2,48 +2,6 @@
  * Created by zhang on 2018/8/14.
  */
 
-if(typeof projectGljObject !== 'undefined'){
-    projectGljObject.displayTypeMap=[
-        {ID:'LABOUR',text:'人工'},
-        {ID:'GENERAL_MATERIAL',text:'材料'},
-        {ID:'GENERAL_MACHINE',text:'施工机具'},//重庆2018定额中去掉了主材,机械的显示改为了施工机具
-        {ID:'MAIN_MATERIAL',text:'主材'}
-    ];
-}
-if(typeof gljUtil !== 'undefined'){
-    gljUtil.hasCompMachine = [301,304];//有组成物的机械
-    gljUtil.machineComposition = [303,305,306,307,308,309,310,311];//可以做为机械组成物的类型
-}
-
-//允许使用的工料机类型:人工、普通材料、混凝土、砂浆、配合比、商品混凝土、商品砂浆、其他材料费、机械台班、机上人工、仪器仪表、燃料动力费、折旧费、
-// 检修费、维护费、安拆费及场外运费、校验费、其他费用、主材、企业管理费、利润、一般风险费
-if(typeof allowGljType !== 'undefined'){
-    allowGljType = [1, 201, 202, 203, 204, 205, 206, 207, 301, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 4, 6, 7, 8];
-}
-if(typeof allowComponent !== 'undefined'){
-    //允许含有组成物的工料机类型:混凝土、砂浆、配合比、机械台班、仪器仪表、主材
-    allowComponent = [202, 203, 204, 301, 304, 4];
-}
-if(typeof componentType !== 'undefined'){
-    //可以作为组成物的工料机类型:普通材料、机上人工、燃料动力费、折旧费、检修费、维护费、安拆费及场外运费、校验费、其他费用、主材
-    componentType = [201, 303, 305, 306, 307, 308, 309, 310, 311, 4];
-}
-if(typeof machineAllowComponent !== 'undefined'){
-    //允许含有组成物的机械工料机类型:机械台班、仪器仪表
-    machineAllowComponent = [301, 304];
-}
-if(typeof machineComponent !== 'undefined'){
-    //可以作为机械工料机组成物的工料机类型:机械组成物、机上人工、燃料动力费、折旧费、检修费、维护费、安拆费及场外运费、校验费、其他费用
-    machineComponent = [303, 305, 306, 307, 308, 309, 310, 311];
-}
-if(typeof materialAllowComponent !== 'undefined'){
-    //允许含有组成物的材料工料机类型:混凝土、砂浆、配合比
-    materialAllowComponent = [202, 203, 204];
-}
-if(typeof materialComponent !== 'undefined'){
-    //可以作为材料工料机组成物的工料机类型:普通材料
-    materialComponent = [201];
-}
 
 //重庆综合里程、工地转移费率值修改特殊处理
 
@@ -61,129 +19,3 @@ if(typeof feeRateObject !== 'undefined'){
        return result;
    }
 }
-
-
-// CSL, 2018-08-21 计算程序定额基数、取费类别的覆盖。-----------------------------------------------------------------------
-// 重庆养护作为原始代码模块,以下变量及方法定义已写入原始位置,此处无需覆盖。其它地区的养护需在此位置覆盖,参见neimeng_2019.js。
-// let isCQ2018 = true;
-// function overwriteRationCalcBases (taxType){};
-// (function overwriteFeeTypes() {})();
-
-
-//清单计算基数相关
-/*
- 2019-11-27   baseFigureMap 的结构变了,覆盖后导致报错,暂时注释,待确认
-
-if(typeof baseFigureMap !== 'undefined'){
-    baseFigureMap = {
-        //与清单直接关联=======
-        '分部分项工程费': {base: 'FBFXGCF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
-        '分部分项定额人工费': {base: 'FBFXDEJJRGF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
-        '分部分项定额材料费': {base: 'FBFXDEJJCLF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
-        '分部分项定额施工机具使用费': {base: 'FBFXDEJJJXF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
-        '分部分项主材费': {base: 'FBFXZCF', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
-        '分部分项人工工日': {base: 'FBFXRGGR', fixedFlag: fixedFlag.SUB_ENGINERRING, class: 'FBFX'},
-        '措施项目费': {base: 'CSXMF', fixedFlag: fixedFlag.MEASURE, class: 'CSXM'},
-        '组织措施项目费': {base: 'ZZCSXMF', fixedFlag: fixedFlag.CONSTRUCTION_ORGANIZATION, class: 'CSXM'},
-        '组织措施项目定额人工费': {base: 'ZZCSXMDEJJRGF', fixedFlag: fixedFlag.CONSTRUCTION_ORGANIZATION, class: 'CSXM'},
-        '组织措施项目定额材料费': {base: 'ZZCSXMDEJJCLF', fixedFlag: fixedFlag.CONSTRUCTION_ORGANIZATION, class: 'CSXM'},
-        '组织措施项目定额施工机具使用费': {base: 'ZZCSXMDEJJJXF', fixedFlag: fixedFlag.CONSTRUCTION_ORGANIZATION, class: 'CSXM'},
-        '安全文明施工专项费': {base: 'AQWMSGZXF', fixedFlag: fixedFlag.SAFETY_CONSTRUCTION, class: 'CSXM'},
-        '技术措施项目费': {base: 'JSCSXMF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
-        '技术措施项目定额人工费': {base: 'JSCSXMDEJJRGF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
-        '技术措施项目定额材料费': {base: 'JSCSXMDEJJCLF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
-        '技术措施项目定额施工机具使用费': {base: 'JSCSXMDEJJJXF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
-        '技术措施项目主材费': {base: 'JSCSXMZCF', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
-        '技术措施项目人工工日': {base: 'JSCSXMRGGR', fixedFlag: fixedFlag.CONSTRUCTION_TECH, class: 'CSXM'},
-        '其他项目费': {base: 'QTXMF',  fixedFlag: fixedFlag.OTHER, class: 'QTXM'},
-        '规费': {base: 'GF', fixedFlag: fixedFlag.CHARGE, class: 'GF'},
-        '税金': {base: 'SJ', fixedFlag: fixedFlag.TAX, class: 'SJ'},
-        '增值税': {base: 'ZZS', class: 'SJ', fixedFlag: fixedFlag.ADDED_VALUE_TAX},
-        //不于清单直接关联==========
-        '建筑面积': {base: 'JZMJ', class: 'FBFX'},
-        '人材机价差': {base: 'RCJJC', class: 'RCJ'},
-        '人工价差': {base: 'RGJC', class: 'RCJ'},
-        '材料价差': {base: 'CLJC', class: 'RCJ'},
-        '施工机具使用费价差': {base: 'JXJC', class: 'RCJ'},
-        '分部分项人材机价差': {base: 'FBFXRCJJC', class: 'RCJ'},
-        '分部分项人工价差': {base: 'FBFXRGJC', class: 'RCJ'},
-        '分部分项材料价差': {base: 'FBFXCLJC', class: 'RCJ'},
-        '分部分项施工机具使用费价差': {base: 'FBFXJXJC', class: 'RCJ'},
-        '技术措施项目人材机价差': {base: 'JSCSXMRCJJC', class: 'RCJ'},
-        '技术措施项目人工价差': {base: 'JSCSXMRGJC', class: 'RCJ'},
-        '技术措施项目材料价差': {base: 'JSCSXMCLJC', class: 'RCJ'},
-        '技术措施项目施工机具使用费价差': {base: 'JSCSXMJXJC', class: 'RCJ'},
-        '甲供定额人工费': {base: 'JGDEJJRGF', class: 'RCJ'},
-        '甲供定额材料费': {base: 'JGDEJJCLF', class: 'RCJ'},
-        '甲供定额施工机具使用费': {base: 'JGDEJJJXF', class: 'RCJ'},
-        '甲供人工费': {base: 'JGRGF', class: 'RCJ'},
-        '甲供材料费': {base: 'JGCLF', class: 'RCJ'},
-        '甲供施工机具使用费费': {base: 'JGJXF', class: 'RCJ'},
-        '甲供主材费': {base: 'JGZCF', class: 'RCJ'},
-        '甲定定额人工费': {base: 'JDDEJJRGF', class: 'RCJ'},
-        '甲定定额材料费': {base: 'JDDEJJCLF', class: 'RCJ'},
-        '甲定定额施工机具使用费': {base: 'JDDEJJJXF', class: 'RCJ'},
-        '甲定人工费': {base: 'JDRGF', class: 'RCJ'},
-        '甲定材料费': {base: 'JDCLF', class: 'RCJ'},
-        '甲定施工机具使用费': {base: 'JDJXF', class: 'RCJ'},
-        '甲定主材费': {base: 'JDZCF', class: 'RCJ'},
-        '暂估材料费(从子目汇总)': {base: 'ZGCLFFZM', class: 'RCJ'},
-        '税前工程造价': {base: 'SQGCZJ', class: 'SQGCZJ',
-            cycleCalcRef: [fixedFlag.SUB_ENGINERRING, fixedFlag.OTHER, fixedFlag.CHARGE],   //循环计算相关固定行,由于计算排除了本身,不用判断措施项目
-            multiRef: [fixedFlag.SUB_ENGINERRING, fixedFlag.MEASURE, fixedFlag.OTHER, fixedFlag.CHARGE]},//相关固定行
-    };
-}
-
-*/
-
-
-if(typeof baseFigureTemplate !== 'undefined'){
-    baseFigureTemplate['ZZS'] =  function (tender) {//增值税
-        if(cbTools.isUnDef(calcBase.fixedBills[fixedFlag.ADDED_VALUE_TAX])){
-            return 0;
-        }
-        const totalFeeType = tender ? 'tenderTotalFee' : 'totalFee';
-        let bill = calcBase.fixedBills[fixedFlag.ADDED_VALUE_TAX]['bill'];
-        if(cbTools.isUnDef(bill)) return 0;
-        if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
-        return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common[totalFeeType]) ? bill.feesIndex.common[totalFeeType] : 0;
-    };
-}
-if(typeof figureClassTemplate !== 'undefined'){
-    figureClassTemplate['ADDED_VALUE_TAX'] = {flag: fixedFlag.ADDED_VALUE_TAX, filter: ['SJ', 'ZZS', 'SQGCZJ']}
-};
-//去除分类分包费
-if(typeof $ !== 'undefined' && $('#cbClassList')){
-    $('#cbClassList').find('li:eq(5)').remove();
-}
-//测试地区============
-/*if(typeof regions !== 'undefined') {
-    regions = [ '兰州', '定西', '天水', '平凉', '庆阳', '武威', '金昌', '张掖', '酒泉', '甘矿', '嘉峪关', '临夏', '合作', '武都', '白银'];
-}*/
-//==============
-
-
-
-//这个文档浏览器库和服务器端共用,所以这个文件中用到的变量都要记得做undefined判断,不然后端读取时会有问题
-//=================================================== 前后端分割线 ======================================================================
-if(typeof module !== 'undefined'){
-    module.exports = {
-        getCusCoeContent: getCusCoeContent,
-        getCustomerCoeData: getCustomerCoeData
-    };
-}
-
-function getCusCoeContent() {
-    return '人工×1,材料×1,施工机具×1,主材×1,设备×1'//2019-07-08 bug 添加自定义系数添加设备
-}
-
-function getCustomerCoeData() {
-    return [
-        {amount:1, operator:'*', gljCode:null, coeType:'定额'},
-        { amount:1, operator:'*', gljCode:null, coeType:'人工'},
-        { amount:1, operator:'*', gljCode:null, coeType:'材料'},
-        { amount:1, operator:'*', gljCode:null, coeType:'施工机具'},
-        { amount:1, operator:'*', gljCode:null, coeType:'主材'},
-        { amount:1, operator:'*', gljCode:null, coeType:'设备'}
-    ]
-}