From 704a278dca1c5ff1f7640e3483a3734bbde1ef8f Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 15 Nov 2023 14:03:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E5=93=81=E5=8C=85=E8=A3=85=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=AF=BC=E5=87=BA=EF=BC=8C=E9=AB=98=E7=BA=A7=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/itembasic/index.ts | 7 ++++++- src/api/wms/itempackaging/index.ts | 8 ++++++-- src/config/axios/index.ts | 4 ++++ src/hooks/web/useTable.ts | 1 + .../basicDataManage/itemManage/itembasic/index.vue | 1 - .../itemManage/itempackaging/index.vue | 11 ++--------- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/api/wms/itembasic/index.ts b/src/api/wms/itembasic/index.ts index 446f89cfa..64b06710f 100644 --- a/src/api/wms/itembasic/index.ts +++ b/src/api/wms/itembasic/index.ts @@ -61,7 +61,12 @@ export const deleteItembasic = async (id: number) => { // 导出物品基本信息 Excel export const exportItembasic = async (params) => { - return await request.download({ url: `/wms/itembasic/export-excel`, params }) + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/itembasic/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/itembasic/export-excel`, params }) + } } // 下载用户导入模板 diff --git a/src/api/wms/itempackaging/index.ts b/src/api/wms/itempackaging/index.ts index e74098611..d7ab4945b 100644 --- a/src/api/wms/itempackaging/index.ts +++ b/src/api/wms/itempackaging/index.ts @@ -52,9 +52,13 @@ export const deleteItempackaging = async (id: number) => { // 导出物品包装信息 Excel export const exportItempackaging = async (params) => { - return await request.download({ url: `/wms/itempackaging/export-excel`, params }) + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/itempackaging/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/itempackaging/export-excel`, params }) + } } - // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/itempackaging/get-import-template' }) diff --git a/src/config/axios/index.ts b/src/config/axios/index.ts index 919b50131..69c5e72ac 100644 --- a/src/config/axios/index.ts +++ b/src/config/axios/index.ts @@ -47,6 +47,10 @@ export default { const res = await request({ method: 'GET', responseType: 'blob', ...option }) return res as unknown as Promise }, + downloadPost: async (option: any) => { + const res = await request({ method: 'POST', responseType: 'blob', ...option }) + return res as unknown as Promise + }, upload: async (option: any) => { option.headersType = 'multipart/form-data' const res = await request({ method: 'POST', ...option }) diff --git a/src/hooks/web/useTable.ts b/src/hooks/web/useTable.ts index 34248f9d0..53cd83cce 100644 --- a/src/hooks/web/useTable.ts +++ b/src/hooks/web/useTable.ts @@ -5,6 +5,7 @@ import { computed, nextTick, reactive, ref, unref, watch } from 'vue' import type { TableProps } from '@/components/Table/src/types' import { TableSetPropsType } from '@/types/table' +import { emit } from 'process' const { t } = useI18n() interface ResponseType { diff --git a/src/views/wms/basicDataManage/itemManage/itembasic/index.vue b/src/views/wms/basicDataManage/itemManage/itembasic/index.vue index 77b384200..1797ac193 100644 --- a/src/views/wms/basicDataManage/itemManage/itembasic/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itembasic/index.vue @@ -205,7 +205,6 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - console.log(tableObject.params) const data = await ItembasicApi.exportItembasic(tableObject.params) download.excel(data, '物品基本信息.xls') } catch { diff --git a/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue b/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue index 7e98abd65..26f07eaae 100644 --- a/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue @@ -220,15 +220,8 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - // 判断是筛选后的列表数据 - if (tableObject.params.isSearch) { - // 调用筛选后的导出接口 后端未提供 参数传 tableObject.params 20231109 - const data = await ItempackagingApi.exportItempackaging(setSearchParams) - download.excel(data, '物品包装信息 .xls') - } else { - const data = await ItempackagingApi.exportItempackaging(setSearchParams) - download.excel(data, '物品包装信息 .xls') - } + const data = await ItempackagingApi.exportItempackaging(tableObject.params) + download.excel(data, '物品包装信息.xls') } catch { } finally { exportLoading.value = false