zhangweicheng 7 anni fa
parent
commit
c7a0eab3dd

+ 1 - 1
modules/ration_glj/facade/ration_glj_facade.js

@@ -138,7 +138,7 @@ function get_lib_glj_info(ration_glj) {
                     }
                 });
             }else {
-                cb(null,null);
+                cb(null,result);
             }
         })
     }

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

@@ -871,7 +871,7 @@ var gljOprObj = {
         }
     },
     setGLJSelection:function (args,newVal) {
-        if($('#actionType').val()=='add'){
+        if($('#actionType').val()=='add'||$('#actionType').val()=='insert'){
             this.addGLJsSelection(args,newVal);
         }else {
             this.replaceGLJSelection(args,newVal);
@@ -1180,7 +1180,7 @@ $(function(){
         }
         gljOprObj.gljLibSheetData =gljOprObj.AllRecode;
         var selected=null;
-        if($('#actionType').val()=='add'){
+        if($('#actionType').val()=='add',$('#actionType').val()=='insert'){
             gljOprObj.GLJSelection=[];
         }else {
              selected=gljOprObj.sheetData[gljContextMenu.selectedRow];

+ 3 - 3
web/building_saas/main/js/views/main_tree_col.js

@@ -157,12 +157,12 @@ let MainTreeCol = {
         // CSL, 2017-11-28
         subType: function (node) {
             if (node.data.type == rationType.volumePrice || node.data.type == rationType.gljRation||node.sourceType === projectObj.project.ration_glj.getSourceType()){
-                let VPType = new GC.Spread.Sheets.CellTypes.ComboBox();
+                let VPType = sheetCommonObj.getDynamicCombo();;
 
                 if (node.data.type == rationType.volumePrice)
-                    VPType.items(["人工","材料","机械","主材","设备"])
+                    VPType.itemHeight(5).items(["人工","材料","机械","主材","设备"])
                 else if (node.data.type == rationType.gljRation||node.sourceType === projectObj.project.ration_glj.getSourceType())
-                    VPType.items(["材料","主材","设备"]);
+                    VPType.itemHeight(3).items(["材料","主材","设备"]);
 
                 return VPType;
             };

+ 14 - 2
web/building_saas/main/js/views/project_view.js

@@ -341,7 +341,7 @@ var projectObj = {
     },
     mainSpreadEnterCell: function (sender, info) {
         let colSetting = projectObj.mainController.setting.cols[info.col];
-        if(colSetting.data.field === 'unit' || projectObj.lastCol.data.field === 'unit'){
+        if(colSetting.data.field === 'unit' || projectObj.lastCol.data.field === 'unit'||colSetting.data.field ==='subType'|| projectObj.lastCol.data.field === 'subType'){
             info.sheet.repaint();
         }
     },
@@ -357,7 +357,7 @@ var projectObj = {
         // 自动行高
         const autoHeight = project.property.displaySetting.autoHeight;
         if (autoHeight) {
-            this.mainSpread.getActiveSheet().autoFitRow(info.row);
+            projectObj.mainSpread.getActiveSheet().autoFitRow(info.row);
         }
     },
     mainSpreadRangeChanged: function (sender, info) {
@@ -519,6 +519,18 @@ var projectObj = {
                         ProjectController.addRation(project, controller, rationType.volumePrice);
                     }
                 },
+                "insertGLJ": {
+                    name: "插入工料机",
+                    icon: 'fa-sign-in',
+                    disabled: function () {
+                        var selected = project.mainTree.selected;
+                        var readOnly = MainTreeCol.readOnly;
+                        return readOnly.billsParent(selected)||(readOnly.bills(selected)&&!readOnly.calcBaseType(selected));
+                    },
+                    callback: function (key, opt) {
+                        getGLJData('insert');// ProjectController.addRation(project, controller, rationType.volumePrice);
+                    }
+                },
                 "spr1": '--------',
                 "delete": {
                     name: '删除',