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