From 977d503805174a4780e090c9caeb8e803a6c61d3 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 15 Jan 2026 18:12:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=94=9F=E4=BA=A7=E7=89=A9=E6=96=99):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=92=A4=E9=94=80=E5=87=BA=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增撤销出入库记录API接口及前端操作按钮逻辑 处理入库和出库两种类型的撤销操作 --- .../productionMaterial/mminventory.js | 12 +++ .../productionMaterial/MmInventory.vue | 75 +++++++++++++++++-- 2 files changed, 81 insertions(+), 6 deletions(-) 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()