From 427cec80c1dd446f85c86bc86ad9d85acde2c990 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Wed, 28 Aug 2024 16:21:54 +0800 Subject: [PATCH] =?UTF-8?q?HL-5257=E5=88=B6=E5=93=81=E5=AD=90=E4=BB=B6?= =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E6=92=A4=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/productscrapRecordMain/index.ts | 5 +++++ .../productscrapRecordMain/index.vue | 20 +++++++++++++++++-- .../productscrapRecordMain.data.ts | 10 ++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/api/wms/productscrapRecordMain/index.ts b/src/api/wms/productscrapRecordMain/index.ts index de4020cac..1d18efe35 100644 --- a/src/api/wms/productscrapRecordMain/index.ts +++ b/src/api/wms/productscrapRecordMain/index.ts @@ -69,4 +69,9 @@ export const exportProductscrapRecordMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/productscrap-record-main/get-import-template' }) +} + +// 撤销 +export const revoke = async (requestNumber: number, number: number) => { + return await request.get({ url: `/wms/productscrap-record-main/revoke?requestNumber=` + requestNumber + '&number=' + number}) } \ No newline at end of file diff --git a/src/views/wms/productionManage/productscrap/productscrapRecordMain/index.vue b/src/views/wms/productionManage/productscrap/productscrapRecordMain/index.vue index f880d248e..ae2d97a3c 100644 --- a/src/views/wms/productionManage/productscrap/productscrapRecordMain/index.vue +++ b/src/views/wms/productionManage/productscrap/productscrapRecordMain/index.vue @@ -238,17 +238,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 ProductscrapRecordMainApi.revoke(row.requestNumber, row.number) + buttonBaseClick('refresh',null) + } } // 获取部门 用于详情 部门回显 const { wsCache } = useCache() diff --git a/src/views/wms/productionManage/productscrap/productscrapRecordMain/productscrapRecordMain.data.ts b/src/views/wms/productionManage/productscrap/productscrapRecordMain/productscrapRecordMain.data.ts index 551eca89d..23dd4094f 100644 --- a/src/views/wms/productionManage/productscrap/productscrapRecordMain/productscrapRecordMain.data.ts +++ b/src/views/wms/productionManage/productscrap/productscrapRecordMain/productscrapRecordMain.data.ts @@ -409,6 +409,16 @@ export const ProductscrapRecordMain = useCrudSchemas( activeValue: 'TRUE' } } + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 120, + fixed: 'right' + }, } ]) )