|
@@ -1726,13 +1726,20 @@ $(document).ready(() => {
|
|
|
insertData.id = select[billsTree.setting.id];
|
|
|
insertData.batchData = self.getBatchData();
|
|
|
|
|
|
- postData(window.location.pathname + '/update', {postType: 'batch-insert', postData: insertData}, function (data) {
|
|
|
- pos.updateDatas(data.pos);
|
|
|
- const result = billsTree.loadPostData(data.ledger);
|
|
|
- billsTreeSpreadObj.refreshTree(billsSheet, result);
|
|
|
- billsTreeSpreadObj.refreshOperationValid(billsSheet, selection);
|
|
|
+ if (insertData.batchData.length > 0) {
|
|
|
+ postData(window.location.pathname + '/update', {
|
|
|
+ postType: 'batch-insert',
|
|
|
+ postData: insertData
|
|
|
+ }, function (data) {
|
|
|
+ pos.updateDatas(data.pos);
|
|
|
+ const result = billsTree.loadPostData(data.ledger);
|
|
|
+ billsTreeSpreadObj.refreshTree(billsSheet, result);
|
|
|
+ billsTreeSpreadObj.refreshOperationValid(billsSheet, selection);
|
|
|
+ self.obj.modal('hide');
|
|
|
+ }, null, true);
|
|
|
+ } else {
|
|
|
self.obj.modal('hide');
|
|
|
- }, null, true);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
$('input[name=batch-filter]').change(function () {
|