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
+9 -17
View File
@@ -118,7 +118,7 @@ const matDialog = ref(false)
const mEditingId = ref(0)
const mForm = reactive({
code: '', name: '', shortName: '', spec: '', unit: '',
manageMode: 1, templateCode: '', description: '', drawingNo: '',
manageMode: 1, templateCode: '', description: '',
itemType: 1, safetyStock: 0
})
const mSaving = ref(false)
@@ -155,7 +155,7 @@ function resetMForm() {
mEditingId.value = 0
Object.assign(mForm, {
code: '', name: '', shortName: '', spec: '', unit: '',
manageMode: 1, templateCode: '', description: '', drawingNo: '',
manageMode: 1, templateCode: '', description: '',
itemType: 1, safetyStock: 0
})
}
@@ -171,7 +171,6 @@ function openMatEdit(row) {
code: row.code, name: row.name, shortName: row.shortName || '',
spec: row.spec || '', unit: row.unit || '', manageMode: row.manageMode,
templateCode: row.templateCode || '',
drawingNo: row.drawingNo || '',
itemType: row.itemType || 1,
safetyStock: row.safetyStock || 0,
description: row.description || ''
@@ -181,7 +180,7 @@ function openMatEdit(row) {
async function saveMaterial() {
if (!mForm.code || !mForm.name) {
ElMessage.warning('物料编码和名称必填')
ElMessage.warning('图号和名称必填')
return
}
// 其他类物料规格强制(客户诉求 问题记录 L50)
@@ -195,7 +194,6 @@ async function saveMaterial() {
await request.post('/material/update', {
id: mEditingId.value, name: mForm.name, shortName: mForm.shortName,
spec: mForm.spec, unit: mForm.unit, description: mForm.description,
drawingNo: mForm.drawingNo,
itemType: Number(mForm.itemType),
safetyStock: Number(mForm.safetyStock) || 0,
manageMode: mForm.manageMode
@@ -398,8 +396,8 @@ async function onMaterialFile(e) {
<!-- 物料档案 -->
<template v-else>
<el-form inline style="margin-bottom:14px" @submit.prevent="searchMaterials">
<el-form-item label="物料编码">
<el-input v-model="matFilter.materialCode" placeholder="物料编码" clearable style="width:140px"
<el-form-item label="图号">
<el-input v-model="matFilter.materialCode" placeholder="图号" clearable style="width:140px"
@keyup.enter="searchMaterials" />
</el-form-item>
<el-form-item label="名称">
@@ -436,7 +434,7 @@ async function onMaterialFile(e) {
<el-button type="success" @click="openMatCreate">新增物料</el-button>
<el-button v-if="can('material:import')" type="warning" :loading="matImporting" @click="pickMaterialFile">导入</el-button>
<el-button v-if="can('material:export')" :loading="matExporting" @click="exportMaterials">导出</el-button>
<el-tooltip v-if="can('material:import')" content="Excel 模板首行表头物料编码 | 名称 | 简称 | 规格 | 单位 | 类型(结构件/电气件) | 说明 | 图号(可选)">
<el-tooltip v-if="can('material:import')" content="Excel 模板首行表头图号 | 名称 | 简称 | 规格 | 单位 | 类型(结构件/电气件) | 说明">
<el-link type="info" :underline="false" style="margin-left:4px">导入说明</el-link>
</el-tooltip>
<input ref="matFileRef" type="file" accept=".xlsx,.xls" style="display:none" @change="onMaterialFile" />
@@ -445,7 +443,7 @@ async function onMaterialFile(e) {
<el-table :data="materials" border size="small" v-loading="materialLoading"
empty-text="暂无物料请点击新增物料">
<el-table-column label="ID" prop="id" width="60" align="center" />
<el-table-column prop="code" label="物料编码" min-width="120" />
<el-table-column prop="code" label="图号" min-width="120" />
<el-table-column prop="name" label="名称" min-width="120" />
<el-table-column prop="spec" label="规格" min-width="90">
<template #default="{ row }">{{ row.spec || '-' }}</template>
@@ -453,9 +451,6 @@ async function onMaterialFile(e) {
<el-table-column prop="unit" label="单位" width="70" align="center">
<template #default="{ row }">{{ row.unit || '-' }}</template>
</el-table-column>
<el-table-column prop="drawingNo" label="图号" min-width="90" align="center">
<template #default="{ row }">{{ row.drawingNo || '-' }}</template>
</el-table-column>
<el-table-column label="品类" width="90" align="center">
<template #default="{ row }">
<el-tag :type="itemTypeTagType(row.itemType)" size="small">{{ itemTypeText(row.itemType) }}</el-tag>
@@ -491,8 +486,8 @@ async function onMaterialFile(e) {
<el-dialog v-model="matDialog" :title="mEditingId ? '编辑物料' : '新增物料'" width="560px"
append-to-body destroy-on-close>
<el-form label-width="90px">
<el-form-item label="物料编码" required>
<el-input v-model="mForm.code" placeholder=" SCREW-M3" :disabled="!!mEditingId" clearable />
<el-form-item label="物料编码/图号" required>
<el-input v-model="mForm.code" placeholder="图号即物料编码 SCREW-M3" :disabled="!!mEditingId" clearable />
</el-form-item>
<el-form-item label="名称" required>
<el-input v-model="mForm.name" placeholder=" 螺丝 M3" clearable />
@@ -506,9 +501,6 @@ async function onMaterialFile(e) {
<el-form-item label="单位">
<el-input v-model="mForm.unit" placeholder=" /" clearable />
</el-form-item>
<el-form-item label="图号">
<el-input v-model="mForm.drawingNo" placeholder="图纸编号可空" clearable />
</el-form-item>
<el-form-item label="品类">
<el-select v-model="mForm.itemType" placeholder="请选择" style="width:100%" @change="onItemTypeChange">
<el-option :value="1" label="原材料" />