feat(生产物料): 添加撤销出入库记录功能

新增撤销出入库记录API接口及前端操作按钮逻辑
处理入库和出库两种类型的撤销操作
This commit is contained in:
Tom
2026-01-15 18:12:19 +08:00
parent be85e20c95
commit 977d503805
2 changed files with 81 additions and 6 deletions

View File

@@ -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
})
}

View File

@@ -604,14 +604,24 @@
<el-table-column label="操作">
<template #default="scope">
<el-button
v-if="scope.row.remarks == '已撤销' || scope.row.transactionType == '出库红单'"
type="info"
size="small"
icon="refresh-left"
title="删除"
title="已撤销"
v-hasPermi="['mmrecordinbound:delete']"
@click="handleDelete(scope.row)"
>撤销</el-button
>已撤销</el-button
>
<el-button
v-else
type="info"
size="small"
title="撤销"
v-hasPermi="['mmrecordinbound:delete']"
@click="handleCancel(scope.row)"
disabled
>已撤销</el-button
>
</template>
</el-table-column>
</el-table>
@@ -648,12 +658,23 @@
<el-table-column label="操作">
<template #default="scope">
<el-button
v-if="scope.row.remarks == '已撤销' || scope.row.transactionType == '入库红单'"
type="info"
size="small"
title="撤销"
v-hasPermi="['mmrecordinbound:delete']"
@click="handleCancel(scope.row)"
disabled
>已撤销</el-button
>
<el-button
v-else
type="info"
size="small"
icon="refresh-left"
title="删除"
title="撤销"
v-hasPermi="['mmrecordinbound:delete']"
@click="handleDelete(scope.row)"
@click="handleCancel(scope.row)"
>撤销</el-button
>
</template>
@@ -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()