feat: 全端体验与稳定性整改(帮助文档清理/收集式报错/操作列统一/托盘与WS通知/物料同步重推)

- 移除 bj_power_dashboard 旧 React 大屏源码(迁移至 2D SVG 方案)
- MES/WMS/工位终端前端:清理 help.js 与 PageHelp 帮助文档,统一操作列与布局,接入请求拦截器
- 新增收集式校验错误弹窗(ErrorListDialog 统一拦截 3015,逐条列现象+建议)
- 新增托盘程序(tray)与 WebSocket(ws) 实时通知模块(三端共用)
- MES/WMS 物料档案新增同步状态字段,补齐双向失败重推与默认角色 seed
- 工单/产能/产品工艺/日排产逻辑调整;拧紧枪按工位配置
- 新增迁移 SQL:扭矩按工位、sysconfig 序列修复
- 更新 技术约束/案例/部署手册/项目说明 等文档
This commit is contained in:
SunYF
2026-11-10 23:42:50 +08:00
parent af554cea75
commit 619fc8983d
219 changed files with 8565 additions and 10739 deletions
+130 -1
View File
@@ -3,6 +3,17 @@
<el-alert type="info" :closable="false" style="margin-bottom:12px"
title="工位数以数据库为准。新增/停用/绑定工艺在此完成;虚拟工位(线下位)可在「工位名称」列直接点选重命名;内置工位名称锁定不可改、不可删除。" />
<!-- 工位模板:平铺展示(最多 20 个),点击应用 -->
<div style="margin-bottom:12px">
<div style="font-size:13px;font-weight:600;margin-bottom:6px">工位模板(点击应用,最多展示 20 个):</div>
<div style="display:flex;flex-wrap:wrap;gap:8px">
<el-button v-for="t in templates" :key="t.name" size="small" @click="openTemplate(t)">
{{ t.name }}<el-tag v-if="t.productCode" size="small" type="success" style="margin-left:6px">{{ t.productCode }}</el-tag>
</el-button>
<span v-if="!templates.length" style="color:#909399;font-size:12px">暂无工位模板,可在「产品工艺」页勾选多个产品工艺生成</span>
</div>
</div>
<div style="margin-bottom:12px">
<el-button v-if="can('produce.station:add')" type="primary" @click="openAdd">新增工位</el-button>
<span style="margin-left:12px;color:#909399;font-size:12px">虚拟工位类型选「线下位」,不连 PLC、仅记录上下线。</span>
@@ -150,6 +161,70 @@
<el-button v-if="can('produce.station:edit')" type="primary" @click="saveTabs">保存</el-button>
</template>
</el-dialog>
<!-- 查看工位模板并确认应用 -->
<el-dialog v-model="tplDlg.show" :title="`工位模板 - ${tplDlg.name}`" width="620px">
<div style="font-weight:600;margin-bottom:8px">工位 → 绑定工艺</div>
<el-table :data="tplDlg.stations" border size="small" empty-text="该模板未配置工位">
<el-table-column prop="stationNo" label="工位" width="90" align="center" />
<el-table-column label="绑定工艺" min-width="220">
<template #default="{ row }">{{ flowNameOf(row.flowId) }}</template>
</el-table-column>
</el-table>
<div style="margin-top:10px;font-size:13px">满足产品工艺:<b>{{ tplDlg.processNames.join('、') || '—' }}</b></div>
<div style="margin-top:6px;font-size:13px">适用产品:<b>{{ tplDlg.productCode || '不限定(跨产品模板)' }}</b></div>
<div style="margin-top:10px;font-size:13px">
本次要生产的产品(用于产品一致性校验):
<el-select v-model="tplDlg.targetProductCode" clearable filterable placeholder="不选=跳过校验" style="width:230px;margin-left:6px">
<el-option v-for="c in productCodes" :key="c" :value="c" :label="c" />
</el-select>
</div>
<div style="margin-top:6px;color:#909399;font-size:12px">点「预检并应用」会先逐条列出会被跳过的工位与原因,确认后才真正写入绑定。</div>
<template #footer>
<el-button @click="tplDlg.show = false">取消</el-button>
<el-button type="primary" @click="precheckTemplate">预检并应用</el-button>
</template>
</el-dialog>
<!-- 套用前冲突清单:逐条列出跳过原因,用户确认后才提交 -->
<el-dialog v-model="precheckDlg.show" title="套用前检查" width="620px">
<div style="margin-bottom:8px;font-size:13px">
模板:<b>{{ precheckDlg.name }}</b> 适用产品:<b>{{ precheckDlg.productCode || '不限定' }}</b>
</div>
<el-alert v-if="precheckDlg.blockedCount" type="warning" :closable="false" show-icon
:title="`有 ${precheckDlg.blockedCount} 个工位会被跳过,其余工位仍会正常套用`" style="margin-bottom:10px" />
<el-alert v-else type="success" :closable="false" show-icon title="未发现冲突,全部工位可套用" style="margin-bottom:10px" />
<el-table :data="precheckDlg.rows" border size="small" max-height="320">
<el-table-column prop="stationNo" label="工位" width="80" align="center" />
<el-table-column label="绑定工艺" width="160">
<template #default="{ row }">{{ flowNameOf(row.flowId) }}</template>
</el-table-column>
<el-table-column label="结果 / 跳过原因" min-width="240">
<template #default="{ row }">
<span v-if="row.blocked" style="color:#e6a23c">{{ row.reasons.join(';') }}</span>
<span v-else style="color:#67c23a">可套用</span>
</template>
</el-table-column>
</el-table>
<template #footer>
<el-button @click="precheckDlg.show = false">返回修改</el-button>
<el-button type="primary" @click="confirmApplyTemplate">确认应用(跳过冲突工位)</el-button>
</template>
</el-dialog>
<!-- 模板应用结果(一次列全 applied / skipped / matched) -->
<el-dialog v-model="resultDlg.show" title="模板应用结果" width="520px">
<div style="margin-bottom:8px;font-size:13px">已应用工位:<b>{{ resultDlg.applied.length ? resultDlg.applied.map((n) => '工位' + n).join('、') : '—' }}</b></div>
<div style="margin-bottom:8px;font-size:13px">满足产品工艺:<b>{{ resultDlg.matched.length ? resultDlg.matched.join('、') : '—' }}</b></div>
<div style="font-weight:600;margin-bottom:6px">跳过的工位(冲突):</div>
<template v-if="resultDlg.skipped.length">
<div v-for="(s, i) in resultDlg.skipped" :key="i" style="color:#e6a23c;font-size:13px">工位{{ s.stationNo }}:{{ s.reason }}</div>
</template>
<div v-else style="color:#909399;font-size:13px">无</div>
<template #footer>
<el-button type="primary" @click="resultDlg.show = false">知道了</el-button>
</template>
</el-dialog>
</el-card>
<PageHelp :data="helpStation" page="Station" />
</template>
@@ -364,8 +439,62 @@ async function remove(row) {
// ---------- 工位派工已删除:路线由工单「工艺组合」决定,绑定关系即本页下拉选择 ----------
// ---------- 工位模板(平铺展示 / 查看 / 应用)----------
const templates = ref([])
async function loadTemplates() {
try {
const data = await request.get('/station-templates')
templates.value = (data?.list || []).slice(0, 20)
} catch { templates.value = [] }
}
const flowNameOf = (id) => (flows.value.find((f) => f.id === id) || {}).name || ('工艺' + id)
const tplDlg = reactive({ show: false, name: '', productCode: '', targetProductCode: '', stations: [], processNames: [] })
const productCodes = computed(() => [...new Set((ppOptions.value || []).map((p) => p.productCode).filter(Boolean))])
function openTemplate(t) {
tplDlg.name = t.name || ''
tplDlg.productCode = t.productCode || ''
// 默认目标产品=模板适用产品;用户可改选,改选后不一致会在预检时被拒
tplDlg.targetProductCode = t.productCode || ''
tplDlg.stations = Array.isArray(t.stations) ? t.stations : []
tplDlg.processNames = Array.isArray(t.processNames) ? t.processNames : []
tplDlg.show = true
}
// 套用两步走:先只读预检列冲突清单,用户确认后才写库(2026-11-10 问题2 闭环)
const precheckDlg = reactive({ show: false, name: '', productCode: '', targetProductCode: '', rows: [], blockedCount: 0 })
async function precheckTemplate() {
const resp = await request.post('/stations/apply-template/precheck', {
name: tplDlg.name, targetProductCode: tplDlg.targetProductCode
})
const rows = Array.isArray(resp?.rows) ? resp.rows : []
precheckDlg.name = tplDlg.name
precheckDlg.productCode = resp?.productCode || tplDlg.productCode
precheckDlg.targetProductCode = tplDlg.targetProductCode
precheckDlg.rows = rows
precheckDlg.blockedCount = rows.filter((r) => r.blocked).length
tplDlg.show = false
precheckDlg.show = true
}
async function confirmApplyTemplate() {
await applyTemplate(precheckDlg.targetProductCode)
precheckDlg.show = false
}
const resultDlg = reactive({ show: false, applied: [], skipped: [], matched: [] })
async function applyTemplate(targetProductCode) {
const resp = await request.post('/stations/apply-template', {
name: tplDlg.name, targetProductCode: targetProductCode || ''
})
tplDlg.show = false
resultDlg.applied = Array.isArray(resp?.applied) ? resp.applied : []
resultDlg.skipped = Array.isArray(resp?.skipped) ? resp.skipped : []
resultDlg.matched = Array.isArray(resp?.matched) ? resp.matched : []
resultDlg.show = true
await load()
}
onMounted(async () => {
await Promise.all([load(), loadDocks()])
await Promise.all([load(), loadDocks(), loadTemplates()])
flows.value = (await request.get('/process-flows', { params: { pageSize: 1000, page: 1 } }))?.list || []
try {
ppOptions.value = (await request.get('/product-processes', { params: { pageSize: 1000, page: 1 } }))?.list || []