feat(物料管理): 添加出/入库记录的撤销功能
在出库和入库记录页面添加撤销按钮,支持撤销已提交的记录。对于已撤销或红单记录显示为禁用状态。新增撤销接口调用和相应处理逻辑。
This commit is contained in:
@@ -91,24 +91,30 @@
|
|||||||
<el-table-column prop="warehouseCode" label="仓库编码" align="center" v-if="columns.showColumn('warehouseCode')" />
|
<el-table-column prop="warehouseCode" label="仓库编码" align="center" v-if="columns.showColumn('warehouseCode')" />
|
||||||
<el-table-column prop="batchNo" label="批次号" align="center" v-if="columns.showColumn('batchNo')" />
|
<el-table-column prop="batchNo" label="批次号" align="center" v-if="columns.showColumn('batchNo')" />
|
||||||
<el-table-column prop="operator" label="操作员" align="center" v-if="columns.showColumn('operator')" />
|
<el-table-column prop="operator" label="操作员" align="center" v-if="columns.showColumn('operator')" />
|
||||||
<!-- <el-table-column label="操作" width="160">
|
<el-table-column label="操作">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
v-if="scope.row.remarks == '已撤销' || scope.row.transactionType == '入库红单'"
|
||||||
|
type="info"
|
||||||
size="small"
|
size="small"
|
||||||
icon="edit"
|
title="撤销"
|
||||||
title="编辑"
|
|
||||||
v-hasPermi="['mmrecordinbound:edit']"
|
|
||||||
@click="handleUpdate(scope.row)"></el-button>
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
size="small"
|
|
||||||
icon="delete"
|
|
||||||
title="删除"
|
|
||||||
v-hasPermi="['mmrecordinbound:delete']"
|
v-hasPermi="['mmrecordinbound:delete']"
|
||||||
@click="handleDelete(scope.row)"></el-button>
|
@click="handleCancel(scope.row)"
|
||||||
|
disabled
|
||||||
|
>已撤销</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-else
|
||||||
|
type="info"
|
||||||
|
size="small"
|
||||||
|
icon="refresh-left"
|
||||||
|
title="撤销"
|
||||||
|
v-hasPermi="['mmrecordinbound:delete']"
|
||||||
|
@click="handleCancel(scope.row)"
|
||||||
|
>撤销</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
|
||||||
@@ -303,7 +309,7 @@ import {
|
|||||||
getMmRecordInbound
|
getMmRecordInbound
|
||||||
} from '@/api/materialManagement/productionMaterial/mmrecordinbound.js'
|
} from '@/api/materialManagement/productionMaterial/mmrecordinbound.js'
|
||||||
import { listMmTransactionType } from '@/api/materialManagement/productionMaterial/mmtransactiontype.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 { listUser } from '@/api/system/user.js'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { exportMmRecordInbound } from '@/api/materialManagement/productionMaterial/mmrecordinbound.js'
|
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()
|
handleQuery()
|
||||||
getTypeOfWarehousingList()
|
getTypeOfWarehousingList()
|
||||||
getMaterialCodeList()
|
getMaterialCodeList()
|
||||||
|
|||||||
@@ -93,24 +93,29 @@
|
|||||||
<el-table-column prop="orderNo" label="订单号" align="center" v-if="columns.showColumn('orderNo')" />
|
<el-table-column prop="orderNo" label="订单号" align="center" v-if="columns.showColumn('orderNo')" />
|
||||||
<el-table-column prop="operator" label="操作员" align="center" v-if="columns.showColumn('operator')" />
|
<el-table-column prop="operator" label="操作员" align="center" v-if="columns.showColumn('operator')" />
|
||||||
<el-table-column prop="remarks" label="备注" align="center" v-if="columns.showColumn('remarks')" />
|
<el-table-column prop="remarks" label="备注" align="center" v-if="columns.showColumn('remarks')" />
|
||||||
<!-- <el-table-column label="操作" width="160">
|
<el-table-column label="操作">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
v-if="scope.row.remarks == '已撤销' || scope.row.transactionType == '出库红单'"
|
||||||
|
type="info"
|
||||||
size="small"
|
size="small"
|
||||||
icon="edit"
|
title="已撤销"
|
||||||
title="编辑"
|
v-hasPermi="['mmrecordinbound:delete']"
|
||||||
v-hasPermi="['mmrecordoutbound:edit']"
|
disabled
|
||||||
@click="handleUpdate(scope.row)"></el-button>
|
>已撤销</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
v-else
|
||||||
|
icon="refresh-left"
|
||||||
|
type="info"
|
||||||
size="small"
|
size="small"
|
||||||
icon="delete"
|
title="撤销"
|
||||||
title="删除"
|
v-hasPermi="['mmrecordinbound:delete']"
|
||||||
v-hasPermi="['mmrecordoutbound:delete']"
|
@click="handleCancel(scope.row)"
|
||||||
@click="handleDelete(scope.row)"></el-button>
|
>撤销</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
|
||||||
@@ -275,7 +280,7 @@ import {
|
|||||||
} from '@/api/materialManagement/productionMaterial/mmrecordoutbound.js'
|
} from '@/api/materialManagement/productionMaterial/mmrecordoutbound.js'
|
||||||
import { listMmTransactionType } from '@/api/materialManagement/productionMaterial/mmtransactiontype.js'
|
import { listMmTransactionType } from '@/api/materialManagement/productionMaterial/mmtransactiontype.js'
|
||||||
import { listMmMaterial } from '@/api/materialManagement/productionMaterial/mmmaterial.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 { listUser } from '@/api/system/user.js'
|
||||||
import dateOptions from '@/utils/dateOptions.js'
|
import dateOptions from '@/utils/dateOptions.js'
|
||||||
import useUserStore from '@/store/modules/user'
|
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()
|
handleQuery()
|
||||||
getTypeOfWarehousingList()
|
getTypeOfWarehousingList()
|
||||||
getMaterialList()
|
getMaterialList()
|
||||||
|
|||||||
Reference in New Issue
Block a user