refactor(mes): 移除工位接驳台绑定逻辑,改为独立dock主数据

- 移除station表的hasDock、dockCode字段及相关代码
- 新增dock表注释及关联逻辑,支持一个工位绑定多个接驳台
- 更新工位相关的seed、logic、schema及前端代码,适配新的接驳台管理方式
- 新增SQL注释固化脚本,完善MES表注释
This commit is contained in:
SunYF
2026-10-08 13:09:53 +08:00
parent 7c7c16ee6d
commit 1f7a42fc38
132 changed files with 2799 additions and 1090 deletions
+16 -5
View File
@@ -236,7 +236,11 @@ async function submitBatch() {
if (!go) return
batchSubmitting.value = true
try {
const data = await request.post('/zone/batch-generate', { ...batchForm, preview: false })
const data = await request.post('/zone/batch-generate', {
...batchForm, preview: false,
// 提交时带上预览表里(可能被手改过的)位置名称,后端优先采用
positions: batchPreview.value.map((x) => ({ positionNo: x.positionNo, positionName: x.positionName }))
})
ElMessage.success(`已生成 ${data?.created || 0} 个位置,跳过已存在 ${data?.skipped || 0} 个`)
batchDialog.value = false
zoneTabLoaded[4] = false
@@ -253,6 +257,7 @@ const layerBatchPreview = ref([])
const layerBatchPreviewing = ref(false)
const layerBatchSubmitting = ref(false)
const editLayerKey = ref('') // 当前点击编辑层名称的层号(点击层名称变输入框,回车/失焦保存到预览行)
const editPosKey = ref('') // 当前点击编辑位置名称的位置号(点击位置名称变输入框,回车/失焦保存到预览行)
function openLayerBatchGen() {
Object.assign(layerBatchForm, { zoneCode: '', shelfNo: '', layerStart: 1, layerEnd: 1 })
@@ -831,13 +836,19 @@ async function onMaterialFile(e) {
<el-table v-if="batchPreview.length" :data="batchPreview" border size="small" max-height="300">
<el-table-column prop="layerNo" label="层" width="80" align="center" />
<el-table-column prop="positionNo" label="位置号" width="100" align="center" />
<el-table-column prop="positionName" label="位置名称" min-width="200" />
<el-table-column label="位置名称" min-width="200">
<template #default="{ row }">
<el-input v-if="editPosKey === row.positionNo" v-model="row.positionName" size="small" maxlength="50"
@keyup.enter="editPosKey = ''" @blur="editPosKey = ''" />
<span v-else style="cursor:pointer" title="点击修改位置名称" @click="editPosKey = row.positionNo">{{ row.positionName }}</span>
</template>
</el-table-column>
<el-table-column label="是否已存在" width="110" align="center">
<template #default="{ row }"><el-tag :type="row.exists ? 'info' : 'success'" size="small">{{ row.exists ? '已存在' : '新增' }}</el-tag></template>
</el-table-column>
</el-table>
<div v-if="batchPreview.length" style="color:#909399;font-size:12px;margin-top:6px">
共 {{ batchPreview.length }} 个位置,其中已存在 {{ batchPreview.filter(x=>x.exists).length }} 个(生成时自动跳过)。
共 {{ batchPreview.length }} 个位置,其中已存在 {{ batchPreview.filter(x=>x.exists).length }} 个(生成时自动跳过)。位置名称可点击修改,确认生成时按修改后名称入库。
</div>
</el-dialog>
@@ -921,7 +932,7 @@ async function onMaterialFile(e) {
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="materialLoading" @click="searchMaterials">查询</el-button>
<el-button v-if="can('material:create')" type="success" @click="openMatCreate">新增物料</el-button>
<el-button v-if="can('material:create')" 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 首行表头按名称识别(列顺序可变、可含多余列):图号 | 名称 | 规格 | 单位 | 类型(结构件/电气件/其他) | 品类(原材料/成品/其他,可选;半成品不是物料品类) | 说明(除「说明」「品类」外均为必填)">
@@ -983,7 +994,7 @@ async function onMaterialFile(e) {
@size-change="(s) => { matPage.size = s; matPage.current = 1; loadMaterials() }" />
</div>
<el-dialog v-model="matDialog" :title="mEditingId ? '编辑物料' : '新增物料'" width="560px"
<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>