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' + }, + } ])) //表单校验