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 @@ - +