From b9a16dc63e646a6d441cf2d15cc36af229b174fa Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Wed, 28 Aug 2024 10:20:36 +0800 Subject: [PATCH] =?UTF-8?q?HL-5257=E8=AE=A1=E5=88=92=E5=A4=96=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E6=92=A4=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/unplannedreceiptRecordMain/index.ts | 5 +++++ .../unplannedreceiptRecordMain/index.vue | 20 +++++++++++++++++-- .../unplannedreceiptRecordMain.data.ts | 10 ++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/api/wms/unplannedreceiptRecordMain/index.ts b/src/api/wms/unplannedreceiptRecordMain/index.ts index bf684d705..482b65e7b 100644 --- a/src/api/wms/unplannedreceiptRecordMain/index.ts +++ b/src/api/wms/unplannedreceiptRecordMain/index.ts @@ -68,4 +68,9 @@ export const exportUnplannedreceiptRecordMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/unplannedreceipt-record-main/get-import-template' }) +} + +// 撤销 +export const revoke = async (id: number) => { + return await request.get({ url: `/wms/unplannedreceipt-record-main/revoke?id=` + id }) } \ No newline at end of file diff --git a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRecordMain/index.vue b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRecordMain/index.vue index f0e8b1661..04eab44c5 100644 --- a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRecordMain/index.vue +++ b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRecordMain/index.vue @@ -128,17 +128,33 @@ const buttonBaseClick = (val, item) => { } } +const isShowRevokeButton = (row,val) => { + if (val.indexOf(row.revokeFlag) > -1) { + return false + } else { + return true + } +} + // 列表-操作按钮 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.backoutBtn({hide:isShowRevokeButton(row,['FALSE'])}) // 撤销 + ] } - return [] + return [ + defaultButtons.backoutBtn({hide:isShowRevokeButton(row,['FALSE'])}) // 撤销 + ] } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { + if (val == 'backout') { // 撤销 + await UnplannedreceiptRecordMainApi.revoke(row.masterId) + buttonBaseClick('refresh',null) + } } // 获取部门 用于详情 部门回显 const { wsCache } = useCache() diff --git a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRecordMain/unplannedreceiptRecordMain.data.ts b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRecordMain/unplannedreceiptRecordMain.data.ts index 8df92cf66..8d03144d5 100644 --- a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRecordMain/unplannedreceiptRecordMain.data.ts +++ b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRecordMain/unplannedreceiptRecordMain.data.ts @@ -467,6 +467,16 @@ export const UnplannedreceiptRecordMain = useCrudSchemas(reactive( } } }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 120, + fixed: 'right' + }, + } ])) //表单校验