feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段

- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统
- 为BomItem实体添加relatedStandard字段及相关CRUD方法
- 为InspectionRecord实体添加reportNo、materialCode、materialName等字段
- 更新ent schema确保新字段的验证和默认值设置
- 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
SunYF
2026-09-17 12:49:07 +08:00
parent b4b274301d
commit 1cc93795ce
191 changed files with 24504 additions and 1250 deletions
+21 -1
View File
@@ -74,6 +74,16 @@ const recording = ref(false)
const idRef = ref()
const records = ref([])
// 货位四级串(U18):区域/货架/层/位置,跳过空段,用于盘点差异精确定位。
function locText(row) {
const parts = []
if (row?.zoneCode) parts.push(row.zoneCode)
if (row?.shelfNo) parts.push(row.shelfNo + '架')
if (row?.layerNo) parts.push(row.layerNo + '层')
if (row?.positionNo) parts.push(row.positionNo + '位')
return parts.length ? parts.join('/') : '-'
}
async function submitRecord() {
if (!active.no) {
ElMessage.warning('请先发起或填写盘点单号')
@@ -101,7 +111,11 @@ async function submitRecord() {
targetId: data?.targetId ?? targetId,
bookQty: data?.bookQty ?? '-',
scannedQty: data?.scannedQty ?? qty,
diffQty: data?.diffQty ?? qty - (data?.bookQty ?? 0)
diffQty: data?.diffQty ?? qty - (data?.bookQty ?? 0),
zoneCode: data?.zoneCode ?? '',
shelfNo: data?.shelfNo ?? '',
layerNo: data?.layerNo ?? '',
positionNo: data?.positionNo ?? ''
}
if (hit >= 0) records.value.splice(hit, 1, row)
else records.value.unshift(row)
@@ -274,6 +288,9 @@ const currentStep = computed(() => {
</el-form>
<el-table :data="records" border size="small" max-height="300" empty-text="尚无扫码记录">
<el-table-column prop="targetId" label="批次号 / SN 序列号" min-width="180" />
<el-table-column label="货位" min-width="150">
<template #default="{ row }">{{ locText(row) }}</template>
</el-table-column>
<el-table-column prop="bookQty" label="账面数" width="90" align="center" />
<el-table-column prop="scannedQty" label="实盘数" width="90" align="center" />
<el-table-column label="差异" width="90" align="center">
@@ -293,6 +310,9 @@ const currentStep = computed(() => {
<el-table :data="finishResult.diffs || []" border size="small"
empty-text="无差异,账实相符">
<el-table-column prop="targetId" label="批次号 / SN 序列号" min-width="190" />
<el-table-column label="货位" min-width="150">
<template #default="{ row }">{{ locText(row) }}</template>
</el-table-column>
<el-table-column prop="type" label="类型" width="100" align="center">
<template #default="{ row }">{{ row.type === 'BATCH' ? '批次' : 'SN' }}</template>
</el-table-column>