From 9ae975ac0d9368b612f797de8cb322d7de8560c1 Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Mon, 8 Jul 2024 11:10:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=E7=BF=BB=E5=8C=85=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/packageoverJobMain/index.ts | 4 ++ .../packageoverJobMain/index.vue | 38 ++++++++++++++----- .../packageoverJobMain.data.ts | 18 ++++----- 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/src/api/wms/packageoverJobMain/index.ts b/src/api/wms/packageoverJobMain/index.ts index dcd1df373..6ce1b6c77 100644 --- a/src/api/wms/packageoverJobMain/index.ts +++ b/src/api/wms/packageoverJobMain/index.ts @@ -69,6 +69,10 @@ export const updatePackageoverJobMain = async (data: PackageoverJobMainVO) => { export const deletePackageoverJobMain = async (id: number) => { return await request.delete({ url: `/wms/packageover-job-main/delete?id=` + id }) } +// 关闭翻包任务主 +export const closePackageoverJobMain = async (id: number) => { + return await request.put({ url: `/wms/packageover-job-main/close?id=` + id }) +} // 导出翻包任务主 Excel export const exportPackageoverJobMain = async (params) => { diff --git a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/index.vue b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/index.vue index 9f4aade48..9450acd5e 100644 --- a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/index.vue +++ b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/index.vue @@ -33,9 +33,9 @@ {{ row.number }} - + @@ -138,16 +138,34 @@ const buttonBaseClick = (val, item) => { console.log('其他按钮', item) } } - -// 列表-操作按钮 -const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'wms:packageover-job-main:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:packageover-job-main:delete'}), // 删除 -] - +const butttondata = (row,$index) => { + const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 + if(findIndex>-1&&findIndex<$index){ + return [] + } + return [ + // defaultButtons.mainListEditBtn({hasPermi:'wms:packageover-job-main:update'}), // 编辑 + defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:packageover-job-main:close'}), // 关闭 + // defaultButtons.mainListDeleteBtn({hasPermi:'wms:packageover-job-main:delete'}), // 删除 + ] +} +// 根据状态返回该按钮是否显示 +const isShowMainButton = (row, val) => { + if (val.indexOf(row.status) > -1) { + return false + } else { + return true + } +} // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { - if (val == 'edit') { // 编辑 + if (val == 'mainClose') { // 关闭 + // 发起关闭 + await message.confirm('确认要关闭吗?') + await PackageoverJobMainApi.closePackageoverJobMain(row.masterId) + // 刷新列表 + await getList() + }else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.masterId) diff --git a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/packageoverJobMain.data.ts b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/packageoverJobMain.data.ts index 6ba16b567..6a0c13ec8 100644 --- a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/packageoverJobMain.data.ts +++ b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/packageoverJobMain.data.ts @@ -523,15 +523,15 @@ export const PackageoverJobMain = useCrudSchemas(reactive([ }, isTable: false }, - // { - // label: '操作', - // field: 'action', - // isForm: false, - // table: { - // width: 150, - // fixed: 'right' - // } - // } + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } ])) // 表单校验