From 07db916b1c37dfbbbaaf083b16b6ae1d97464334 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Wed, 28 Aug 2024 18:41:09 +0800 Subject: [PATCH] =?UTF-8?q?HL-5257=E6=8A=A5=E5=BA=9F=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E6=92=A4=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/scrapRecordMain/index.ts | 7 ++++++- .../scrap/scrapRecordMain/index.vue | 16 +++++++++++++++- .../scrapRecordMain/scrapRecordMain.data.ts | 10 ++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/api/wms/scrapRecordMain/index.ts b/src/api/wms/scrapRecordMain/index.ts index 1efab607d..eb1d8aa08 100644 --- a/src/api/wms/scrapRecordMain/index.ts +++ b/src/api/wms/scrapRecordMain/index.ts @@ -68,4 +68,9 @@ export const exportScrapRecordMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/scrap-record-main/get-import-template' }) -} \ No newline at end of file +} + +// 撤销 +export const revoke = async (id: number) => { + return await request.get({ url: `/wms/scrap-record-main/revoke?id=` + id }) +} diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/index.vue b/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/index.vue index ac521af8a..0104e9141 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/index.vue +++ b/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/index.vue @@ -128,17 +128,31 @@ 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 [] + return [ + defaultButtons.backoutBtn({hide:isShowRevokeButton(row,['FALSE'])}) // 撤销 + ] } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { + if (val == 'backout') { // 撤销 + await ScrapRecordMainApi.revoke(row.masterId) + buttonBaseClick('refresh',null) + } } // 获取部门 用于详情 部门回显 const { wsCache } = useCache() diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/scrapRecordMain.data.ts b/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/scrapRecordMain.data.ts index 520aa838a..c6a40668e 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/scrapRecordMain.data.ts +++ b/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/scrapRecordMain.data.ts @@ -477,6 +477,16 @@ export const ScrapRecordMain = useCrudSchemas( activeValue: 'TRUE' } } + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 120, + fixed: 'right' + }, } ]) )