feat: 重构入库流程,支持序列号与类型解耦,新增通用入库组件

- 重构物料档案字段:将"序列号件"改为"序列号",描述是否有序列号,与类型独立
- 调整入库页逻辑:按物料"序列号"决定记账方式,类型仅用于页签归属
- 新增通用入库组件 InboundEntry,复用三个类型页签的表单逻辑
- 优化成品入库页面,提交后自动切换到入库列表页签
- 修正物料校验提示文案,统一表述为"是否有序列号"
This commit is contained in:
SunYF
2026-10-07 20:00:06 +08:00
parent 756d978900
commit 7c7c16ee6d
20 changed files with 621 additions and 759 deletions
+19 -4
View File
@@ -34,7 +34,9 @@
<el-table-column label="对象" width="110">
<template #default="{ row }">{{ entityName(row.entityType) }}</template>
</el-table-column>
<el-table-column prop="entityId" label="对象标识" width="140" show-overflow-tooltip />
<el-table-column label="对象标识" width="140" show-overflow-tooltip>
<template #default="{ row }">{{ entityIdLabel(row) }}</template>
</el-table-column>
<el-table-column label="操作人" width="110">
<template #default="{ row }">{{ row.operatorName || row.operator || '-' }}</template>
</el-table-column>
@@ -73,19 +75,26 @@ const EVENT_FAMILIES = [
{ label: '质量检验', value: 'inspection.' },
{ label: '库存盘点', value: 'stocktake.' },
{ label: '半成品', value: 'semi.' },
{ label: '成品入库', value: 'finished.' }
{ label: '成品入库', value: 'finished.' },
{ label: '附件管理', value: 'attachment.' },
{ label: 'AGV调度', value: 'agv.' },
{ label: '系统维护', value: 'system.' },
{ label: '生产备料', value: 'material_backflush.' }
]
const FAMILY_LABEL = Object.fromEntries(EVENT_FAMILIES.map((f) => [f.value, f.label]))
const FAMILY_TAG = {
'user.': 'primary', 'role.': 'warning', 'rbac.': 'danger',
'material.': 'success', 'zone.': 'success', 'inbound.': 'success',
'outbound.': 'warning', 'inspection.': 'info', 'stocktake.': 'info', 'semi.': 'info',
'finished.': 'success'
'finished.': 'success', 'attachment.': 'info', 'agv.': 'warning', 'system.': 'danger',
'material_backflush.': 'warning'
}
const ENTITY_LABEL = {
user: '账号', role: '角色', rbac: '权限', material: '物料', zone: '区域',
inbound: '入库', outbound: '出库', inspection: '检验', stocktake: '盘点', semi: '半成品',
finished: '成品'
finished: '成品', attachment: '附件', agv_task: 'AGV任务', material_request: '叫料单',
order_material_ledger: '工单物料台账', return_order: '退库单', inventory: '库存',
disk: '磁盘', log: '日志文件'
}
function familyName(evt) {
@@ -99,6 +108,12 @@ function familyTag(evt) {
function entityName(t) {
return (t && ENTITY_LABEL[t]) || t || '-'
}
// 对象标识兜底翻译:历史日志把动作名写进了对象标识(如 attachment.archive 的 entityId=archive)
function entityIdLabel(row) {
const v = String(row?.entityId ?? '')
if (row?.entityType === 'attachment' && v === 'archive') return '归档任务'
return v || '-'
}
const filters = reactive({ eventType: '', operator: '' })
// 仅 admin 可按操作人筛选/查看全部;普通用户后端强制只返回自己的日志