feat: 新增收集式校验错误弹窗及工位报警语音播报

新增 ErrorListDialog 组件用于统一展示结构化校验错误信息,实现报错一次收全;新增工位报警语音播报功能,通过浏览器 SpeechSynthesis 播放本工位相关报警;调整物料类别及序列号字段文案,移除「其他」类别;新增工单实际开始字段及采集方式配置;优化 AGV 及 PlcSend 页签刷新逻辑;新增看板物料追溯及工位报警接口;删除 PLC 强制写 M 位及相关测试代码;同步数据库字段注释及补丁。
This commit is contained in:
SunYF
2026-10-20 16:36:26 +08:00
parent f743cf21fb
commit b0c048d9aa
126 changed files with 4603 additions and 1639 deletions
+41 -14
View File
@@ -86,19 +86,21 @@
<span v-else style="color:#909399">全部显示</span>
</template>
</el-table-column>
<el-table-column label="操作" width="130" align="center" fixed="right">
<el-table-column label="操作" width="120" align="center" fixed="right">
<template #default="{ row }">
<el-button v-if="can('produce.station:edit')" link type="primary" size="small" @click="openName(row)">改名</el-button>
<el-dropdown trigger="click" @command="(c) => stationCommand(row, c)">
<el-button link type="primary" size="small">更多 ▾</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="tabs">页签</el-dropdown-item>
<el-dropdown-item v-if="can('produce.station:edit')" :command="row.status === 'ENABLED' ? 'disable' : 'enable'" :style="row.status === 'ENABLED' ? 'color:#e6a23c' : ''">{{ row.status === 'ENABLED' ? '停用' : '启用' }}</el-dropdown-item>
<el-dropdown-item v-if="can('produce.station:delete') && !row.isBuiltin" command="del" divided style="color:#f56c6c">删除</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<div style="display:flex;align-items:center;justify-content:center;gap:8px">
<el-button v-if="can('produce.station:edit')" link type="primary" size="small" @click="openName(row)">改名</el-button>
<el-dropdown trigger="click" @command="(c) => stationCommand(row, c)">
<el-button link type="primary" size="small">更多 ▾</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="tabs">页签</el-dropdown-item>
<el-dropdown-item v-if="can('produce.station:edit')" :command="row.status === 'ENABLED' ? 'disable' : 'enable'" :style="row.status === 'ENABLED' ? 'color:#e6a23c' : ''">{{ row.status === 'ENABLED' ? '停用' : '启用' }}</el-dropdown-item>
<el-dropdown-item v-if="can('produce.station:delete') && !row.isBuiltin" command="del" divided style="color:#f56c6c">删除</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
@@ -283,8 +285,33 @@ async function bindFlow(row, fid) {
try {
await request.post('/stations', { id: row.id, stationNo: row.stationNo, name: row.name, stationType: row.stationType || 'LINE', flowId: fid })
ElMessage.success(fid ? '已绑定工艺' : '已解除绑定')
} catch {
// 拦截器已提示(如绑定到未启用的流程)
} catch (e) {
// 规则3(fail-open):PLC 离线未确认 → 后端返回 3021(拦截器不弹 toast),此处弹二次确认
if (e && e.code === 3021) {
let confirmed = false
try {
await ElMessageBox.confirm(
`PLC 当前离线,无法确认工位${row.stationNo} 是否还有工件。请到现场确认工位已清空后再操作。`,
'PLC 离线',
{ type: 'warning', confirmButtonText: '已现场确认,继续', cancelButtonText: '取消' }
)
confirmed = true
} catch {
confirmed = false
}
if (confirmed) {
try {
await request.post('/stations', {
id: row.id, stationNo: row.stationNo, name: row.name,
stationType: row.stationType || 'LINE', flowId: fid, plcOfflineConfirmed: true
})
ElMessage.success(fid ? '已绑定工艺(PLC 离线已现场确认)' : '已解除绑定(PLC 离线已现场确认)')
} catch {
// 二次重发仍失败:拦截器已提示(如在途指令/托盘在位等硬拒绝)
}
}
}
// 其他错误拦截器已提示(如绑定到未启用的流程)
} finally {
await load()
}