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
@@ -28,6 +28,25 @@
<el-button size="large" type="danger" plain @click="logout">退出</el-button>
</header>
<!-- 待办状态条:各类待办数量,点击跳对应页签 -->
<div class="todo-bar">
<span class="todo-title">待办状态</span>
<button
v-for="t in todoItems"
:key="t.key"
class="todo-item"
:class="{ zero: !t.count }"
type="button"
:title="t.detail"
@click="gotoTab(t.tab)"
>
<span>{{ t.label }}</span>
<b class="todo-num" :class="{ hot: t.count > 0 }">{{ t.count }}</b>
</button>
<span class="todo-spacer"></span>
<span class="remote-tip" title="手机 / 平板扫码枪通过浏览器访问本终端时,可用本机注入方式把扫码内容填入当前光标输入框">远程访问模式:手机 / 平板扫码枪可用本机注入方式输入</span>
</div>
<!-- 停单横幅(醒目置顶:已停止接单 + 原因,恢复接单即关闭) -->
<transition name="fade">
<div v-if="paused" class="pause-banner">
@@ -41,28 +60,61 @@
</transition>
<el-tabs v-model="tab" type="border-card" class="main-tabs">
<el-tab-pane v-if="hasTab('online')" label="上线建档" name="online">
<el-tab-pane v-if="hasTab('online')" name="online">
<template #label>
<span class="tab-label" :title="TAB_DUTY.online">上线建档</span>
<span v-if="badgeCount.online" class="tab-badge">{{ badgeCount.online }}</span>
</template>
<OnlinePanel />
</el-tab-pane>
<el-tab-pane v-if="hasTab('offline')" label="下线完工" name="offline">
<el-tab-pane v-if="hasTab('offline')" name="offline">
<template #label>
<span class="tab-label" :title="TAB_DUTY.offline">下线完工</span>
<span v-if="badgeCount.offline" class="tab-badge">{{ badgeCount.offline }}</span>
</template>
<OfflinePanel />
</el-tab-pane>
<el-tab-pane v-if="hasTab('work')" label="作业" name="work">
<el-tab-pane v-if="hasTab('work')" name="work">
<template #label>
<span class="tab-label" :title="TAB_DUTY.work">作业</span>
<span v-if="badgeCount.work" class="tab-badge">{{ badgeCount.work }}</span>
</template>
<WorkPanel ref="workRef" @call-material="tab = 'material'" />
</el-tab-pane>
<el-tab-pane v-if="hasTab('material') && hasDock" label="物料 / 叫料" name="material">
<el-tab-pane v-if="hasTab('material') && hasDock" name="material">
<template #label>
<span class="tab-label" :title="TAB_DUTY.material">物料 / 叫料</span>
<span v-if="badgeCount.material" class="tab-badge">{{ badgeCount.material }}</span>
</template>
<MaterialPanel />
</el-tab-pane>
<el-tab-pane v-if="hasTab('pdf')" label="工艺文件" name="pdf">
<el-tab-pane v-if="hasTab('pdf')" name="pdf">
<template #label>
<span class="tab-label" :title="TAB_DUTY.pdf">工艺文件</span>
<span v-if="badgeCount.pdf" class="tab-badge">{{ badgeCount.pdf }}</span>
</template>
<PdfPanel />
</el-tab-pane>
<el-tab-pane v-if="hasTab('inspect')" label="巡检 / 异常" name="inspect">
<el-tab-pane v-if="hasTab('inspect')" name="inspect">
<template #label>
<span class="tab-label" :title="TAB_DUTY.inspect">巡检 / 异常</span>
<!-- 改动18:小红点带悬停说明 + 点击展开明细 -->
<el-tooltip v-if="badgeCount.inspect" :content="badgeText.inspect" placement="bottom" :show-after="200">
<span class="tab-badge badge-clickable" @click.stop="openBadgeTip('inspect')">{{ badgeCount.inspect }}</span>
</el-tooltip>
</template>
<InspectPanel />
</el-tab-pane>
</el-tabs>
<WorkloadDialog ref="wlRef" />
<!-- 改动18:点击小红点展开「这个数字是什么、去哪处理」 -->
<el-dialog v-model="badgeTipDlg.show" :title="badgeTipDlg.title" width="620px" append-to-body>
<div style="white-space:pre-wrap;font-size:15px;line-height:1.9">{{ badgeTipDlg.text }}</div>
<template #footer><el-button type="primary" @click="badgeTipDlg.show = false">知道了</el-button></template>
</el-dialog>
<!-- 下班退料弹窗(G3/G4 2026-11-04):接驳台左/右显式必选;实际<理论时损耗原因必填;2026-11-04 定稿:运输方式+参考值 -->
<el-dialog v-model="duty.visible" title="剩余物料退料(下班前)" width="980px" :close-on-click-modal="false">
<el-alert type="info" :closable="false" show-icon class="duty-tip"
@@ -132,7 +184,7 @@
</template>
<script setup>
import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue'
import { computed, nextTick, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
import WorkPanel from './panels/WorkPanel.vue'
@@ -157,6 +209,9 @@ import request, { clearAuth } from '../utils/request'
import {
hasNg,
hasTab,
missingChecks,
missingSteps,
missingTorqueSteps,
myDocks,
loadConfig,
loadPoints,
@@ -172,7 +227,8 @@ import {
state,
stationNo,
user,
visibleTabs
visibleTabs,
wip
} from '../store/station'
const router = useRouter()
@@ -185,6 +241,59 @@ const stationName = computed(() => state.task?.stationName || '')
// 无接驳台即无叫料/退料/托盘回库入口;上线建档/下线完工/作业报工不受影响
const hasDock = computed(() => myDocks.value.length > 0)
// ---------- 待办状态条 / 页签红点(数量与状态条同源) ----------
// 6 个页签的职责说明(中文,鼠标悬停显示)
const TAB_DUTY = {
online: '上线建档:登记工件进线,生成追溯首节点',
offline: '下线完工:核对完工状态,确认入库回流仓库',
work: '作业:按工艺步骤装配、拧紧、报工',
material: '物料 / 叫料:绑定装配物料、缺料叫料与退料',
pdf: '工艺文件:查看工艺步骤图纸与整流程工艺文件',
inspect: '巡检 / 异常:签到点检、过程巡检、异常上报'
}
// 3 类待办,数量全部取自 store 现有派生数据:
// · 待处理任务 = 作业页未录入步骤 + 未拧紧步骤
// · 在制品待办 = 本工位在制品列表条数
// · 待检验/待确认 = 未勾选检测确认步骤 + 不合格告警项
const todoItems = computed(() => [
{ key: 'task', label: '待处理任务', tab: 'work',
count: missingSteps.value.length + missingTorqueSteps.value.length,
detail: `未录入步骤 ${missingSteps.value.length} 项 + 未拧紧步骤 ${missingTorqueSteps.value.length} 项;到「作业」页扫码后逐步报工、拧紧即清零` },
{ key: 'wip', label: '在制品待办', tab: 'online', count: wip.value.length,
detail: `本工位在制品 ${wip.value.length} 件(已上线未流转完);在「上线建档」可查看进线情况,完工走「下线完工」` },
{ key: 'inspect', label: '待检验/待确认', tab: 'inspect',
count: missingChecks.value.length + (hasNg.value ? 1 : 0),
detail: `未勾选检测确认 ${missingChecks.value.length} 项${hasNg.value ? ' + 1 项不合格告警' : ''};到「巡检 / 异常」页完成签到点检、勾选检测确认、复检并上报异常` }
])
// 页签徽标数量:与状态条同源(按页签聚合)
const badgeCount = computed(() => {
const m = {}
for (const t of todoItems.value) m[t.tab] = (m[t.tab] || 0) + t.count
return m
})
// 2026-11-10 改动18:小红点不再只显示一个数字,鼠标悬停/点击都能看到「这个 1 是什么、去哪处理」
const badgeText = computed(() => {
const m = {}
for (const t of todoItems.value) {
m[t.tab] = (m[t.tab] ? m[t.tab] + ';' : '') + `${t.label} ${t.count} 项:${t.detail}`
}
return m
})
const badgeTipDlg = reactive({ show: false, title: '', text: '' })
function openBadgeTip(tabKey) {
const items = todoItems.value.filter((t) => t.tab === tabKey)
badgeTipDlg.title = `页签待办说明 · ${({ work: '作业', online: '上线建档', inspect: '巡检 / 异常' })[tabKey] || tabKey}`
badgeTipDlg.text = items.length
? items.map((t) => `${t.label}:${t.count} 项\n${t.detail}`).join('\n\n')
: '当前页签暂无待办'
badgeTipDlg.show = true
}
async function gotoTab(name) {
tab.value = name
await nextTick()
if (name === 'work') workRef.value?.focusScan?.()
}
// 任务下发页签配置后,当前页签若被隐藏则切到第一个可见页签
watch(visibleTabs, () => {
if (visibleTabs.value.length && !visibleTabs.value.includes(tab.value)) {
@@ -572,4 +681,76 @@ onBeforeUnmount(() => {
.duty-actions {
margin-top: 10px;
}
.todo-bar {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
padding: 8px 16px;
background: #fff;
border-bottom: 1px solid #ebeef5;
}
.todo-title {
font-size: 15px;
font-weight: 700;
color: #303133;
margin-right: 4px;
}
.todo-item {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 4px 12px;
font-size: 14px;
color: #606266;
background: #f4f6f9;
border: 1px solid #e4e7ed;
border-radius: 18px;
cursor: pointer;
}
.todo-item:hover {
border-color: #1f6feb;
color: #1f6feb;
}
.todo-item.zero {
opacity: 0.65;
}
.todo-num {
min-width: 20px;
padding: 0 6px;
border-radius: 10px;
background: #e4e7ed;
color: #909399;
font-size: 13px;
text-align: center;
}
.todo-num.hot {
background: #f56c6c;
color: #fff;
}
.todo-spacer {
flex: 1;
}
.remote-tip {
font-size: 13px;
color: #909399;
}
.tab-label {
font-size: 14px;
}
.tab-badge {
display: inline-block;
min-width: 18px;
margin-left: 6px;
padding: 0 5px;
border-radius: 9px;
background: #f56c6c;
color: #fff;
font-size: 12px;
line-height: 18px;
text-align: center;
}
/* 改动18:带说明的小红点可点击,鼠标形状提示用户点开看明细 */
.tab-badge.badge-clickable { cursor: pointer; text-decoration: underline dotted; }
.tab-badge.badge-clickable:hover { background: #e6a23c; }
</style>