diff --git a/src/api/materialManagement/productionMaterial/mminventory.js b/src/api/materialManagement/productionMaterial/mminventory.js index 7ac559b..a5eca65 100644 --- a/src/api/materialManagement/productionMaterial/mminventory.js +++ b/src/api/materialManagement/productionMaterial/mminventory.js @@ -137,4 +137,16 @@ export async function queryMmInventory(data) { }) } +/** + * 撤销出/入库记录 + */ +export async function cancelMmInventory(data) { + return request({ + url: 'mes/productionMaterial/MmInventory/RevokeReceipt', + method: 'post', + data: data + }) +} + + diff --git a/src/views/materialManagement/productionMaterial/MmInventory.vue b/src/views/materialManagement/productionMaterial/MmInventory.vue index cabce19..673376d 100644 --- a/src/views/materialManagement/productionMaterial/MmInventory.vue +++ b/src/views/materialManagement/productionMaterial/MmInventory.vue @@ -604,14 +604,24 @@ @@ -648,12 +658,23 @@ @@ -675,7 +696,8 @@ import { createInboundReceipt, getLocationOption, createOutboundReceipt, - queryMmInventory + queryMmInventory, + cancelMmInventory // 撤销出/入库记录 } from '@/api/materialManagement/productionMaterial/mminventory.js' import { listMmTransactionType } from '@/api/materialManagement/productionMaterial/mmtransactiontype.js' import { warehouseOptions } from '@/utils/warehouse.js' @@ -1125,6 +1147,47 @@ function handleExport() { }) } +/** 撤销出/入库记录 */ +function handleCancel(row) { + if (inoroutFlag.value == '入库') { + proxy + .$confirm('是否确认撤销入库记录?', '警告', { + confirmButtonText: proxy.$t('common.ok'), + cancelButtonText: proxy.$t('common.cancel'), + type: 'warning' + }) + .then(() => { + cancelMmInventory({ id: row.id, type: 1 }).then((res) => { + const { code, msg } = res + if (code == 200) { + proxy.$modal.msgSuccess('撤销成功') + queryRecord() + } else { + proxy.$modal.msgError(msg) + } + }) + }) + } else { + proxy + .$confirm('是否确认撤销出库记录?', '警告', { + confirmButtonText: proxy.$t('common.ok'), + cancelButtonText: proxy.$t('common.cancel'), + type: 'warning' + }) + .then(() => { + cancelMmInventory({ id: row.id, type: 2 }).then((res) => { + const { code, msg } = res + if (code == 200) { + proxy.$modal.msgSuccess('撤销成功') + queryRecord() + } else { + proxy.$modal.msgError(msg) + } + }) + }) + } +} + handleQuery() getMaterialCodeList() getLocationOptionList()