瀏覽代碼

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/YangHuCost

Conflicts:
	web/building_saas/main/js/models/calc_program.js
chenshilong 6 年之前
父節點
當前提交
cc029b6d6f
共有 32 個文件被更改,包括 327 次插入390 次删除
  1. 5 0
      modules/all_models/project_glj.js
  2. 5 1
      modules/glj/models/glj_list_model.js
  3. 4 0
      modules/main/facade/ration_facade.js
  4. 12 6
      modules/pm/facade/pm_facade.js
  5. 7 2
      modules/pm/models/project_model.js
  6. 42 12
      modules/ration_glj/facade/glj_calculate_facade.js
  7. 4 0
      modules/ration_glj/facade/ration_glj_facade.js
  8. 5 1
      public/gljUtil.js
  9. 1 0
      public/web/gljUtil.js
  10. 68 0
      public/web/sheet/sheet_common.js
  11. 1 1
      public/web/tree_sheet/tree_sheet_helper.js
  12. 80 143
      web/building_saas/complementary_glj_lib/js/glj.js
  13. 2 3
      web/building_saas/complementary_glj_lib/js/gljComponent.js
  14. 1 12
      web/building_saas/complementary_glj_lib/js/sheetOpr.js
  15. 0 1
      web/building_saas/main/html/calc_program_manage.html
  16. 0 7
      web/building_saas/main/js/models/bills.js
  17. 0 4
      web/building_saas/main/js/models/calc_base.js
  18. 2 3
      web/building_saas/main/js/models/fee_rate.js
  19. 4 0
      web/building_saas/main/js/models/project_glj.js
  20. 0 3
      web/building_saas/main/js/models/ration.js
  21. 16 0
      web/building_saas/main/js/models/ration_glj.js
  22. 9 42
      web/building_saas/main/js/views/calc_base_view.js
  23. 4 0
      web/building_saas/main/js/views/project_glj_view.js
  24. 1 1
      web/building_saas/main/js/views/project_property_basicInfo.js
  25. 16 26
      web/building_saas/main/js/views/project_property_projFeature.js
  26. 10 43
      web/building_saas/main/js/views/project_view.js
  27. 16 70
      web/building_saas/main/js/views/quantity_edit_view.js
  28. 2 2
      web/building_saas/main/js/views/std_billsGuidance_lib.js
  29. 4 2
      web/building_saas/pm/js/pm_newMain.js
  30. 1 0
      web/common/html/header.html
  31. 1 1
      web/users/html/login.html
  32. 4 4
      web/users/html/user-set.html

+ 5 - 0
modules/all_models/project_glj.js

@@ -102,6 +102,11 @@ let modelSchema = {
         type: Number,
         default: 0
     },
+    //以下仅普通材料可用
+    grossWeightCoe: Number, //毛重系数
+    purchaseStorageRate: Number, //采购保管费率
+    offSiteTransportLossRate: Number, //场外运输损耗率
+    handlingLossRate: Number, //每增一次装卸损耗率
     ratio_data: Schema.Types.Mixed,
     remark:String
 };

+ 5 - 1
modules/glj/models/glj_list_model.js

@@ -602,7 +602,11 @@ class GLJListModel extends BaseModel {
                     adjCoe:tmp.adjCoe,
                     original_code:tmp.code,
                     materialType: tmp.materialType,   //三材类别
-                    materialCoe: tmp.materialCoe
+                    materialCoe: tmp.materialCoe,
+                    grossWeightCoe:tmp.grossWeightCoe,
+                    purchaseStorageRate:tmp.purchaseStorageRate,
+                    offSiteTransportLossRate:tmp.offSiteTransportLossRate,
+                    handlingLossRate:tmp.handlingLossRate
                 };
                 gljInsertData.push(gljData);
             }

+ 4 - 0
modules/main/facade/ration_facade.js

@@ -443,6 +443,10 @@ async function addRationGLJ(std,newRation,compilation) {
                 newGLJ.adjCoe = std_glj.adjCoe;
                 newGLJ.materialType = std_glj.materialType;
                 newGLJ.materialCoe = std_glj.materialCoe;
+                newGLJ.grossWeightCoe = std_glj.grossWeightCoe;
+                newGLJ.purchaseStorageRate = std_glj.purchaseStorageRate;
+                newGLJ.offSiteTransportLossRate = std_glj.offSiteTransportLossRate;
+                newGLJ.handlingLossRate = std_glj.handlingLossRate;
                 newGLJ.createType = 'normal';
                 let info =  await ration_glj_facade.getInfoFromProjectGLJ(newGLJ,unitPriceFileId,ext);
                 newGLJ = ration_glj_facade.createNewRecord(info);

+ 12 - 6
modules/pm/facade/pm_facade.js

@@ -784,13 +784,19 @@ async function getFullPath(projectID) {
     }
 }
 
