|
@@ -1861,14 +1861,18 @@ $(document).ready(function() {
|
|
|
insertData.batchType = (select.code && select.code !== '') ? 'child' : 'next';
|
|
|
insertData.id = ledgerTree.getNodeKey(select);
|
|
|
insertData.batchData = self.getBatchData();
|
|
|
- postData(window.location.pathname + '/update', {postType: 'batch-insert', postData: insertData}, function (data) {
|
|
|
- pos.updateDatas(data.pos);
|
|
|
- const result = ledgerTree.loadPostData(data.ledger);
|
|
|
- treeOperationObj.refreshTree(sheet, result);
|
|
|
- sheet.setSelection(result.create[0].index, sel.col, sel.rowCount, sel.colCount);
|
|
|
- treeOperationObj.refreshOperationValid(sheet);
|
|
|
+ if (insertData.batchData.length > 0) {
|
|
|
+ postData(window.location.pathname + '/update', {postType: 'batch-insert', postData: insertData}, function (data) {
|
|
|
+ pos.updateDatas(data.pos);
|
|
|
+ const result = ledgerTree.loadPostData(data.ledger);
|
|
|
+ treeOperationObj.refreshTree(sheet, result);
|
|
|
+ sheet.setSelection(result.create[0].index, sel.col, sel.rowCount, sel.colCount);
|
|
|
+ treeOperationObj.refreshOperationValid(sheet);
|
|
|
+ self.obj.modal('hide');
|
|
|
+ }, null, true);
|
|
|
+ } else {
|
|
|
self.obj.modal('hide');
|
|
|
- }, null, true);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|