From 34e90e31a41efdd2e86312a134689d69302de667 Mon Sep 17 00:00:00 2001 From: zhaoxuebing <1291173720@qq.com> Date: Tue, 12 Dec 2023 19:21:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E5=87=BA=E5=BA=93=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/scrapRequestMain/index.ts | 32 ++++++- .../scrap/scrapJobMain/index.vue | 6 +- .../scrap/scrapRequestMain/index.vue | 84 +++++++++++++++++-- .../scrapRequestMain/scrapRequestMain.data.ts | 71 +++++++++++++++- 4 files changed, 176 insertions(+), 17 deletions(-) diff --git a/src/api/wms/scrapRequestMain/index.ts b/src/api/wms/scrapRequestMain/index.ts index 0f4ddf2d9..6a6ef1f40 100644 --- a/src/api/wms/scrapRequestMain/index.ts +++ b/src/api/wms/scrapRequestMain/index.ts @@ -65,4 +65,34 @@ export const exportScrapRequestMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/scrap-request-main/get-import-template' }) -} \ No newline at end of file +} + +// 关闭-报废出库申请 +export const closeScrapRequestMain = async (id) => { + return await request.put({ url: `/wms/scrap-request-main/close?id=` + id }) +} + +// 重新添加-报废出库申请 +export const reAddScrapRequestMain = async (id) => { + return await request.put({ url: `/wms/scrap-request-main/reAdd?id=` + id }) +} + +// 提交审批-报废出库申请 +export const submitScrapRequestMain = async (id) => { + return await request.put({ url: `/wms/scrap-request-main/submit?id=` + id }) +} + +// 审批驳回-报废出库申请 +export const refusedScrapRequestMain = async (id) => { + return await request.put({ url: `/wms/scrap-request-main/refused?id=` + id }) +} + +// 审批通过-报废出库申请 +export const agreeScrapRequestMain = async (id) => { + return await request.put({ url: `/wms/scrap-request-main/agree?id=` + id }) +} + +// 处理-报废出库申请 +export const handleScrapRequestMain = async (id) => { + return await request.put({ url: `/wms/scrap-request-main/handle?id=` + id }) +} diff --git a/src/views/wms/inventoryjobManage/scrap/scrapJobMain/index.vue b/src/views/wms/inventoryjobManage/scrap/scrapJobMain/index.vue index 1e63ae62f..c393ddab1 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapJobMain/index.vue +++ b/src/views/wms/inventoryjobManage/scrap/scrapJobMain/index.vue @@ -174,9 +174,9 @@ const isShowMainButton = (row,val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), // 承接 - defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1'])}), // 关闭 - defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // 放弃 + // defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), // 承接 + // defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1'])}), // 关闭 + // defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // 放弃 // defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // 执行 ] } diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue index 7905f7b7b..50d4fb319 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue @@ -186,30 +186,36 @@ 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:scrap-request-main:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:scrap-request-main:delete'}), // 删除 + defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:scrap-request-main:close'}), // 关闭 + defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:scrap-request-main:reAdd'}), // 重新添加 + defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:scrap-request-main:submit'}), // 提交审批 + defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:scrap-request-main:refused'}), // 驳回 + defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:scrap-request-main:agree'}), // 审批通过 + defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:scrap-request-main:handle'}), // 处理 + defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:scrap-request-main:update'}), // 编辑 + // defaultButtons.mainListDeleteBtn({hasPermi:'wms:scrap-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') { // 删除 @@ -217,6 +223,66 @@ const buttonTableClick = async (val, row) => { } } +/** 关闭按钮操作 */ +const handleClose = async (id: number) => { + try { + await message.confirm(t('common.confirmColse')) + await ScrapRequestMainApi.closeScrapRequestMain(id) + message.success(t('common.closeSuccess')) + await getList() + } catch {} +} + +/** 重新添加按钮操作 */ +const handleReAdd = async (id: number) => { + try { + await message.confirm(t('common.confirmReAdd')) + await ScrapRequestMainApi.reAddScrapRequestMain(id) + message.success(t('common.reAddSuccess')) + await getList() + } catch {} +} + +/** 提交按钮操作 */ +const handleSubmit = async (id: number) => { + try { + await message.confirm(t('common.confirmSubmit')) + await ScrapRequestMainApi.submitScrapRequestMain(id) + message.success(t('common.submitSuccess')) + await getList() + } catch {} +} + +/** 审批驳回按钮操作 */ +const handleRefused = async (id: number) => { + try { + await message.confirm(t('common.confirmRefused')) + await ScrapRequestMainApi.refusedScrapRequestMain(id) + message.success(t('common.refusedSuccess')) + await getList() + } catch {} +} + +/** 审批通过按钮操作 */ +const handleAgree = async (id: number) => { + try { + await message.confirm(t('common.confirmAgree')) + await ScrapRequestMainApi.agreeScrapRequestMain(id) + message.success(t('common.agreeSuccess')) + await getList() + } catch {} +} + +/** 处理按钮操作 */ +const handleHandle = async (id: number) => { + try { + await message.confirm(t('common.confirmHandle')) + await ScrapRequestMainApi.handleScrapRequestMain(id) + message.success(t('common.handleSuccess')) + await getList() + } catch {} +} + /** 添加/修改操作 */ const formRef = ref() const openForm =async (type: string, row?: number) => { diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts index 2f4d3e21f..ae33afd0f 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts @@ -18,6 +18,8 @@ const queryParams = { // 获取当前操作人的部门 import { useUserStore } from '@/store/modules/user' +import {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data"; +import * as WarehouseApi from "@/api/wms/warehouse"; const userStore = useUserStore() const userDept = userStore.userSelfInfo.dept @@ -105,7 +107,35 @@ export const ScrapRequestMain = useCrudSchemas(reactive([ width: 150 }, isSearch: true, - isForm: false, + tableForm: { + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择仓库代码', + searchField: 'code', + searchTitle: '仓库信息', + searchAllSchemas: Warehouse.allSchemas, + searchPage: WarehouseApi.getWarehousePage, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择仓库代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '仓库信息', // 查询弹窗标题 + searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类 + searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } }, { label: '从库位类型范围', @@ -377,6 +407,9 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm: { + disabled: true + } }, { label: '物品名称', @@ -387,6 +420,9 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ }, isTableForm: false, isForm: false, + tableForm: { + disabled: true + } }, { label: '物品描述1', @@ -415,6 +451,9 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm: { + disabled: true + } }, { label: '包装号', @@ -429,7 +468,16 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ searchField: 'packingNumber', searchTitle: '库存余额信息', searchAllSchemas: Balance.allSchemas, - searchPage: BalanceApi.getBalancePage + searchPage: BalanceApi.getBalancePage, + searchCondition: [{ + key: 'warehouseCode', + value: 'fromWarehouseCode', + isMainValue: true + },{ + key: 'inventoryStatus', + value: 'SCRAP', + isMainValue: false + }] }, form: { // labelMessage: '信息提示说明!!!', @@ -439,7 +487,16 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ searchField: 'packingNumber', searchTitle: '库存余额信息', searchAllSchemas: Balance.allSchemas, - searchPage: BalanceApi.getBalancePage + searchPage: BalanceApi.getBalancePage, + searchCondition: [{ + key: 'warehouseCode', + value: 'fromWarehouseCode', + isMainValue: true + },{ + key: 'inventoryStatus', + value: 'SCRAP', + isMainValue: false + }] } } }, @@ -450,6 +507,9 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm: { + disabled: true + } }, { label: '数量', @@ -492,6 +552,9 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm: { + disabled: true + } }, { label: '库存状态', @@ -647,4 +710,4 @@ export const ScrapRequestDetailRules = reactive({ itemCode: [ { required: true, message: '请选择物品代码', trigger: 'change' } ], -}) \ No newline at end of file +})