-async function getProjectFeature(libID,feeStandardName){
-    let lib = await featureLibModel.findOne({'ID':libID})
-    if(lib){
-        let eng = _.find(lib.feature,{'key':'engineering'})
-        if(eng) eng.value = feeStandardName;
+//@param {String}libID(工程特征库ID) {Object}assign(需要赋值的key-value)
+async function getProjectFeature(libID, assign) {
+    let lib = await featureLibModel.findOne({'ID':libID});
+    if (lib) {
+        for (let key in assign) {
+            let obj = _.find(lib.feature, {key: key});
+            if (obj) {
+                obj.value = assign[key];
+            }
+        }
         return lib.feature;
-    }else {
+
+    } else {
         return [];
     }
 }

+ 7 - 2
modules/pm/models/project_model.js

@@ -165,8 +165,13 @@ ProjectsDAO.prototype.updateUserProjects = async function (userId, compilationId
                     //data.updateData.property.basicInformation = basicInformation;
                     //工程特征
                     if(data.updateData.property.featureLibID){
-                        //工程专业显示费用定额的名称
-                        data.updateData.property.projectFeature = await pmFacade.getProjectFeature(data.updateData.property.featureLibID, data.updateData.property.feeStandardName);
+                        //项目类别(valuationType)、养护类别(engineering)、费用标准(feeStandard)根据新建分选的选项去赋值
+                        let assign = {
+                            valuationType: data.updateData.property.valuationType === 'bill' ? '预算' : '工程量清单',
+                            engineering: data.updateData.property.engineeringName,
+                            feeStandard: data.updateData.property.feeStandardName
+                        };
+                        data.updateData.property.projectFeature = await pmFacade.getProjectFeature(data.updateData.property.featureLibID, assign);
                     }
                     /*projectFeature[0]['value'] = data.updateData.property.engineeringName || '';
                     data.updateData.property.projectFeature = projectFeature;*/

+ 42 - 12
modules/ration_glj/facade/glj_calculate_facade.js

@@ -8,6 +8,8 @@ let _=require("lodash");
 let ration_glj = mongoose.model('ration_glj');
 let ration = mongoose.model('ration');
 let ration_coe = mongoose.model('ration_coe');
+const ProjectModel = require('../../pm/models/project_model').project;
+let mixRatioModel = mongoose.model('mix_ratio');
 let std_ration_lib_ration_items = mongoose.model('std_ration_lib_ration_items');
 let std_glj_lib_gljList_model = mongoose.model('std_glj_lib_gljList');
 let glj_type_util = require('../../../public/cache/std_glj_type_util');
@@ -49,9 +51,7 @@ async function calculateQuantity(query,noNeedCal,refreshRationName = false){
          let impactRation = await ration.findOne({ID:query.rationID,projectID:query.projectID});
          let gljList = await ration_glj.find(query);//{projectID:query.projectID,rationID:query.rationID}
          let coeList = await ration_coe.find({projectID:query.projectID,rationID:query.rationID}).sort('seq').exec();
-         let assList=[];
-         let assRation = null;
-         let adjustState=[];
+         let assList=[], assRation = null, adjustState=[],mixRatioMap = {};
          if(!impactRation){//如果定额不存在或者已删除,返回空
              return null;
          }
@@ -65,12 +65,15 @@ async function calculateQuantity(query,noNeedCal,refreshRationName = false){
                  }
              }
          }
-         gljList = sortRationGLJ(gljList);
-         for(let i =0;i<gljList.length;i++ ){
-             let r = await calculateQuantityPerGLJ(gljList[i],gljList,coeList,assList,adjustState,noNeedCal);
-             result.glj_result.push(r);
+         for(let glj of gljList){//先把混凝土,砂浆,配合比有自定义消耗的挑出来
+             if(gljUtil.isConcreteType(glj.type)&& !noCustomQuantiyt(glj)) await getMixRatioMap(glj,mixRatioMap);
          }
 
+        gljList = sortRationGLJ(gljList);
+        for(let i =0;i<gljList.length;i++ ){
+            let r = await calculateQuantityPerGLJ(gljList[i],gljList,coeList,assList,adjustState,mixRatioMap,noNeedCal);
+            result.glj_result.push(r);
+        }
          if(noNeedCal==null){
             await ration_glj.bulkWrite(generateUpdateTasks(result.glj_result));
          }
@@ -137,8 +140,16 @@ function sortRationGLJ(list) {
     return list;
 }
 
-async function calculateQuantityPerGLJ(glj,gljList,coeList,assList,adjustState,noNeedCal) {
-    let decimalObject =await decimal_facade.getProjectDecimal(glj.projectID);
+function sortBeforeCalc(list) {
+    list = _.sortByAll(list, [function (item) {
+       return gljUtil.isConcreteType(item.type)?1:2;
+    }]);
+    return list;
+}
+
+
+async function calculateQuantityPerGLJ(glj,gljList,coeList,assList,adjustState,mixRatioMap,noNeedCal) {
+    let decimalObject = await decimal_facade.getProjectDecimal(glj.projectID);
     let decimal = (decimalObject&&decimalObject.glj&&decimalObject.glj.quantity)?decimalObject.glj.quantity:3;
     let quantity =  scMathUtil.roundTo(parseFloat(glj.quantity),-decimal);
     let result={
@@ -151,12 +162,12 @@ async function calculateQuantityPerGLJ(glj,gljList,coeList,assList,adjustState,n
         }
     };
     try {
-        if(noNeedCal==null){
-            if(!glj._doc.hasOwnProperty('customQuantity')||glj.customQuantity==null||glj.customQuantity==""){
+        if(noNeedCal==null){//计算顺序:辅助定额,附注条件,自定义消耗(如果有就不用前计算两项),自定义乘系数
+            if(noCustomQuantiyt(glj)){
                 quantity =scMathUtil.roundTo(parseFloat(glj.rationItemQuantity),-decimal);
                 quantity =scMathUtil.roundTo(await calculateAss(quantity,assList,glj),-decimal);
                 quantity = calculateQuantityByCoes(quantity,coeList,glj,gljList,decimal);
-            }else {
+            }else {//对于有自定义消耗量的,并且是混凝土,浆砂,配合比 这三种类型,其组成物的消耗量要跟据自定义消耗量做相应的换算
                 quantity = glj.customQuantity;
                 result.doc.customQuantity = glj.customQuantity;
             }
@@ -176,6 +187,25 @@ async function calculateQuantityPerGLJ(glj,gljList,coeList,assList,adjustState,n
     }
 }
 
+async function getMixRatioMap(glj,mixRatioMap) {//生成组成物对应的父工料机的映射表
+    let unitPriceFileId = await ProjectModel.getUnitPriceFileId(glj.projectID);
+    let connect_key = gljUtil.getIndex(glj);
+    let mixList =  await mixRatioModel.find({"unit_price_file_id":unitPriceFileId,'connect_key':connect_key})
+    for(let m of mixList){
+        let mkey = gljUtil.getIndex(m);
+        if(mixRatioMap[mkey]){
+            mixRatioMap[mkey].push({customQuantity:glj.customQuantity,rationItemQuantity:glj.rationItemQuantity,consumption:m.consumption});
+        }else {
+            mixRatioMap[mkey] = [{customQuantity:glj.customQuantity,rationItemQuantity:glj.rationItemQuantity,consumption:m.consumption}];
+        }
+    }
+}
+
+
+function noCustomQuantiyt(glj) {//是否有自定义消耗量
+    return !glj._doc.hasOwnProperty('customQuantity')||glj.customQuantity==null||glj.customQuantity==""
+}
+
 async function calculateAss(quantity,assList,glj) {
     for(let i=0;i<assList.length;i++){
         if(assList[i].assRation){

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

@@ -595,6 +595,10 @@ function getGLJSearchInfo(ration_glj) {
         adjCoe: ration_glj.adjCoe,
         materialType:ration_glj.materialType,
         materialCoe:ration_glj.materialCoe,
+        grossWeightCoe:ration_glj.grossWeightCoe,
+        purchaseStorageRate:ration_glj.purchaseStorageRate,
+        offSiteTransportLossRate:ration_glj.offSiteTransportLossRate,
+        handlingLossRate:ration_glj.handlingLossRate,
         from: ration_glj.from ? ration_glj.from : 'std'//std:标准工料机库, cpt:补充工料机库
     };
     let glj_type_object = glj_type_util.getStdGljTypeCacheObj();

+ 5 - 1
public/gljUtil.js

@@ -17,7 +17,8 @@ module.exports = {
     getBasePrice:getBasePrice,
     getAdjustPrice:getAdjustPrice,
     getMainType:getMainType,
-    isConcreteType:isConcreteType
+    isConcreteType:isConcreteType,
+    getIndex:getIndex
 };
 
 function calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal) {
@@ -47,6 +48,9 @@ function calcPriceDiff(glj,calcOptions) {
 function getMainType() {
     return gljNodeUtil.getMainType();
 }
+function getIndex(obj, pops) {
+    return gljNodeUtil.getIndex(obj, pops);
+}
 
 function isConcreteType(type) {
     return gljNodeUtil.isConcreteType(type);

+ 1 - 0
public/web/gljUtil.js

@@ -288,6 +288,7 @@ let gljUtil = {
     getIndex(obj, pops){
         let t_index = '';
         let k_arr = [];
+        if(!this.isDef(pops)) pops = this.gljKeyArray;
         for (let p of pops) {
             let tmpK = (obj[p] == undefined || obj[p] == null || obj[p] == '') ? 'null' : obj[p];
             k_arr.push(tmpK);

+ 68 - 0
public/web/sheet/sheet_common.js

@@ -544,6 +544,74 @@ var sheetCommonObj = {
         };
         return new selectButton();
     },
+    getCusButtonCellType:function (callback,readOnly=false) {
+        var ns = GC.Spread.Sheets;
+        function CusButtonCellType() {
+        }
+        CusButtonCellType.prototype = new ns.CellTypes.Text();
+        CusButtonCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
+
+            if(!readOnly){
+                if(options.sheet.getActiveRowIndex()==options.row&&options.sheet.getActiveColumnIndex()==options.col){
+                    var image = document.getElementById('f_btn'),imageMagin = 3;
+                    var imageHeight = 15;
+                    var imageWidth = 25;
+                    var imageX = x + w - imageWidth- imageMagin, imageY = y + h / 2 - imageHeight / 2;
+                    ctx.save();
+                    ctx.fillStyle = style.backColor;
+                    ctx.fillRect(x,y,w,h);
+                    ctx.drawImage(image, imageX, imageY,imageWidth,imageHeight);
+                    ctx.beginPath();
+                    ctx.arc(imageX+imageWidth/2,imageY+imageHeight/2,1,0,360,false);
+                    ctx.arc(imageX+imageWidth/2-4,imageY+imageHeight/2,1,0,360,false);
+                    ctx.arc(imageX+imageWidth/2+4,imageY+imageHeight/2,1,0,360,false);
+                    ctx.fillStyle="black";//填充颜色,默认是黑色
+                    ctx.fill();//画实心圆
+                    ctx.closePath();
+                    ctx.restore();
+                    //这里的左对齐的,当显示的字长度超过空白地方时,要改成右对齐
+                    if(style.hAlign == 0){
+                        w = w - imageWidth - imageMagin;
+                        if(value){
+                            let textWidth = ctx.measureText(value).width;
+                            let spaceWidth = w;
+                            if(spaceWidth<textWidth){
+                                style.hAlign = 2;
+                            }
+                        }
+                    }else if(style.hAlign == 2){//如果是右对齐的,往左边挪,给按钮留出空间
+                        x = x - imageWidth - imageMagin;
+                    }
+
+                }
+            }
+            GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
+        };
+        CusButtonCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
+            return {
+                x: x,
+                y: y,
+                row: context.row,
+                col: context.col,
+                cellStyle: cellStyle,
+                cellRect: cellRect,
+                sheetArea: context.sheetArea
+            };
+        };
+
+        CusButtonCellType.prototype.processMouseDown = function (hitinfo) {
+            if(hitinfo.sheet.getActiveRowIndex()==hitinfo.row&&hitinfo.sheet.getActiveColumnIndex()==hitinfo.col){
+                var offset=hitinfo.cellRect.x+hitinfo.cellRect.width-6;
+                var imageWidth = 25;
+                if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
+                    if(!readOnly){
+                        if(callback) callback(hitinfo)
+                    }
+                }
+            }
+        };
+        return new CusButtonCellType();
+    },
     setReplaceButton(row,col,sheet){
         let replaceButton = function(){
 

+ 1 - 1
public/web/tree_sheet/tree_sheet_helper.js

@@ -470,7 +470,7 @@ var TREE_SHEET_HELPER = {
             let centerX = hitinfo.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
             let centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2;
             //方框外1像素内都有效
-            if (hitinfo.x >= centerX - halfBoxLength - 2 && hitinfo.x <= centerX + halfBoxLength + 2 &&
+            if (hitinfo.x >= centerX - halfBoxLength - 3 && hitinfo.x <= centerX + halfBoxLength + 2 &&
                 hitinfo.y >= centerY - halfBoxLength - 2 && hitinfo.y <= centerY + halfBoxLength + 2) {
                 node.setExpanded(!node.expanded);
                 let sheetName = hitinfo.sheet.name();

+ 80 - 143
web/building_saas/complementary_glj_lib/js/glj.js

@@ -73,8 +73,7 @@ let repositoryGljObj = {
     gljList: [],
     stdGljList:[],
     complementaryGljList: [],
-    machineModel: {textArr: ['特', '大', '中', '小'], comboItems: [{text: '特', value: 1}, {text: '大', value: 2},{text: '中', value: 3}, {text: '小', value: 4}]},
-    machineModelIdx: {'1': '特', '2': '大', '3': '中', '4': '小'},
+    feeDataCode: ['grossWeightCoe', 'purchaseStorageRate', 'offSiteTransportLossRate', 'handlingLossRate'],
     distTypeTree: null,//add
     setting: {
         header:[
@@ -84,7 +83,10 @@ let repositoryGljObj = {
             {headerName:"单位",headerWidth:45,dataCode:"unit", dataType: "String", hAlign: "center", vAlign: "center"},
             {headerName:"定额价",headerWidth:80,dataCode:"basePrice", dataType: "Number", formatter: "0.00", hAlign: "right", vAlign: "center"},
             {headerName:"类型",headerWidth:90,dataCode:"gljType", dataType: "String", hAlign: "center", vAlign: "center"},
-            {headerName:"机型",headerWidth:60,dataCode:"model", dataType: "Number", hAlign: "center", vAlign: "center"},
+            {headerName:"毛重系数",headerWidth:90,dataCode:"grossWeightCoe", dataType: "Number", hAlign: "center", vAlign: "center"},
+            {headerName:"采购保管费率",headerWidth:90,dataCode:"purchaseStorageRate", dataType: "Number", hAlign: "center", vAlign: "center"},
+            {headerName:"场外运输损耗率",headerWidth:100,dataCode:"offSiteTransportLossRate", dataType: "Number", hAlign: "center", vAlign: "center"},
+            {headerName:"每增一次装卸损耗率",headerWidth:100,dataCode:"handlingLossRate", dataType: "Number", hAlign: "center", vAlign: "center"},
             {headerName:"是否新增",headerWidth:60,dataCode:"isComplementary", hAlign: "center", vAlign: "center"}
         ],
         view:{
@@ -111,10 +113,9 @@ let repositoryGljObj = {
         sheet.resumeEvent();
     },
     getComboData: function (gljDistType) {
-        let me = this;
         let distType;
         let distTypeTree = {
-            prefix: 'gljType',
+            prefix : 'gljType',
             distTypes: {},
             comboDatas: [],
             distTypesArr: []
@@ -124,20 +125,20 @@ let repositoryGljObj = {
                 data: typeData,
                 children: [],
                 parent: null
-            }
+            };
             distTypeTree.distTypes[distTypeTree.prefix + typeData.ID] = typeObj;
             distTypeTree.distTypesArr.push(typeObj);
         });
         gljDistType.forEach(function (typeData) {
             distType = distTypeTree.distTypes[distTypeTree.prefix + typeData.ID];
             let parent = distTypeTree.distTypes[distTypeTree.prefix + typeData.ParentID];
-            if (parent) {
+            if(parent){
                 distType.parent = parent;
                 parent.children.push(distType);
             }
         });
         distTypeTree.distTypesArr.forEach(function (distTypeObj) {
-            if (distTypeObj.data.fullName !== '材料' && distTypeObj.data.fullName !== '机械') {
+            if(allowGljType.includes(distTypeObj.data.ID)){
                 distTypeTree.comboDatas.push({text: distTypeObj.data.fullName, value: distTypeObj.data.ID});
             }
         });
@@ -170,7 +171,6 @@ let repositoryGljObj = {
         });
     },
     getGljItems: function(stdGljLibId, callback) {
-        console.log('enterGG');
         let me = this;
         CommonAjax.post('complementartGlj/api/getGljItems', {stdGljLibId: stdGljLibId}, function (rstData) {
             me.stdGljList = rstData.stdGljs;
@@ -217,11 +217,8 @@ let repositoryGljObj = {
                     sheet.setCellType(row, isComplementaryCol, baseCell);
                 }
             });
-            sheetOpr.showData(sheet, me.setting, cacheSection, me.distTypeTree, me.machineModelIdx);
+            sheetOpr.showData(sheet, me.setting, cacheSection, me.distTypeTree);
             sheetCommonObj.setDynamicCombo(sheet, 0, 5, sheet.getRowCount(), me.distTypeTree.comboDatas, false, 'text');
-            sheetCommonObj.setDynamicCombo(sheet, 0, 6, sheet.getRowCount(), me.machineModel.comboItems, false, 'text');
-
-
             cacheSection = null;
         }
     },
@@ -277,21 +274,6 @@ let repositoryGljObj = {
         return v !== undefined && v !== null;
     },
 
-    //成为了组成物,暂时只需要判断主材的
-    isComponent: function (gljId, gljList) {
-        for(let i = 0, len = gljList.length; i < len; i++){
-            let gljComponent = gljList[i].component;
-            if(gljList[i].gljType === 4 && this.isDef(gljComponent) && gljComponent.length > 0){
-                for(let j = 0, jLen = gljComponent.length; j < jLen; j++){
-                    if(gljComponent[j].ID === gljId){
-                        return true;
-                    }
-                }
-            }
-        }
-        return false;
-    },
-
     getCurrentComponent: function (gljComponent) {
         let me = repositoryGljObj, rst = [];
         for(let i = 0; i < gljComponent.length; i++){
@@ -405,11 +387,9 @@ let repositoryGljObj = {
                     }
                 }
             }
-        }
-        else{
+        } else{
             me.currentGlj = null;
         }
-
         //组成物表能编辑则显示,否则隐藏该工作表
         let rightWidth = getLocalCache('compleGLjrightContentWidth') || '25%';
         rightWidth = rightWidth.replace('%', '');
@@ -503,7 +483,7 @@ let repositoryGljObj = {
     },
     onButtonClicked: function (sender, args) {
         let me = repositoryGljObj;
-        if(args.col === 6 && args.row < me.currentCache.length){
+        if(me.setting.header[args.col].dataCode === 'isComplementary' && args.row < me.currentCache.length){
             args.sheet.setValue(args.row, args.col, true);
         }
     },
@@ -512,18 +492,19 @@ let repositoryGljObj = {
         let rObj = sheetOpr.combineRowData(me.workBook.getSheet(0), me.setting, args.row);
         me.currentEditingGlj = rObj;
         me.orgCode = me.workBook.getSheet(0).getValue(args.row, 0);
+        let dataCode = me.setting.header[args.col].dataCode;
         if(args.row < me.currentCache.length){
             me.currentGlj = me.currentCache[args.row];
-            if(args.col === 0 || (args.col === 4 && allowComponent.includes(me.currentGlj.gljType) && me.currentGlj.component.length > 0)
-                || (args.col === 6 && me.currentGlj.gljType !== 301) || args.col === 7){
+            //费率数据列只有普通材料能用,可添加组成物的人材机,基价只读
+            if (dataCode === 'code'|| (me.feeDataCode.includes(dataCode) && me.currentGlj.gljType !== 201) ||
+                (dataCode === 'basePrice' && allowComponent.includes(me.currentGlj.gljType)) ||
+                dataCode === 'isComplementary'){
                 args.cancel = true;
-            }
-            else {
+            } else {
                 rObj.ID = me.currentGlj.ID;
                 rObj.gljClass = me.currentGlj.gljClass;
             }
-        }
-        else {
+        } else {
             me.currentGlj = null;
         }
     },
@@ -531,29 +512,29 @@ let repositoryGljObj = {
         let me = repositoryGljObj, that = gljComponentOprObj,
             rObj = sheetOpr.combineRowData(me.workBook.getSheet(0), me.setting, args.row, me),
             updateArr = [], addArr = [], updateBasePrcArr = [];
+        let dataCode = me.setting.header[args.col].dataCode;
         me.editingRowIdx = args.row;
         rObj.basePrice = rObj.basePrice ? rObj.basePrice : 0;
         //更新
         if (me.currentEditingGlj["ID"]) {
             rObj["ID"] = me.currentEditingGlj["ID"];
             rObj.gljClass = me.currentEditingGlj.gljClass;
-            //for(let col =0; col< me.setting.header.length; col++){
-                if(me.currentEditingGlj[me.setting.header[args.col].dataCode] !== rObj[me.setting.header[args.col].dataCode]){
-                    //me.addGljObj = rObj;
+                if(me.currentEditingGlj[dataCode] !== rObj[dataCode]){
                     //编码、名称、单位、类型不可为空
-                    if(rObj[me.setting.header[0].dataCode] && rObj[me.setting.header[1].dataCode] && rObj[me.setting.header[3].dataCode] && rObj[me.setting.header[5].dataCode]
-                    &&rObj[me.setting.header[0].dataCode].toString().trim().length !== 0 && rObj[me.setting.header[1].dataCode].toString().trim().length !== 0 && rObj[me.setting.header[3].dataCode].toString().trim().length !== 0&&
-                        rObj[me.setting.header[5].dataCode].toString().trim().length !== 0){
+                    if(rObj.code && rObj.name && rObj.unit && rObj.gljType
+                    &&rObj.code.toString().trim().length !== 0 && rObj.name.toString().trim().length !== 0 && rObj.unit.toString().trim().length !== 0&&
+                        rObj.gljType.toString().trim().length !== 0){
                         if(rObj.gljType !== me.currentEditingGlj.gljType){//修改了工料机类型
-                                if(me.currentGlj){
-                                    me.currentGlj.component = [];
+                            if(me.currentGlj){
+                                me.currentGlj.component = [];
+                            }
+                            //工料机类型不为普通材料时,情况费率数据
+                            if (me.currentEditingGlj.gljType === 201 && rObj.gljType !== 201) {
+                                for (let feeCode of me.feeDataCode) {
+                                    if (me.currentEditingGlj[feeCode]) {
+                                        rObj[feeCode] = null;
+                                    }
                                 }
-                               /* if(me.allowComponent.indexOf(rObj.gljType) !== -1){
-                                    rObj.basePrice = 0;
-                                }*/
-                            //工料机类型不为机械台班时,清空机型
-                            if(me.currentEditingGlj.gljType === 301 && rObj.gljType !== 301 && me.currentEditingGlj.model){
-                                rObj.model = null;
                             }
                             if(componentType.includes(me.currentEditingGlj.gljType) &&
                                 !(machineComponent.includes(me.currentEditingGlj.gljType) && machineComponent.includes(rObj.gljType))
@@ -570,8 +551,13 @@ let repositoryGljObj = {
                                 }
                             }
                             sheetOpr.cleanData(that.workBook.getSheet(0), that.setting, 5);
-                        }
-                        else if(rObj.basePrice !== me.currentEditingGlj.basePrice){//修改了单价,可修改单价的必为可成为组成物的
+                        } else if (me.feeDataCode.includes(dataCode) && rObj[dataCode] !== me.currentEditingGlj[dataCode]) {
+                            if(isNaN(rObj[dataCode])){
+                                args.sheet.setValue(args.row, args.col, me.currentEditingGlj[dataCode] ? me.currentEditingGlj[dataCode] : '');
+                                alert(`${me.setting.header[args.col].headerName}只能输入数值!`);
+                                return;
+                            }
+                        } else if(rObj.basePrice !== me.currentEditingGlj.basePrice){//修改了单价,可修改单价的必为可成为组成物的
                             //寻找所有引用了此组成物的工料机,并从组成物中删去此工料机,并重算单价
                             if(isNaN(parseFloat(rObj.basePrice))){
                                 alert('单价只能为数值!');
@@ -588,22 +574,20 @@ let repositoryGljObj = {
                                     updateArr.push(updateGljs.updateBasePrcArr[i]);
                                 }
                             }
-                            //rObj.basePrice = !isNaN(parseFloat(rObj.basePrice)) && (rObj.basePrice && typeof rObj.basePrice !== 'undefined') ? that.round(parseFloat(rObj.basePrice), 2) : 0;
                         }
                         rObj.component = me.currentGlj.component;
                         updateArr.push(rObj);
                     }
                     else{
-                        if(me.setting.header[args.col].dataCode === 'gljType'){
-                            let distTypeVal =  me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj[me.setting.header[args.col].dataCode]].data.fullName;
+                        if(dataCode === 'gljType'){
+                            let distTypeVal =  me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj[dataCode]].data.fullName;
                             args.sheet.setValue(args.row, args.col, distTypeVal);
                         }
                         else{
-                            args.sheet.setValue(args.row, args.col, me.currentEditingGlj[me.setting.header[args.col].dataCode]);
+                            args.sheet.setValue(args.row, args.col, me.currentEditingGlj[dataCode]);
                         }
                     }
                 }
-          //  }
             //--------------------------------------
             if(me.currentEditingGlj.basePrice !== rObj.basePrice){
                 //update basePrice of ration when editting basePrice of glj
@@ -634,16 +618,12 @@ let repositoryGljObj = {
             if(typeof rObj.code !== 'undefined'){
                 me.addGljObj = rObj;
                 let isCanSav = true;
-                if(!rObj[me.setting.header[0].dataCode] || !rObj[me.setting.header[1].dataCode] || !rObj[me.setting.header[3].dataCode] || !rObj[me.setting.header[5].dataCode]){
+                if(!rObj.code || !rObj.name || !rObj.unit || !rObj.gljType){
                     isCanSav = false;
                 }
                 if(isCanSav){
                     me.addGljObj = null;
                     rObj.component = [];
-                    //如果类型为混凝土、砂浆、配合比、机械台班时,添加时填写的单价清空
-                   /* if(me.allowComponent.indexOf(rObj.gljType) !== -1){
-                        rObj.basePrice = 0;
-                    }*/
                     rObj.basePrice = !isNaN(parseFloat(rObj.basePrice)) && (rObj.basePrice && typeof rObj.basePrice !== 'undefined') ? parseFloat(rObj.basePrice) : 0;
                     addArr.push(rObj);
                 }
@@ -659,10 +639,7 @@ let repositoryGljObj = {
     },
     delGljs: function (sels) {
         let me = repositoryGljObj;
-        let sheet = me.workBook.getSheet(0),
-            updateArr = [], removeArr = [],
-            tempRemoveArr= [],
-            refGljCodes = [], //已被引用的工料机
+        let updateArr = [], removeArr = [],
             updateBasePrcArr = [],//删除基价单位后重新计算
             canUpdate = false,
             cacheSection = me.currentCache;
@@ -682,7 +659,6 @@ let repositoryGljObj = {
                                 }
                             }
                             removeArr.push(cacheSection[sels[i].row + j].ID);
-                            //tempRemoveArr.push({ID: cacheSection[sels[i].row + j].ID, code: cacheSection[sels[i].row + j].code});
                             //删除后重新计算引用了此工料机的定额单价
                             updateBasePrcArr.push({gljId: cacheSection[sels[i].row + j].ID, gljType: cacheSection[sels[i].row + j].gljType, basePrice: 0, delete: 1});
                         }
@@ -807,7 +783,6 @@ let repositoryGljObj = {
     validUpdateObj: function (pasteObj, rowIdx) {
         let rst = {updateGlj: [], updateBasePrcArr: []}, backUpObj = {},
             me = repositoryGljObj,
-            that = gljComponentOprObj,
             tempObj = me.currentCache[rowIdx],
             reCalBasePrc = false,
             isValid = true;
@@ -856,8 +831,10 @@ let repositoryGljObj = {
                     pasteObj.gljType = me.distTypeTree.comboDatas[i].value;
                     isExsit = true;
                     reCalBasePrc = true;
-                    if(pasteObj.gljType !== 301 && tempObj.gljType === 301){
-                        tempObj.model = null;
+                    if (pasteObj.gljType !== 201 && tempObj.gljType === 201) {
+                        for (let feeCode of me.feeDataCode) {
+                            tempObj[feeCode] = null;
+                        }
                     }
                     if(componentType.includes(tempObj.gljType)&&
                         !(machineComponent.includes(tempObj.gljType) && machineComponent.includes(pasteObj.gljType)) &&
@@ -874,9 +851,6 @@ let repositoryGljObj = {
                         }
                     }
                     tempObj.component = tempObj.gljType === me.distTypeTree.comboDatas[i].value ? tempObj.component : [];
-                    /*if(me.allowComponent.indexOf(tempObj.gljType) !== -1){
-                        tempObj.basePrice = tempObj.gljType === me.distTypeTree.comboDatas[i].value ? tempObj.basePrice : 0;
-                    }*/
                     tempObj.gljType = me.distTypeTree.comboDatas[i].value;
                     tempObj.shortName = me.distTypeTree.distTypes[me.distTypeTree.prefix + tempObj.gljType].data.shortName;
                     break;
@@ -884,6 +858,16 @@ let repositoryGljObj = {
             }
             if(!isExsit) isValid = false;
         }
+        for (let feeCode of me.feeDataCode) {
+            if (typeof pasteObj[feeCode] !== 'undefined' && !isNaN(pasteObj[feeCode])) {
+                if ((typeof pasteObj.gljType !== 'undefined' && pasteObj.gljType === 201) ||
+                    (tempObj.gljType && tempObj.gljType === 201)) {
+                    tempObj[feeCode] = pasteObj[feeCode];
+                } else {
+                    isValid = false;
+                }
+            }
+        }
         //
         pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? scMathUtil.roundTo(parseFloat(pasteObj.basePrice), 2) :
             me.currentCache[rowIdx].basePrice;
@@ -900,34 +884,10 @@ let repositoryGljObj = {
                 }
             }
         }
-        if(typeof pasteObj.model !== 'undefined'){
-            if(!me.machineModel.textArr.includes(pasteObj.model)){
-                isValid = false;
-            }
-            else {
-                let existsModel = false;
-                if((typeof pasteObj.gljType !== 'undefined' && pasteObj.gljType === 301) ||
-                    (tempObj.gljType && tempObj.gljType === 301)){
-                    me.machineModel.comboItems.forEach(function (item) {
-                        if(item.text === pasteObj.model){
-                            tempObj.model = item.value;
-                            existsModel = true;
-                        }
-                    });
-                    if(!existsModel){
-                        isValid = false;
-                    }
-                }
-                else {
-                    isValid = false;
-                }
-            }
-        }
         if(isValid){
             rst.updateGlj.push(tempObj);
             if(reCalBasePrc){
                 //重新计算定额基价对象
-                //rst.updateBasePrc = {gljId: tempObj.ID, gljType: tempObj.gljType, basePrice: tempObj.basePrice};
                 let newReObj = {gljId: tempObj.ID, gljType: tempObj.gljType, basePrice: tempObj.basePrice};
                 rst.updateBasePrcArr.push(newReObj);
             }
@@ -973,15 +933,10 @@ let repositoryGljObj = {
             }
 
         }
-        if(typeof pasteObj.model !== 'undefined' && pasteObj.model){
-            if(!me.machineModel.textArr.includes(pasteObj.model) || pasteObj.gljType !== 301){
+        for (let feeCode of me.feeDataCode) {
+            if (typeof pasteObj[feeCode] !== 'undefined' && (isNaN(pasteObj[feeCode]) || pasteObj.gljType !== 201)) {
                 return false;
             }
-            me.machineModel.comboItems.forEach(function (item) {
-                if(item.text === pasteObj.model){
-                    pasteObj.model = item.value;
-                }
-            });
         }
         pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) : 0;
         if(!me.parentNodeIds["_pNodeId_" + me.gljCurTypeId]){
@@ -1002,6 +957,7 @@ let repositoryGljObj = {
             if(info.cellRange.col === 0){
                 return false;
             }
+            //可添加组成物的人材机基价由组成物基价计算得来,基价列只读
             else if(info.cellRange.col <= 4 && info.cellRange.col + info.cellRange.colCount - 1 >= 4){
                 for(let i = 0, len = info.cellRange.rowCount; i < len; i++){
                     let row = i + info.cellRange.row;
@@ -1020,13 +976,11 @@ let repositoryGljObj = {
     },
     onClipboardPasting: function(sender, args) {
         let me = repositoryGljObj;
-        let maxCol = args.cellRange.col + args.cellRange.colCount - 1;
         if (!me.canPasted(args)) {
             args.cancel = true;
         }
     },
     onClipboardPasted: function(e, info) {
-        //  if(info.pasteData.text.trim().length > 0){
         let me = repositoryGljObj;
         let updateArr = [], addArr = [];
         let items = sheetOpr.analyzePasteData(me.setting, info);
@@ -1034,20 +988,17 @@ let repositoryGljObj = {
             maxRow = me.currentCache.length - 1,//当前数据最大行数
             updateBasePrcArr = [] ,
             updateCount, resumeArr = [];
-        if(endRow <= maxRow){
-            //updateItems = items;
+        if(endRow <= maxRow){//只有更新
             for(let i = 0; i < items.length; i++){
                 let updateObj = me.validUpdateObj(items[i], info.cellRange.row + i);
                 if(updateObj && typeof updateObj.updateGlj !== 'undefined' && updateObj.updateGlj.length > 0){
-                    //updateArr = updateObj.updateGlj;
                     updateArr = updateArr.concat(updateObj.updateGlj);
                     if(typeof updateObj.updateBasePrcArr !== 'undefined'){
                         updateBasePrcArr = updateBasePrcArr.concat(updateObj.updateBasePrcArr);
                     }
                 }
             }
-        }
-        else if(beginRow <= maxRow && endRow > maxRow){
+        } else if(beginRow <= maxRow && endRow > maxRow){//更新+新增
             updateCount = maxRow - beginRow + 1;
             for(let i = 0; i < updateCount; i++){
                 let updateObj = me.validUpdateObj(items[i], info.cellRange.row + i);
@@ -1059,29 +1010,17 @@ let repositoryGljObj = {
                     }
                 }
             }
-            if(info.cellRange.colCount === me.setting.header.length -1){
-                for(let i = updateCount ; i < items.length; i++){
-                    if(me.isValidObj(items[i])){
-                        items[i].component = [];
-                        //类型为混凝土、砂浆、配合比、机械时,基价只能组成物计算
-                        /* if(me.allowComponent.indexOf(items[i].gljType) !== -1){
-                         items[i].basePrice = 0;
-                         }*/
-                        addArr.push(items[i]);
-                    }
+            for(let i = updateCount ; i < items.length; i++){
+                if(me.isValidObj(items[i])){
+                    items[i].component = [];
+                    addArr.push(items[i]);
                 }
             }
-        }
-        else{
-            if(info.cellRange.colCount === me.setting.header.length -1){
-                for(let i = 0; i < items.length; i++){
-                    if(me.isValidObj(items[i])){
-                        items[i].component = [];
-                        /*if(me.allowComponent.indexOf(items[i].gljType) !== -1){
-                         items[i].basePrice = 0;
-                         }*/
-                        addArr.push(items[i]);
-                    }
+        } else{//新增
+            for(let i = 0; i < items.length; i++){
+                if(me.isValidObj(items[i])){
+                    items[i].component = [];
+                    addArr.push(items[i]);
                 }
             }
         }
@@ -1095,15 +1034,13 @@ let repositoryGljObj = {
             for(let i = 0; i < resumeArr.length ; i++){
                 if(resumeArr[i] < me.currentCache.length){
                     for(let col = 0; col < me.setting.header.length -1; col++){
-                        if(me.setting.header[col].dataCode === 'gljType'){
-                            let gljType = me.currentCache[resumeArr[i]][me.setting.header[col].dataCode];
+                        let dCode = me.setting.header[col].dataCode;
+                        if(dCode === 'gljType'){
+                            let gljType = me.currentCache[resumeArr[i]][dCode];
                             sheet.setValue(resumeArr[i], col, me.distTypeTree.distTypes["gljType" + gljType].data.fullName);
                         }
-                        else if(me.setting.header[col].dataCode === 'model'){
-                            sheet.setValue(resumeArr[i], col, me.currentCache[resumeArr[i]][me.setting.header[col].dataCode] ? me.machineModelIdx[me.currentCache[resumeArr[i]][me.setting.header[col].dataCode]]: '');
-                        }
                         else{
-                            sheet.setValue(resumeArr[i], col, me.currentCache[resumeArr[i]][me.setting.header[col].dataCode]);
+                            sheet.setValue(resumeArr[i], col, me.currentCache[resumeArr[i]][dCode]);
                         }
                     }
                 }
@@ -1121,7 +1058,6 @@ let repositoryGljObj = {
         if(updateBasePrcArr.length > 0 && me.rationLibs.length > 0){
             me.updateRationBasePrcRq(updateBasePrcArr);
         }
-        // }
     },
     updateRationBasePrcRq: function (basePrcArr) {
         CommonAjax.post('/complementartGlj/api/updateRationBasePrc', {basePrcArr: basePrcArr}, function (rstData) {
@@ -1163,10 +1099,11 @@ let repositoryGljObj = {
             me.showGljItems(me.complementaryGljList, me.gljCurTypeId);
             //getCurrentGlj
             let row = me.workBook.getSheet(0).getSelections()[0].row;
-            me.currentGlj = row < me.currentCache.length ? me.currentCache[row] : null;
+           /* me.currentGlj = row < me.currentCache.length ? me.currentCache[row] : null;
             me.currentComponent = me.currentGlj ?  me.getCurrentComponent(me.currentGlj.component) : [];
             sheetOpr.cleanData(gljComponentOprObj.workBook.getSheet(0), gljComponentOprObj.setting, -1);
-            sheetOpr.showData(gljComponentOprObj.workBook.getSheet(0), gljComponentOprObj.setting, me.currentComponent);
+            sheetOpr.showData(gljComponentOprObj.workBook.getSheet(0), gljComponentOprObj.setting, me.currentComponent);*/
+            me.initSel(row);
         }
         let errCaller = function (err) {
             alert('保存失败');

+ 2 - 3
web/building_saas/complementary_glj_lib/js/gljComponent.js

@@ -220,7 +220,6 @@ let gljComponentOprObj = {
         if(thatRow < that.currentCache.length){
             that.currentGlj = that.currentCache[thatRow];
             if(me.setting.view.lockedCols.indexOf(args.col) !== -1 || !allowComponent.includes(that.currentGlj.gljType) ||
-                (that.currentGlj.gljType === 4 && that.isComponent(that.currentGlj.ID, that.stdGljList.concat(that.complementaryGljList))) ||
                 (args.col === 4 && (!that.currentComponent|| args.row >= that.currentComponent.length))){
                 args.cancel = true;
             }
@@ -359,8 +358,8 @@ let gljComponentOprObj = {
         let me = gljComponentOprObj, that = repositoryGljObj;
         let maxCol = info.cellRange.col + info.cellRange.colCount - 1;
         //复制的列数超过正确的列数,不可复制
-        if(info.cellRange.col !== 4 && info.cellRange.colCount > 1 || (that.currentGlj.gljType === 4 && that.isComponent(that.currentGlj.ID, that.stdGljList.concat(that.complementaryGljList)))){
-            args.cancel = true;
+        if(info.cellRange.col !== 4 && info.cellRange.colCount > 1){
+            info.cancel = true;
         }
     },
     onClipboardPasted: function (sender, info) {

+ 1 - 12
web/building_saas/complementary_glj_lib/js/sheetOpr.js

@@ -113,7 +113,7 @@ let sheetOpr = {
             area.vAlign(GC.Spread.Sheets.VerticalAlign.center);
         }
     },
-    showData: function(sheet, setting, data, distTypeTree, machineModelIdx) {
+    showData: function(sheet, setting, data, distTypeTree) {
         var me = this, ch = GC.Spread.Sheets.SheetArea.viewport;
         sheet.suspendPaint();
         sheet.suspendEvent();
@@ -141,9 +141,6 @@ let sheetOpr = {
                     let distTypeVal =  distTypeTree.distTypes[distTypeTree.prefix + data[row].gljType].data.fullName;
                     sheet.setValue(row, col, distTypeVal, ch);
                 }
-                else if(setting.header[col].dataCode === 'model' && data[row].model){
-                    sheet.setValue(row, col, machineModelIdx ? machineModelIdx[data[row].model] : '');
-                }
                 else {
                     sheet.setValue(row, col, data[row][setting.header[col].dataCode], ch);
                     sheet.setTag(row, 0, data[row].ID, ch);
@@ -200,7 +197,6 @@ let sheetOpr = {
         var rst = {};
         let comboBoxCellType = sheet.getCellType(row, 5);
         let items = comboBoxCellType.items();
-        let machineItems = sheet.getCellType(row, 6).items();
         for (var col = 0; col < setting.header.length; col++) {
             if(setting.header[col].dataCode === 'gljType'){
                 items.forEach(function(item){
@@ -212,13 +208,6 @@ let sheetOpr = {
                     }
                 });
             }
-            else if(setting.header[col].dataCode === 'model'){
-                machineItems.forEach(function(item){
-                    if(sheet.getValue(row, col) === item.text){
-                        rst[setting.header[col].dataCode] = item.value;
-                    }
-                });
-            }
             else if (setting.header[col].dataCode === 'code'){
                 if(repositoryGljObj){
                     let stdGljList = repositoryGljObj.stdGljList,

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

@@ -10,7 +10,6 @@
 
 <body>
     <div style="">
-        <img id="f_btn" src="/web/dest/css/img/feeRate_btn.jpg" alt="" style="display: none" />
     </div>
     <div class="toolsbar px-1" />
     <div class="container-fluid">

+ 0 - 7
web/building_saas/main/js/models/bills.js

@@ -792,13 +792,6 @@ var Bills = {
                     }
                     gljOprObj.refreshView();
                 });
-                //添加内容为定额子目时,根据特征及内容添加规则刷新清单
-                if(updateData['ration']){
-                    let addRuleSetting = getAddRuleSetting();
-                    if(addRuleSetting && addRuleSetting.addContent === '5'){
-                        addRuleUseToBills(getAddRuleSetting(), projectObj.project.mainTree.items);
-                    }
-                };
 
                 if (isDeleteChild){
                     calcTools.forceSelect(parentNode);

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

@@ -1080,10 +1080,6 @@ let cbCalctor = {
                     node.data.feesIndex.common.totalFee : 0;
         }
         return 0;
-    },
-    //计算
-    exec: function () {
-
     }
 };
 

+ 2 - 3
web/building_saas/main/js/models/fee_rate.js

@@ -60,7 +60,7 @@ var FeeRate = {
         };
         FeeRate.prototype.getAllSubRates = function () {
             let rates =  this.getActivateFeeRate().rates;
-            let subRates = [],nameMap={};
+            let subRates = [],nameMap={},temRates=[];
             for(let r of rates){
                 if(gljUtil.isDef(r.subFeeRate)){
                     for(let p of r.subFeeRate.recodes){
@@ -74,11 +74,10 @@ var FeeRate = {
                                 subRates.push(sub);
                             }
                         }
-
                     }
                 }
             }
-            return subRates;
+            return _.sortByAll(subRates,['ID'])//要保证树节点的ID子项是紧跟着父项的,不然的话显示会有问题
         };
         FeeRate.prototype.getSubViewData= function(item) {
             var datas = [];

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

@@ -537,6 +537,10 @@ ProjectGLJ.prototype.addMixRatio = function(selections,callback){
                 repositoryId:glj.repositoryId,
                 materialType:glj.materialType,
                 materialCoe:glj.materialCoe,
+                grossWeightCoe:glj.grossWeightCoe,
+                purchaseStorageRate:glj.purchaseStorageRate,
+                offSiteTransportLossRate:glj.offSiteTransportLossRate,
+                handlingLossRate:glj.handlingLossRate
             };
             if (glj.hasOwnProperty("compilationId")) {
                 pglj.from = "cpt";

+ 0 - 3
web/building_saas/main/js/models/ration.js

@@ -336,7 +336,6 @@ var Ration = {
             } else {
                 data[field] = newValue;
             }
-            updateBillsOprRation();
             updateData.push({'updateType': 'ut_update', 'updateData': data});
             this.project.pushNow('updateBills', this.getSourceType(), updateData);
         };
@@ -433,7 +432,6 @@ var Ration = {
                 if(data.length < nodeInfo.length && nodeInfo[data.length].newCode!=null){//说明有部分定额编号没找到记录
                     alert('当前库中找不到定额"' + nodeInfo[data.length].newCode + '"');
                 }
-                updateBillsOprRation();
             })
         };
         ration.prototype.addMultiRation = function (items, callback) {
@@ -531,7 +529,6 @@ var Ration = {
                         }else {
                             project.calcProgram.calcNodesAndSave(newNodes);
                         }
-                        updateBillsOprRation();
                         if(callback){
                             callback();
                         }

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

@@ -584,6 +584,10 @@ let ration_glj = {
                         adjCoe: glj.adjCoe,
                         materialType:glj.materialType,
                         materialCoe:glj.materialCoe,
+                        grossWeightCoe:glj.grossWeightCoe,
+                        purchaseStorageRate:glj.purchaseStorageRate,
+                        offSiteTransportLossRate:glj.offSiteTransportLossRate,
+                        handlingLossRate:glj.handlingLossRate,
                         repositoryId: glj.repositoryId
                     };
                     if(pEngineer) new_glj.programID = pEngineer;
@@ -663,6 +667,10 @@ let ration_glj = {
                 createType: 'add',
                 materialType:glj.materialType,
                 materialCoe:glj.materialCoe,
+                grossWeightCoe:glj.grossWeightCoe,
+                purchaseStorageRate:glj.purchaseStorageRate,
+                offSiteTransportLossRate:glj.offSiteTransportLossRate,
+                handlingLossRate:glj.handlingLossRate,
                 repositoryId: glj.repositoryId
             };
             if (glj.hasOwnProperty("compilationId")) {
@@ -766,6 +774,10 @@ let ration_glj = {
             oldData.repositoryId = glj.repositoryId;
             oldData.materialType = glj.materialType;
             oldData. materialCoe =  glj.materialCoe;
+            oldData.grossWeightCoe= glj.grossWeightCoe;
+            oldData.purchaseStorageRate = glj.purchaseStorageRate;
+            oldData.offSiteTransportLossRate = glj.offSiteTransportLossRate;
+            oldData.handlingLossRate = glj.handlingLossRate;
             if (glj.hasOwnProperty("compilationId")) {
                 oldData.from = "cpt";
                 if (glj.code.indexOf('-') != -1) {//这条工料机是用户通过修改包称、规格、型号等保存到补充工料机库的
@@ -830,6 +842,10 @@ let ration_glj = {
                 repositoryId: glj.repositoryId,
                 materialType: glj.materialType,   //三材类别
                 materialCoe: glj.materialCoe,
+                grossWeightCoe:glj.grossWeightCoe,
+                purchaseStorageRate:glj.purchaseStorageRate,
+                offSiteTransportLossRate:glj.offSiteTransportLossRate,
+                handlingLossRate:glj.handlingLossRate,
                 projectID: oldData.projectID
             };
             if (glj.hasOwnProperty("compilationId")) {

+ 9 - 42
web/building_saas/main/js/views/calc_base_view.js

@@ -352,18 +352,15 @@ let calcBaseView = {
         }
         CalcBaseCellType.prototype = new ns.CellTypes.Text();
         CalcBaseCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
-            //  if(value!=null){
-            // ctx.fillText(value,x+3+ctx.measureText(value).width,y+h-3);
-            // ctx.fillText(value,x+w-3,y+h-3);
-            GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
-            // }
             if(calcBaseView.editingCell && !projectReadOnly && calcBaseView.ifEdit(type, options.row)){
-                if(calcBaseView.editingCell.row==options.row&&calcBaseView.editingCell.col==options.col){
+                if(options.sheet.getActiveRowIndex()==options.row&&options.sheet.getActiveColumnIndex()==options.col){
                     var image = document.getElementById('f_btn'),imageMagin = 3;
-                    var imageHeight = h-2*imageMagin;
-                    var imageWidth = w*2/(type=='bills'?7:20);
+                    var imageHeight = 15;
+                    var imageWidth = 25;
                     var imageX = x + w - imageWidth- imageMagin, imageY = y + h / 2 - imageHeight / 2;
                     ctx.save();
+                    ctx.fillStyle = style.backColor;
+                    ctx.fillRect(x,y,w,h);
                     ctx.drawImage(image, imageX, imageY,imageWidth,imageHeight);
                     ctx.beginPath();
                     ctx.arc(imageX+imageWidth/2,imageY+imageHeight/2,1,0,360,false);
@@ -373,8 +370,10 @@ let calcBaseView = {
                     ctx.fill();//画实心圆
                     ctx.closePath();
                     ctx.restore();
+                    x = x - imageWidth - imageMagin;
                 }
             }
+            GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
         };
         CalcBaseCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
             return {
@@ -389,11 +388,9 @@ let calcBaseView = {
         };
         CalcBaseCellType.prototype.processMouseDown = function (hitinfo) {
             let me = calcBaseView;
-            if(me.editingCell && hitinfo.row==me.editingCell.row){
+            if(hitinfo.sheet.getActiveRowIndex()==hitinfo.row&&hitinfo.sheet.getActiveColumnIndex()==hitinfo.col){
                 var offset=hitinfo.cellRect.x+hitinfo.cellRect.width-6;
-                var imageMagin=3;
-                var imageHeight = hitinfo.cellRect.height-2*imageMagin;
-                var imageWidth = hitinfo.cellRect.width*2/7;
+                var imageWidth = 25;
                 if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
                     if(!projectReadOnly && me.ifEdit(type, hitinfo.row)){
                         hitinfo.sheet.setActiveCell(hitinfo.row, hitinfo.col);
@@ -406,39 +403,9 @@ let calcBaseView = {
                         $('#tabCalcBase').tab('show');
                         calcBaseView.initCalctor(type);
                     }
-                }else {//鼠标点击其它地方,消失
-                    hideButton(hitinfo);
                 }
             }
         };
-        CalcBaseCellType.prototype.processMouseEnter = function (hitinfo){
-            let me = calcBaseView;
-            me.pmLeave = false;
-            if(me.editingCell==null){
-                var showSelectBtn = true;
-                showSelectBtn=me.ifEdit(type, hitinfo.row);
-                if(showSelectBtn){
-                    me.editingCell={
-                        row:hitinfo.row,
-                        col:hitinfo.col
-                    };
-                    hitinfo.sheet.invalidateLayout();
-                    hitinfo.sheet.repaint();
-                }
-            }
-        };
-        CalcBaseCellType.prototype.processMouseLeave = function (hitinfo) {
-            hideButton(hitinfo);
-        };
-
-        function hideButton(hitinfo) {
-            if(!calcBaseView.pmLeave){
-                calcBaseView.editingCell=null;
-                hitinfo.sheet.invalidateLayout();
-                hitinfo.sheet.repaint();
-                calcBaseView.pmLeave = true;
-            }
-        }
         return new CalcBaseCellType();
     },
 };

+ 4 - 0
web/building_saas/main/js/views/project_glj_view.js

@@ -680,6 +680,10 @@ projectGljObject={
             supply_quantity:glj.supply_quantity,
             materialType:glj.materialType,
             materialCoe:glj.materialCoe,
+            grossWeightCoe:glj.grossWeightCoe,
+            purchaseStorageRate:glj.purchaseStorageRate,
+            offSiteTransportLossRate:glj.offSiteTransportLossRate,
+            handlingLossRate:glj.handlingLossRate,
             delivery:glj.delivery,
             delivery_address:glj.delivery_address,
             is_adjust_price:glj.is_adjust_price,

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

@@ -406,7 +406,7 @@ let basicInfoView = {
             if(recode&&recode.hasOwnProperty('items')){
                 //方框外1像素内都有效
                 const boxLengh = 10;
-                if (hitinfo.x >= centerX - halfBoxLength - 1 && hitinfo.x <= centerX + halfBoxLength + 1 &&
+                if (hitinfo.x >= centerX - halfBoxLength - 2 && hitinfo.x <= centerX + halfBoxLength + 1 &&
                     hitinfo.y >= centerY - halfBoxLength - 1 && hitinfo.y <= centerY + halfBoxLength + 1) {
                     var collapsed = recode.collapsed==undefined?true:recode.collapsed;
                     collapsed = !collapsed

+ 16 - 26
web/building_saas/main/js/views/project_property_projFeature.js

@@ -20,10 +20,11 @@ let projFeatureView = {
             allowUserDragFill: false,
             scrollbarMaxAlign : true
         },
-        numRows: [],//6, 7, 8, 9, 10, 11, 12, 13, 14, 15
+        numRows: [],
+        combos: [],
         dateRows: [],
         locked: {
-            rows: [0, 1],
+            rows: [0],
             cols: [0]
         }
     },
@@ -79,7 +80,7 @@ let projFeatureView = {
         if(!this.workBook){
             this.workBook = new GC.Spread.Sheets.Workbook($('#projFeatureSpread')[0], {sheetCount: 1});
             sheetCommonObj.spreadDefaultStyle(this.workBook);
-            sheetCommonObj.bindEscKey(this.workBook, [{sheet: this.workBook.getSheet(0), editStarting: this.onEditStarting, editEnded: this.onEditEnded}]);
+            sheetCommonObj.bindEscKey(this.workBook, [{sheet: this.workBook.getSheet(0), editStarting: null, editEnded: this.onEditEnded}]);
             this.setOptions(this.workBook, this.setting.options);
             this.buildHeader(this.workBook.getActiveSheet(), this.setting.header);
             this.bindEvent(this.workBook);
@@ -89,10 +90,9 @@ let projFeatureView = {
     bindEvent: function (workBook) {
         const _events = GC.Spread.Sheets.Events;
         let sheet = workBook.getActiveSheet();
-        sheet.bind(_events.EditStarting, this.onEditStarting);
+        sheet.options.isProtected = true;
         sheet.bind(_events.EditEnded, this.onEditEnded);
         sheet.bind(_events.EnterCell, this.onEnterCell);
-        sheet.bind(_events.ClipboardPasting, this.onClipboardPasting);
         sheet.bind(_events.ClipboardPasted, this.onClipboardPasted);
     },
 
@@ -105,6 +105,10 @@ let projFeatureView = {
             me.initTree(sheet, true, datas);
             sheet.setFormatter(-1, 1, '@');
            for(let row = 0;row < datas.length ; row ++){
+               //锁定
+               if (!me.setting.locked.rows.includes(row)) {
+                   sheet.getCell(row, 1).locked(false);
+               }
                if(datas[row].cellType == 'comboBox'){
                    let options = datas[row].options?datas[row].options.split("@"):[];
                    me.setCombo(sheet, row, options);
@@ -119,16 +123,6 @@ let projFeatureView = {
         this.renderSheetFuc(sheet, fuc);
     },
 
-    onEditStarting: function (sender, args) {
-        let me = projFeatureView;
-        if(me.setting.locked.cols.indexOf(args.col) !== -1){
-            args.cancel = true;
-        }
-        if(args.col === 1 && me.setting.locked.rows.indexOf(args.row) !== -1){
-            args.cancel = true;
-        }
-    },
-
     onEditEnded: function (sender, args) {
         let me = projFeatureView;
         let v =  args.editingText ? args.editingText.toString().trim() : '';
@@ -148,13 +142,6 @@ let projFeatureView = {
         args.sheet.repaint();
     },
 
-    onClipboardPasting: function (sender, args) {
-        let me = projFeatureView;
-        if(me.setting.locked.cols.indexOf(args.cellRange.col) !== -1){
-            args.cancel = true;
-        }
-    },
-
     onClipboardPasted: function (sender, args) {
         let me = projFeatureView;
         let items = sheetCommonObj.analyzePasteData(me.setting, args);
@@ -165,11 +152,8 @@ let projFeatureView = {
         for(let i = 0, len = items.length; i < len; i++){
             let row = i + args.cellRange.row;
             let comboItems = me.getComboItemsByRow(row);
-            if(me.setting.locked.rows.indexOf(row) !== -1){
-                recRows.push(row);
-            }
             //粘贴下拉框数据过滤
-            else if(comboItems && comboItems.indexOf(items[i].value) !== -1){
+            if(comboItems && comboItems.indexOf(items[i].value) !== -1){
                 recRows.push(row);
             }
             else if(me.setting.numRows.indexOf(row) !== -1 && !me.isNum(items[i].value)){
@@ -220,6 +204,12 @@ let projFeatureView = {
     initDatas: function (datas) {
         this.datas = [];
         for(let i = 0, len = datas.length; i < len; i++){
+            if (typeof datas[i].readOnly === 'string') {
+                datas[i].readOnly = JSON.parse(datas[i].readOnly);
+            }
+            if (datas[i].readOnly && !this.setting.locked.rows.includes(i)) {
+                this.setting.locked.rows.push(i);
+            }
             this.datas.push(this.copyObj(datas[i]));
         }
     },

+ 10 - 43
web/building_saas/main/js/views/project_view.js

@@ -1928,18 +1928,15 @@ var projectObj = {
         }
         CommonTotalFeeCellType.prototype = new ns.CellTypes.Text();
         CommonTotalFeeCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
-            //  if(value!=null){
-            // ctx.fillText(value,x+3+ctx.measureText(value).width,y+h-3);
-            // ctx.fillText(value,x+w-3,y+h-3);
-            GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
-            // }
-            if(calcBaseView.editingCell && !projectReadOnly && calcBaseView.ifEdit(type, options.row)){
-                if(calcBaseView.editingCell.row==options.row&&calcBaseView.editingCell.col==options.col){
+            if(!projectReadOnly && calcBaseView.ifEdit(type, options.row)){
+                if(options.sheet.getActiveRowIndex()==options.row&&options.sheet.getActiveColumnIndex()==options.col){
                     var image = document.getElementById('f_btn'),imageMagin = 3;
-                    var imageHeight = h-2*imageMagin;
-                    var imageWidth = w*2/(type=='bills'?7:20);
+                    var imageHeight = 15;
+                    var imageWidth = 25;
                     var imageX = x + w - imageWidth- imageMagin, imageY = y + h / 2 - imageHeight / 2;
                     ctx.save();
+                    ctx.fillStyle = style.backColor;
+                    ctx.fillRect(x,y,w,h);
                     ctx.drawImage(image, imageX, imageY,imageWidth,imageHeight);
                     ctx.beginPath();
                     ctx.arc(imageX+imageWidth/2,imageY+imageHeight/2,1,0,360,false);
@@ -1949,8 +1946,10 @@ var projectObj = {
                     ctx.fill();//画实心圆
                     ctx.closePath();
                     ctx.restore();
+                    x = x - imageWidth - imageMagin;
                 }
             }
+            GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
         };
         CommonTotalFeeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
             return {
@@ -1965,11 +1964,9 @@ var projectObj = {
         };
         CommonTotalFeeCellType.prototype.processMouseDown = function (hitinfo) {
             let me = calcBaseView;
-            if(me.editingCell && hitinfo.row==me.editingCell.row){
+            if(hitinfo.sheet.getActiveRowIndex()==hitinfo.row&&hitinfo.sheet.getActiveColumnIndex()==hitinfo.col){
                 var offset=hitinfo.cellRect.x+hitinfo.cellRect.width-6;
-                var imageMagin=3;
-                var imageHeight = hitinfo.cellRect.height-2*imageMagin;
-                var imageWidth = hitinfo.cellRect.width*2/7;
+                var imageWidth = 25;
                 if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
                     if(!projectReadOnly && me.ifEdit(type, hitinfo.row)){
                         if(hitinfo.sheet.getParent() === projectObj.mainSpread){
@@ -1983,39 +1980,9 @@ var projectObj = {
                         calcBaseView.initCalctor(type);
                         feeRateObject.showSelectModal(hitinfo);
                     }
-                }else {//鼠标点击其它地方,消失
-                    hideButton(hitinfo);
                 }
             }
         };
-        CommonTotalFeeCellType.prototype.processMouseEnter = function (hitinfo){
-            let me = calcBaseView;
-            me.pmLeave = false;
-            if(me.editingCell==null){
-                var showSelectBtn = true;
-                showSelectBtn=me.ifEdit(type, hitinfo.row);
-                if(showSelectBtn){
-                    me.editingCell={
-                        row:hitinfo.row,
-                        col:hitinfo.col
-                    };
-                    hitinfo.sheet.invalidateLayout();
-                    hitinfo.sheet.repaint();
-                }
-            }
-        };
-        CommonTotalFeeCellType.prototype.processMouseLeave = function (hitinfo) {
-            hideButton(hitinfo);
-        };
-
-        function hideButton(hitinfo) {
-            if(!calcBaseView.pmLeave){
-                calcBaseView.editingCell=null;
-                hitinfo.sheet.invalidateLayout();
-                hitinfo.sheet.repaint();
-                calcBaseView.pmLeave = true;
-            }
-        }
         return new CommonTotalFeeCellType();
     },
     selectColAndFocus :function (newNode,field = 'code') {//选中单元格并设置焦点

+ 16 - 70
web/building_saas/main/js/views/quantity_edit_view.js

@@ -54,7 +54,7 @@ let quantityEditObj = {
         $("#quantityEXPValue").val(strartString+value+endString);
         setCursor($("#quantityEXPValue")[0],startIndex+value.length);//设置回光标位置
     },
-    getQuantityEditCellType:function () {
+    getQuantityEditCellType:function () {//这个需配合整个表的selection change事件,当change的时候会repaint,按钮会显示
         var ns = GC.Spread.Sheets;
         function QuantityEditCellType() {
             var init=false;
@@ -62,17 +62,15 @@ let quantityEditObj = {
         }
         QuantityEditCellType.prototype = new ns.CellTypes.Text();
         QuantityEditCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
-            // if(value!=null){
-            // ctx.fillText(value,x+3+ctx.measureText(value).width,y+h-3);
-            // }
-            GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
-            if(quantityEditObj.editingCell && !projectReadOnly){
-                if(quantityEditObj.editingCell.row==options.row&&quantityEditObj.editingCell.col==options.col){
+            if(!projectReadOnly){
+                if(options.sheet.getActiveRowIndex()==options.row&&options.sheet.getActiveColumnIndex()==options.col){
                     var image = document.getElementById('f_btn'),imageMagin = 3;
-                    var imageHeight = h-2*imageMagin;
-                    var imageWidth = w*2/7;
+                    var imageHeight = 15;
+                    var imageWidth = 25;
                     var imageX = x + w - imageWidth- imageMagin, imageY = y + h / 2 - imageHeight / 2;
                     ctx.save();
+                    ctx.fillStyle = style.backColor;
+                    ctx.fillRect(x,y,w,h);
                     ctx.drawImage(image, imageX, imageY,imageWidth,imageHeight);
                     ctx.beginPath();
                     ctx.arc(imageX+imageWidth/2,imageY+imageHeight/2,1,0,360,false);
@@ -82,9 +80,10 @@ let quantityEditObj = {
                     ctx.fill();//画实心圆
                     ctx.closePath();
                     ctx.restore();
+                    x = x - imageWidth - imageMagin;
                 }
             }
-
+            GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
         };
         QuantityEditCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
             return {
@@ -99,71 +98,18 @@ let quantityEditObj = {
         };
 
         //2018 -09 -26  修改工程量这个输入控件,删除悬浮提示注释,还原时通过git 历史
-
         QuantityEditCellType.prototype.processMouseDown = function (hitinfo) {
             let me=quantityEditObj;
-           /* if(isDoubleClick(this) == true && !projectReadOnly){//如果是双击,直接显示 2019-1-17 需求更改,取消双击弹出
-                me.showSelectModal(hitinfo);
-                return ;
-            }*/
-           if(me.editingCell && hitinfo.row==me.editingCell.row){
-               if(me.editingCell.isBtn == false){//是第一次点击,刷新显示按钮
-                   me.editingCell.isBtn = true;
-                   hitinfo.sheet.invalidateLayout();
-                   hitinfo.sheet.repaint();
-               }else {
-                   var offset=hitinfo.cellRect.x+hitinfo.cellRect.width-6;
-                   var imageMagin=3;
-                   var imageHeight = hitinfo.cellRect.height-2*imageMagin;
-                   var imageWidth = hitinfo.cellRect.width*2/7;
-                   if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
-                       if(!projectReadOnly){
-                           me.showSelectModal(hitinfo);
-                       }
-                   }/*else {//点击其它地方,按钮消失
-                    hideButton(hitinfo)
-                    }*/
-               }
-            }
-        };
-        QuantityEditCellType.prototype.processMouseEnter = function (hitinfo) {
-            var me=quantityEditObj;
-            me.pmLeave = false;
-            if(me.editingCell==null){
-                me.editingCell={
-                    row:hitinfo.row,
-                    col:hitinfo.col,
-                    isBtn :false//鼠标刚进入的时候按钮还是没显示的状态
+            if(hitinfo.sheet.getActiveRowIndex()==hitinfo.row&&hitinfo.sheet.getActiveColumnIndex()==hitinfo.col){
+                var offset=hitinfo.cellRect.x+hitinfo.cellRect.width-6;
+                var imageWidth = 25;
+                if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
+                    if(!projectReadOnly){
+                        me.showSelectModal(hitinfo);
+                    }
                 }
-               // hitinfo.sheet.invalidateLayout();
-                //hitinfo.sheet.repaint();
             }
         };
-        QuantityEditCellType.prototype.processMouseLeave = function (hitinfo) {
-            hideButton(hitinfo);
-        };
-
-        function hideButton(hitinfo) {
-            if(!quantityEditObj.pmLeave){//鼠标进入显示三个点按钮
-                quantityEditObj.editingCell=null;
-                hitinfo.sheet.invalidateLayout();
-                hitinfo.sheet.repaint();
-                quantityEditObj.pmLeave = true;
-            }
-        }
-
-        function isDoubleClick(quantityCell) {
-            let nowTime = +new Date();
-            if(quantityCell.clickTime !=0){
-                if(nowTime - quantityCell.clickTime < 280) {//判断为双击
-                    quantityCell.clickTime = 0;
-                    return true;
-                }
-            }
-            quantityCell.clickTime = nowTime;//计录点击时间
-            return false
-        }
-
         return new QuantityEditCellType();
     },
     showSelectModal:function (hitinfo) {

+ 2 - 2
web/building_saas/main/js/views/std_billsGuidance_lib.js

@@ -38,7 +38,7 @@ const billsGuidance = (function () {
             headRowHeight: [40],
             defaultRowHeight: 21,
             cols: [{
-                width: 140,
+                width: 105,
                 readOnly: true,
                 showHint: true,
                 head: {
@@ -94,7 +94,7 @@ const billsGuidance = (function () {
             ]
         },
         headers: [
-            {name: '项目编码', dataCode: 'code', width: 140, vAlign: 'center', hAlign: 'left', formatter: '@'},
+            {name: '项目编码', dataCode: 'code', width: 105, vAlign: 'center', hAlign: 'left', formatter: '@'},
             {name: '项目名称', dataCode: 'name', width: 190, vAlign: 'center', hAlign: 'left', formatter: '@'},
             {name: '单位', dataCode: 'unit', width: 60, vAlign: 'center', hAlign: 'center', formatter: '@'},
         ],

+ 4 - 2
web/building_saas/pm/js/pm_newMain.js

@@ -574,6 +574,9 @@ const projTreeObj = {
             }
         }
     },
+    cusButtonClick:async function(info){
+        projTreeObj.changeFileClick(null,info);
+    },
     onDragDropBlock : function (sender,args) {//拖动移动项目位置
         let selected = projTreeObj.tree.selected;
         let targetNode = projTreeObj.tree.items[args.toRow];
@@ -1047,8 +1050,7 @@ const projTreeObj = {
                     me.setCellValue({row: i, col: j}, nodes[i],sheet,setting);
                     let dataCode = headers[j].dataCode;
                     if(nodes[i].data.projType == "Tender" && (dataCode=="feeRateFile" || dataCode == "unitPriceFile")) {
-                        sheet.setCellType(i, j,sheetCommonObj.getSelectButton(headers[j].width),GC.Spread.Sheets.SheetArea.viewport);
-                        sheet.getCell(i, j,GC.Spread.Sheets.SheetArea.viewport).locked(false);
+                        sheet.setCellType(i, j,sheetCommonObj.getCusButtonCellType(me.cusButtonClick,false),GC.Spread.Sheets.SheetArea.viewport);
                     }
                     //sheet.setValue(i, j, nodes[i]['data'][dataCode]);
                 }

+ 1 - 0
web/common/html/header.html

@@ -1,3 +1,4 @@
+<img id="f_btn" src="/web/dest/css/img/feeRate_btn.jpg" alt="" style="display: none" />
 <nav class="navbar navbar-expand-lg p-0 d-flex">
     <% if(controller === 'boot' || controller === 'pm'){ %>
     <!--<a style="text-decoration: none" href="javascript:void(0);" class="header-logo">-->

+ 1 - 1
web/users/html/login.html

@@ -43,7 +43,7 @@
         <div class="modal-dialog modal-lg" role="document">
             <div class="modal-content">
                 <div class="modal-header">
-                    <h5 class="modal-title">选择费用定额</h5>
+                    <h5 class="modal-title">选择编制办法</h5>
                     <p class="m-0 text-warning"><i class="fa fa-exclamation-triangle"></i> <b>登录设置</b> 中可以修改您的登录习惯。</p>
                 </div>
                 <div class="modal-body">

+ 4 - 4
web/users/html/user-set.html

@@ -44,7 +44,7 @@
                         <legend class="my-3">登录设置</legend>
                         <form method="post" action="/user/save-preferences">
                             <div class="form-group">
-                                <label class="form-control-label">登录时选择费用定额</label>
+                                <label class="form-control-label">登录时选择编制办法</label>
                                 <div class="form-control">
                                     <div class="form-check form-check-inline">
                                       <input name="login_ask" type="radio" class="form-check-input" value="1"
@@ -54,14 +54,14 @@
                                     <div class="form-check form-check-inline">
                                       <input name="login_ask" type="radio" class="form-check-input" value="0"
                                         <% if(preferenceSetting.login_ask === 0) { %>checked="checked" <% } %>>
-                                      <span class="form-check-label">指定费用定额</span>
+                                      <span class="form-check-label">指定编制办法</span>
                                     </div>
                                 </div>
                             </div>
                             <div class="form-group">
-                                <label class="form-control-label">指定费用定额</label>
+                                <label class="form-control-label">指定编制办法</label>
                                 <select class="form-control" name="select_version">
-                                    <option value="">请选择费用定额</option>
+                                    <option value="">请选择编制办法</option>
                                     <% if (compilationList.length > 0) {%>
                                     <% compilationList.forEach(function(compilation) { %>
                                     <option value="<%= compilation._id %>" <% if(preferenceSetting.select_version === compilation._id.toString()) { %>selected="selected" <% } %>><%= compilation.name %></option>