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' + }, } ]) )