feat: 重构 AGV 对接与在制品查询,新增 PLC 手动监控功能
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
|
||||
<div class="spacer"></div>
|
||||
|
||||
<el-button size="large" :type="pendingTotal ? 'warning' : 'default'" @click="manualFlush">
|
||||
待同步 {{ pendingTotal }}
|
||||
<el-button size="large" :type="pendingTotal || deadTotal ? 'warning' : 'default'" @click="sqRef?.open()">
|
||||
待同步 {{ pendingTotal }}<template v-if="deadTotal"> · 待处理 {{ deadTotal }}</template>
|
||||
</el-button>
|
||||
<el-button size="large" @click="wlRef?.open()">我的工作量</el-button>
|
||||
<span class="user-name">{{ user.name || user.username || '-' }}</span>
|
||||
@@ -52,10 +52,6 @@
|
||||
<el-tab-pane v-if="hasTab('material')" label="物料 / 叫料" name="material">
|
||||
<MaterialPanel />
|
||||
</el-tab-pane>
|
||||
<!-- 页签 key 沿用 'move':兼容存量工位 visibleTabs 配置(历史为移料,现为产线点位上料/下料) -->
|
||||
<el-tab-pane v-if="hasTab('move')" label="产线点位(上料/下料)" name="move">
|
||||
<LinePointPanel />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="hasTab('pdf')" label="工艺文件" name="pdf">
|
||||
<PdfPanel />
|
||||
</el-tab-pane>
|
||||
@@ -65,6 +61,7 @@
|
||||
</el-tabs>
|
||||
|
||||
<WorkloadDialog ref="wlRef" />
|
||||
<SyncQueueDialog ref="sqRef" />
|
||||
|
||||
<!-- 全局帮助:右下角悬浮「?」,内容随当前页签切换 -->
|
||||
<PageHelp :data="helpData" />
|
||||
@@ -77,23 +74,22 @@ import { useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import WorkPanel from './panels/WorkPanel.vue'
|
||||
import MaterialPanel from './panels/MaterialPanel.vue'
|
||||
import LinePointPanel from './panels/LinePointPanel.vue'
|
||||
import PdfPanel from './panels/PdfPanel.vue'
|
||||
import InspectPanel from './panels/InspectPanel.vue'
|
||||
import OnlinePanel from './panels/OnlinePanel.vue'
|
||||
import OfflinePanel from './panels/OfflinePanel.vue'
|
||||
import WorkloadDialog from './panels/WorkloadDialog.vue'
|
||||
import SyncQueueDialog from './panels/SyncQueueDialog.vue'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
import {
|
||||
helpInspect,
|
||||
helpLinePoint,
|
||||
helpMaterial,
|
||||
helpOffline,
|
||||
helpOnline,
|
||||
helpPdf,
|
||||
helpWorkstation
|
||||
} from '../help'
|
||||
import { stationLogout, syncFlush } from '../api'
|
||||
import { stationLogout } from '../api'
|
||||
import { clearAuth } from '../utils/request'
|
||||
import {
|
||||
hasNg,
|
||||
@@ -105,6 +101,7 @@ import {
|
||||
loadTight,
|
||||
loadTask,
|
||||
loadWip,
|
||||
deadTotal,
|
||||
orderNo,
|
||||
paused,
|
||||
pauseReason,
|
||||
@@ -123,10 +120,6 @@ const workRef = ref()
|
||||
const wlRef = ref()
|
||||
const clock = ref('')
|
||||
const stationName = computed(() => state.task?.stationName || '')
|
||||
// 0=上线位、13=下线位为虚拟工位,分别展示上线建档 / 下线完工面板
|
||||
const isOnline = computed(() => Number(stationNo.value) === 0)
|
||||
const isOffline = computed(() => Number(stationNo.value) === 13)
|
||||
const isVirtual = computed(() => isOnline.value || isOffline.value)
|
||||
|
||||
// 任务下发页签配置后,当前页签若被隐藏则切到第一个可见页签
|
||||
watch(visibleTabs, () => {
|
||||
@@ -141,7 +134,6 @@ const HELP_MAP = {
|
||||
offline: helpOffline,
|
||||
work: helpWorkstation,
|
||||
material: helpMaterial,
|
||||
move: helpLinePoint,
|
||||
pdf: helpPdf,
|
||||
inspect: helpInspect
|
||||
}
|
||||
@@ -158,14 +150,6 @@ function tickClock() {
|
||||
clock.value = `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`
|
||||
}
|
||||
|
||||
async function manualFlush() {
|
||||
try {
|
||||
const data = await syncFlush()
|
||||
ElMessage.success(`本轮同步成功 ${data?.count ?? 0} 条`)
|
||||
loadStats()
|
||||
} catch (e) { /* 统一错误提示 */ }
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
// 退出前先本地退出(服务端登出失败也照样退),再按响应提醒本人未发送成功的条数
|
||||
let data = null
|
||||
@@ -175,10 +159,14 @@ async function logout() {
|
||||
clearAuth()
|
||||
router.push('/login')
|
||||
const n = Number(data?.pendingTotal || 0)
|
||||
if (n > 0) {
|
||||
const d = Number(data?.deadTotal || 0)
|
||||
if (n > 0 || d > 0) {
|
||||
const parts = []
|
||||
if (n > 0) parts.push(`${n} 条待自动重传`)
|
||||
if (d > 0) parts.push(`${d} 条待人工处理(被 MES 拒绝,需重选点位后再次提交)`)
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: `您有 ${n} 条报工数据发送失败,仍保留在本机(只有您本人登录可见/可发送),下次登录后请留意「待同步」`,
|
||||
message: `您有数据未上报成功,仍保留在本机(只有您本人登录可见/可发送):${parts.join(';')}。下次登录后请点「待同步」处理。`,
|
||||
duration: 8000,
|
||||
showClose: true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user