Browse Source

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

TonyKang 5 years atrás
parent
commit
50629c31e6
2 changed files with 15 additions and 8 deletions
  1. 13 6
      app/public/js/revise.js
  2. 2 2
      app/service/revise_bills.js

+ 13 - 6
app/public/js/revise.js

@@ -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 () {

+ 2 - 2
app/service/revise_bills.js

@@ -93,7 +93,7 @@ module.exports = app => {
                     const inP = {
                         id: this.uuid.v4(), tid: tid, lid: qd.id, crid: rid,
                         add_stage: 0, add_times: 0, add_user: this.ctx.session.sessionUser.accountId,
-                        name: p.name, drawing_code: p.drawing_code,
+                        name: p.name, drawing_code: p.drawing_code, porder: p.porder,
                     };
                     if (p.quantity) {
                         inP.sgfh_qty = this.round(p.quantity, precision.value);
@@ -194,7 +194,7 @@ module.exports = app => {
                     const inP = {
                         id: this.uuid.v4(), tid: tid, lid: qd.id, crid: rid,
                         add_stage: 0, add_times: 0, add_user: this.ctx.session.sessionUser.accountId,
-                        name: p.name, drawing_code: p.drawing_code,
+                        name: p.name, drawing_code: p.drawing_code, porder: p.porder,
                     };
                     if (p.quantity) {
                         inP.sgfh_qty = this.round(p.quantity, precision.value);