From 06afc357adf8b4033a5229572ca68dca3f5c40a2 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Fri, 21 Jun 2024 17:26:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=AF=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E9=80=80=E5=9B=9E=E5=88=B0=E4=B8=8D=E5=8F=AF=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/models/settle/usable.js | 2 ++ .../wwwroot/router/business.js | 1 + .../wwwroot/views/settle/usable.js | 21 +++++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/usable.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/usable.js index 17468194..4e11f88b 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/usable.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/usable.js @@ -36,6 +36,7 @@ export default function (businessType) { const queryUrl = `settleaccount/${service}/main-query`; const exportUrl = `settleaccount/${service}/export`; const addUrl = `settleaccount/${service}/generate-invoice`; + const backUrl = `settleaccount/${service}/back-can-settlement`; const queryMethod = "POST"; const exportMethod = "POST"; @@ -105,6 +106,7 @@ export default function (businessType) { edit: { exportUrl, addUrl, + backUrl, exportMethod, addMethod, schema: schema, diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js index 19f21fd9..7215d379 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js @@ -110,6 +110,7 @@ function createUsableSettleList(path, business, client, title = "可结算单") component: "/settle/usable", children: [ createButton("query", "title=查询&isTop=true"), + createButton("back", "title=退回"), createButton("add", "title=创建发票"), //行级按钮 createButton("export", "title=导出&isTop=true&pattern=paged"), ], diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js index 3f3a3f29..8aa2220c 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js @@ -15,6 +15,7 @@ export default { const config = useConfig(businessType); const onCommand = async (item, rows) => { const url = config.edit.addUrl; + const backUrl = config.edit.backUrl; if (item.path === "add") { const invbillNum = rows[0].billNum; await appListRef.value.onClick( @@ -31,6 +32,26 @@ export default { true ); } + if (item.path === "back") { + const data = appListRef.value.buildQuery(); + await appListRef.value.onClick( + async () => { + const result = await request(backUrl, data, { method: "POST" }, true); + if (result.errors) { + if (result.data.code === 400 && result.data.fileName) { + ElMessage({ + type: "warnning", + message: "操作失败", + }); + window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); + } + console.log(result); + } + }, + `确认是否退回到不可结算单?`, + true + ); + } }; return { appListRef, config, onCommand }; },