|
@@ -38,7 +38,7 @@ var pageOprObj = {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- repositoryGljObj = {
|
|
|
+repositoryGljObj = {
|
|
|
treeObj : null,
|
|
|
workBook: null,
|
|
|
gljCurTypeId: -1,
|
|
@@ -92,9 +92,9 @@ var pageOprObj = {
|
|
|
});
|
|
|
distTypeTree.distTypesArr.forEach(function (distTypeObj) {
|
|
|
/*if(distTypeObj.children.length === 0 && distTypeObj.data.fullName !== '普通机械' &&distTypeObj.data.fullName !== '机械组成物'
|
|
|
- && distTypeObj.data.fullName !== '机上人工'){
|
|
|
- distTypeTree.comboDatas.push({text: distTypeObj.data.fullName, value: distTypeObj.data.ID});
|
|
|
- }*/
|
|
|
+ && distTypeObj.data.fullName !== '机上人工'){
|
|
|
+ distTypeTree.comboDatas.push({text: distTypeObj.data.fullName, value: distTypeObj.data.ID});
|
|
|
+ }*/
|
|
|
if(distTypeObj.data.fullName !== '材料'){
|
|
|
distTypeTree.comboDatas.push({text: distTypeObj.data.fullName, value: distTypeObj.data.ID});
|
|
|
}
|
|
@@ -195,88 +195,88 @@ var pageOprObj = {
|
|
|
var me = repositoryGljObj;
|
|
|
me.workBook = sheetCommonObj.buildSheet(container, me.setting, 30, me);
|
|
|
me.workBook.getSheet(0).options.isProtected = true;
|
|
|
- /* me.repositoryGljDelOpr();
|
|
|
- me.workBook.bind(GC.Spread.Sheets.Events.ClipboardPasting, me.onClipboardPasting);
|
|
|
- me.workBook.bind(GC.Spread.Sheets.Events.ClipboardPasted, me.onClipboardPasted);
|
|
|
- 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.RangeChanged, me.onRangeChanged);
|
|
|
- me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EnterCell, me.onEnterCell);*/
|
|
|
+ /* me.repositoryGljDelOpr();
|
|
|
+ me.workBook.bind(GC.Spread.Sheets.Events.ClipboardPasting, me.onClipboardPasting);
|
|
|
+ me.workBook.bind(GC.Spread.Sheets.Events.ClipboardPasted, me.onClipboardPasted);
|
|
|
+ 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.RangeChanged, me.onRangeChanged);
|
|
|
+ me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EnterCell, me.onEnterCell);*/
|
|
|
},
|
|
|
- onEnterCell: function (sender, args) {
|
|
|
- let me = repositoryGljObj;
|
|
|
- me.cellRowIdx = args.row;
|
|
|
- let isHasData = false;
|
|
|
- if(me.addGljObj){
|
|
|
- for(let i=0; i<me.setting.header.length; i++){
|
|
|
- if(me.addGljObj[me.setting.header[i].dataCode]){
|
|
|
- isHasData = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if(isHasData){
|
|
|
- if(me.editingRowIdx !== me.cellRowIdx) {
|
|
|
- let isComple = true;
|
|
|
- let focusToCol;
|
|
|
- function getFocusToCol (me){
|
|
|
- if(!me.addGljObj[me.setting.header[0].dataCode]){
|
|
|
- $('#alertGljTxt').text('编号不能为空,是否取消增加工料机?');
|
|
|
- return 0;
|
|
|
- }
|
|
|
- else if(!me.addGljObj[me.setting.header[1].dataCode]){
|
|
|
- $('#alertGljTxt').text('名称不能为空,是否取消增加工料机?');
|
|
|
- return 1;
|
|
|
- }
|
|
|
+ onEnterCell: function (sender, args) {
|
|
|
+ let me = repositoryGljObj;
|
|
|
+ me.cellRowIdx = args.row;
|
|
|
+ let isHasData = false;
|
|
|
+ if(me.addGljObj){
|
|
|
+ for(let i=0; i<me.setting.header.length; i++){
|
|
|
+ if(me.addGljObj[me.setting.header[i].dataCode]){
|
|
|
+ isHasData = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(isHasData){
|
|
|
+ if(me.editingRowIdx !== me.cellRowIdx) {
|
|
|
+ let isComple = true;
|
|
|
+ let focusToCol;
|
|
|
+ function getFocusToCol (me){
|
|
|
+ if(!me.addGljObj[me.setting.header[0].dataCode]){
|
|
|
+ $('#alertGljTxt').text('编号不能为空,是否取消增加工料机?');
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else if(!me.addGljObj[me.setting.header[1].dataCode]){
|
|
|
+ $('#alertGljTxt').text('名称不能为空,是否取消增加工料机?');
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
else if(!me.addGljObj[me.setting.header[5].dataCode]){
|
|
|
- $('#alertGljTxt').text('类型不能为空,是否取消增加工料机?');
|
|
|
- return 5;
|
|
|
- }
|
|
|
- else {
|
|
|
- return -1;
|
|
|
- }
|
|
|
- }
|
|
|
- focusToCol = getFocusToCol(me);
|
|
|
- if(focusToCol === -1){
|
|
|
+ $('#alertGljTxt').text('类型不能为空,是否取消增加工料机?');
|
|
|
+ return 5;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ focusToCol = getFocusToCol(me);
|
|
|
+ if(focusToCol === -1){
|
|
|
|
|
|
- }
|
|
|
- else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
$('#gljAlertBtn').click();
|
|
|
- //me.workBook.getSheet(0).options.isProtected = true;
|
|
|
- sheetCommonObj.lockAllCells(args.sheet);
|
|
|
- $('#aleCanceBtn').click(function () {
|
|
|
+ //me.workBook.getSheet(0).options.isProtected = true;
|
|
|
+ sheetCommonObj.lockAllCells(args.sheet);
|
|
|
+ $('#aleCanceBtn').click(function () {
|
|
|
// me.workBook.getSheet(0).options.isProtected = false;
|
|
|
- sheetCommonObj.unLockAllCells(args.sheet);
|
|
|
- sheetCommonObj.reLockSomeCodes(args.sheet, 0, repositoryGljObj.currentCache.length);
|
|
|
- me.workBook.getSheet(0).setActiveCell(me.editingRowIdx, focusToCol);
|
|
|
- });
|
|
|
- $('#gljAleClose').click(function () {
|
|
|
+ sheetCommonObj.unLockAllCells(args.sheet);
|
|
|
+ sheetCommonObj.reLockSomeCodes(args.sheet, 0, repositoryGljObj.currentCache.length);
|
|
|
+ me.workBook.getSheet(0).setActiveCell(me.editingRowIdx, focusToCol);
|
|
|
+ });
|
|
|
+ $('#gljAleClose').click(function () {
|
|
|
// me.workBook.getSheet(0).options.isProtected = false;
|
|
|
- sheetCommonObj.unLockAllCells(args.sheet);
|
|
|
- sheetCommonObj.reLockSomeCodes(args.sheet, 0, repositoryGljObj.currentCache.length);
|
|
|
- me.workBook.getSheet(0).setActiveCell(me.editingRowIdx, focusToCol);
|
|
|
- });
|
|
|
- $('#aleConfBtn').click(function () {
|
|
|
+ sheetCommonObj.unLockAllCells(args.sheet);
|
|
|
+ sheetCommonObj.reLockSomeCodes(args.sheet, 0, repositoryGljObj.currentCache.length);
|
|
|
+ me.workBook.getSheet(0).setActiveCell(me.editingRowIdx, focusToCol);
|
|
|
+ });
|
|
|
+ $('#aleConfBtn').click(function () {
|
|
|
// me.workBook.getSheet(0).options.isProtected = false;
|
|
|
- sheetCommonObj.unLockAllCells(args.sheet);
|
|
|
- sheetCommonObj.reLockSomeCodes(args.sheet, 0, repositoryGljObj.currentCache.length);
|
|
|
- me.addGljObj = null;
|
|
|
- for(let col=0; col<me.setting.header.length; col++){
|
|
|
- let field = me.setting.header[col].dataCode;
|
|
|
- if(field === 'gljType'){
|
|
|
- me.workBook.getSheet(0).getCell(me.editingRowIdx, col).value(
|
|
|
- me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj[field]].data.fullName);
|
|
|
- }
|
|
|
- else{
|
|
|
- me.workBook.getSheet(0).getCell(me.editingRowIdx, col).value(me.currentEditingGlj[me.setting.header[col].dataCode]);
|
|
|
- }
|
|
|
- }
|
|
|
- me.workBook.getSheet(0).setActiveCell(me.editingRowIdx, 0);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
+ sheetCommonObj.unLockAllCells(args.sheet);
|
|
|
+ sheetCommonObj.reLockSomeCodes(args.sheet, 0, repositoryGljObj.currentCache.length);
|
|
|
+ me.addGljObj = null;
|
|
|
+ for(let col=0; col<me.setting.header.length; col++){
|
|
|
+ let field = me.setting.header[col].dataCode;
|
|
|
+ if(field === 'gljType'){
|
|
|
+ me.workBook.getSheet(0).getCell(me.editingRowIdx, col).value(
|
|
|
+ me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj[field]].data.fullName);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ me.workBook.getSheet(0).getCell(me.editingRowIdx, col).value(me.currentEditingGlj[me.setting.header[col].dataCode]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ me.workBook.getSheet(0).setActiveCell(me.editingRowIdx, 0);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
onCellEditStart: function(sender, args) {
|
|
|
var me = repositoryGljObj;
|
|
|
var rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row);
|
|
@@ -328,16 +328,16 @@ var pageOprObj = {
|
|
|
}
|
|
|
//update basePrice of ration when editting gljType of glj
|
|
|
if(me.currentEditingGlj.gljType !== rObj.gljType){
|
|
|
- let gljTypeObj = {gljId: me.currentEditingGlj.ID, gljType: rObj.gljType, basePrice: rObj.basePrice};
|
|
|
+ let gljTypeObj = {gljId: me.currentEditingGlj.ID, gljType: rObj.gljType, basePrice: rObj.basePrice};
|
|
|
updateBasePrcArr.push(gljTypeObj);
|
|
|
me.updateRationBasePrcRq(updateBasePrcArr);
|
|
|
}
|
|
|
} else {
|
|
|
me.addGljObj = rObj;
|
|
|
let isCanSav = true;
|
|
|
- if(!rObj[me.setting.header[0].dataCode] || !rObj[me.setting.header[1].dataCode] || !rObj[me.setting.header[5].dataCode]){
|
|
|
- isCanSav = false;
|
|
|
- }
|
|
|
+ if(!rObj[me.setting.header[0].dataCode] || !rObj[me.setting.header[1].dataCode] || !rObj[me.setting.header[5].dataCode]){
|
|
|
+ isCanSav = false;
|
|
|
+ }
|
|
|
if(isCanSav){
|
|
|
me.addGljObj = null;
|
|
|
addArr.push(rObj);
|
|
@@ -353,347 +353,347 @@ var pageOprObj = {
|
|
|
me.mixUpdateRequest(updateArr, addArr, []);
|
|
|
}
|
|
|
},
|
|
|
- repositoryGljDelOpr: function () {
|
|
|
+ repositoryGljDelOpr: function () {
|
|
|
let me = repositoryGljObj;
|
|
|
- me.workBook.commandManager().register('repositoryGljDel', function () {
|
|
|
- let sheet = me.workBook.getSheet(0),
|
|
|
- updateArr = [], removeArr = [],
|
|
|
- tempRemoveArr= [],
|
|
|
- refGljCodes = [], //已被引用的工料机
|
|
|
- updateBasePrcArr = [],//删除基价单位后重新计算
|
|
|
- sels = sheet.getSelections(),
|
|
|
- cacheSection = me.currentCache;
|
|
|
- if(sels.length > 0 && cacheSection.length > 0){
|
|
|
- for(let i = 0; i < sels.length; i++){
|
|
|
- if(sels[i].colCount === me.setting.header.length){
|
|
|
- for(let j = 0; j < sels[i].rowCount; j++){
|
|
|
- if(sels[i].row + j < cacheSection.length){
|
|
|
- tempRemoveArr.push({ID: cacheSection[sels[i].row + j].ID, code: cacheSection[sels[i].row + j].code});
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else{
|
|
|
- let maxCol = sels[i].col + sels[i].colCount - 1;
|
|
|
- if(sels[i].col >= 2 && maxCol <= 4){
|
|
|
- for(let j = 0; j < sels[i].rowCount; j++){
|
|
|
- if(sels[i].row + j < cacheSection.length){
|
|
|
- let updateObj = cacheSection[sels[i].row + j];
|
|
|
- for(let col = sels[i].col; col <= maxCol; col++){
|
|
|
- if(me.setting.header[col].dataCode === 'basePrice'){
|
|
|
- updateObj[me.setting.header[col].dataCode] = 0;
|
|
|
- updateBasePrcArr.push({gljId: updateObj.ID, gljType: updateObj.gljType, basePrice: 0});
|
|
|
- }
|
|
|
- else{
|
|
|
- updateObj[me.setting.header[col].dataCode] = '';
|
|
|
- }
|
|
|
- }
|
|
|
- updateArr.push(updateObj);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //编号、名称、类型不可为空
|
|
|
- else{
|
|
|
- if(sels[i].row < cacheSection.length){
|
|
|
- let text = '', cantNullStr =['编码', '名称', '类型'];
|
|
|
- for(let col = sels[i].col; col <= sels[i].col + sels[i].colCount -1; col++){
|
|
|
- if(cantNullStr.indexOf(me.setting.header[col].headerName) !== -1){
|
|
|
- text += me.setting.header[col].headerName + " ";
|
|
|
- }
|
|
|
- }
|
|
|
- $('#alertText').text(text + "不可为空!");
|
|
|
- $('#codeAlertBtn').click();
|
|
|
- sheet.options.isProtected = true;
|
|
|
- $('#codAleConfBtn').click(function () {
|
|
|
- sheetCommonObj.lockSomeCodes(sheet, 0, cacheSection.length);
|
|
|
- });
|
|
|
- $('#codAleClose').click(function () {
|
|
|
- sheetCommonObj.lockSomeCodes(sheet, 0, cacheSection.length);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //提取已被引用工料机
|
|
|
- if(tempRemoveArr.length > 0){
|
|
|
- for(let i = 0; i < tempRemoveArr.length; i++){
|
|
|
- if(me.rationGljIds.indexOf(tempRemoveArr[i].ID) !== -1){
|
|
|
- refGljCodes.push(tempRemoveArr[i].code);
|
|
|
- tempRemoveArr.splice(i--, 1);
|
|
|
- }
|
|
|
- else{
|
|
|
- removeArr.push(tempRemoveArr[i].ID);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //提示
|
|
|
- if(refGljCodes.length > 0){
|
|
|
- let alertText;
|
|
|
- if(refGljCodes.length > 3){
|
|
|
- alertText = "编号: " + refGljCodes[0]+" 、" + refGljCodes[1] + " 、" + refGljCodes[2] + "...等工料机已有定额引用,删除失败!";
|
|
|
- }
|
|
|
- else {
|
|
|
- let alertCode = " ";
|
|
|
- for(let i=0; i< refGljCodes.length; i++){
|
|
|
- alertCode += refGljCodes[i] + " 、";
|
|
|
- }
|
|
|
- alertText = "编号:" + alertCode + "工料机已有定额引用,删除失败!"
|
|
|
- }
|
|
|
- $('#alertText').text(alertText);
|
|
|
- $('#codeAlertBtn').click();
|
|
|
- sheet.options.isProtected = true;
|
|
|
- $('#codAleConfBtn').click(function () {
|
|
|
- sheetCommonObj.lockSomeCodes(sheet, 0, cacheSection.length);
|
|
|
- if(removeArr.length > 0){
|
|
|
- me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
- }
|
|
|
- });
|
|
|
- $('#codAleClose').click(function () {
|
|
|
- sheetCommonObj.lockSomeCodes(sheet, 0, cacheSection.length);
|
|
|
- me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
- });
|
|
|
- }
|
|
|
- else if(removeArr.length > 0 || updateArr.length > 0){
|
|
|
- me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
- if(updateBasePrcArr.length > 0){
|
|
|
- me.updateRationBasePrcRq(updateBasePrcArr);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ me.workBook.commandManager().register('repositoryGljDel', function () {
|
|
|
+ let sheet = me.workBook.getSheet(0),
|
|
|
+ updateArr = [], removeArr = [],
|
|
|
+ tempRemoveArr= [],
|
|
|
+ refGljCodes = [], //已被引用的工料机
|
|
|
+ updateBasePrcArr = [],//删除基价单位后重新计算
|
|
|
+ sels = sheet.getSelections(),
|
|
|
+ cacheSection = me.currentCache;
|
|
|
+ if(sels.length > 0 && cacheSection.length > 0){
|
|
|
+ for(let i = 0; i < sels.length; i++){
|
|
|
+ if(sels[i].colCount === me.setting.header.length){
|
|
|
+ for(let j = 0; j < sels[i].rowCount; j++){
|
|
|
+ if(sels[i].row + j < cacheSection.length){
|
|
|
+ tempRemoveArr.push({ID: cacheSection[sels[i].row + j].ID, code: cacheSection[sels[i].row + j].code});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ let maxCol = sels[i].col + sels[i].colCount - 1;
|
|
|
+ if(sels[i].col >= 2 && maxCol <= 4){
|
|
|
+ for(let j = 0; j < sels[i].rowCount; j++){
|
|
|
+ if(sels[i].row + j < cacheSection.length){
|
|
|
+ let updateObj = cacheSection[sels[i].row + j];
|
|
|
+ for(let col = sels[i].col; col <= maxCol; col++){
|
|
|
+ if(me.setting.header[col].dataCode === 'basePrice'){
|
|
|
+ updateObj[me.setting.header[col].dataCode] = 0;
|
|
|
+ updateBasePrcArr.push({gljId: updateObj.ID, gljType: updateObj.gljType, basePrice: 0});
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ updateObj[me.setting.header[col].dataCode] = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ updateArr.push(updateObj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //编号、名称、类型不可为空
|
|
|
+ else{
|
|
|
+ if(sels[i].row < cacheSection.length){
|
|
|
+ let text = '', cantNullStr =['编码', '名称', '类型'];
|
|
|
+ for(let col = sels[i].col; col <= sels[i].col + sels[i].colCount -1; col++){
|
|
|
+ if(cantNullStr.indexOf(me.setting.header[col].headerName) !== -1){
|
|
|
+ text += me.setting.header[col].headerName + " ";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $('#alertText').text(text + "不可为空!");
|
|
|
+ $('#codeAlertBtn').click();
|
|
|
+ sheet.options.isProtected = true;
|
|
|
+ $('#codAleConfBtn').click(function () {
|
|
|
+ sheetCommonObj.lockSomeCodes(sheet, 0, cacheSection.length);
|
|
|
+ });
|
|
|
+ $('#codAleClose').click(function () {
|
|
|
+ sheetCommonObj.lockSomeCodes(sheet, 0, cacheSection.length);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //提取已被引用工料机
|
|
|
+ if(tempRemoveArr.length > 0){
|
|
|
+ for(let i = 0; i < tempRemoveArr.length; i++){
|
|
|
+ if(me.rationGljIds.indexOf(tempRemoveArr[i].ID) !== -1){
|
|
|
+ refGljCodes.push(tempRemoveArr[i].code);
|
|
|
+ tempRemoveArr.splice(i--, 1);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ removeArr.push(tempRemoveArr[i].ID);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //提示
|
|
|
+ if(refGljCodes.length > 0){
|
|
|
+ let alertText;
|
|
|
+ if(refGljCodes.length > 3){
|
|
|
+ alertText = "编号: " + refGljCodes[0]+" 、" + refGljCodes[1] + " 、" + refGljCodes[2] + "...等工料机已有定额引用,删除失败!";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ let alertCode = " ";
|
|
|
+ for(let i=0; i< refGljCodes.length; i++){
|
|
|
+ alertCode += refGljCodes[i] + " 、";
|
|
|
+ }
|
|
|
+ alertText = "编号:" + alertCode + "工料机已有定额引用,删除失败!"
|
|
|
+ }
|
|
|
+ $('#alertText').text(alertText);
|
|
|
+ $('#codeAlertBtn').click();
|
|
|
+ sheet.options.isProtected = true;
|
|
|
+ $('#codAleConfBtn').click(function () {
|
|
|
+ sheetCommonObj.lockSomeCodes(sheet, 0, cacheSection.length);
|
|
|
+ if(removeArr.length > 0){
|
|
|
+ me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#codAleClose').click(function () {
|
|
|
+ sheetCommonObj.lockSomeCodes(sheet, 0, cacheSection.length);
|
|
|
+ me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else if(removeArr.length > 0 || updateArr.length > 0){
|
|
|
+ me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
+ if(updateBasePrcArr.length > 0){
|
|
|
+ me.updateRationBasePrcRq(updateBasePrcArr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
me.workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.del, false, false, false, false);
|
|
|
me.workBook.commandManager().setShortcutKey('repositoryGljDel', GC.Spread.Commands.Key.del, false, false, false, false);
|
|
|
- },
|
|
|
- onRangeChanged: function(sender, args) {
|
|
|
- if (args.action == GC.Spread.Sheets.RangeChangedAction.clear) {
|
|
|
- var me = repositoryGljObj, updateArr = [], removeArr = [], cancelArr = [], isMisCode = true;
|
|
|
- var cacheSection = me.currentCache;
|
|
|
- if (cacheSection) {
|
|
|
- for (var i = 0; i < args.rowCount; i++) {
|
|
|
- let rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row + i),
|
|
|
- isEmpty = sheetCommonObj.chkIfEmpty(rObj, me.setting);
|
|
|
- if(isEmpty){
|
|
|
- if(args.row + i < cacheSection.length){
|
|
|
- rObj.ID = cacheSection[args.row + i].ID
|
|
|
- removeArr.push(rObj.ID);
|
|
|
- }
|
|
|
- }
|
|
|
- else {
|
|
|
- if(!rObj.code){
|
|
|
- cancelArr.push(args.row + i);
|
|
|
- }
|
|
|
- else if(!rObj.gljType){
|
|
|
- isMisCode = false;
|
|
|
- cancelArr.push(args.row + i);
|
|
|
- }
|
|
|
- else{
|
|
|
- rObj.gljClass = me.gljCurTypeId;
|
|
|
- updateArr.push(rObj);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //reshow datas
|
|
|
- function resetDatas(args, repositoryGljObj, cancelArr){
|
|
|
- args.sheet.options.isProtected = false;
|
|
|
- args.sheet.suspendPaint();
|
|
|
- for(let i =0; i <cancelArr.length; i++){
|
|
|
- for(let col =args.col; col< repositoryGljObj.setting.header.length; col++){
|
|
|
- let value = repositoryGljObj.setting.header[col].dataCode === 'gljType' ?
|
|
|
- repositoryGljObj.distTypeTree.distTypes[repositoryGljObj.distTypeTree.prefix + cacheSection[cancelArr[i]].gljType].data.fullName :
|
|
|
- cacheSection[cancelArr[i]][repositoryGljObj.setting.header[col].dataCode];
|
|
|
- args.sheet.setValue(args.row + i, col, value);
|
|
|
- }
|
|
|
- }
|
|
|
- args.sheet.resumePaint();
|
|
|
- args.sheet.setActiveCell(args.row, 0);
|
|
|
- }
|
|
|
- if(cancelArr.length > 0){
|
|
|
- let text = isMisCode === true ? "编号不可为空,编辑失败!": "类型不可为空,编辑失败!"
|
|
|
- $('#alertText').text(text);
|
|
|
- $('#codeAlertBtn').click();
|
|
|
- args.sheet.options.isProtected = true;
|
|
|
- $('#codAleConfBtn').click(function () {
|
|
|
- resetDatas(args, me, cancelArr);
|
|
|
- });
|
|
|
- $('#codAleClose').click(function () {
|
|
|
- resetDatas(args, me, cancelArr);
|
|
|
- });
|
|
|
- }
|
|
|
- let refGljIds = [], refGljCodes = [], alertText;
|
|
|
- if(removeArr.length > 0){
|
|
|
- for(let i =0; i <removeArr.length; i++){
|
|
|
- if(me.rationGljIds.indexOf(removeArr[i]) !== -1){
|
|
|
- refGljIds.push(removeArr[i]);
|
|
|
- removeArr.splice(i--, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- for(let i =0; i< me.currentCache.length; i++){
|
|
|
- for(let j=0; j< refGljIds.length; j++){
|
|
|
- if(me.currentCache[i].ID === refGljIds[j]){
|
|
|
- refGljCodes.push(me.currentCache[i].code);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if(refGljIds.length > 0){
|
|
|
- if(refGljCodes.length > 3){
|
|
|
- alertText = "编号:" + refGljCodes[0]+" " + refGljCodes[1] + " " + refGljCodes[2] + "...等工料机已有定额引用,删除失败!";
|
|
|
- }
|
|
|
- else {
|
|
|
- let alertCode = " ";
|
|
|
- for(let i=0; i< refGljCodes.length; i++){
|
|
|
- alertCode += refGljCodes[i] + " ";
|
|
|
- }
|
|
|
- alertText = "编号:" + alertCode + "工料机已有定额引用,删除失败!"
|
|
|
- }
|
|
|
- $('#alertText').text(alertText);
|
|
|
- $('#codeAlertBtn').click();
|
|
|
- args.sheet.options.isProtected = true;
|
|
|
- $('#codAleConfBtn').click(function () {
|
|
|
- if(removeArr.length > 0){
|
|
|
- me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
- }
|
|
|
- else{
|
|
|
- let resetArr = [];
|
|
|
- for(let i=0; i<args.rowCount; i++){
|
|
|
- resetArr.push(args.row + i);
|
|
|
- }
|
|
|
- resetDatas(args, me, resetArr);
|
|
|
- }
|
|
|
- });
|
|
|
- $('#codAleClose').click(function () {
|
|
|
- if(removeArr.length > 0){
|
|
|
- me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
- }
|
|
|
- else{
|
|
|
- let resetArr = [];
|
|
|
- for(let i=0; i<args.rowCount; i++){
|
|
|
- resetArr.push(args.row + i);
|
|
|
- }
|
|
|
- resetDatas(args, me, resetArr);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- else if(refGljIds.length === 0 && removeArr.length > 0){
|
|
|
- me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
- }
|
|
|
- if(updateArr.length > 0){
|
|
|
- me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- validUpdateObj: function (pasteObj, rowIdx) {
|
|
|
- let rst = {}, backUpObj = {},
|
|
|
- me = repositoryGljObj,
|
|
|
- tempObj = me.currentCache[rowIdx],
|
|
|
- reCalBasePrc = false, isValid = true;
|
|
|
- //备份原始数据
|
|
|
- for(let atr in tempObj){
|
|
|
- backUpObj[atr] = tempObj[atr];
|
|
|
- }
|
|
|
- if(typeof pasteObj.code !== 'undefined'){
|
|
|
- if(pasteObj.code.trim().length !== 0){
|
|
|
- let isExist = false;
|
|
|
- for(let i = 0; i < me.gljList.length; i++){
|
|
|
- if(me.gljList[i].code === pasteObj.code){
|
|
|
- isExist = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if(!isExist){
|
|
|
- tempObj.code = pasteObj.code;
|
|
|
- }
|
|
|
- else isValid = false;
|
|
|
- }
|
|
|
- else isValid = false;
|
|
|
- }
|
|
|
- if(typeof pasteObj.name !== 'undefined'){
|
|
|
- if(pasteObj.name.trim().length === 0) isValid = false;
|
|
|
- else tempObj.name = pasteObj.name;
|
|
|
- }
|
|
|
- if(typeof pasteObj.specs !== 'undefined'){
|
|
|
- tempObj.specs = pasteObj.specs;
|
|
|
- }
|
|
|
- if(typeof pasteObj.unit !== 'undefined'){
|
|
|
- tempObj.unit = pasteObj.unit;
|
|
|
- }
|
|
|
- if(typeof pasteObj.gljType !== 'undefined'){
|
|
|
- let isExsit = false;
|
|
|
- for(let i = 0; i < me.distTypeTree.comboDatas.length; i++){
|
|
|
- if(pasteObj.gljType === me.distTypeTree.comboDatas[i].text){
|
|
|
- isExsit = true;
|
|
|
- reCalBasePrc = true;
|
|
|
- tempObj.gljType = me.distTypeTree.comboDatas[i].value;
|
|
|
- tempObj.shortName = me.distTypeTree.distTypes[me.distTypeTree.prefix + tempObj.gljType].data.shortName;
|
|
|
+ },
|
|
|
+ onRangeChanged: function(sender, args) {
|
|
|
+ if (args.action == GC.Spread.Sheets.RangeChangedAction.clear) {
|
|
|
+ var me = repositoryGljObj, updateArr = [], removeArr = [], cancelArr = [], isMisCode = true;
|
|
|
+ var cacheSection = me.currentCache;
|
|
|
+ if (cacheSection) {
|
|
|
+ for (var i = 0; i < args.rowCount; i++) {
|
|
|
+ let rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row + i),
|
|
|
+ isEmpty = sheetCommonObj.chkIfEmpty(rObj, me.setting);
|
|
|
+ if(isEmpty){
|
|
|
+ if(args.row + i < cacheSection.length){
|
|
|
+ rObj.ID = cacheSection[args.row + i].ID
|
|
|
+ removeArr.push(rObj.ID);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if(!rObj.code){
|
|
|
+ cancelArr.push(args.row + i);
|
|
|
+ }
|
|
|
+ else if(!rObj.gljType){
|
|
|
+ isMisCode = false;
|
|
|
+ cancelArr.push(args.row + i);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ rObj.gljClass = me.gljCurTypeId;
|
|
|
+ updateArr.push(rObj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //reshow datas
|
|
|
+ function resetDatas(args, repositoryGljObj, cancelArr){
|
|
|
+ args.sheet.options.isProtected = false;
|
|
|
+ args.sheet.suspendPaint();
|
|
|
+ for(let i =0; i <cancelArr.length; i++){
|
|
|
+ for(let col =args.col; col< repositoryGljObj.setting.header.length; col++){
|
|
|
+ let value = repositoryGljObj.setting.header[col].dataCode === 'gljType' ?
|
|
|
+ repositoryGljObj.distTypeTree.distTypes[repositoryGljObj.distTypeTree.prefix + cacheSection[cancelArr[i]].gljType].data.fullName :
|
|
|
+ cacheSection[cancelArr[i]][repositoryGljObj.setting.header[col].dataCode];
|
|
|
+ args.sheet.setValue(args.row + i, col, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ args.sheet.resumePaint();
|
|
|
+ args.sheet.setActiveCell(args.row, 0);
|
|
|
+ }
|
|
|
+ if(cancelArr.length > 0){
|
|
|
+ let text = isMisCode === true ? "编号不可为空,编辑失败!": "类型不可为空,编辑失败!"
|
|
|
+ $('#alertText').text(text);
|
|
|
+ $('#codeAlertBtn').click();
|
|
|
+ args.sheet.options.isProtected = true;
|
|
|
+ $('#codAleConfBtn').click(function () {
|
|
|
+ resetDatas(args, me, cancelArr);
|
|
|
+ });
|
|
|
+ $('#codAleClose').click(function () {
|
|
|
+ resetDatas(args, me, cancelArr);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ let refGljIds = [], refGljCodes = [], alertText;
|
|
|
+ if(removeArr.length > 0){
|
|
|
+ for(let i =0; i <removeArr.length; i++){
|
|
|
+ if(me.rationGljIds.indexOf(removeArr[i]) !== -1){
|
|
|
+ refGljIds.push(removeArr[i]);
|
|
|
+ removeArr.splice(i--, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for(let i =0; i< me.currentCache.length; i++){
|
|
|
+ for(let j=0; j< refGljIds.length; j++){
|
|
|
+ if(me.currentCache[i].ID === refGljIds[j]){
|
|
|
+ refGljCodes.push(me.currentCache[i].code);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(refGljIds.length > 0){
|
|
|
+ if(refGljCodes.length > 3){
|
|
|
+ alertText = "编号:" + refGljCodes[0]+" " + refGljCodes[1] + " " + refGljCodes[2] + "...等工料机已有定额引用,删除失败!";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ let alertCode = " ";
|
|
|
+ for(let i=0; i< refGljCodes.length; i++){
|
|
|
+ alertCode += refGljCodes[i] + " ";
|
|
|
+ }
|
|
|
+ alertText = "编号:" + alertCode + "工料机已有定额引用,删除失败!"
|
|
|
+ }
|
|
|
+ $('#alertText').text(alertText);
|
|
|
+ $('#codeAlertBtn').click();
|
|
|
+ args.sheet.options.isProtected = true;
|
|
|
+ $('#codAleConfBtn').click(function () {
|
|
|
+ if(removeArr.length > 0){
|
|
|
+ me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ let resetArr = [];
|
|
|
+ for(let i=0; i<args.rowCount; i++){
|
|
|
+ resetArr.push(args.row + i);
|
|
|
+ }
|
|
|
+ resetDatas(args, me, resetArr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#codAleClose').click(function () {
|
|
|
+ if(removeArr.length > 0){
|
|
|
+ me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ let resetArr = [];
|
|
|
+ for(let i=0; i<args.rowCount; i++){
|
|
|
+ resetArr.push(args.row + i);
|
|
|
+ }
|
|
|
+ resetDatas(args, me, resetArr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else if(refGljIds.length === 0 && removeArr.length > 0){
|
|
|
+ me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
+ }
|
|
|
+ if(updateArr.length > 0){
|
|
|
+ me.mixUpdateRequest(updateArr, [], removeArr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ validUpdateObj: function (pasteObj, rowIdx) {
|
|
|
+ let rst = {}, backUpObj = {},
|
|
|
+ me = repositoryGljObj,
|
|
|
+ tempObj = me.currentCache[rowIdx],
|
|
|
+ reCalBasePrc = false, isValid = true;
|
|
|
+ //备份原始数据
|
|
|
+ for(let atr in tempObj){
|
|
|
+ backUpObj[atr] = tempObj[atr];
|
|
|
+ }
|
|
|
+ if(typeof pasteObj.code !== 'undefined'){
|
|
|
+ if(pasteObj.code.trim().length !== 0){
|
|
|
+ let isExist = false;
|
|
|
+ for(let i = 0; i < me.gljList.length; i++){
|
|
|
+ if(me.gljList[i].code === pasteObj.code){
|
|
|
+ isExist = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!isExist){
|
|
|
+ tempObj.code = pasteObj.code;
|
|
|
+ }
|
|
|
+ else isValid = false;
|
|
|
+ }
|
|
|
+ else isValid = false;
|
|
|
+ }
|
|
|
+ if(typeof pasteObj.name !== 'undefined'){
|
|
|
+ if(pasteObj.name.trim().length === 0) isValid = false;
|
|
|
+ else tempObj.name = pasteObj.name;
|
|
|
+ }
|
|
|
+ if(typeof pasteObj.specs !== 'undefined'){
|
|
|
+ tempObj.specs = pasteObj.specs;
|
|
|
+ }
|
|
|
+ if(typeof pasteObj.unit !== 'undefined'){
|
|
|
+ tempObj.unit = pasteObj.unit;
|
|
|
+ }
|
|
|
+ if(typeof pasteObj.gljType !== 'undefined'){
|
|
|
+ let isExsit = false;
|
|
|
+ for(let i = 0; i < me.distTypeTree.comboDatas.length; i++){
|
|
|
+ if(pasteObj.gljType === me.distTypeTree.comboDatas[i].text){
|
|
|
+ isExsit = true;
|
|
|
+ reCalBasePrc = true;
|
|
|
+ tempObj.gljType = me.distTypeTree.comboDatas[i].value;
|
|
|
+ tempObj.shortName = me.distTypeTree.distTypes[me.distTypeTree.prefix + tempObj.gljType].data.shortName;
|
|
|
|
|
|
- }
|
|
|
- }
|
|
|
- if(!isExsit) isValid = false;
|
|
|
- }
|
|
|
- //
|
|
|
- pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) :
|
|
|
- me.currentCache[rowIdx].basePrice;
|
|
|
- if(pasteObj.basePrice !== me.currentCache[rowIdx].basePrice){
|
|
|
- reCalBasePrc = true;
|
|
|
- tempObj.basePrice = pasteObj.basePrice;
|
|
|
- }
|
|
|
- if(isValid){
|
|
|
- rst.updateGlj = tempObj;
|
|
|
- if(reCalBasePrc){
|
|
|
- //重新计算定额基价对象
|
|
|
- rst.updateBasePrc = {gljId: tempObj.ID, gljType: tempObj.gljType, basePrice: tempObj.basePrice};
|
|
|
- }
|
|
|
- }
|
|
|
- else {
|
|
|
- for(let attr in backUpObj){
|
|
|
- tempObj[attr] = backUpObj[attr];
|
|
|
- }
|
|
|
- }
|
|
|
- return rst;
|
|
|
- },
|
|
|
- //粘贴的数据是否是可添加的数据,只有含有编号,名称,类型才可添加
|
|
|
- isValidObj: function(pasteObj) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!isExsit) isValid = false;
|
|
|
+ }
|
|
|
+ //
|
|
|
+ pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) :
|
|
|
+ me.currentCache[rowIdx].basePrice;
|
|
|
+ if(pasteObj.basePrice !== me.currentCache[rowIdx].basePrice){
|
|
|
+ reCalBasePrc = true;
|
|
|
+ tempObj.basePrice = pasteObj.basePrice;
|
|
|
+ }
|
|
|
+ if(isValid){
|
|
|
+ rst.updateGlj = tempObj;
|
|
|
+ if(reCalBasePrc){
|
|
|
+ //重新计算定额基价对象
|
|
|
+ rst.updateBasePrc = {gljId: tempObj.ID, gljType: tempObj.gljType, basePrice: tempObj.basePrice};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ for(let attr in backUpObj){
|
|
|
+ tempObj[attr] = backUpObj[attr];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
+ //粘贴的数据是否是可添加的数据,只有含有编号,名称,类型才可添加
|
|
|
+ isValidObj: function(pasteObj) {
|
|
|
let me = repositoryGljObj;
|
|
|
- if(!(pasteObj.code && typeof pasteObj.code !== 'undefined') || !(pasteObj.name && typeof pasteObj.name !== 'undefined') ||
|
|
|
- !(pasteObj.gljType && typeof pasteObj.gljType !== 'undefined')){
|
|
|
- return false;
|
|
|
- }
|
|
|
- if(pasteObj.gljType && typeof pasteObj.gljType !== 'undefined'){
|
|
|
- let isExist = false;
|
|
|
- for(let i = 0; i < me.distTypeTree.comboDatas.length; i++){
|
|
|
- if(me.distTypeTree.comboDatas[i].text === pasteObj.gljType){
|
|
|
- isExist = true;
|
|
|
- pasteObj.gljType = me.distTypeTree.comboDatas[i].value;
|
|
|
- pasteObj.shortName = me.distTypeTree.distTypes[me.distTypeTree.prefix + pasteObj.gljType].data.shortName;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if(!isExist){
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- if(pasteObj.code && typeof pasteObj.code !== 'undefined'){
|
|
|
+ if(!(pasteObj.code && typeof pasteObj.code !== 'undefined') || !(pasteObj.name && typeof pasteObj.name !== 'undefined') ||
|
|
|
+ !(pasteObj.gljType && typeof pasteObj.gljType !== 'undefined')){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(pasteObj.gljType && typeof pasteObj.gljType !== 'undefined'){
|
|
|
+ let isExist = false;
|
|
|
+ for(let i = 0; i < me.distTypeTree.comboDatas.length; i++){
|
|
|
+ if(me.distTypeTree.comboDatas[i].text === pasteObj.gljType){
|
|
|
+ isExist = true;
|
|
|
+ pasteObj.gljType = me.distTypeTree.comboDatas[i].value;
|
|
|
+ pasteObj.shortName = me.distTypeTree.distTypes[me.distTypeTree.prefix + pasteObj.gljType].data.shortName;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!isExist){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(pasteObj.code && typeof pasteObj.code !== 'undefined'){
|
|
|
for(let i = 0; i < me.gljList.length; i++){
|
|
|
if(me.gljList[i].code === pasteObj.code){
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) : 0;
|
|
|
- pasteObj.gljClass = me.gljCurTypeId;
|
|
|
- return true;
|
|
|
- },
|
|
|
- onClipboardPasting: function(sender, args) {
|
|
|
- var me = repositoryGljObj;
|
|
|
- /*if (args.cellRange.colCount != me.setting.header.length || me.gljCurTypeId < 0 || me.parentNodeIds["_pNodeId_" + me.gljCurTypeId]) {
|
|
|
- args.cancel = true;
|
|
|
- }*/
|
|
|
- if (me.gljCurTypeId < 0 ) {
|
|
|
- args.cancel = true;
|
|
|
- }
|
|
|
- },
|
|
|
+ }
|
|
|
+ pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) : 0;
|
|
|
+ pasteObj.gljClass = me.gljCurTypeId;
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+ onClipboardPasting: function(sender, args) {
|
|
|
+ var me = repositoryGljObj;
|
|
|
+ /*if (args.cellRange.colCount != me.setting.header.length || me.gljCurTypeId < 0 || me.parentNodeIds["_pNodeId_" + me.gljCurTypeId]) {
|
|
|
+ args.cancel = true;
|
|
|
+ }*/
|
|
|
+ if (me.gljCurTypeId < 0 ) {
|
|
|
+ args.cancel = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
onClipboardPasted: function(e, info) {
|
|
|
var me = repositoryGljObj;
|
|
|
var updateArr = [], addArr = [];
|
|
@@ -787,10 +787,10 @@ var pageOprObj = {
|
|
|
info.sheet.resumePaint();
|
|
|
}
|
|
|
if (updateArr.length > 0 || addArr.length > 0) {
|
|
|
- me.mixUpdateRequest(updateArr, addArr, []);
|
|
|
+ me.mixUpdateRequest(updateArr, addArr, []);
|
|
|
}
|
|
|
if(updateBasePrcArr.length > 0){
|
|
|
- me.updateRationBasePrcRq(updateBasePrcArr);
|
|
|
+ me.updateRationBasePrcRq(updateBasePrcArr);
|
|
|
}
|
|
|
},
|
|
|
updateRationBasePrcRq: function (basePrcArr) {
|
|
@@ -819,7 +819,7 @@ var pageOprObj = {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- },
|
|
|
+ },
|
|
|
mixUpdateRequest: function(updateArr, addArr, removeIds) {
|
|
|
var me = repositoryGljObj;
|
|
|
$.ajax({
|
|
@@ -853,21 +853,21 @@ var pageOprObj = {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getParentCache: function (nodes) {
|
|
|
+ getParentCache: function (nodes) {
|
|
|
let me = repositoryGljObj, rst = [];
|
|
|
for(let i = 0; i < me.gljList.length; i++){
|
|
|
if(nodes.indexOf(me.gljList[i].gljClass) !== -1){
|
|
|
rst.push(me.gljList[i]);
|
|
|
}
|
|
|
}
|
|
|
- rst.sort(function (a, b) {
|
|
|
- let rst = 0;
|
|
|
- if(a.code > b.code) rst = 1;
|
|
|
- else if(a.code < b.code)rst = -1;
|
|
|
- return rst;
|
|
|
- });
|
|
|
- return rst;
|
|
|
- },
|
|
|
+ rst.sort(function (a, b) {
|
|
|
+ let rst = 0;
|
|
|
+ if(a.code > b.code) rst = 1;
|
|
|
+ else if(a.code < b.code)rst = -1;
|
|
|
+ return rst;
|
|
|
+ });
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
getCache: function() {
|
|
|
var me = this, rst = [];
|
|
|
for (var i = 0; i < me.gljList.length; i++) {
|