From 10f640f15b0713db554d335e18f939f0df20ea34 Mon Sep 17 00:00:00 2001 From: "hongxi.lian" Date: Wed, 22 Nov 2023 17:28:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/inventoryinitRequestMain/index.ts | 30 +++++- src/api/wms/scrapRequestMain/index.ts | 7 +- .../wms/unplannedissueRequestMain/index.ts | 7 +- .../wms/unplannedreceiptRequestMain/index.ts | 9 +- .../inventoryinitRequestMain/index.vue | 96 ++++++++++++++++--- .../scrap/scrapRequestMain/index.vue | 2 +- .../unplannedissueRequestMain/index.vue | 2 +- .../unplannedreceiptRequestMain/index.vue | 2 +- 8 files changed, 134 insertions(+), 21 deletions(-) diff --git a/src/api/wms/inventoryinitRequestMain/index.ts b/src/api/wms/inventoryinitRequestMain/index.ts index de778aaab..821a49cff 100644 --- a/src/api/wms/inventoryinitRequestMain/index.ts +++ b/src/api/wms/inventoryinitRequestMain/index.ts @@ -44,6 +44,29 @@ export const createInventoryinitRequestMain = async (data: InventoryinitRequestM export const updateInventoryinitRequestMain = async (data: InventoryinitRequestMainVO) => { return await request.put({ url: `/wms/inventoryinit-request-main/update`, data }) } +// 关闭库存初始化申请主 Excel +export const closeInventoryinitRequestMain = async (id) => { + return await request.put({ url: `/wms/inventoryinit-request-main/close?id=` + id }) +} +// 重新添加库存初始化申请主 Excel +export const reAddInventoryinitRequestMain = async (id) => { + return await request.put({ url: `/wms/inventoryinit-request-main/reAdd?id=` + id }) +} + +// 审批驳回库存初始化申请主 Excel +export const refusedInventoryinitRequestMain = async (id) => { + return await request.put({ url: `/wms/inventoryinit-request-main/refused?id=` + id }) +} + +// 审批通过库存初始化申请主 Excel +export const agreeInventoryinitRequestMain = async (id) => { + return await request.put({ url: `/wms/inventoryinit-request-main/agree?id=` + id }) +} + +// 提交库存初始化申请主 Excel +export const submitInventoryinitRequestMain = async (id) => { + return await request.put({ url: `/wms/inventoryinit-request-main/submit?id=` + id }) +} // 删除库存初始化申请主 export const deleteInventoryinitRequestMain = async (id: number) => { @@ -58,4 +81,9 @@ export const exportInventoryinitRequestMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/inventoryinit-request-main/get-import-template' }) -} \ No newline at end of file +} + +// 处理采购收货申请主 Excel +export const handleInventoryinitRequestMain = async (id) => { + return await request.put({ url: `/wms/inventoryinit-request-main/handle?id=` + id }) +} diff --git a/src/api/wms/scrapRequestMain/index.ts b/src/api/wms/scrapRequestMain/index.ts index 424eb3d61..0f4ddf2d9 100644 --- a/src/api/wms/scrapRequestMain/index.ts +++ b/src/api/wms/scrapRequestMain/index.ts @@ -54,7 +54,12 @@ export const deleteScrapRequestMain = async (id: number) => { // 导出报废出库申请主 Excel export const exportScrapRequestMain = async (params) => { - return await request.download({ url: `/wms/scrap-request-main/export-excel`, params }) + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/scrap-request-main/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/scrap-request-main/export-excel`, params }) + } } // 下载用户导入模板 diff --git a/src/api/wms/unplannedissueRequestMain/index.ts b/src/api/wms/unplannedissueRequestMain/index.ts index 7fed8d1ba..d5bc786fa 100644 --- a/src/api/wms/unplannedissueRequestMain/index.ts +++ b/src/api/wms/unplannedissueRequestMain/index.ts @@ -55,7 +55,12 @@ export const deleteUnplannedissueRequestMain = async (id: number) => { // 导出计划外出库申请主 Excel export const exportUnplannedissueRequestMain = async (params) => { - return await request.download({ url: `/wms/unplannedissue-request-main/export-excel`, params }) + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/unplannedissue-request-main/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/unplannedissue-request-main/export-excel`, params }) + } } // 下载用户导入模板 diff --git a/src/api/wms/unplannedreceiptRequestMain/index.ts b/src/api/wms/unplannedreceiptRequestMain/index.ts index 3256a7039..5c2982d11 100644 --- a/src/api/wms/unplannedreceiptRequestMain/index.ts +++ b/src/api/wms/unplannedreceiptRequestMain/index.ts @@ -54,9 +54,16 @@ export const deleteUnplannedreceiptRequestMain = async (id: number) => { // 导出计划外入库申请主 Excel export const exportUnplannedreceiptRequestMain = async (params) => { - return await request.download({ url: `/wms/unplannedreceipt-request-main/export-excel`, params }) + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/unplannedreceipt-request-main/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/unplannedreceipt-request-main/export-excel`, params }) + } } + + // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/unplannedreceipt-request-main/get-import-template' }) diff --git a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue index 4d5768030..0bdcca8c2 100644 --- a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue @@ -179,30 +179,31 @@ const isShowMainButton = (row,val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // 关闭 - defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // 重新添加 - defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 - defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // 驳回 - defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 - defaultButtons.mainListEditBtn({hasPermi:'wms:inventoryinit-request-main:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:inventoryinit-request-main:delete'}), // 删除 + defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:inventoryinit-request-main:close'}), // 关闭 + defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:inventoryinit-request-main:reAdd'}), //重新添加 + defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:inventoryinit-request-main:submit'}), // 提交审批 + defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:inventoryinit-request-main:refused'}), // 驳回 + defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:inventoryinit-request-main:agree'}), // 审批通过 + defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:inventoryinit-request-main:handle'}), // 处理 + defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:inventoryinit-request-main:update'}), // 编辑 + defaultButtons.mainListDeleteBtn({hasPermi:'wms:inventoryinit-request-main:delete'}), // 删除 ] } - - // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainClose') { // 关闭 - console.log('列表-操作按钮事件-关闭') + handleClose(row.id) } else if (val == 'mainReAdd') { // 重新添加 - console.log('列表-操作按钮事件-重新添加') + handleReAdd(row.id) } else if (val == 'mainSubmit') { // 提交审批 - console.log('列表-操作按钮事件-提交审批') + handleSubmit(row.id) } else if (val == 'mainTurnDown') { // 驳回 - console.log('列表-操作按钮事件-驳回') + handleRefused(row.id) } else if (val == 'mainApprove') { // 审批通过 - console.log('列表-操作按钮事件-审批通过') + handleAgree(row.id) + } else if (val == 'mainHandle') { // 处理 + handleHandle(row.id) } else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 @@ -210,6 +211,73 @@ const buttonTableClick = async (val, row) => { } } + + +/** 关闭按钮操作 */ +const handleClose = async (id: number) => { + try { + await message.confirm(t('common.confirmColse')) + await InventoryinitRequestMainApi.closeInventoryinitRequestMain(id) + message.success(t('common.closeSuccess')) + await getList() + } catch {} +} + + +/** 重新添加按钮操作 */ +const handleReAdd = async (id: number) => { + try { + await message.confirm(t('common.confirmReAdd')) + await InventoryinitRequestMainApi.reAddInventoryinitRequestMain(id) + message.success(t('common.reAddSuccess')) + await getList() + } catch {} +} + + +/** 提交按钮操作 */ +const handleSubmit = async (id: number) => { + try { + await message.confirm(t('common.confirmSubmit')) + await InventoryinitRequestMainApi.submitInventoryinitRequestMain(id) + message.success(t('common.updateSuccess')) + await getList() + } catch {} +} + + +/** 审批通过按钮操作 */ +const handleAgree = async (id: number) => { + try { + await message.confirm(t('common.confirmAgree')) + await InventoryinitRequestMainApi.agreeInventoryinitRequestMain(id) + message.success(t('common.agreeSuccess')) + await getList() + } catch {} +} + + +/** 处理按钮操作 */ +const handleHandle = async (id: number) => { + try { + await message.confirm(t('common.confirmHandle')) + await InventoryinitRequestMainApi.handleInventoryinitRequestMain(id) + message.success(t('common.handleSuccess')) + await getList() + } catch {} +} + + +/** 审批驳回按钮操作 */ +const handleRefused = async (id: number) => { + try { + await message.confirm(t('common.confirmRefused')) + await InventoryinitRequestMainApi.refusedInventoryinitRequestMain(id) + message.success(t('common.refusedSuccess')) + await getList() + } catch {} +} + /** 添加/修改操作 */ const formRef = ref() const openForm =async (type: string, row?: number) => { diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue index ef380d84b..6c3e58a37 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue @@ -250,7 +250,7 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await ScrapRequestMainApi.exportScrapRequestMain(setSearchParams) + const data = await ScrapRequestMainApi.exportScrapRequestMain(tableObject.params) download.excel(data, '报废出库申请主.xlsx') } catch { } finally { diff --git a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue index 325a9dfdb..d68fe56d5 100644 --- a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue @@ -254,7 +254,7 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await UnplannedissueRequestMainApi.exportUnplannedissueRequestMain(setSearchParams) + const data = await UnplannedissueRequestMainApi.exportUnplannedissueRequestMain(tableObject.params) download.excel(data, '计划外出库申请主.xlsx') } catch { } finally { diff --git a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue index ff0e306d0..68d673858 100644 --- a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue @@ -262,7 +262,7 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await UnplannedreceiptRequestMainApi.exportUnplannedreceiptRequestMain(setSearchParams) + const data = await UnplannedreceiptRequestMainApi.exportUnplannedreceiptRequestMain(tableObject.params) download.excel(data, '计划外入库申请主.xlsx') } catch { } finally {