Explorar o código

打开定额库编辑器,首次输入三位编号,不应识别为时间。例如1-1-1

zhongzewei %!s(int64=6) %!d(string=hai) anos
pai
achega
93c2a22748

+ 30 - 56
web/maintain/ration_repository/js/ration.js

@@ -650,16 +650,8 @@ let rationOprObj = {
                 } else {
                     let cacheSection = me.updateCache(addArr, updateArr, removeIds, result);
                     me.sortByCode(cacheSection);
-                    /*cacheSection.sort(function(a, b){
-                        let rst = 0;
-                        if (a.code > b.code) rst = 1
-                        else if (a.code < b.code) rst = -1;
-                        return rst;
-                    });*/
-                    //add
                     let curRow = me.workBook.getActiveSheet().getActiveRowIndex();
                     me.rationSelInit(curRow);
-                    //add
                     //jobContent
                     if(jobContentOprObj ){
                         jobContentOprObj.currentRationItems = cacheSection;
@@ -699,47 +691,34 @@ let rationOprObj = {
             let me = rationOprObj;
             me.mixUpdate = 0;
             me.currentSectionId = sectionID;
-            /*if (me.currentRations["_SEC_ID_" + sectionID]) {
-                //jobContent--
-                jobContentOprObj.currentRationItems = me.currentRations["_SEC_ID_" + sectionID];
-                jobContentOprObj.rationJobContentOpr(me.currentRations["_SEC_ID_" + sectionID]);
-                //annotation
-                annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
-                me.showRationItems(sectionID);
-                sectionTreeObj.removeBtn.removeClass('disabled');
-                if(callback){
-                    callback();
-                }
-            } else */{
-                $.ajax({
-                    type:"POST",
-                    url:"api/getRationItems",
-                    data:{"rationRepId": pageOprObj.rationLibId, "sectionID": sectionID},
-                    dataType:"json",
-                    cache:false,
-                    timeout:10000,
-                    success:function(result){
-                        if (result) {
-                            me.currentRations["_SEC_ID_" + sectionID] = result.data;
-                            me.sortByCode(me.currentRations["_SEC_ID_" + sectionID]);
-                            //job--
-                            jobContentOprObj.currentRationItems = me.currentRations["_SEC_ID_" + sectionID];
-                            jobContentOprObj.rationJobContentOpr(me.currentRations["_SEC_ID_" + sectionID]);
-                            //annotation
-                            annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
-                            me.showRationItems(sectionID);
-                        }
-                        sectionTreeObj.removeBtn.removeClass('disabled');
-                        if(callback) {
-                            callback(result.data);
-                        }
-                    },
-                    error:function(err){
-                        sectionTreeObj.removeBtn.removeClass('disabled');
-                        alert(err);
+            $.ajax({
+                type:"POST",
+                url:"api/getRationItems",
+                data:{"rationRepId": pageOprObj.rationLibId, "sectionID": sectionID},
+                dataType:"json",
+                cache:false,
+                timeout:10000,
+                success:function(result){
+                    if (result) {
+                        me.currentRations["_SEC_ID_" + sectionID] = result.data;
+                        me.sortByCode(me.currentRations["_SEC_ID_" + sectionID]);
+                        //job--
+                        jobContentOprObj.currentRationItems = me.currentRations["_SEC_ID_" + sectionID];
+                        jobContentOprObj.rationJobContentOpr(me.currentRations["_SEC_ID_" + sectionID]);
+                        //annotation
+                        annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
+                        me.showRationItems(sectionID);
                     }
-                })
-            }
+                    sectionTreeObj.removeBtn.removeClass('disabled');
+                    if(callback) {
+                        callback(result.data);
+                    }
+                },
+                error:function(err){
+                    sectionTreeObj.removeBtn.removeClass('disabled');
+                    alert(err);
+                }
+            })
         }
     },
     showRationItems: function(sectionID){
@@ -749,13 +728,10 @@ let rationOprObj = {
             sheetAss = rationAssistOprObj.sheet, settingAss = rationAssistOprObj.setting,
             sheetInst = rationInstObj.sheet, settingInst = rationInstObj.setting;
         if (me.workBook) {
-            if (me.currentRations && me.currentRations["_SEC_ID_" + sectionID] && me.currentRations["_SEC_ID_" + sectionID].length > 0) {
+            sheetCommonObj.cleanData(me.workBook.getSheet(0), me.setting, -1);
+            if (me.currentRations && me.currentRations["_SEC_ID_" + sectionID]) {
                 let cacheSection = me.currentRations["_SEC_ID_" + sectionID];
-                sheetCommonObj.cleanData(me.workBook.getSheet(0), me.setting, -1);
                 sheetsOprObj.showData(me.workBook.getSheet(0), me.setting, cacheSection);
-                //combo
-                //sheetCommonObj.setStaticCombo(me.workBook.getActiveSheet(), 0, 2, cacheSection.length, rationUnits, 10, false);
-                //--sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, 2, me.workBook.getActiveSheet().getRowCount(), rationUnits, 10, false);
                 if(me.mixDel === 1){
                     let row = me.workBook.getSheet(0).getSelections()[0].row;
                     if (cacheSection && row < cacheSection.length) {
@@ -780,16 +756,14 @@ let rationOprObj = {
 
             } else {
                 sheetCommonObj.setDynamicCombo(sheetAss, 0, 5, sheetAss.getRowCount(), rationAssistOprObj.setting.comboItems, false, false);
-                //--sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, 2, me.workBook.getActiveSheet().getRowCount(), rationUnits, 10, false);
                 //清除ration数据及工料机数据
                 rationGLJOprObj.currentRationItem = null;
-                sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
+                //sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
                 sheetCommonObj.cleanSheet(sheetGLJ, settingGLJ, -1);
                 sheetCommonObj.cleanSheet(sheetCoe, settingCoe, -1);
                 sheetCommonObj.cleanSheet(sheetAss, settingAss, -1);
                 sheetCommonObj.cleanSheet(sheetInst, settingInst, -1);
             }
-           //--- me.workBook.focus(true);
         }
         sectionTreeObj.workBook.focus(true);
     },

+ 0 - 1
web/maintain/ration_repository/js/ration_coe.js

@@ -410,7 +410,6 @@ var rationCoeOprObj = {
 
                         me.showCoeItems(ration.ID);
                     }
-                    //sheetCommonObj.lockCells(me.sheet, me.setting);
                     if(callback) callback();
                 },
                 error:function(err){

+ 0 - 22
web/maintain/ration_repository/js/sheetsOpr.js

@@ -32,11 +32,6 @@ let sheetsOprObj = {
         else{
             sheet.setRowCount(typeof repositoryGljObj !== 'undefined' && repositoryGljObj.currentOprParent === 1 ? data.length : data.length + 10);
         }
-        /*if(data.length === 0){
-            for(let i = 0; i < sheet.getRowCount(); i++){
-                sheet.getCell(i, 4, GC.Spread.Sheets.SheetArea.viewport).locked(false);
-            }
-        }*/
         for (var col = 0; col < setting.header.length; col++) {
             var hAlign = "left", vAlign = "center";
             if (setting.header[col].hAlign) {
@@ -47,20 +42,10 @@ let sheetsOprObj = {
             vAlign = setting.header[col].vAlign?setting.header[col].vAlign:vAlign;
             me.setAreaAlign(sheet.getRange(-1, col, -1, 1), hAlign, vAlign);
             if (setting.header[col].formatter) {
-                //var style = new GC.Spread.Sheets.Style();
-                //style.formatter = setting.header[col].formatter;
-                //sheet.setStyle(row,col,style,GC.Spread.Sheets.SheetArea.viewport);
                 sheet.setFormatter(-1, col, setting.header[col].formatter, GC.Spread.Sheets.SheetArea.viewport);
             }
             for (var row = 0; row < data.length; row++) {
-                //var cell = sheet.getCell(row, col, GC.Spread.Sheets.SheetArea.viewport);
                 if(setting.header[col].dataCode === 'gljType' && data[row].gljType){
-                   /* if(typeof repositoryGljObj !== 'undefined' && typeof repositoryGljObj.allowComponent !== 'undefined' && repositoryGljObj.allowComponent.indexOf(data[row].gljType) !== -1){
-                        sheet.getCell(row, 4, GC.Spread.Sheets.SheetArea.viewport).locked(true);
-                    }
-                    else if(typeof repositoryGljObj !== 'undefined' && typeof repositoryGljObj.allowComponent !== 'undefined' && repositoryGljObj.allowComponent.indexOf(data[row].gljType) === -1){
-                        sheet.getCell(row, 4, GC.Spread.Sheets.SheetArea.viewport).locked(false);
-                    }*/
                     let distTypeVal =  distTypeTree.distTypes[distTypeTree.prefix + data[row].gljType].data.fullName;
                     sheet.setValue(row, col, distTypeVal, ch);
                 }
@@ -68,18 +53,11 @@ let sheetsOprObj = {
                     sheet.setValue(row, col, data[row][setting.header[col].dataCode] !== undefined && data[row][setting.header[col].dataCode] !== null
                         ? data[row][setting.header[col].dataCode] : '', ch);
                     sheet.setTag(row, 0, data[row].ID, ch);
-                    /*if(typeof setting.owner !== 'undefined' && setting.owner !== 'gljComponent'){
-                        sheet.getCell(row, 0, GC.Spread.Sheets.SheetArea.viewport).locked(true);
-                    }*/
                 }
             }
-          /*  for(let i = data.length; i < sheet.getRowCount(); i++){
-                sheet.getCell(i, 4, GC.Spread.Sheets.SheetArea.viewport).locked(false);
-            }*/
         }
         sheet.resumeEvent();
         sheet.resumePaint();
-        //me.shieldAllCells(sheet);
     },
     showDataForGljSel: function(sheet, setting, data, distTypeTree) {
         var me = this, ch = GC.Spread.Sheets.SheetArea.viewport;