From 7d05de97d5adaab7008f1e128e7a2114d9fb7cd2 Mon Sep 17 00:00:00 2001 From: WUSIJIAN <13825895+wsj0228@user.noreply.gitee.com> Date: Sat, 28 Feb 2026 17:59:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=9B=98=E7=82=B9=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=AF=BC=E5=87=BA=E6=A8=A1=E6=9D=BF=E5=8A=9F=E8=83=BD?= =?UTF-8?q?,=E6=96=B0=E5=A2=9E=E7=9B=98=E7=82=B9=E4=BB=BB=E5=8A=A1ID?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BC=A0=E9=80=92,=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=A8=A1=E6=9D=BF=E5=89=8D=E7=9A=84=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E9=80=89=E6=8B=A9=E9=AA=8C=E8=AF=81=E6=8F=90=E7=A4=BA?= =?UTF-8?q?,=E8=B0=83=E6=95=B4=E4=BB=BB=E5=8A=A1=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=88=97=E6=9C=80=E5=B0=8F=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/assets/operation/count/index.ts | 3 ++- src/views/assets/operation/count/component/importDialog.vue | 6 +++++- src/views/assets/operation/count/index.vue | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/api/assets/operation/count/index.ts b/src/api/assets/operation/count/index.ts index e4be48e..84f1727 100644 --- a/src/api/assets/operation/count/index.ts +++ b/src/api/assets/operation/count/index.ts @@ -92,10 +92,11 @@ export function cancelInventoryCount(id: string[], reason?: string) { } // 导出盘点模板 -export function exportInventoryCountTemplate() { +export function exportInventoryCountTemplate(id: string) { return newService({ url: 'assets/inventory/count/exportInventoryCountTemplate', method: 'get', + params: { id }, responseType: 'blob', }); } diff --git a/src/views/assets/operation/count/component/importDialog.vue b/src/views/assets/operation/count/component/importDialog.vue index 778c3c0..e4a7ff8 100644 --- a/src/views/assets/operation/count/component/importDialog.vue +++ b/src/views/assets/operation/count/component/importDialog.vue @@ -91,8 +91,12 @@ const handleExceed = () => { // 下载模板 const onDownloadTemplate = async () => { + if (!countId.value) { + ElMessage.warning('请先选择盘点任务'); + return; + } try { - const res = await exportInventoryCountTemplate(); + const res = await exportInventoryCountTemplate(countId.value); const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); const url = window.URL.createObjectURL(blob); const link = document.createElement('a'); diff --git a/src/views/assets/operation/count/index.vue b/src/views/assets/operation/count/index.vue index f34fe29..cc6f808 100644 --- a/src/views/assets/operation/count/index.vue +++ b/src/views/assets/operation/count/index.vue @@ -42,7 +42,7 @@ - +