Explorar o código

Merge branch '1.0.0_online' of http://192.168.1.12:3000/SmartCost/ConstructionCost into 1.0.0_online

TonyKang %!s(int64=7) %!d(string=hai) anos
pai
achega
4e76f54ca0

+ 2 - 1
modules/all_models/mix_ratio.js

@@ -45,6 +45,7 @@ let modelSchema = {
     // 对应工料机code
     code: String,
     // 工料机类型
-    type: Number
+    type: Number,
+    model: Number// 机型
 };
 mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));

+ 2 - 0
modules/all_models/project_glj.js

@@ -75,6 +75,8 @@ let modelSchema = {
     },
     // 类型
     type: Number,
+    // 机型
+    model: Number,
     // 单位
     unit: String,
     // 显示调整基价

+ 1 - 1
modules/all_models/ration.js

@@ -51,7 +51,6 @@ let rationSchema = new Schema({
     from:{type: String,default:'std'},          //std, cpt  来自标准、补充
     isSubcontract: Boolean,                     // 是否分包
     installationKey:String,                   //用来记录安装增加费的关联字段
-
     // 定额特有属性:
     libID: Number,
     maskName: String,
@@ -74,6 +73,7 @@ let rationSchema = new Schema({
     specs:String,//规格型号
     shortName:String,//缩写
     customQuantity:String,//自定义消耗
+    model: Number,// 机型
     adjCoe:Number,
     remark:String
 });

+ 2 - 0
modules/all_models/ration_glj.js

@@ -24,6 +24,8 @@ var ration_glj = new Schema({
     shortName:String,
     billsItemID: String,
     type:Number,
+    // 机型
+    model: Number,
     // 调整系数ID
     adjCoe: Number,
     quantity:String,

+ 1 - 0
modules/all_models/std_glj.js

@@ -24,6 +24,7 @@ const std_glj = new Schema({
     basePrice: Number,
     gljClass: Number,
     gljType: Number,
+    model: Number,// 机型
     shortName: String,
     unit: String,
     adjCoe: Number,

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

@@ -233,10 +233,8 @@ class GLJController extends BaseController {
         response.json(responseData);
     }
 
-
     //添加组成物
     async addMixRatio(request,response){
-
         let result={
             error:0
         };
@@ -257,7 +255,8 @@ class GLJController extends BaseController {
                     code: newProjectGLJ.code,
                     specs:newProjectGLJ.specs,
                     name:newProjectGLJ.name,
-                    unit:newProjectGLJ.unit
+                    unit:newProjectGLJ.unit,
+                    model:newProjectGLJ.model
                 };
                 newProjectGLJ.ratio_data = await mixRatioModel.add(mixRatio);
                 mixRatios.push(newProjectGLJ);

+ 3 - 2
modules/main/facade/ration_facade.js

@@ -284,13 +284,13 @@ async function addRationGLJ(std,newRation) {
             newGLJ.quantity = sub.consumeAmt;
             newGLJ.glj_repository_id = std.rationRepId;
             let std_glj = null;
-           if(sub.type == 'complementary'){//有可能来自标准工料机库或补充工料机库
+            if(sub.type == 'complementary'){//有可能来自标准工料机库或补充工料机库
                 std_glj = cptGLJMap[sub.gljId];
                 newGLJ.from = 'cpt';
             }else {
                std_glj = stdGLJMap[sub.gljId];
                newGLJ.from = 'std';
-           }
+            }
             let std_gljTime = +new Date();
             if(std_glj){
                 newGLJ.name = std_glj.name;
@@ -298,6 +298,7 @@ async function addRationGLJ(std,newRation) {
                 newGLJ.original_code = std_glj.code;
                 newGLJ.unit = std_glj.unit;
                 newGLJ.specs = std_glj.specs;
+                newGLJ.model = std_glj.model;
                 newGLJ.basePrice = std_glj.basePrice;
                 newGLJ.marketPrice = std_glj.basePrice;
                 newGLJ.shortName = std_glj.shortName;

+ 2 - 0
modules/ration_glj/facade/ration_glj_facade.js

@@ -167,6 +167,7 @@ function createNewRecord(ration_glj) {
     newRecoed.shortName = ration_glj.shortName;
     newRecoed.billsItemID = ration_glj.billsItemID;
     newRecoed.type = ration_glj.type;
+    newRecoed.model = ration_glj.model;
     newRecoed.repositoryId = ration_glj.repositoryId;
     newRecoed.projectGLJID = ration_glj.projectGLJID;
     newRecoed.adjCoe = ration_glj.adjCoe;
@@ -568,6 +569,7 @@ function getGLJSearchInfo(ration_glj) {
         specs: ration_glj.specs,
         unit: ration_glj.unit,
         type: ration_glj.subType ? ration_glj.subType : ration_glj.type,//如果有subType,则是通过插入定额级的工料机进来的
+        model: ration_glj.model,
         type_of_work: ration_glj.subType ? ration_glj.subType : ration_glj.type,
         base_price: ration_glj.basePrice,
         market_price: ration_glj.marketPrice,

+ 30 - 37
public/web/gljUtil.js

@@ -3,8 +3,6 @@
  */
 
 
-
-
 let gljUtil = {
     calcProjectGLJQuantity:function (projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal,_,scMathUtil,isTender) {
         let project_gljs = projectGLJDatas.gljList;
@@ -122,11 +120,9 @@ let gljUtil = {
         let r_quantity = ration?scMathUtil.roundForObj(ration.quantity,q_decimal):0;
         return scMathUtil.roundForObj(r_quantity * rationQuantityCoe,q_decimal);
     },
-
     isNotEmpty:function (str) {
         return this.isDef(str) && str!="";
     },
-
     getSubdivisionAndTechBillsLeavesID:function (billsDatas) {//分别取分部分项和技术措施项目的所有叶子清单ID
          if(typeof (projectObj) !== 'undefined'){//存在,说明在前端调用
              return [projectObj.project.Bills.getSubdivisionProjectLeavesID(),projectObj.project.Bills.getTechLeavesID()];
@@ -167,7 +163,6 @@ let gljUtil = {
     },
     getFlag:function (b) {
         return _.find(b.flags,{"fieldName":"fixed"});
-
     },
     getGLJPrice:function (glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil) {
         let result = {};
@@ -247,7 +242,7 @@ let gljUtil = {
             let labour = _.find(labourCoeDatas.coes,{'ID':glj.adjCoe});
             let coe = labour && labour.coe ? labour.coe : 1;
             return scMathUtil.roundTo(parseFloat(coe * scMathUtil.roundForObj(glj.unit_price.base_price,decimal)), -decimal);
-        } else if (notEditType.indexOf(glj.unit_price.type)!=-1&&glj.ratio_data.length>0) {//对于混凝土、配合比、砂浆、机械台班,调整价根据组成物计算得出。
+        } else if (this.notEditType.indexOf(glj.unit_price.type)!=-1&&glj.ratio_data.length>0) {//对于混凝土、配合比、砂浆、机械台班,调整价根据组成物计算得出。
             let p =0;
             for(let ratio of glj.ratio_data){
                 let tem =  _.find( projectGLJDatas.gljList,{
@@ -282,8 +277,7 @@ let gljUtil = {
     },
     isFlag : function (v) {
         return this.isDef(v.flagsIndex) && this.isDef(v.flagsIndex.fixed) && this.isDef(v.flagsIndex.fixed.flag);
-    }
-    ,
+    },
     isDef:function (v) {
         return v !== undefined && v !== null;
     },
@@ -306,41 +300,40 @@ let gljUtil = {
         CONSTRUCTION_TECH: 3
     },
     gljType : {
-        // 人工
-        LABOUR: 1,
-        // ==============材料类型=================
-        // 普通材料
-        GENERAL_MATERIAL: 201,
-        // 混凝土
-        CONCRETE: 202,
-        // 砂浆
-        MORTAR: 203,
-        // 配合比
-        MIX_RATIO: 204,
-        // 商品混凝土
-        COMMERCIAL_CONCRETE: 205,
-        // 商品砂浆
-        COMMERCIAL_MORTAR: 206,
+        LABOUR: 1, // 人工
         // ==============材料类型=================
+        GENERAL_MATERIAL: 201,  // 普通材料
+        CONCRETE: 202, // 混凝土
+        MORTAR: 203,// 砂浆
+        MIX_RATIO: 204,// 配合比
+        COMMERCIAL_CONCRETE: 205,// 商品混凝土
+        COMMERCIAL_MORTAR: 206,// 商品砂浆
+        OTHER_MATERIAL: 207, // 其它材料
         // ==============机械类型=================
-        // 机械台班
-        GENERAL_MACHINE: 301,
-        // 机械组成物
-        MACHINE_COMPOSITION: 302,
-        // 机上人工
-        MACHINE_LABOUR: 303,
+        GENERAL_MACHINE: 301,// 机械台班
+        MACHINE_COMPOSITION: 302,// 机械组成物
+        MACHINE_LABOUR: 303,// 机上人工
+        INSTRUMENT: 304,// 仪器仪表
+        FUEL_POWER_FEE:305,//燃料动力费
+        DEPRECIATION_FEE:306,//折旧费
+        INSPECTION_FEE:307,//检修费
+        MAINTENANCE:308,//维护费
+        DISMANTLING_FREIGHT_FEE:309,//安拆费及场外运费
+        VERIFICATION_FEE:310,//校验费
+        OTHER_FEE:311,//其他费用
         // ==============机械类型=================
-        // 主材
-        MAIN_MATERIAL: 4,
-        // 设备
-        EQUIPMENT: 5
+        MAIN_MATERIAL: 4,// 主材
+        EQUIPMENT: 5// 设备
     },
-     notEditType : [202, 203,204, 301, 4],
-     gljKeyArray : ['code','name','specs','unit','type'],
-      rationType : {
+    notEditType : [202,203,204,301,304,4],
+    gljKeyArray : ['code','name','specs','unit','type'],
+    rationType : {
         ration: 1,
         volumePrice: 2,
         gljRation: 3,
         install:4
-    }
+    },
+    hasCompMaterial:[202, 203, 204],//有组成物的材料
+    hasCompMachine:[301],//有组成物的机械
+    machineComposition:[302,303]//可以做为机械组成物的类型
 }

+ 2 - 2
web/building_saas/glj/html/project_glj.html

@@ -16,11 +16,11 @@
         <div class="gl-side col-lg-1 filterType" id='filterType'>
             <ul class="nav flex-column nav-pills mt-2 mb-2">
                 <li class="nav-item"><a class="nav-link active" href="#" id="ALL">所有人材机</a></li>
-                <li class="nav-item li_sub"><a class="nav-link" href="javascript:void(0)" id="LABOUR">人工</a></li>
+             <!--   <li class="nav-item li_sub"><a class="nav-link" href="javascript:void(0)" id="LABOUR">人工</a></li>
                 <li class="nav-item li_sub"><a class="nav-link" href="javascript:void(0)" id="GENERAL_MATERIAL">材料</a></li>
                 <li class="nav-item li_sub"><a class="nav-link" href="javascript:void(0)" id="GENERAL_MACHINE">机械</a></li>
                 <li class="nav-item li_sub"><a class="nav-link" href="javascript:void(0)" id="MAIN_MATERIAL">主材</a></li>
-                <li class="nav-item li_sub"><a class="nav-link" href="javascript:void(0)" id="EQUIPMENT">设备</a></li>
+                <li class="nav-item li_sub"><a class="nav-link" href="javascript:void(0)" id="EQUIPMENT">设备</a></li>-->
                 <li class="nav-item"><a class="nav-link" href="javascript:void(0)" id="FBFX">分部分项人材机</a></li>
                 <li class="nav-item"><a class="nav-link" href="javascript:void(0)" id="TECH">措施项目人材机</a></li>
                 <li class="nav-item"><a class="nav-link" href="javascript:void(0)" id="JGCL">甲供材料</a></li>

+ 1 - 1
web/building_saas/glj/js/project_glj_spread.js

@@ -20,7 +20,7 @@ function ProjectGLJSpread() {
     this.supplyType = ['自行采购', '部分甲供', '完全甲供', '甲定乙供'];
     this.supplyComboMap = supplyComboMap
     // 工料机类型是混凝土、砂浆、配合比、机械(不包括机械组成物)时,供货方式列只读。
-    this.supplyReadonlyType = notEditType;
+    this.supplyReadonlyType = gljUtil.notEditType;
 }
 
 /**

+ 1 - 0
web/building_saas/main/html/main.html

@@ -1600,6 +1600,7 @@
 
 
         <script type="text/javascript">
+            projectGljObject.initFilterTypeList();
             optionsOprObj.getOptions();
             projectInfoObj.showProjectInfo();
             projectObj.checkMainSpread();

+ 26 - 43
web/building_saas/main/js/models/main_consts.js

@@ -18,34 +18,31 @@ const ModuleNames = {
     installation_fee:'installation_fee'
 };
 
-let gljType = {
-    // 人工
-    LABOUR: 1,
-
-    // 普通材料
-    GENERAL_MATERIAL: 201,
-    // 混凝土
-    CONCRETE: 202,
-    // 砂浆
-    MORTAR: 203,
-    // 配合比
-    MIX_RATIO: 204,
-    // 商品混凝土
-    COMMERCIAL_CONCRETE: 205,
-    // 商品砂浆
-    COMMERCIAL_MORTAR: 206,
-
-    // 机械台班
-    GENERAL_MACHINE: 301,
-    // 机械组成物
-    MACHINE_COMPOSITION: 302,
-    // 机上人工
-    MACHINE_LABOUR: 303,
-
-    // 主材
-    MAIN_MATERIAL: 4,
-    // 设备
-    EQUIPMENT: 5
+let gljType = {//这里还是要有所有的类型
+    LABOUR: 1, // 人工
+    // ==============材料类型=================
+    GENERAL_MATERIAL: 201,  // 普通材料
+    CONCRETE: 202, // 混凝土
+    MORTAR: 203,// 砂浆
+    MIX_RATIO: 204,// 配合比
+    COMMERCIAL_CONCRETE: 205,// 商品混凝土
+    COMMERCIAL_MORTAR: 206,// 商品砂浆
+    OTHER_MATERIAL: 207, // 其它材料
+    // ==============机械类型=================
+    GENERAL_MACHINE: 301,// 机械台班
+    MACHINE_COMPOSITION: 302,// 机械组成物
+    MACHINE_LABOUR: 303,// 机上人工
+    INSTRUMENT: 304,// 仪器仪表
+    FUEL_POWER_FEE:305,//燃料动力费
+    DEPRECIATION_FEE:306,//折旧费
+    INSPECTION_FEE:307,//检修费
+    MAINTENANCE:308,//维护费
+    DISMANTLING_FREIGHT_FEE:309,//安拆费及场外运费
+    VERIFICATION_FEE:310,//校验费
+    OTHER_FEE:311,//其他费用
+    // ==============机械类型=================
+    MAIN_MATERIAL: 4,// 主材
+    EQUIPMENT: 5// 设备
 };
 // 计算基数 [定额基价材料费] 要用到的材料类型。
 const baseMaterialTypes = [
@@ -74,21 +71,7 @@ const allMaterialTypes = [
     gljType.EQUIPMENT
 ];
 // 会有组成物的材料、机械台班
-const compositionTypes = [
-    gljType.MAIN_MATERIAL,
-    gljType.CONCRETE,
-    gljType.MORTAR,
-    gljType.MIX_RATIO,
-    gljType.GENERAL_MACHINE
-];
-
-const notEditType = [
-    gljType.CONCRETE,
-    gljType.MORTAR,
-    gljType.MIX_RATIO,
-    gljType.GENERAL_MACHINE,
-    gljType.MAIN_MATERIAL
-];
+const compositionTypes =gljUtil.notEditType;//统一定义,方便覆盖
 
 const CP_Col_Width = {          // 多处计算程序界面的列宽统一设置
     rowHeader: 30,

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

@@ -258,7 +258,7 @@ ProjectGLJ.prototype.updateGLJProperty = function (node, updateField, newval) {
 }
 
 ProjectGLJ.prototype.getPriceDecimal = function (glj) {//价格的小数位数,有无组成物,取值不同
-    if(notEditType.indexOf(glj.unit_price.type)!=-1&&glj.ratio_data.length>0){
+    if(gljUtil.notEditType.indexOf(glj.unit_price.type)!=-1&&glj.ratio_data.length>0){
          return getDecimal("glj.unitPriceHasMix");
     }else {
         return getDecimal('glj.unitPrice');
@@ -531,6 +531,7 @@ ProjectGLJ.prototype.addMixRatio = function(selections,callback){
                 market_price: glj.basePrice,
                 shortName: glj.shortName,
                 type: glj.gljType,
+                model:glj.model,
                 adjCoe: glj.adjCoe,
                 from:'std',
                 repositoryId:glj.repositoryId,

+ 4 - 0
web/building_saas/main/js/models/ration_glj.js

@@ -536,6 +536,7 @@ let ration_glj = {
                         unit: glj.unit,
                         specs: glj.specs,
                         subType: glj.gljType,
+                        model:glj.model,
                         basePrice: glj.basePrice,
                         marketPrice:glj.basePrice,
                         original_code: glj.code,
@@ -615,6 +616,7 @@ let ration_glj = {
                     marketPrice:glj.basePrice,
                     shortName: glj.shortName,
                     type: glj.gljType,
+                    model:glj.model,
                     adjCoe: glj.adjCoe,
                     createType: 'add',
                     materialType:glj.materialType,
@@ -710,6 +712,7 @@ let ration_glj = {
             oldData.original_code = glj.code;
             oldData.unit = glj.unit;
             oldData.specs = glj.specs;
+            oldData.model = glj.model;
             oldData.basePrice = glj.basePrice;
             oldData.marketPrice = glj.basePrice;
             oldData.repositoryId = glj.repositoryId;
@@ -759,6 +762,7 @@ let ration_glj = {
                 unit: glj.unit,
                 specs: glj.specs,
                 type: glj.gljType,
+                model:glj.model,
                 basePrice: glj.basePrice,
                 marketPrice:glj.basePrice,
                 repositoryId: glj.repositoryId,

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

@@ -428,7 +428,7 @@ var gljOprObj = {
     },
     hasComposition:function (ration_glj,isRationType) {//判断是否有组成物,有则返回true   现在主材类型的工料机也有可能有组成物。
         let type = isRationType==true? ration_glj.subType:ration_glj.type;
-        if(notEditType.indexOf(type)!=-1||type==gljType.MAIN_MATERIAL){
+        if(gljUtil.notEditType.indexOf(type)!=-1||type==gljType.MAIN_MATERIAL){
             let keyArray = isRationType==true? rationKeyArray:gljKeyArray;
             let con_key = this.getIndex(ration_glj,keyArray);
             var mixRatioMap = projectObj.project.projectGLJ.datas.mixRatioMap;

+ 19 - 30
web/building_saas/main/js/views/project_glj_view.js

@@ -43,6 +43,13 @@ projectGljObject={
     mixRatioData:[],
     usedTenderList:[],
     usedUnitPriceInfo:null,
+    displayTypeMap:[
+        {ID:'LABOUR',text:'人工'},
+        {ID:'GENERAL_MATERIAL',text:'材料'},
+        {ID:'GENERAL_MACHINE',text:'机械'},
+        {ID:'MAIN_MATERIAL',text:'主材'},
+        {ID:'EQUIPMENT',text:'设备'}
+    ],
     initProjectGljSpread:function () {
         if(!this.projectGljSpread){
             this.projectGljSpread = SheetDataHelper.createNewSpread($("#project_glj_sheet")[0],2);
@@ -129,13 +136,12 @@ projectGljObject={
         let me = this;
         if(me.selectedProjectGLJ){
             let showTypes = [];
-            let materialArr = [202, 203, 204];//混凝土、砂浆、配合比,
             if(me.selectedProjectGLJ.type == gljType.MAIN_MATERIAL){//对于主材,只显示没有组成物并且除了自已的主材
                 showTypes = [gljType.MAIN_MATERIAL];
-            }else if(_.includes(materialArr,me.selectedProjectGLJ.type)){//混凝土、砂浆、配合比
+            }else if(_.includes(gljUtil.hasCompMaterial,me.selectedProjectGLJ.type)){//混凝土、砂浆、配合比
                 showTypes = [gljType.GENERAL_MATERIAL];
-            }else if(me.selectedProjectGLJ.type == gljType.GENERAL_MACHINE){//机械类型可添加机械组成物、机上人工
-                showTypes = [gljType.MACHINE_COMPOSITION,gljType.MACHINE_LABOUR];
+            }else if(me.selectedProjectGLJ.type == gljType.GENERAL_MACHINE){//机械中有组成物的类型可添加机械组成物、机上人工
+                showTypes = gljUtil.machineComposition;
             }
             gljOprObj.gljLibSheetData = _.filter(gljOprObj.gljLibSheetData, function (item) {
                 if(me.selectedProjectGLJ.type == gljType.MAIN_MATERIAL){
@@ -162,7 +168,6 @@ projectGljObject={
                 gljOprObj.showRationGLJSheetData();
                 me.onUnitFileChange(me.selectedProjectGLJ);
             });
-
         });
     },
     showMixRatioData:function () {
@@ -346,7 +351,6 @@ projectGljObject={
             info.sheet.getCell(info.row, info.col).text(0);
             return ;
         }
-
         for(let c of info.changedCells){
             let value = info.sheet.getCell(c.row, c.col).text();
             if (!me.checkData(c.col,me.mixRatioSetting,value)) {
@@ -357,15 +361,12 @@ projectGljObject={
                 changeInfo.push({row:c.row,col:c.col,value:value});
             }
         }
-
         if(canChange == false){//数据类型不对
             me.showMixRatioData();
         }
         if(changeInfo.length > 0){
             me.batchUpdateConsumption(changeInfo);
         }
-
-
     },
     batchUpdateProjectGLJ:function(changeInfo,sheetName){
         let projectGLJ = projectObj.project.projectGLJ;
@@ -396,7 +397,6 @@ projectGljObject={
             me.showMaterialTreeData();
         }
     },
-
     batchUpdateGLJProperty:function (changeInfo,sheetName,callback) {
         let me = projectGljObject,updateMap = {};
         let projectGLJ = projectObj.project.projectGLJ;
@@ -481,7 +481,6 @@ projectGljObject={
         });
 
     },
-
     showProjectGljData:function () {
         this.projectGljSpread.setActiveSheetIndex(0);
         let sel = this.projectGljSheet.getSelections()[0];
@@ -515,7 +514,6 @@ projectGljObject={
     },
     refreshDataSheet:function () {
         let me = projectGljObject;
-        //------------5;
         let quantityCol = _.findIndex(me.projectGljSetting.header,function (header) {
             return header.dataCode ==  'quantity'|| header.dataCode == 'techQuantity' || header.dataCode =='subdivisionQuantity';
         });
@@ -536,7 +534,6 @@ projectGljObject={
             me.showMixRatioData();
         }
     },
-
     createMaterialTree:function (gljList) {
         let me = projectGljObject;
         let q_decimal = getDecimal("glj.quantity");
@@ -574,7 +571,6 @@ projectGljObject={
                 }
             }
         }
-
         for(let mkey in sumMap){
             if(mkey == materialTypeMap.GC && sumMap[materialTypeMap.GJ]){//钢材汇总要加上钢筋的总量
                 parentMap['GC'].data.materialQuantity = scMathUtil.roundToString(sumMap[mkey]+sumMap[materialTypeMap.GJ],q_decimal);
@@ -582,16 +578,13 @@ projectGljObject={
                 parentMap[materialTypeMap[mkey]].data.materialQuantity = scMathUtil.roundToString(sumMap[mkey],q_decimal);
             }
         }
-
         this.materialTree.sortTreeItems();
-
         function createMaterialNode(data,parent,next) {
             let newNode = me.materialTree.addNode(parent, next, data.id);
             newNode.data = data;
             return newNode;
         }
     },
-
     getMaterialSheetDataByGLJ:function (glj) {
         let q_decimal = getDecimal("glj.quantity");
         let m_decimal = getDecimal("material");
@@ -618,13 +611,11 @@ projectGljObject={
         };
         if(glj.materialCoe){
             data.materialCoe = scMathUtil.roundForObj(glj.materialCoe,m_decimal);
-            //data.materialCoe = scMathUtil.roundToString(glj.materialCoe,m_decimal);
             data.materialQuantity = scMathUtil.roundForObj(glj.materialCoe * glj.quantity,q_decimal);//还要做汇总,汇总完再转成string
         }
         gljOprObj.setGLJPrice(data,glj);
         data.basePrice = scMathUtil.roundToString(data.basePrice,p_decimal);
         data.marketPrice = scMathUtil.roundToString(data.marketPrice,p_decimal);
-
         return data;
     },
     filterProjectGLJ:function (gljList) {
@@ -702,7 +693,7 @@ projectGljObject={
         if(data.basePrice == data.marketPrice){//如果定额价等于市场价时,改底色。 优先度低于有组成物时的底色
             data.bgColour = "#C4CAFB";
         }
-        if (notEditType.indexOf(glj.type) >= 0) {
+        if (gljUtil.notEditType.indexOf(glj.type) >= 0) {
             if (data.ratio_data  && data.ratio_data.length > 0){//有组成物时
                 //设置底色
                 data.bgColour = "#E0E0E0";
@@ -917,9 +908,7 @@ projectGljObject={
                 value = scMathUtil.roundForObj(value,getDecimal("material"));
             }
             extend = Object.keys(extend).length > 0 ?  JSON.stringify(extend) : '';
-
             if(recode[dataCode] == value) return;
-
             let updateData = {id: recode.id, field: dataCode, value: value, extend: extend};
             projectGLJ.pGljUpdate(updateData,callback);
         };
@@ -1043,11 +1032,16 @@ projectGljObject={
             }else {
                 $("#save-as-tips").hide();
                 $('#save-as-confirm').removeAttr("disabled");
-                if(callback){
-                    callback();
-                }
+                if(callback) callback();
             }
         });
+    },
+    initFilterTypeList:function () {//初始化人材机汇总工料机类型过滤列表
+        let htmlString = '';
+        for(let t of this.displayTypeMap){
+            htmlString += '<li class="nav-item li_sub"><a class="nav-link" href="javascript:void(0)" id="'+t.ID+'">'+t.text+'</a></li>';
+        }
+        $('#ALL').after(htmlString);
     }
 };
 
@@ -1097,7 +1091,6 @@ function getFileHierarchyInfo(treeData){
     return rst;
 }
 
-
 $(function () {
     let pojGljResizeEles =  getProjectResizeEles();
     slideResize(pojGljResizeEles, {min: 170, max: 700}, 'height', function () {
@@ -1223,7 +1216,6 @@ $(function () {
                 $("#newUnitFileName").val(newName);
                 return;
             }
-
         }
         let data = {project_id: scUrlUtil.GetQueryString('project'), change_id: changeUnitPriceId, type: type};
         projectObj.project.projectGLJ.changeFile(data,function () {
@@ -1295,7 +1287,6 @@ $(function () {
             }
         });
     });
-
     // 单价文件另存为操作
     $("#save-as-confirm").click(function () {
         let projectGLJ = projectObj.project.projectGLJ;
@@ -1314,13 +1305,11 @@ $(function () {
     });
 
     $("#filterType").on("click","ul li a",function(e){
-
         let children = $('#filterType a');
         for(let c of children){
             $(c).removeClass('active');
         }
         $(this).addClass('active');
-
         let me = projectGljObject;
         me.displayType = filterType[this.id];
         me.refreshDataSheet();

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

@@ -864,7 +864,7 @@ var projectObj = {
                         col.showHint = true;
                     }
 
-                    // 综合单价、综合合价,小数部分应补0对齐。  CSLAAAAA
+                    // 综合单价、综合合价,小数部分应补0对齐。  CSL
                     // if (col.data.field.hasSubStr("common")){
                         if (col.data.field.hasSubStr(".totalFee"))
                             col.data.formatter = MainTreeCol.getNumberFormatter(decimalObj.ration.totalPrice, true);

+ 11 - 3
web/over_write/js/chongqing_2018.js

@@ -10,10 +10,9 @@ if(gljType){
         MIX_RATIO: 204,// 配合比
         COMMERCIAL_CONCRETE: 205, // 商品混凝土
         COMMERCIAL_MORTAR: 206, // 商品砂浆
-        OTHER_MATERIAL: 207, // 商品砂浆
+        OTHER_MATERIAL: 207, // 其它材料
         GENERAL_MACHINE: 301,// 机械台班
         MACHINE_LABOUR: 303, // 机上人工
-        MACHINE_COMPOSITION: 302,// 机械组成物
         INSTRUMENT: 304,// 仪器仪表
         FUEL_POWER_FEE:305,//燃料动力费
         DEPRECIATION_FEE:306,//折旧费
@@ -22,6 +21,15 @@ if(gljType){
         DISMANTLING_FREIGHT_FEE:309,//安拆费及场外运费
         VERIFICATION_FEE:310,//校验费
         OTHER_FEE:311,//其他费用
-        MAIN_MATERIAL: 4,// 主材
+        MAIN_MATERIAL: 4// 主材
     };
 }
+
+if(projectGljObject){
+    projectGljObject.displayTypeMap=[
+        {ID:'LABOUR',text:'人工'},
+        {ID:'GENERAL_MATERIAL',text:'材料'},
+        {ID:'GENERAL_MACHINE',text:'施工机具'},//重庆2018定额中去掉了主材,机械的显示改为了施工机具
+        {ID:'MAIN_MATERIAL',text:'主材'}
+    ];
+}