Bläddra i källkod

结算台账、结算汇总,查找定位

MaiXinRong 4 dagar sedan
förälder
incheckning
a7748963c1

+ 2 - 2
app/controller/settle_controller.js

@@ -624,8 +624,8 @@ module.exports = app => {
         async loadGatherData(ctx) {
             try {
                 const settle = await this.ctx.service.settle.getLatestCompleteSettle(ctx.tender.id);
-                const bills = await this.ctx.service.settleBills.getAllDataByCondition({ where: { settle_id: settle.id }});
-                const pos = await this.ctx.service.settlePos.getAllDataByCondition({ where: { settle_id: settle.id }});
+                const bills = settle ? await this.ctx.service.settleBills.getAllDataByCondition({ where: { settle_id: settle.id }}) : [];
+                const pos = settle ? await this.ctx.service.settlePos.getAllDataByCondition({ where: { settle_id: settle.id }}) : [];
                 ctx.body = { err: 0, msg: '', data: { bills, pos } };
             } catch(err) {
                 ctx.log(err);

+ 1 - 1
app/public/js/settle_gather.js

@@ -178,7 +178,7 @@ $(document).ready(() => {
             if (tab.attr('content') === '#search' && !searchLedger) {
                 searchLedger = $.ledgerSearch({
                     selector: '#search',
-                    ledger: { billsTree: settleTree, pos: settlePos },
+                    ledger: { billsTree: settleTree, getLedgerPos: function(node) {return settlePos.getLedgerPos(node.lid)} },
                     searchOver: true,
                     searchEmpty: true,
                     keyId: 'tree_id',

+ 1 - 1
app/public/js/settle_ledger.js

@@ -283,7 +283,7 @@ $(document).ready(() => {
             if (tab.attr('content') === '#search' && !searchLedger) {
                 searchLedger = $.ledgerSearch({
                     selector: '#search',
-                    ledger: { billsTree: settleTree, pos: settlePos },
+                    ledger: { billsTree: settleTree, getLedgerPos: function(node) {return settlePos.getLedgerPos(node.lid)} },
                     searchOver: true,
                     searchEmpty: true,
                     keyId: 'tree_id',