|
@@ -565,6 +565,7 @@ $(document).ready(() => {
|
|
|
count: type === 'add' ? addCount : count,
|
|
|
}
|
|
|
}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshData = tree.loadPostData(result);
|
|
|
self.refreshTree(sheet, refreshData);
|
|
|
const sel = sheet.getSelections()[0];
|
|
@@ -583,6 +584,7 @@ $(document).ready(() => {
|
|
|
count: type === 'add' ? addCount : count,
|
|
|
}
|
|
|
}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshData = tree.loadPostData(result);
|
|
|
self.refreshTree(sheet, refreshData);
|
|
|
if (['up-move', 'down-move'].indexOf(type) > -1) {
|
|
@@ -783,6 +785,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
// 更新至服务器
|
|
|
postData(window.location.pathname + '/update', {postType: 'update', postData: data}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshNode = billsTree.loadPostData(result);
|
|
|
billsTreeSpreadObj.refreshTree(info.sheet, refreshNode);
|
|
|
});
|
|
@@ -921,6 +924,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
if (datas.length > 0) {
|
|
|
postData(window.location.pathname + '/update', {postType: 'update', postData: datas}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshNode = tree.loadPostData(result);
|
|
|
if (refreshNode.update) {
|
|
|
refreshNode.update = refreshNode.update.concat(filterNodes);
|
|
@@ -1017,6 +1021,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
if (datas.length > 0) {
|
|
|
postData(window.location.pathname + '/update', {postType: 'update', postData: datas}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshNode = tree.loadPostData(result);
|
|
|
if (refreshNode.update) {
|
|
|
refreshNode.update = refreshNode.update.concat(filterNodes);
|
|
@@ -1058,6 +1063,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
if (datas.length > 0) {
|
|
|
postData(window.location.pathname + '/update', {postType: 'update', postData: datas}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshNode = sheet.zh_tree.loadPostData(result);
|
|
|
billsTreeSpreadObj.refreshTree(sheet, refreshNode);
|
|
|
billsTreeSpreadObj.loadExprToInput(sheet);
|
|
@@ -1081,6 +1087,7 @@ $(document).ready(() => {
|
|
|
block: copyInfo.block,
|
|
|
}
|
|
|
}, function (data) {
|
|
|
+ changeList = data.changeList;
|
|
|
pos.updateDatas(data.pos);
|
|
|
const result = tree.loadPostData(data.ledger);
|
|
|
self.refreshTree(sheet, result);
|
|
@@ -1176,6 +1183,7 @@ $(document).ready(() => {
|
|
|
if (datas.length > 0) {
|
|
|
callback();
|
|
|
postData(window.location.pathname + '/update', {postType: 'update', postData: datas}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshNode = sheet.zh_tree.loadPostData(result);
|
|
|
billsTreeSpreadObj.refreshTree(sheet, refreshNode);
|
|
|
});
|
|
@@ -1207,6 +1215,7 @@ $(document).ready(() => {
|
|
|
recursiveSortCode(data, select.code, select.children);
|
|
|
if (data.length > 0) {
|
|
|
postData(window.location.pathname + '/update', {postType: 'update', postData: data}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshNode = tree.loadPostData(result);
|
|
|
billsTreeSpreadObj.refreshTree(sheet, refreshNode);
|
|
|
})
|
|
@@ -1273,6 +1282,7 @@ $(document).ready(() => {
|
|
|
|
|
|
// 更新至服务器
|
|
|
postData(window.location.pathname + '/update', {postType: 'update', postData: data}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshNode = billsTree.loadPostData(result);
|
|
|
billsTreeSpreadObj.refreshTree(billsSheet, refreshNode);
|
|
|
});
|
|
@@ -1721,6 +1731,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
if (data.postData.length > 0) {
|
|
|
postData(window.location.pathname + '/update', data, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
if (type === 'delete') {
|
|
|
pos.removeDatas(result.pos);
|
|
|
sheet.deleteRows(row, count);
|
|
@@ -1960,6 +1971,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
}
|
|
|
postData(window.location.pathname + '/update', data, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const updateRst = pos.updateDatas(result.pos);
|
|
|
// 刷新当前行, 不适用于新增(在非下一空白行新增)
|
|
|
if (updateRst.create.length > 0) {
|
|
@@ -1968,6 +1980,15 @@ $(document).ready(() => {
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
}
|
|
|
const loadResult = billsTree.loadPostData(result.ledger);
|
|
|
+ // 判断是否只剩一个,并同步去勾
|
|
|
+ const billsNode = SpreadJsObj.getSelectObject(billsSheet);
|
|
|
+ billsNode.is_change = _.findIndex(changeList, { gcl_id: billsNode.id }) > -1 ? 1 : 0;
|
|
|
+ if (loadResult.update) {
|
|
|
+ const r = _.find(loadResult.update, { id: billsNode.id });
|
|
|
+ r.is_change = billsNode.is_change;
|
|
|
+ } else {
|
|
|
+ loadResult.update = [billsNode];
|
|
|
+ }
|
|
|
billsTreeSpreadObj.refreshTree(billsSheet, loadResult);
|
|
|
billsTreeSpreadObj.refreshOperationValid(billsSheet);
|
|
|
}, function () {
|
|
@@ -2019,6 +2040,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
if (datas.length > 0) {
|
|
|
postData(window.location.pathname + '/update', {postType: 'pos', posPostType: 'update', postData: datas}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
pos.updateDatas(result.pos);
|
|
|
posSpreadObj.loadCurPosData();
|
|
|
const loadResult = billsTree.loadPostData(result.ledger);
|
|
@@ -2058,9 +2080,19 @@ $(document).ready(() => {
|
|
|
}
|
|
|
if (data.postData.length > 0) {
|
|
|
postData(window.location.pathname + '/update', data, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
pos.removeDatas(result.pos);
|
|
|
sheet.deleteRows(row, count);
|
|
|
const loadResult = billsTree.loadPostData(result.ledger);
|
|
|
+ // 判断是否只剩一个,并同步去勾
|
|
|
+ const billsNode = SpreadJsObj.getSelectObject(billsSheet);
|
|
|
+ billsNode.is_change = _.findIndex(changeList, { gcl_id: billsNode.id }) > -1 ? 1 : 0;
|
|
|
+ if (loadResult.update) {
|
|
|
+ const r = _.find(loadResult.update, { id: billsNode.id });
|
|
|
+ r.is_change = billsNode.is_change;
|
|
|
+ } else {
|
|
|
+ loadResult.update = [billsNode];
|
|
|
+ }
|
|
|
billsTreeSpreadObj.refreshTree(billsSheet, loadResult);
|
|
|
billsTreeSpreadObj.refreshOperationValid(billsSheet);
|
|
|
});
|
|
@@ -2170,6 +2202,7 @@ $(document).ready(() => {
|
|
|
return;
|
|
|
}
|
|
|
postData(window.location.pathname + '/update', {postType: 'pos', posPostType: 'paste', postData: data}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
pos.updateDatas(result.pos);
|
|
|
posSpreadObj.loadCurPosData();
|
|
|
const loadResult = billsTree.loadPostData(result.ledger);
|
|
@@ -2195,6 +2228,7 @@ $(document).ready(() => {
|
|
|
pegs.forEach(function (p) {p.porder = ++order; p.lid = node.id});
|
|
|
|
|
|
postData(window.location.pathname + '/update', {postType: 'pos', posPostType: 'paste', postData: pegs}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
pos.updateDatas(result.pos);
|
|
|
posSpreadObj.loadCurPosData();
|
|
|
billsTreeSpreadObj.refreshOperationValid(billsSheet);
|
|
@@ -2240,6 +2274,7 @@ $(document).ready(() => {
|
|
|
|
|
|
// 更新至服务器
|
|
|
postData(window.location.pathname + '/update', {postType: 'pos', posPostType: 'update', postData: data}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const updateRst = pos.updateDatas(result.pos);
|
|
|
// 刷新当前行, 不适用于新增(在非下一空白行新增)
|
|
|
SpreadJsObj.reLoadRowData(posSheet, row);
|
|
@@ -2378,6 +2413,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
},
|
|
|
}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshData = mainTree.loadPostData(result);
|
|
|
billsTreeSpreadObj.refreshTree(mainSheet, refreshData);
|
|
|
const sel = mainSheet.getSelections()[0];
|
|
@@ -2575,6 +2611,7 @@ $(document).ready(() => {
|
|
|
postType: 'batch-insert',
|
|
|
postData: insertData
|
|
|
}, function (data) {
|
|
|
+ changeList = result.changeList;
|
|
|
pos.updateDatas(data.pos);
|
|
|
const result = billsTree.loadPostData(data.ledger);
|
|
|
billsTreeSpreadObj.refreshTree(billsSheet, result);
|
|
@@ -2787,6 +2824,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
},
|
|
|
}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshData = mainTree.loadPostData(result);
|
|
|
billsTreeSpreadObj.refreshTree(mainSheet, refreshData);
|
|
|
const sel = mainSheet.getSelections()[0];
|
|
@@ -3012,6 +3050,7 @@ $(document).ready(() => {
|
|
|
dealBills: oneBills,
|
|
|
},
|
|
|
}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshData = mainTree.loadPostData(result);
|
|
|
billsTreeSpreadObj.refreshTree(mainSheet, refreshData);
|
|
|
const sel = mainSheet.getSelections()[0];
|
|
@@ -3322,6 +3361,7 @@ $(document).ready(() => {
|
|
|
stdNode: stdTree.getNodeKey(stdNode)
|
|
|
}
|
|
|
}, function (result) {
|
|
|
+ changeList = result.changeList;
|
|
|
const refreshNode = mainTree.loadPostData(result);
|
|
|
billsTreeSpreadObj.refreshTree(mainSheet, refreshNode);
|
|
|
if (sel) {
|