|
@@ -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);
|
|
|
},
|