diff --git a/src/api/wms/unplannedissueRecordMain/index.ts b/src/api/wms/unplannedissueRecordMain/index.ts index 18feaf0ab..6aec7d292 100644 --- a/src/api/wms/unplannedissueRecordMain/index.ts +++ b/src/api/wms/unplannedissueRecordMain/index.ts @@ -59,3 +59,8 @@ export const exportUnplannedissueRecordMain = async (params) => { export const importTemplate = () => { return request.download({ url: '/wms/unplannedissue-record-main/get-import-template' }) } + +// 撤销 +export const revoke = async (id: number) => { + return await request.get({ url: `/wms/unplannedissue-record-main/revoke?id=` + id }) +} diff --git a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRecordMain/index.vue b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRecordMain/index.vue index 342ad3be9..82cfb8735 100644 --- a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRecordMain/index.vue +++ b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRecordMain/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 UnplannedissueRecordMainApi.revoke(row.masterId) + buttonBaseClick('refresh',null) + } } // 获取部门 用于详情 部门回显 const { wsCache } = useCache() diff --git a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRecordMain/unplannedissueRecordMain.data.ts b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRecordMain/unplannedissueRecordMain.data.ts index 52f8636d2..559cf7f47 100644 --- a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRecordMain/unplannedissueRecordMain.data.ts +++ b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRecordMain/unplannedissueRecordMain.data.ts @@ -481,6 +481,16 @@ export const UnplannedissueRecordMain = useCrudSchemas(reactive([ } } }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 120, + fixed: 'right' + }, + } ])) //表单校验