From f2fcd6d28c34726fb0ae2bbe2396b27abf34983f Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 16 Jan 2026 09:59:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=89=A9=E6=96=99=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=87=BA/=E5=85=A5=E5=BA=93=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E7=9A=84=E6=92=A4=E9=94=80=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在出库和入库记录页面添加撤销按钮,支持撤销已提交的记录。对于已撤销或红单记录显示为禁用状态。新增撤销接口调用和相应处理逻辑。 --- .../productionMaterial/MmRecordInbound.vue | 55 ++++++++++++++----- .../productionMaterial/MmRecordOutbound.vue | 52 +++++++++++++----- 2 files changed, 80 insertions(+), 27 deletions(-) diff --git a/src/views/materialManagement/productionMaterial/MmRecordInbound.vue b/src/views/materialManagement/productionMaterial/MmRecordInbound.vue index f6e9664..63ea3f1 100644 --- a/src/views/materialManagement/productionMaterial/MmRecordInbound.vue +++ b/src/views/materialManagement/productionMaterial/MmRecordInbound.vue @@ -91,24 +91,30 @@ - + @@ -303,7 +309,7 @@ import { getMmRecordInbound } from '@/api/materialManagement/productionMaterial/mmrecordinbound.js' import { listMmTransactionType } from '@/api/materialManagement/productionMaterial/mmtransactiontype.js' -import { getMaterialOption, getLocationOption } from '@/api/materialManagement/productionMaterial/mminventory.js' +import { getMaterialOption, getLocationOption, cancelMmInventory } from '@/api/materialManagement/productionMaterial/mminventory.js' import { listUser } from '@/api/system/user.js' import useUserStore from '@/store/modules/user' import { exportMmRecordInbound } from '@/api/materialManagement/productionMaterial/mmrecordinbound.js' @@ -664,6 +670,27 @@ function handleExport() { }) } +/** 撤销出/入库记录 */ +function handleCancel(row) { + 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) + } + }) + }) +} + handleQuery() getTypeOfWarehousingList() getMaterialCodeList() diff --git a/src/views/materialManagement/productionMaterial/MmRecordOutbound.vue b/src/views/materialManagement/productionMaterial/MmRecordOutbound.vue index 4b4dcdc..90f16d2 100644 --- a/src/views/materialManagement/productionMaterial/MmRecordOutbound.vue +++ b/src/views/materialManagement/productionMaterial/MmRecordOutbound.vue @@ -93,24 +93,29 @@ - + @@ -275,7 +280,7 @@ import { } from '@/api/materialManagement/productionMaterial/mmrecordoutbound.js' import { listMmTransactionType } from '@/api/materialManagement/productionMaterial/mmtransactiontype.js' import { listMmMaterial } from '@/api/materialManagement/productionMaterial/mmmaterial.js' -import { getLocationOption } from '@/api/materialManagement/productionMaterial/mminventory.js' +import { getLocationOption, cancelMmInventory } from '@/api/materialManagement/productionMaterial/mminventory.js' import { listUser } from '@/api/system/user.js' import dateOptions from '@/utils/dateOptions.js' import useUserStore from '@/store/modules/user' @@ -630,6 +635,27 @@ function handleExport() { }) } +/** 撤销出/入库记录 */ +function handleCancel(row) { + 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() getTypeOfWarehousingList() getMaterialList()