|
@@ -9,19 +9,17 @@ $("#gongliao").click(function(){
|
|
$("#fuzhu").click(function(){
|
|
$("#fuzhu").click(function(){
|
|
$(this).attr('href', "/rationRepository/coeList" + "?repository=" + getQueryString("repository"))
|
|
$(this).attr('href', "/rationRepository/coeList" + "?repository=" + getQueryString("repository"))
|
|
});
|
|
});
|
|
-
|
|
|
|
-var rationOprObj = {
|
|
|
|
|
|
+let rationOprObj = {
|
|
workBook: null,
|
|
workBook: null,
|
|
currentRations: {},
|
|
currentRations: {},
|
|
currentEditingRation: null,
|
|
currentEditingRation: null,
|
|
currentSectionId: -1,
|
|
currentSectionId: -1,
|
|
- activeCell: null,
|
|
|
|
rationsCodes: [],
|
|
rationsCodes: [],
|
|
setting: {
|
|
setting: {
|
|
header:[
|
|
header:[
|
|
{headerName:"编码",headerWidth:120,dataCode:"code", dataType: "String", formatter: "@"},
|
|
{headerName:"编码",headerWidth:120,dataCode:"code", dataType: "String", formatter: "@"},
|
|
{headerName:"名称",headerWidth:280,dataCode:"name", dataType: "String"},
|
|
{headerName:"名称",headerWidth:280,dataCode:"name", dataType: "String"},
|
|
- {headerName:"单位",headerWidth:120,dataCode:"unit", dataType: "String", hAlign: "center"},
|
|
|
|
|
|
+ {headerName:"计量单位",headerWidth:120,dataCode:"unit", dataType: "String", hAlign: "center"},
|
|
{headerName:"人工费",headerWidth:120,dataCode:"labourPrice", dataType: "Number", formatter: "0.00", hAlign: "right"},
|
|
{headerName:"人工费",headerWidth:120,dataCode:"labourPrice", dataType: "Number", formatter: "0.00", hAlign: "right"},
|
|
{headerName:"材料费",headerWidth:120,dataCode:"materialPrice", dataType: "Number", formatter: "0.00", hAlign: "right"},
|
|
{headerName:"材料费",headerWidth:120,dataCode:"materialPrice", dataType: "Number", formatter: "0.00", hAlign: "right"},
|
|
{headerName:"机械费",headerWidth:120,dataCode:"machinePrice", dataType: "Number", formatter: "0.00", hAlign: "right"},
|
|
{headerName:"机械费",headerWidth:120,dataCode:"machinePrice", dataType: "Number", formatter: "0.00", hAlign: "right"},
|
|
@@ -43,7 +41,7 @@ var rationOprObj = {
|
|
},
|
|
},
|
|
buildSheet: function(container) {
|
|
buildSheet: function(container) {
|
|
let rationRepId = getQueryString("repository");
|
|
let rationRepId = getQueryString("repository");
|
|
- var me = rationOprObj;
|
|
|
|
|
|
+ let me = rationOprObj;
|
|
let gljLibID = storageUtil.getSessionCache("gljLib", "repositoryID_" + rationRepId);
|
|
let gljLibID = storageUtil.getSessionCache("gljLib", "repositoryID_" + rationRepId);
|
|
if(!gljLibID || typeof gljLibID === 'undefined' || gljLibID == -1){
|
|
if(!gljLibID || typeof gljLibID === 'undefined' || gljLibID == -1){
|
|
alert("没有引用工料机库!");
|
|
alert("没有引用工料机库!");
|
|
@@ -57,42 +55,40 @@ var rationOprObj = {
|
|
me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EnterCell, me.onEnterCell);
|
|
me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EnterCell, me.onEnterCell);
|
|
me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EditStarting, me.onCellEditStart);
|
|
me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EditStarting, me.onCellEditStart);
|
|
me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EditEnded, me.onCellEditEnd);
|
|
me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EditEnded, me.onCellEditEnd);
|
|
- //me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.RangeChanged, me.onRangeChanged);
|
|
|
|
- me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.CellClick, me.onCellClick);
|
|
|
|
|
|
+ me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.SelectionChanged, me.onSelectionChanged);
|
|
},
|
|
},
|
|
-
|
|
|
|
- onCellClick: function(sender, args) {
|
|
|
|
- var me = rationOprObj,
|
|
|
|
- sheetGLJ = rationGLJOprObj.sheet, settingGLJ = rationGLJOprObj.setting,
|
|
|
|
- sheetCoe = rationCoeOprObj.sheet, settingCoe = rationCoeOprObj.setting,
|
|
|
|
- sheetAss = rationAssistOprObj.sheet, settingAss = rationAssistOprObj.setting;
|
|
|
|
- me.activeCell = {row: args.row, col: args.col};
|
|
|
|
- sheetCommonObj.cleanSheet(sheetGLJ, settingGLJ, -1);
|
|
|
|
- sheetCommonObj.shieldAllCells(sheetGLJ);
|
|
|
|
- sheetCommonObj.cleanSheet(sheetCoe, settingCoe, -1);
|
|
|
|
- sheetCommonObj.shieldAllCells(sheetCoe);
|
|
|
|
- sheetCommonObj.cleanSheet(sheetAss, settingAss, -1);
|
|
|
|
- sheetCommonObj.shieldAllCells(sheetAss);
|
|
|
|
- if(!(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader || args.sheetArea === GC.Spread.Sheets.SheetArea.corner)){
|
|
|
|
- var cacheSection = me.getCache();
|
|
|
|
- if (cacheSection && args.row < cacheSection.length) {
|
|
|
|
- rationGLJOprObj.getGljItems(cacheSection[args.row], function () {
|
|
|
|
|
|
+ onSelectionChanged: function (sender, info) {
|
|
|
|
+ if(info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row){
|
|
|
|
+ let row = info.newSelections[0].row;
|
|
|
|
+ let me = rationOprObj,
|
|
|
|
+ sheetGLJ = rationGLJOprObj.sheet, settingGLJ = rationGLJOprObj.setting,
|
|
|
|
+ sheetCoe = rationCoeOprObj.sheet, settingCoe = rationCoeOprObj.setting,
|
|
|
|
+ sheetAss = rationAssistOprObj.sheet, settingAss = rationAssistOprObj.setting;
|
|
|
|
+ sheetCommonObj.cleanSheet(sheetGLJ, settingGLJ, -1);
|
|
|
|
+ sheetCommonObj.cleanSheet(sheetCoe, settingCoe, -1);
|
|
|
|
+ sheetCommonObj.cleanSheet(sheetAss, settingAss, -1);
|
|
|
|
+ let cacheSection = me.getCache();
|
|
|
|
+ if (cacheSection && row < cacheSection.length) {
|
|
|
|
+ rationGLJOprObj.getGljItems(cacheSection[row], function () {
|
|
me.workBook.focus(true);
|
|
me.workBook.focus(true);
|
|
});
|
|
});
|
|
- rationCoeOprObj.getCoeItems(cacheSection[args.row], function () {
|
|
|
|
|
|
+ rationCoeOprObj.getCoeItems(cacheSection[row], function () {
|
|
me.workBook.focus(true);
|
|
me.workBook.focus(true);
|
|
});
|
|
});
|
|
- rationAssistOprObj.getAssItems(cacheSection[args.row]);
|
|
|
|
|
|
+ rationAssistOprObj.getAssItems(cacheSection[row]);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
rationGLJOprObj.currentRationItem = null;
|
|
rationGLJOprObj.currentRationItem = null;
|
|
}
|
|
}
|
|
- };
|
|
|
|
- me.workBook.focus(true);
|
|
|
|
|
|
+ me.workBook.focus(true);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ isInt: function (num) {
|
|
|
|
+ return !isNaN(num) && num % 1 === 0;
|
|
|
|
+ },
|
|
getCache: function() {
|
|
getCache: function() {
|
|
- var me = this, rst = me.currentRations["_SEC_ID_" + me.currentSectionId];
|
|
|
|
|
|
+ let me = this, rst = me.currentRations["_SEC_ID_" + me.currentSectionId];
|
|
if (!(rst)) {
|
|
if (!(rst)) {
|
|
me.currentRations["_SEC_ID_" + me.currentSectionId] = [];
|
|
me.currentRations["_SEC_ID_" + me.currentSectionId] = [];
|
|
rst = me.currentRations["_SEC_ID_" + me.currentSectionId];
|
|
rst = me.currentRations["_SEC_ID_" + me.currentSectionId];
|
|
@@ -100,30 +96,32 @@ var rationOprObj = {
|
|
return rst;
|
|
return rst;
|
|
},
|
|
},
|
|
updateCache: function(addArr, updateArr, removeIds, result) {
|
|
updateCache: function(addArr, updateArr, removeIds, result) {
|
|
- var me = this, cacheSection = me.getCache();
|
|
|
|
|
|
+ let me = this, cacheSection = me.getCache();
|
|
if (addArr.length > 0) {
|
|
if (addArr.length > 0) {
|
|
me.currentRations["_SEC_ID_" + me.currentSectionId] = cacheSection.concat(addArr);
|
|
me.currentRations["_SEC_ID_" + me.currentSectionId] = cacheSection.concat(addArr);
|
|
cacheSection = me.currentRations["_SEC_ID_" + me.currentSectionId];
|
|
cacheSection = me.currentRations["_SEC_ID_" + me.currentSectionId];
|
|
}
|
|
}
|
|
- for (var i = removeIds.length - 1; i >= 0; i--) {
|
|
|
|
- for (var j = cacheSection.length - 1; j >= 0 ; j--) {
|
|
|
|
|
|
+ for (let i = removeIds.length - 1; i >= 0; i--) {
|
|
|
|
+ for (let j = cacheSection.length - 1; j >= 0 ; j--) {
|
|
if (cacheSection[j]["ID"] == removeIds[i]) {
|
|
if (cacheSection[j]["ID"] == removeIds[i]) {
|
|
cacheSection.splice(j,1);
|
|
cacheSection.splice(j,1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (result && result.data.ops && result.data.ops.length > 0) {
|
|
if (result && result.data.ops && result.data.ops.length > 0) {
|
|
- for (var i = 0; i < result.data.ops.length; i++) {
|
|
|
|
- for (var j = 0; j < cacheSection.length; j++) {
|
|
|
|
|
|
+ for (let i = 0; i < result.data.ops.length; i++) {
|
|
|
|
+ for (let j = 0; j < cacheSection.length; j++) {
|
|
if (cacheSection[j][me.setting.header[0].dataCode] == result.data.ops[i][me.setting.header[0].dataCode]) {
|
|
if (cacheSection[j][me.setting.header[0].dataCode] == result.data.ops[i][me.setting.header[0].dataCode]) {
|
|
cacheSection[j]["ID"] = result.data.ops[i]["ID"];
|
|
cacheSection[j]["ID"] = result.data.ops[i]["ID"];
|
|
cacheSection[j]["rationGljList"] = result.data.ops[i]["rationGljList"];
|
|
cacheSection[j]["rationGljList"] = result.data.ops[i]["rationGljList"];
|
|
|
|
+ cacheSection[j]["rationCoeList"] = result.data.ops[i]["rationCoeList"];
|
|
|
|
+ cacheSection[j]["rationAssList"] = result.data.ops[i]["rationAssList"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- for (var i = 0; i < updateArr.length; i++) {
|
|
|
|
- for (var j = 0; j < cacheSection.length; j++) {
|
|
|
|
|
|
+ for (let i = 0; i < updateArr.length; i++) {
|
|
|
|
+ for (let j = 0; j < cacheSection.length; j++) {
|
|
if (updateArr[i]["ID"] && cacheSection[j]["ID"]) {
|
|
if (updateArr[i]["ID"] && cacheSection[j]["ID"]) {
|
|
if (cacheSection[j]["ID"] == updateArr[i]["ID"]) {
|
|
if (cacheSection[j]["ID"] == updateArr[i]["ID"]) {
|
|
cacheSection[j] = updateArr[i];
|
|
cacheSection[j] = updateArr[i];
|
|
@@ -159,12 +157,9 @@ var rationOprObj = {
|
|
if(sels[sel].col === 0){
|
|
if(sels[sel].col === 0){
|
|
$('#alertText').text("编号不能为空,修改失败!");
|
|
$('#alertText').text("编号不能为空,修改失败!");
|
|
$('#alertModalBtn').click();
|
|
$('#alertModalBtn').click();
|
|
- rationSheet.options.isProtected = true;
|
|
|
|
$('#alertModalCls').click(function () {
|
|
$('#alertModalCls').click(function () {
|
|
- rationSheet.options.isProtected = false;
|
|
|
|
});
|
|
});
|
|
$('#alertModalCof').click(function () {
|
|
$('#alertModalCof').click(function () {
|
|
- rationSheet.options.isProtected = false;
|
|
|
|
})
|
|
})
|
|
}
|
|
}
|
|
else if(sels[sel].col !== 0 && !(sels[sel].col === 3 && sels.col + sels[sel].colCount -1 === 6)){
|
|
else if(sels[sel].col !== 0 && !(sels[sel].col === 3 && sels.col + sels[sel].colCount -1 === 6)){
|
|
@@ -188,6 +183,7 @@ var rationOprObj = {
|
|
}
|
|
}
|
|
if(updateArr.length > 0 || removeArr.length > 0){
|
|
if(updateArr.length > 0 || removeArr.length > 0){
|
|
me.mixUpdate = 1;
|
|
me.mixUpdate = 1;
|
|
|
|
+ me.mixDel = removeArr.length > 0 ? 1 : 0;
|
|
me.mixUpdateRequest(updateArr, [], removeArr);
|
|
me.mixUpdateRequest(updateArr, [], removeArr);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -195,50 +191,9 @@ var rationOprObj = {
|
|
me.workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.del, false, false, false, false);
|
|
me.workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.del, false, false, false, false);
|
|
me.workBook.commandManager().setShortcutKey('rationDelete', GC.Spread.Commands.Key.del, false, false, false, false);
|
|
me.workBook.commandManager().setShortcutKey('rationDelete', GC.Spread.Commands.Key.del, false, false, false, false);
|
|
},
|
|
},
|
|
- onRangeChanged: function(sender, args) {
|
|
|
|
- if (args.action == GC.Spread.Sheets.RangeChangedAction.clear) {
|
|
|
|
- var me = rationOprObj, updateArr = [], removeArr = [];
|
|
|
|
- var cacheSection = me.getCache();
|
|
|
|
- if (cacheSection) {
|
|
|
|
- for (var i = 0; i < args.rowCount; i++) {
|
|
|
|
- //var hasUpdate = false, rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row + i),
|
|
|
|
- var hasUpdate = false, rObj = sheetCommonObj.combineRationRowData(me.workBook.getSheet(0), me.setting, args.row + i),
|
|
|
|
- isEmpty = sheetCommonObj.chkIfEmpty(rObj, me.setting);
|
|
|
|
- for (var j = 0; j < cacheSection.length; j++) {
|
|
|
|
- if (cacheSection[j][me.setting.header[0].dataCode] == rObj[me.setting.header[0].dataCode]) {
|
|
|
|
- rObj["ID"] = cacheSection[j]["ID"];
|
|
|
|
- hasUpdate = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if(isEmpty){
|
|
|
|
- if(args.row + i < cacheSection.length){
|
|
|
|
- rObj.ID = cacheSection[args.row + i].ID;
|
|
|
|
- removeArr.push(rObj.ID);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (hasUpdate) {
|
|
|
|
- if (isEmpty) {
|
|
|
|
- removeArr.push(rObj);
|
|
|
|
- } else updateArr.push(rObj);
|
|
|
|
- } else if (isEmpty) {
|
|
|
|
- if (args.row + i < cacheSection.length) {
|
|
|
|
- rObj["ID"] = cacheSection[args.row + i]["ID"];
|
|
|
|
- removeArr.push(rObj["ID"]);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
|
- //removeRationItems
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
onEnterCell: function (sender, args) {
|
|
onEnterCell: function (sender, args) {
|
|
let me = rationOprObj;
|
|
let me = rationOprObj;
|
|
|
|
+ args.sheet.repaint();
|
|
me.cellRowIdx = args.row;
|
|
me.cellRowIdx = args.row;
|
|
let isHasData = false;
|
|
let isHasData = false;
|
|
if(me.addRationItem){
|
|
if(me.addRationItem){
|
|
@@ -252,54 +207,54 @@ var rationOprObj = {
|
|
if(isHasData){
|
|
if(isHasData){
|
|
if(me.editingRowIdx !== me.cellRowIdx) {
|
|
if(me.editingRowIdx !== me.cellRowIdx) {
|
|
let focusToCol = !me.addRationItem.code ? 0 : -1;
|
|
let focusToCol = !me.addRationItem.code ? 0 : -1;
|
|
- // else {
|
|
|
|
if(focusToCol !== -1){
|
|
if(focusToCol !== -1){
|
|
$('#rationAlertBtn').click();
|
|
$('#rationAlertBtn').click();
|
|
- me.workBook.getSheet(0).options.isProtected = true;
|
|
|
|
$('#rationAlertCac').click(function () {
|
|
$('#rationAlertCac').click(function () {
|
|
- me.workBook.getSheet(0).options.isProtected = false;
|
|
|
|
- //me.workBook.getSheet(0).setActiveCell(me.editingRowIdx, focusToCol);
|
|
|
|
|
|
+ me.addRationItem = null;
|
|
|
|
+ for(let col=0; col<me.setting.header.length; col++){
|
|
|
|
+ me.workBook.getSheet(0).getCell(me.editingRowIdx, col).value('');
|
|
|
|
+ }
|
|
});
|
|
});
|
|
$('#rationAlertCls').click(function () {
|
|
$('#rationAlertCls').click(function () {
|
|
- me.workBook.getSheet(0).options.isProtected = false;
|
|
|
|
- // me.workBook.getSheet(0).setActiveCell(me.editingRowIdx, focusToCol);
|
|
|
|
|
|
+ me.workBook.getSheet(0).setActiveCell(me.editingRowIdx, focusToCol);
|
|
});
|
|
});
|
|
$('#rationAlertCof').click(function () {
|
|
$('#rationAlertCof').click(function () {
|
|
- me.workBook.getSheet(0).options.isProtected = false;
|
|
|
|
- me.addRationItem = null;
|
|
|
|
- for(let col=0; col<me.setting.header.length; col++){
|
|
|
|
- me.workBook.getSheet(0).getCell(me.editingRowIdx, col).value(me.currentEditingRation[me.setting.header[col].dataCode]);
|
|
|
|
- }
|
|
|
|
- //me.workBook.getSheet(0).setActiveCell(me.editingRowIdx, 0);
|
|
|
|
|
|
+ me.workBook.getSheet(0).setActiveCell(me.editingRowIdx, focusToCol);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- // }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onCellEditStart: function(sender, args) {
|
|
onCellEditStart: function(sender, args) {
|
|
- var me = rationOprObj;
|
|
|
|
- //var rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row);
|
|
|
|
- var rObj = sheetCommonObj.combineRationRowData(me.workBook.getSheet(0), me.setting, args.row);
|
|
|
|
- me.currentEditingRation = rObj;
|
|
|
|
- var cacheSection = me.getCache();
|
|
|
|
- if (cacheSection) {
|
|
|
|
- for (var j = 0; j < cacheSection.length; j++) {
|
|
|
|
- if (cacheSection[j][me.setting.header[0].dataCode] == rObj[me.setting.header[0].dataCode]) {
|
|
|
|
- rObj["ID"] = cacheSection[j]["ID"];
|
|
|
|
- break;
|
|
|
|
|
|
+ let me = rationOprObj;
|
|
|
|
+ if(!me.canRations || me.setting.view.lockColumns.indexOf(args.col) !== -1){
|
|
|
|
+ args.cancel = true;
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ let rObj = sheetsOprObj.combineRationRowData(me.workBook.getSheet(0), me.setting, args.row);
|
|
|
|
+ me.currentEditingRation = rObj;
|
|
|
|
+ let cacheSection = me.getCache();
|
|
|
|
+ if (cacheSection) {
|
|
|
|
+ for (let j = 0; j < cacheSection.length; j++) {
|
|
|
|
+ if (cacheSection[j][me.setting.header[0].dataCode] == rObj[me.setting.header[0].dataCode]) {
|
|
|
|
+ rObj["ID"] = cacheSection[j]["ID"];
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onCellEditEnd: function(sender, args) {
|
|
onCellEditEnd: function(sender, args) {
|
|
- //var me = rationOprObj, rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row),
|
|
|
|
- var me = rationOprObj, rObj = sheetCommonObj.combineRationRowData(me.workBook.getSheet(0), me.setting, args.row),
|
|
|
|
|
|
+ let me = rationOprObj, rObj = sheetsOprObj.combineRationRowData(me.workBook.getSheet(0), me.setting, args.row),
|
|
updateArr = [], addArr = [];
|
|
updateArr = [], addArr = [];
|
|
let dataCode = me.setting.header[args.col].dataCode;
|
|
let dataCode = me.setting.header[args.col].dataCode;
|
|
me.editingRowIdx = args.row;
|
|
me.editingRowIdx = args.row;
|
|
if (me.currentEditingRation["ID"]) {
|
|
if (me.currentEditingRation["ID"]) {
|
|
- rObj["ID"] = me.currentEditingRation["ID"];
|
|
|
|
|
|
+ if((!args.editingText || args.editingText.toString().trim().length === 0) && args.col === 0){
|
|
|
|
+ args.sheet.setValue(args.row, args.col, me.currentEditingRation[dataCode] + '');
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ rObj["ID"] = me.currentEditingRation["ID"];
|
|
if(me.currentEditingRation[dataCode] !== rObj[dataCode]){
|
|
if(me.currentEditingRation[dataCode] !== rObj[dataCode]){
|
|
me.addRationItem = rObj;
|
|
me.addRationItem = rObj;
|
|
if(dataCode === 'code'){
|
|
if(dataCode === 'code'){
|
|
@@ -314,10 +269,20 @@ var rationOprObj = {
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ else if(dataCode === 'feeType'){//取费专业控制为整数
|
|
|
|
+ if(me.isInt(rObj[dataCode])){
|
|
|
|
+ updateArr.push(rObj);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ rObj[dataCode] = '';
|
|
|
|
+ args.sheet.setValue(args.row, args.col, typeof me.currentEditingRation[dataCode] !== 'undefined' && me.currentEditingRation[dataCode] ? me.currentEditingRation[dataCode] : '');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
else{
|
|
else{
|
|
updateArr.push(rObj);
|
|
updateArr.push(rObj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else if(!me.currentEditingRation["ID"]) {
|
|
else if(!me.currentEditingRation["ID"]) {
|
|
if (!sheetCommonObj.chkIfEmpty(rObj, me.setting)) {
|
|
if (!sheetCommonObj.chkIfEmpty(rObj, me.setting)) {
|
|
@@ -329,6 +294,9 @@ var rationOprObj = {
|
|
if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
|
|
if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
|
|
rObj.jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
|
|
rObj.jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
|
|
}
|
|
}
|
|
|
|
+ if(annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL){
|
|
|
|
+ rObj.annotation = annotationOprObj.currentAnnotation ? annotationOprObj.currentAnnotation : '';
|
|
|
|
+ }
|
|
me.setInitPrc(rObj);
|
|
me.setInitPrc(rObj);
|
|
addArr.push(rObj);
|
|
addArr.push(rObj);
|
|
me.rationsCodes.push(rObj.code);
|
|
me.rationsCodes.push(rObj.code);
|
|
@@ -338,22 +306,6 @@ var rationOprObj = {
|
|
alert('编码已存在!');
|
|
alert('编码已存在!');
|
|
me.workBook.getSheet(0).setValue(args.row, args.col, '');
|
|
me.workBook.getSheet(0).setValue(args.row, args.col, '');
|
|
}
|
|
}
|
|
- /*else if(!rObj.code && rObj.code === ''){
|
|
|
|
- $('#alertModalBtn').click();
|
|
|
|
- me.workBook.getSheet(0).options.isProtected = true;
|
|
|
|
- $('#alertModalCls').click(function () {
|
|
|
|
- me.workBook.getSheet(0).options.isProtected = false;
|
|
|
|
- me.addRationItem.code = '';
|
|
|
|
- me.workBook.getSheet(0).setValue(args.row, args.col, '');
|
|
|
|
- me.workBook.getSheet(0).setActiveCell(args.row, args.col);
|
|
|
|
- });
|
|
|
|
- $('#alertModalCof').click(function () {
|
|
|
|
- me.workBook.getSheet(0).options.isProtected = false;
|
|
|
|
- me.addRationItem.code = '';
|
|
|
|
- me.workBook.getSheet(0).setValue(args.row, args.col, '');
|
|
|
|
- me.workBook.getSheet(0).setActiveCell(args.row, args.col);
|
|
|
|
- });
|
|
|
|
- }*/
|
|
|
|
}
|
|
}
|
|
else if(rObj.code && rObj.code.toString.trim().length === 0){
|
|
else if(rObj.code && rObj.code.toString.trim().length === 0){
|
|
me.workBook.getSheet(0).setValue(args.row, args.col, '');
|
|
me.workBook.getSheet(0).setValue(args.row, args.col, '');
|
|
@@ -366,36 +318,46 @@ var rationOprObj = {
|
|
me.mixUpdateRequest(updateArr, addArr, []);
|
|
me.mixUpdateRequest(updateArr, addArr, []);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ canPasted: function (beginCol, maxCol) {
|
|
|
|
+ let rst = false;
|
|
|
|
+ if(maxCol < 3 || beginCol > 6){
|
|
|
|
+ rst = true;
|
|
|
|
+ }
|
|
|
|
+ return rst;
|
|
|
|
+ },
|
|
onClipboardPasting: function(sender, args) {
|
|
onClipboardPasting: function(sender, args) {
|
|
- var me = rationOprObj;
|
|
|
|
- /* if (args.cellRange.colCount != me.setting.header.length) {
|
|
|
|
|
|
+ let me = rationOprObj;
|
|
|
|
+ let maxCol = args.cellRange.col + args.cellRange.colCount -1;
|
|
|
|
+ if(!me.canRations || !me.canPasted(args.cellRange.col, maxCol) || maxCol > me.setting.header.length - 1){
|
|
args.cancel = true;
|
|
args.cancel = true;
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
+ //todo: overwrite?
|
|
onClipboardPasted: function(e, info) {
|
|
onClipboardPasted: function(e, info) {
|
|
- var me = rationOprObj;
|
|
|
|
- var cacheSection = me.getCache();
|
|
|
|
- var updateArr = [], addArr = [];
|
|
|
|
- var items = sheetCommonObj.analyzePasteData(me.setting, info);
|
|
|
|
- let failPasteArr = [];
|
|
|
|
- for (var i = 0, rowIdx =info.cellRange.row; i < items.length; i++, rowIdx++) {
|
|
|
|
|
|
+ let me = rationOprObj;
|
|
|
|
+ let cacheSection = me.getCache();
|
|
|
|
+ let updateArr = [], addArr = [];
|
|
|
|
+ let items = sheetCommonObj.analyzePasteData(me.setting, info);
|
|
|
|
+ for (let i = 0; i < items.length; i++) {
|
|
|
|
+ let rowIdx = info.cellRange.row + i;
|
|
if (cacheSection) {
|
|
if (cacheSection) {
|
|
if(!me.isValidUnit(items[i], rationUnits)){//无效单位
|
|
if(!me.isValidUnit(items[i], rationUnits)){//无效单位
|
|
- items[i].unit = typeof cacheSection[rowIdx].unit !== 'undefined' && !cacheSection[rowIdx] ? cacheSection[rowIdx].unit : '';
|
|
|
|
|
|
+ items[i].unit = rowIdx < cacheSection.length && typeof cacheSection[rowIdx].unit !== 'undefined' ? cacheSection[rowIdx].unit : '';
|
|
}
|
|
}
|
|
- //var hasCacheItem = false;
|
|
|
|
if(!cacheSection[rowIdx] && info.cellRange.col === 0 ){
|
|
if(!cacheSection[rowIdx] && info.cellRange.col === 0 ){
|
|
if(me.rationsCodes.indexOf(items[i].code) === -1){
|
|
if(me.rationsCodes.indexOf(items[i].code) === -1){
|
|
//jobConten
|
|
//jobConten
|
|
if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
|
|
if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
|
|
items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
|
|
items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
|
|
}
|
|
}
|
|
|
|
+ if(annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL){
|
|
|
|
+ items[i].annotation = annotationOprObj.currentAnnotation ? annotationOprObj.currentAnnotation : '';
|
|
|
|
+ }
|
|
me.setInitPrc(items[i]);
|
|
me.setInitPrc(items[i]);
|
|
addArr.push(items[i]);
|
|
addArr.push(items[i]);
|
|
me.rationsCodes.push(items[i].code);
|
|
me.rationsCodes.push(items[i].code);
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- failPasteArr.push(items[i].code);
|
|
|
|
me.workBook.getSheet(0).setValue(rowIdx, 0, '');
|
|
me.workBook.getSheet(0).setValue(rowIdx, 0, '');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -405,6 +367,10 @@ var rationOprObj = {
|
|
items[i][me.setting.header[col].dataCode] = cacheSection[rowIdx][me.setting.header[col].dataCode];
|
|
items[i][me.setting.header[col].dataCode] = cacheSection[rowIdx][me.setting.header[col].dataCode];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(items[i].feeType && !me.isInt(items[i].feeType)){
|
|
|
|
+ items[i].feeType = '';
|
|
|
|
+ me.workBook.getSheet(0).setValue(rowIdx, 8, '');
|
|
|
|
+ }
|
|
if(info.cellRange.col === 0){
|
|
if(info.cellRange.col === 0){
|
|
if(me.rationsCodes.indexOf(items[i].code) === -1){
|
|
if(me.rationsCodes.indexOf(items[i].code) === -1){
|
|
items[i].ID = cacheSection[rowIdx].ID;
|
|
items[i].ID = cacheSection[rowIdx].ID;
|
|
@@ -432,22 +398,22 @@ var rationOprObj = {
|
|
if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
|
|
if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
|
|
items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
|
|
items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
|
|
}
|
|
}
|
|
|
|
+ if(annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL){
|
|
|
|
+ items[i].annotation = annotationOprObj.currentAnnotation ? annotationOprObj.currentAnnotation : '';
|
|
|
|
+ }
|
|
me.setInitPrc(items[i]);
|
|
me.setInitPrc(items[i]);
|
|
addArr.push(items[i]);
|
|
addArr.push(items[i]);
|
|
}
|
|
}
|
|
- else{
|
|
|
|
- failPasteArr.push(items[i]);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- /* if(failPasteArr.length > 0 && !(updateArr.length > 0 || addArr.length > 0)){
|
|
|
|
- me.showRationItems(me.currentSectionId);
|
|
|
|
- }*/
|
|
|
|
if (updateArr.length > 0 || addArr.length > 0) {
|
|
if (updateArr.length > 0 || addArr.length > 0) {
|
|
me.mixUpdate = 1;
|
|
me.mixUpdate = 1;
|
|
me.mixUpdateRequest(updateArr, addArr, []);
|
|
me.mixUpdateRequest(updateArr, addArr, []);
|
|
}
|
|
}
|
|
|
|
+ else{
|
|
|
|
+ me.getRationItems(me.currentSectionId);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
setInitPrc: function (obj) {
|
|
setInitPrc: function (obj) {
|
|
obj.labourPrice = 0;
|
|
obj.labourPrice = 0;
|
|
@@ -476,38 +442,54 @@ var rationOprObj = {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- mixUpdateRequest: function(updateArr, addArr, removeIds) {
|
|
|
|
- var me = rationOprObj;
|
|
|
|
- sheetCommonObj.setLockCol(me.workBook.getSheet(0), 0, true);
|
|
|
|
|
|
+ mixUpdateRequest: function(updateArr, addArr, removeIds, callback) {
|
|
|
|
+ let me = rationOprObj;
|
|
$.ajax({
|
|
$.ajax({
|
|
type:"POST",
|
|
type:"POST",
|
|
url:"api/mixUpdateRationItems",
|
|
url:"api/mixUpdateRationItems",
|
|
data:{"rationLibId": getQueryString("repository"), "lastOpr": userAccount, "sectionID": me.currentSectionId, "updateItems": JSON.stringify(updateArr), "addItems": JSON.stringify(addArr), "removeIds": JSON.stringify(removeIds)},
|
|
data:{"rationLibId": getQueryString("repository"), "lastOpr": userAccount, "sectionID": me.currentSectionId, "updateItems": JSON.stringify(updateArr), "addItems": JSON.stringify(addArr), "removeIds": JSON.stringify(removeIds)},
|
|
dataType:"json",
|
|
dataType:"json",
|
|
cache:false,
|
|
cache:false,
|
|
- timeout:5000,
|
|
|
|
|
|
+ timeout:20000,
|
|
success:function(result){
|
|
success:function(result){
|
|
if (result.error) {
|
|
if (result.error) {
|
|
- alert(`error`);
|
|
|
|
|
|
+ alert('error');
|
|
me.getRationItems(me.currentSectionId);
|
|
me.getRationItems(me.currentSectionId);
|
|
} else {
|
|
} else {
|
|
- var cacheSection = me.updateCache(addArr, updateArr, removeIds, result);
|
|
|
|
|
|
+ let cacheSection = me.updateCache(addArr, updateArr, removeIds, result);
|
|
cacheSection.sort(function(a, b){
|
|
cacheSection.sort(function(a, b){
|
|
- var rst = 0;
|
|
|
|
|
|
+ let rst = 0;
|
|
if (a.code > b.code) rst = 1
|
|
if (a.code > b.code) rst = 1
|
|
else if (a.code < b.code) rst = -1;
|
|
else if (a.code < b.code) rst = -1;
|
|
return rst;
|
|
return rst;
|
|
});
|
|
});
|
|
//jobContent
|
|
//jobContent
|
|
- if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.PARTIAL){
|
|
|
|
|
|
+ if(jobContentOprObj ){
|
|
jobContentOprObj.currentRationItems = cacheSection;
|
|
jobContentOprObj.currentRationItems = cacheSection;
|
|
- jobContentOprObj.buildTablePartial(jobContentOprObj.tablePartial, jobContentOprObj.getGroup(cacheSection));
|
|
|
|
|
|
+ jobContentOprObj.setRadiosDisabled(cacheSection.length > 0 ? false : true, jobContentOprObj.radios);
|
|
|
|
+ if(cacheSection.length === 0){
|
|
|
|
+ jobContentOprObj.updateSituation(pageOprObj.rationLibId, me.currentSectionId, 'NONE');
|
|
|
|
+ }
|
|
|
|
+ jobContentOprObj.setRadiosChecked(jobContentOprObj.currentSituation, jobContentOprObj.radios);
|
|
|
|
+ if(jobContentOprObj.currentSituation === jobContentOprObj.situations.PARTIAL){
|
|
|
|
+ jobContentOprObj.buildTablePartial(jobContentOprObj.tablePartial, jobContentOprObj.getGroup(cacheSection));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(annotationOprObj ){
|
|
|
|
+ annotationOprObj.setRadiosDisabled(cacheSection.length > 0 ? false : true, annotationOprObj.radios);
|
|
|
|
+ if(cacheSection.length === 0){
|
|
|
|
+ annotationOprObj.updateAnnoSituation(pageOprObj.rationLibId, me.currentSectionId, 'NONE');
|
|
|
|
+ }
|
|
|
|
+ annotationOprObj.setRadiosChecked(annotationOprObj.currentSituation, annotationOprObj.radios);
|
|
|
|
+ if(annotationOprObj.currentSituation === annotationOprObj.situations.PARTIAL){
|
|
|
|
+ annotationOprObj.buildTablePartial(annotationOprObj.fzTablePartial, annotationOprObj.getGroup(cacheSection));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
me.showRationItems(me.currentSectionId);
|
|
me.showRationItems(me.currentSectionId);
|
|
me.mixUpdate = 0;
|
|
me.mixUpdate = 0;
|
|
- // me.workBook.getSheet(0).setActiveCell(me.activeCell.row, me.activeCell.col);
|
|
|
|
|
|
+ me.mixDel = 0;
|
|
}
|
|
}
|
|
- sheetCommonObj.setLockCol(me.workBook.getSheet(0), 0, false);
|
|
|
|
|
|
+ if(callback) callback();
|
|
},
|
|
},
|
|
error:function(){
|
|
error:function(){
|
|
}
|
|
}
|
|
@@ -515,20 +497,16 @@ var rationOprObj = {
|
|
},
|
|
},
|
|
getRationItems: function(sectionID){
|
|
getRationItems: function(sectionID){
|
|
if (sectionID != -1) {
|
|
if (sectionID != -1) {
|
|
- var me = rationOprObj;
|
|
|
|
|
|
+ let me = rationOprObj;
|
|
me.mixUpdate = 0;
|
|
me.mixUpdate = 0;
|
|
me.currentSectionId = sectionID;
|
|
me.currentSectionId = sectionID;
|
|
if (me.currentRations["_SEC_ID_" + sectionID]) {
|
|
if (me.currentRations["_SEC_ID_" + sectionID]) {
|
|
//jobContent--
|
|
//jobContent--
|
|
jobContentOprObj.currentRationItems = me.currentRations["_SEC_ID_" + sectionID];
|
|
jobContentOprObj.currentRationItems = me.currentRations["_SEC_ID_" + sectionID];
|
|
jobContentOprObj.rationJobContentOpr(me.currentRations["_SEC_ID_" + sectionID]);
|
|
jobContentOprObj.rationJobContentOpr(me.currentRations["_SEC_ID_" + sectionID]);
|
|
- //jobContent--
|
|
|
|
|
|
+ //annotation
|
|
|
|
+ annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
|
|
me.showRationItems(sectionID);
|
|
me.showRationItems(sectionID);
|
|
- ///sheetCommonObj.unShieldAllCells(me.workBook.getSheet(0));
|
|
|
|
- sheetCommonObj.lockCells(rationGLJOprObj.sheet, rationGLJOprObj.setting);
|
|
|
|
- sheetCommonObj.lockCells(rationCoeOprObj.sheet, rationCoeOprObj.setting);
|
|
|
|
- sheetCommonObj.lockCells(me.workBook.getSheet(0), rationOprObj.setting);
|
|
|
|
- sheetCommonObj.unShieldAllCells(rationAssistOprObj.sheet);
|
|
|
|
} else {
|
|
} else {
|
|
$.ajax({
|
|
$.ajax({
|
|
type:"POST",
|
|
type:"POST",
|
|
@@ -536,7 +514,7 @@ var rationOprObj = {
|
|
data:{"sectionID": sectionID},
|
|
data:{"sectionID": sectionID},
|
|
dataType:"json",
|
|
dataType:"json",
|
|
cache:false,
|
|
cache:false,
|
|
- timeout:1000,
|
|
|
|
|
|
+ timeout:10000,
|
|
success:function(result){
|
|
success:function(result){
|
|
if (result) {
|
|
if (result) {
|
|
me.currentRations["_SEC_ID_" + sectionID] = result.data;
|
|
me.currentRations["_SEC_ID_" + sectionID] = result.data;
|
|
@@ -544,18 +522,9 @@ var rationOprObj = {
|
|
//job--
|
|
//job--
|
|
jobContentOprObj.currentRationItems = me.currentRations["_SEC_ID_" + sectionID];
|
|
jobContentOprObj.currentRationItems = me.currentRations["_SEC_ID_" + sectionID];
|
|
jobContentOprObj.rationJobContentOpr(me.currentRations["_SEC_ID_" + sectionID]);
|
|
jobContentOprObj.rationJobContentOpr(me.currentRations["_SEC_ID_" + sectionID]);
|
|
- //job--
|
|
|
|
|
|
+ //annotation
|
|
|
|
+ annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
|
|
me.showRationItems(sectionID);
|
|
me.showRationItems(sectionID);
|
|
- //sheetCommonObj.unShieldAllCells(me.workBook.getSheet(0));
|
|
|
|
- sheetCommonObj.lockCells(me.workBook.getSheet(0), rationOprObj.setting);
|
|
|
|
- sheetCommonObj.lockCells(rationGLJOprObj.sheet, rationGLJOprObj.setting);
|
|
|
|
- sheetCommonObj.lockCells(rationCoeOprObj.sheet, rationCoeOprObj.setting);
|
|
|
|
- sheetCommonObj.unShieldAllCells(rationAssistOprObj.sheet);
|
|
|
|
- } else {
|
|
|
|
- sheetCommonObj.shieldAllCells(me.workBook.getSheet(0));
|
|
|
|
- sheetCommonObj.shieldAllCells(rationGLJOprObj.sheet);
|
|
|
|
- sheetCommonObj.shieldAllCells(rationCoeOprObj.sheet);
|
|
|
|
- sheetCommonObj.shieldAllCells(rationAssistOprObj.sheet);
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
error:function(err){
|
|
error:function(err){
|
|
@@ -565,37 +534,49 @@ var rationOprObj = {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- setCombo: function (sheet, items) {
|
|
|
|
- sheet.suspendPaint();
|
|
|
|
- for(let i = 0, len = sheet.getRowCount(); i < len; i++){
|
|
|
|
- let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
|
|
|
|
- combo.items(items);
|
|
|
|
- combo.itemHeight(10);
|
|
|
|
- sheet.getCell(i, 2).cellType(combo);
|
|
|
|
- }
|
|
|
|
- sheet.resumePaint();
|
|
|
|
- },
|
|
|
|
showRationItems: function(sectionID){
|
|
showRationItems: function(sectionID){
|
|
- var me = rationOprObj;
|
|
|
|
|
|
+ let me = rationOprObj,
|
|
|
|
+ sheetGLJ = rationGLJOprObj.sheet, settingGLJ = rationGLJOprObj.setting,
|
|
|
|
+ sheetCoe = rationCoeOprObj.sheet, settingCoe = rationCoeOprObj.setting,
|
|
|
|
+ sheetAss = rationAssistOprObj.sheet, settingAss = rationAssistOprObj.setting;
|
|
if (me.workBook) {
|
|
if (me.workBook) {
|
|
if (me.currentRations && me.currentRations["_SEC_ID_" + sectionID] && me.currentRations["_SEC_ID_" + sectionID].length > 0) {
|
|
if (me.currentRations && me.currentRations["_SEC_ID_" + sectionID] && me.currentRations["_SEC_ID_" + sectionID].length > 0) {
|
|
- var cacheSection = me.currentRations["_SEC_ID_" + sectionID];
|
|
|
|
- //sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
|
|
|
|
|
|
+ let cacheSection = me.currentRations["_SEC_ID_" + sectionID];
|
|
sheetCommonObj.cleanData(me.workBook.getSheet(0), me.setting, -1);
|
|
sheetCommonObj.cleanData(me.workBook.getSheet(0), me.setting, -1);
|
|
- sheetCommonObj.showData(me.workBook.getSheet(0), me.setting, cacheSection);
|
|
|
|
- sheetCommonObj.setLockCol(me.workBook.getSheet(0), 4, true);
|
|
|
|
|
|
+ sheetsOprObj.showData(me.workBook.getSheet(0), me.setting, cacheSection);
|
|
//combo
|
|
//combo
|
|
- me.setCombo(me.workBook.getActiveSheet(), rationUnits);
|
|
|
|
- if(me.mixUpdate === 1){
|
|
|
|
- rationGLJOprObj.getGljItems(cacheSection[cacheSection.length - 1], function () {
|
|
|
|
- me.workBook.focus(true);
|
|
|
|
- });
|
|
|
|
|
|
+ sheetCommonObj.setStaticCombo(me.workBook.getActiveSheet(), 0, 2, cacheSection.length, rationUnits, 10, false);
|
|
|
|
+ sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), cacheSection.length, 2, me.workBook.getActiveSheet().getRowCount() - cacheSection.length, rationUnits, 10, false);
|
|
|
|
+ if(me.mixDel === 1){
|
|
|
|
+ let row = me.workBook.getSheet(0).getSelections()[0].row;
|
|
|
|
+ if (cacheSection && row < cacheSection.length) {
|
|
|
|
+ sheetCommonObj.cleanData(sheetGLJ, settingGLJ, -1);
|
|
|
|
+ sheetCommonObj.cleanData(sheetCoe, settingCoe, -1);
|
|
|
|
+ sheetCommonObj.cleanData(sheetAss, settingAss, -1);
|
|
|
|
+ rationGLJOprObj.getGljItems(cacheSection[row]);
|
|
|
|
+ rationCoeOprObj.getCoeItems(cacheSection[row]);
|
|
|
|
+ rationAssistOprObj.getAssItems(cacheSection[row]);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ rationGLJOprObj.currentRationItem = null;
|
|
|
|
+ sheetCommonObj.cleanData(sheetGLJ, settingGLJ, -1);
|
|
|
|
+ sheetCommonObj.cleanData(sheetCoe, settingCoe, -1);
|
|
|
|
+ sheetCommonObj.cleanData(sheetAss, settingAss, -1);
|
|
|
|
+ sheetCommonObj.setDynamicCombo(sheetAss, 0, 5, sheetAss.getRowCount(), rationAssistOprObj.setting.comboItems, false, false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} 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数据及工料机数据
|
|
//清除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);
|
|
}
|
|
}
|
|
|
|
+ me.workBook.focus(true);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
sortByCode: function(arr){
|
|
sortByCode: function(arr){
|