From 4b4412fe3597d5687c5baaf4ab0084325d277615 Mon Sep 17 00:00:00 2001 From: zhangminghua Date: Fri, 2 Dec 2022 14:33:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=98=8E=E7=BB=86=E8=A1=A8?= =?UTF-8?q?=E5=B7=B2=E5=AD=98=E5=9C=A8=E7=BC=96=E5=8F=B7=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/achievement.js | 4 +++- api/app/lib/routes/report/index.js | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/app/lib/controllers/report/achievement.js b/api/app/lib/controllers/report/achievement.js index a5c2e70..32fded1 100644 --- a/api/app/lib/controllers/report/achievement.js +++ b/api/app/lib/controllers/report/achievement.js @@ -259,8 +259,10 @@ async function exportAchievementDetail(ctx, dataList) { async function getReceivedNumbers(ctx) { try { + const { tableModel } = ctx.query; const models = ctx.fs.dc.models; - let list = await models.ReceivableDetail.findAll({//查编号 + let model = tableModel || 'ReceivableDetail' + let list = await models[model].findAll({//查编号 attributes: ['number'] }); ctx.status = 200 diff --git a/api/app/lib/routes/report/index.js b/api/app/lib/routes/report/index.js index aedc624..c2e8e89 100644 --- a/api/app/lib/routes/report/index.js +++ b/api/app/lib/routes/report/index.js @@ -16,10 +16,7 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/detail/achievement'] = { content: '查询业绩明细表', visible: false }; router.get('/detail/achievement', achieve.getAchievementDetail); - - - - app.fs.api.logAttr['GET/detail/received/numbers'] = { content: '查询业绩明细已有的编号集合', visible: false }; + app.fs.api.logAttr['GET/detail/received/numbers'] = { content: '查询明细表已有的编号集合', visible: false }; router.get('/detail/received/numbers', achieve.getReceivedNumbers); app.fs.api.logAttr['POST/add/received/back/bulk'] = { content: '导入回款明细', visible: true }; @@ -38,4 +35,5 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/export/invoicing/detail'] = { content: '导出开票明细表', visible: false }; router.get('/export/invoicing/detail', achieve.exportInvoicingDetail); + }; \ No newline at end of file