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
@@ -70,6 +70,12 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="平均作业时长" width="120" align="right">
<template #default="{ row }">{{ fmtDur(row.avgDurationSec) }}</template>
</el-table-column>
<el-table-column label="效率(件/时)" width="110" align="right">
<template #default="{ row }">{{ fmtEff(row.efficiency) }}</template>
</el-table-column>
</el-table>
<el-pagination style="margin-top:12px;justify-content:flex-end" background layout="total, prev, pager, next"
:total="views.byOperator.total" :page-size="pageSize" v-model:current-page="views.byOperator.page"
@@ -90,6 +96,12 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="平均作业时长" width="120" align="right">
<template #default="{ row }">{{ fmtDur(row.avgDurationSec) }}</template>
</el-table-column>
<el-table-column label="效率(件/时)" width="110" align="right">
<template #default="{ row }">{{ fmtEff(row.efficiency) }}</template>
</el-table-column>
</el-table>
<el-pagination style="margin-top:12px;justify-content:flex-end" background layout="total, prev, pager, next"
:total="views.byStation.total" :page-size="pageSize" v-model:current-page="views.byStation.page"
@@ -113,6 +125,12 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="平均作业时长" width="120" align="right">
<template #default="{ row }">{{ fmtDur(row.avgDurationSec) }}</template>
</el-table-column>
<el-table-column label="效率(件/时)" width="110" align="right">
<template #default="{ row }">{{ fmtEff(row.efficiency) }}</template>
</el-table-column>
</el-table>
<el-pagination style="margin-top:12px;justify-content:flex-end" background layout="total, prev, pager, next"
:total="views.detail.total" :page-size="pageSize" v-model:current-page="views.detail.page"
@@ -164,6 +182,22 @@ function rateText(row) {
const r = rateOf(row)
return r < 0 ? '-' : r.toFixed(1) + '%'
}
// 作业时长(秒)→ 人性化显示;效率(件/小时)保留一位小数
function fmtDur(sec) {
const s = Number(sec) || 0
if (s <= 0) return '-'
if (s < 60) return s + '秒'
const m = Math.floor(s / 60)
const rs = s % 60
if (m < 60) return rs ? `${m}${rs}` : `${m}`
const h = Math.floor(m / 60)
const rm = m % 60
return rm ? `${h}${rm}` : `${h}`
}
function fmtEff(v) {
const n = Number(v) || 0
return n > 0 ? n.toFixed(1) : '-'
}
function defaultRange() {
const d = new Date()