From 47b23566d583cff7ca156187af6fe7ff63ee7e03 Mon Sep 17 00:00:00 2001 From: zhaoxuebing <1291173720@qq.com> Date: Mon, 13 May 2024 14:25:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/supplier/index.ts | 23 +++++++++++++++++++ .../supplierManage/supplier/index.vue | 11 ++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/api/wms/supplier/index.ts b/src/api/wms/supplier/index.ts index 805a4163c..961d949a0 100644 --- a/src/api/wms/supplier/index.ts +++ b/src/api/wms/supplier/index.ts @@ -31,6 +31,18 @@ export const getSupplierPage = async (params) => { return await request.get({ url: `/wms/supplier/page`, params }) } } + +// 查询供应商列表分页 +export const getSupplierPageSCP = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/wms/supplier/seniorSCP', data }) + } else { + return await request.get({ url: `/wms/supplier/pageSCP`, params }) + } +} + // 查询供应商列表 export const getSupplierList = async (params) => { return await request.get({ url: `/wms/supplier/list`, params }) @@ -66,6 +78,17 @@ export const exportSupplier = async (params) => { } } + +// 导出供应商 Excel +export const exportSupplierSCP = async (params) => { + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/supplier/export-excel-senior-SCP`, data }) + } else { + return await request.download({ url: `/wms/supplier/export-excel-SCP`, params }) + } +} + // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/supplier/get-import-template' }) diff --git a/src/views/wms/basicDataManage/supplierManage/supplier/index.vue b/src/views/wms/basicDataManage/supplierManage/supplier/index.vue index 896737aac..e2a6b142f 100644 --- a/src/views/wms/basicDataManage/supplierManage/supplier/index.vue +++ b/src/views/wms/basicDataManage/supplierManage/supplier/index.vue @@ -82,7 +82,7 @@ const updataTableColumns = (val) => { } const { tableObject, tableMethods } = useTable({ - getListApi: SupplierApi.getSupplierPage // 分页接口 + getListApi: routeName.value.includes('SCP')?SupplierApi.getSupplierPageSCP:SupplierApi.getSupplierPage // 分页接口 }) // 获得表格的各种操作 @@ -220,8 +220,13 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await SupplierApi.exportSupplier(tableObject.params) - download.excel(data, `${t('ts.供应商')}.xlsx`) + if(routeName.value.includes('SCP')){ + const data = await SupplierApi.exportSupplier(tableObject.params) + download.excel(data, `${t('ts.供应商')}.xlsx`) + }else{ + const data = await SupplierApi.exportSupplierSCP(tableObject.params) + download.excel(data, `${t('ts.供应商')}.xlsx`) + } } catch { } finally { exportLoading.value = false