From ce7968a06f89e92d0ed14ec9811a1b8a304fd1f1 Mon Sep 17 00:00:00 2001 From: zhaoxuebing <1291173720@qq.com> Date: Mon, 13 May 2024 16:50:08 +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/purchaseprice/index.ts | 21 +++++++++++++++++++ src/api/wms/supplieritem/index.ts | 21 +++++++++++++++++++ .../supplierManage/purchaseprice/index.vue | 11 +++++++--- .../supplierManage/supplieritem/index.vue | 11 +++++++--- 4 files changed, 58 insertions(+), 6 deletions(-) diff --git a/src/api/wms/purchaseprice/index.ts b/src/api/wms/purchaseprice/index.ts index cf2438619..03c6af883 100644 --- a/src/api/wms/purchaseprice/index.ts +++ b/src/api/wms/purchaseprice/index.ts @@ -22,6 +22,17 @@ export const getPurchasepricePage = async (params) => { } } +// 查询采购价格单列表 +export const getPurchasepricePageSCP = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/wms/purchaseprice/seniorSCP', data }) + } else { + return await request.get({ url: `/wms/purchaseprice/pageSCP`, params }) + } +} + // 查询采购价格单详情 export const getPurchaseprice = async (id: number) => { return await request.get({ url: `/wms/purchaseprice/get?id=` + id }) @@ -52,6 +63,16 @@ export const exportPurchaseprice = async (params) => { } } +// 导出采购价格单 Excel +export const exportPurchasepriceSCP = async (params) => { + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/purchaseprice/export-excel-senior-SCP`, data }) + } else { + return await request.download({ url: `/wms/purchaseprice/export-excel-SCP`, params }) + } +} + // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/purchaseprice/get-import-template' }) diff --git a/src/api/wms/supplieritem/index.ts b/src/api/wms/supplieritem/index.ts index 448b6b108..e6002d3c7 100644 --- a/src/api/wms/supplieritem/index.ts +++ b/src/api/wms/supplieritem/index.ts @@ -31,6 +31,17 @@ export const getSupplieritemPage = async (params) => { } } +// 查询供应商物料列表 +export const getSupplieritemPageSCP = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/wms/supplieritem/seniorSCP', data }) + } else { + return await request.get({ url: `/wms/supplieritem/pageSCP`, params }) + } +} + // 查询供应商物料详情 export const getSupplieritem = async (id: number) => { return await request.get({ url: `/wms/supplieritem/get?id=` + id }) @@ -61,6 +72,16 @@ export const exportSupplieritem = async (params) => { } } +// 导出供应商物料 Excel +export const exportSupplieritemSCP = async (params) => { + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/supplieritem/export-excel-senior-SCP`, data }) + } else { + return await request.download({ url: `/wms/supplieritem/export-excel-SCP`, params }) + } +} + // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/supplieritem/get-import-template' }) diff --git a/src/views/wms/basicDataManage/supplierManage/purchaseprice/index.vue b/src/views/wms/basicDataManage/supplierManage/purchaseprice/index.vue index 02bca4f0b..1f9694b7c 100644 --- a/src/views/wms/basicDataManage/supplierManage/purchaseprice/index.vue +++ b/src/views/wms/basicDataManage/supplierManage/purchaseprice/index.vue @@ -84,7 +84,7 @@ const updataTableColumns = (val) => { } const { tableObject, tableMethods } = useTable({ - getListApi: PurchasepriceApi.getPurchasepricePage // 分页接口 + getListApi: routeName.value.includes('SCP')?PurchasepriceApi.getPurchasepricePageSCP:PurchasepriceApi.getPurchasepricePage // 分页接口 }) // 获得表格的各种操作 @@ -238,8 +238,13 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await PurchasepriceApi.exportPurchaseprice(tableObject.params) - download.excel(data, `${t('ts.采购价格单')}.xlsx`) + if(routeName.value.includes('SCP')){ + const data = await PurchasepriceApi.exportPurchasepriceSCP(tableObject.params) + download.excel(data, `${t('ts.采购价格单')}.xlsx`) + }else{ + const data = await PurchasepriceApi.exportPurchaseprice(tableObject.params) + download.excel(data, `${t('ts.采购价格单')}.xlsx`) + } } catch { } finally { exportLoading.value = false diff --git a/src/views/wms/basicDataManage/supplierManage/supplieritem/index.vue b/src/views/wms/basicDataManage/supplierManage/supplieritem/index.vue index b3c637e76..182966119 100644 --- a/src/views/wms/basicDataManage/supplierManage/supplieritem/index.vue +++ b/src/views/wms/basicDataManage/supplierManage/supplieritem/index.vue @@ -83,7 +83,7 @@ const updataTableColumns = (val) => { } const { tableObject, tableMethods } = useTable({ - getListApi: SupplieritemApi.getSupplieritemPage // 分页接口 + getListApi: routeName.value.includes('SCP')?SupplieritemApi.getSupplieritemPageSCP:SupplieritemApi.getSupplieritemPage // 分页接口 }) // 获得表格的各种操作 @@ -237,8 +237,13 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await SupplieritemApi.exportSupplieritem(tableObject.params) - download.excel(data, `${t('ts.供应商物料')}.xlsx`) + if(routeName.value.includes('SCP')){ + const data = await SupplieritemApi.exportSupplieritemSCP(tableObject.params) + download.excel(data, `${t('ts.供应商物料')}.xlsx`) + }else{ + const data = await SupplieritemApi.exportSupplieritem(tableObject.params) + download.excel(data, `${t('ts.供应商物料')}.xlsx`) + } } catch { } finally { exportLoading.value = false