From 1dbdcddb44d4695b39bcd5d1c7cff225be73dfde Mon Sep 17 00:00:00 2001 From: zhaoxuebing <1291173720@qq.com> Date: Wed, 27 Dec 2023 16:36:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E5=93=81=E7=BB=B4=E4=BF=AE=E4=B8=8E?= =?UTF-8?q?=E6=8A=A5=E5=BA=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/containerMain/index.ts | 12 ++++- .../containerRepairRecordMain.data.ts | 4 +- .../containerinitadd/containerMain.data.ts | 10 ++++ .../containerinit/containerinitadd/index.vue | 46 ++++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/src/api/wms/containerMain/index.ts b/src/api/wms/containerMain/index.ts index e5c24f9e7..7e10ebf1b 100644 --- a/src/api/wms/containerMain/index.ts +++ b/src/api/wms/containerMain/index.ts @@ -48,4 +48,14 @@ export const exportContainerMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/container-main/get-import-template' }) -} \ No newline at end of file +} + +// 器具维修 +export const repairSubmitContainerRequestMain = async (id) => { + return await request.put({ url: `/wms/container-main/repair?id=` + id }) +} + +// 器具报废 +export const scrapSubmitContainerRequestMain = async (id) => { + return await request.put({ url: `/wms/container-main/scrap?id=` + id }) +} diff --git a/src/views/wms/inventoryManage/containerinit/containerRepair/containerRepairRecordMain.data.ts b/src/views/wms/inventoryManage/containerinit/containerRepair/containerRepairRecordMain.data.ts index a71559004..9eeddeb76 100644 --- a/src/views/wms/inventoryManage/containerinit/containerRepair/containerRepairRecordMain.data.ts +++ b/src/views/wms/inventoryManage/containerinit/containerRepair/containerRepairRecordMain.data.ts @@ -65,7 +65,9 @@ export const ContainerRepairRecordDetail = useCrudSchemas(reactive label: '单据号', field: 'number', sort: 'custom', - isSearch: true, + table: { + width: 150 + } }, { label: '器具号', diff --git a/src/views/wms/inventoryManage/containerinit/containerinitadd/containerMain.data.ts b/src/views/wms/inventoryManage/containerinit/containerinitadd/containerMain.data.ts index 37c395eaa..91fbddc1c 100644 --- a/src/views/wms/inventoryManage/containerinit/containerinitadd/containerMain.data.ts +++ b/src/views/wms/inventoryManage/containerinit/containerinitadd/containerMain.data.ts @@ -133,6 +133,16 @@ export const ContainerMain = useCrudSchemas(reactive([ } } }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 300, + fixed: 'right' + }, + } ])) diff --git a/src/views/wms/inventoryManage/containerinit/containerinitadd/index.vue b/src/views/wms/inventoryManage/containerinit/containerinitadd/index.vue index 3e80e71e6..956735566 100644 --- a/src/views/wms/inventoryManage/containerinit/containerinitadd/index.vue +++ b/src/views/wms/inventoryManage/containerinit/containerinitadd/index.vue @@ -144,8 +144,26 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'wms:containerMain:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:containerMain:delete'}), // 删除 + defaultButtons.mainListEditBtn({hasPermi:'wms:container-main:update'}), // 编辑 + // defaultButtons.mainListDeleteBtn({hasPermi:'wms:container-main:delete'}), // 删除 + { + label: '维修', + name: 'repair', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }, + { + label: '报废', + name: 'scrap', + hide: false, + type: 'danger', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + } ] // 列表-操作按钮事件 @@ -154,9 +172,33 @@ const buttonTableClick = async (val, row) => { openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) + } else if(val == 'repair'){ // 维修 + repairSubmit(row.id) + } else if(val == 'scrap'){ // 报废 + scrapSubmit(row.id) } } +/** 维修按钮操作 */ +const repairSubmit = async (id: number) => { + try { + await message.confirm(t('common.confirmSubmit')) + await ContainerMainApi.repairSubmitContainerRequestMain(id) + message.success(t('common.submitSuccess')) + await getList() + } catch {} +} + +/** 报废按钮操作 */ +const scrapSubmit = async (id: number) => { + try { + await message.confirm(t('common.confirmSubmit')) + await ContainerMainApi.scrapSubmitContainerRequestMain(id) + message.success(t('common.submitSuccess')) + await getList() + } catch {} +} + /** 添加/修改操作 */ const basicFormRef = ref() const openForm = (type: string, row?: any) => {