diff --git a/src/api/wms/productionscrapRecordMain/index.ts b/src/api/wms/productionscrapRecordMain/index.ts index 8cde1c0b8..a464277b7 100644 --- a/src/api/wms/productionscrapRecordMain/index.ts +++ b/src/api/wms/productionscrapRecordMain/index.ts @@ -69,4 +69,9 @@ export const exportProductionscrapRecordMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/productionscrap-record-main/get-import-template' }) -} \ No newline at end of file +} + +// 撤销 +export const revoke = async (id: number) => { + return await request.get({ url: `/wms/productionscrap-record-main/revoke?id=` + id }) +} diff --git a/src/views/wms/issueManage/productionscrap/productionscrapRecordMain/index.vue b/src/views/wms/issueManage/productionscrap/productionscrapRecordMain/index.vue index 292b807ff..ad0813ccb 100644 --- a/src/views/wms/issueManage/productionscrap/productionscrapRecordMain/index.vue +++ b/src/views/wms/issueManage/productionscrap/productionscrapRecordMain/index.vue @@ -135,17 +135,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 ProductionscrapRecordMainApi.revoke(row.masterId) + buttonBaseClick('refresh',null) + } } // 获取部门 用于详情 部门回显 const { wsCache } = useCache() diff --git a/src/views/wms/issueManage/productionscrap/productionscrapRecordMain/productionscrapRecordMain.data.ts b/src/views/wms/issueManage/productionscrap/productionscrapRecordMain/productionscrapRecordMain.data.ts index beee18e09..0c3355821 100644 --- a/src/views/wms/issueManage/productionscrap/productionscrapRecordMain/productionscrapRecordMain.data.ts +++ b/src/views/wms/issueManage/productionscrap/productionscrapRecordMain/productionscrapRecordMain.data.ts @@ -521,6 +521,16 @@ export const ProductionscrapRecordMain = useCrudSchemas( activeValue: 'TRUE' } } + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 120, + fixed: 'right' + }, } ]) )