浏览代码

补充人材机刷新复选框bug

zhongzewei 6 年之前
父节点
当前提交
2517552b71

+ 18 - 4
web/building_saas/complementary_glj_lib/js/glj.js

@@ -157,6 +157,7 @@ let repositoryGljObj = {
     },
     showGljItems: function(data, type) {
         let me = repositoryGljObj;
+        let sheet = me.workBook.getActiveSheet();
         if (me.workBook) {
             let cacheSection = [];
             let pArr = me.parentNodeIds["_pNodeId_" + type];
@@ -167,10 +168,23 @@ let repositoryGljObj = {
                     cacheSection.push(data[i]);
                 }
             }
-            sheetOpr.cleanData(me.workBook.getSheet(0), me.setting, -1);
-            sheetOpr.showData(me.workBook.getSheet(0), me.setting, cacheSection, me.distTypeTree, me.machineModelIdx);
-            sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, 5, me.workBook.getActiveSheet().getRowCount(), me.distTypeTree.comboDatas, false, 'text');
-            sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, 6, me.workBook.getActiveSheet().getRowCount(), me.machineModel.comboItems, false, 'text');
+            sheetOpr.cleanData(sheet, me.setting, -1);
+            //清除是否新增复选框
+            gljClassTreeObj.renderFunc(sheet, function () {
+                let isComplementaryCol = 0;
+                for(let colData of me.setting.header){
+                    if(colData.dataCode === 'isComplementary'){
+                        isComplementaryCol = me.setting.header.indexOf(colData);
+                    }
+                }
+                let baseCell = new GC.Spread.Sheets.CellTypes.Base();
+                for(let row = 0; row < sheet.getRowCount(); row++){
+                    sheet.setCellType(row, isComplementaryCol, baseCell);
+                }
+            });
+            sheetOpr.showData(sheet, me.setting, cacheSection, me.distTypeTree, me.machineModelIdx);
+            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;

+ 7 - 1
web/building_saas/complementary_ration_lib/js/ration.js

@@ -584,7 +584,7 @@ let rationOprObj = {
                 me.getRationItems(me.currentSectionId);
             });
     },
-    getRationItems: function(sectionID){
+    getRationItems: function(sectionID, callback = null){
         if (sectionID != -1) {
             let me = rationOprObj;
             me.mixUpdate = 0;
@@ -596,6 +596,9 @@ let rationOprObj = {
                 //annotation
                 annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
                 me.showRationItems(sectionID);
+                if(callback) {
+                    callback();
+                }
             } else {
                 CommonAjax.post('/complementaryRation/api/getRationItems', {rationRepId: pageOprObj.rationLibId, sectionId: sectionID}, function (rstData) {
                     me.currentRations["_SEC_ID_" + sectionID] = rstData;
@@ -606,6 +609,9 @@ let rationOprObj = {
                     //annotation
                     annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
                     me.showRationItems(sectionID);
+                    if(callback) {
+                        callback();
+                    }
                 });
             }
         }

+ 8 - 5
web/building_saas/complementary_ration_lib/js/section_tree.js

@@ -460,7 +460,10 @@ let sectionTreeObj = {
         if(!me.isDef(node.children) || node.children.length === 0){
             rationOprObj.canRations = true;
             rationOprObj.workBook.getSheet(0).clearSelection();
-            rationOprObj.getRationItems(node.data.ID);
+            rationOprObj.getRationItems(node.data.ID, function () {
+                rationOprObj.workBook.getActiveSheet().setActiveCell(0, 0);
+                rationOprObj.rationSelInit(0);
+            });
             rationOprObj.setCombo(rationOprObj.workBook.getSheet(0), 'dynamic');
         }
         else {
@@ -473,11 +476,11 @@ let sectionTreeObj = {
           //  annotationOprObj.setRadiosDisabled(true, annotationOprObj.radios);
             annotationOprObj.hideTable($('#fzTableAll'), $('#fzTablePartial'));
             sheetCommonObj.cleanSheet(rationOprObj.workBook.getSheet(0), rationOprObj.setting, -1);
+            sheetCommonObj.cleanSheet(rationGLJOprObj.sheet, rationGLJOprObj.setting, -1);
+            sheetCommonObj.cleanSheet(rationCoeOprObj.sheet, rationCoeOprObj.setting, -1);
+            sheetCommonObj.cleanSheet(rationAssistOprObj.sheet, rationAssistOprObj.setting, -1);
+            sheetCommonObj.cleanSheet(rationInstObj.sheet, rationInstObj.setting, -1);
         }
-        sheetCommonObj.cleanSheet(rationGLJOprObj.sheet, rationGLJOprObj.setting, -1);
-        sheetCommonObj.cleanSheet(rationCoeOprObj.sheet, rationCoeOprObj.setting, -1);
-        sheetCommonObj.cleanSheet(rationAssistOprObj.sheet, rationAssistOprObj.setting, -1);
-        sheetCommonObj.cleanSheet(rationInstObj.sheet, rationInstObj.setting, -1);
         //rationGLJOprObj.sheet.getParent().focus(false);
         me.workBook.focus(true);
     }