diff --git a/inventory-web/src/views/stock/stocktake/index.vue b/inventory-web/src/views/stock/stocktake/index.vue index 51d3df8..0548af4 100644 --- a/inventory-web/src/views/stock/stocktake/index.vue +++ b/inventory-web/src/views/stock/stocktake/index.vue @@ -31,6 +31,21 @@ 请先选择公司 + + + + ⚠️ 无法确认是否有进行中的盘点,请检查网络后重试 + + + 重新检测 + + + ([]) const companyLoading = ref(false) // 该公司的活跃会话:{ session_id, total, last_scan_time };无进行中的盘点则为 null const activeSession = ref<{ session_id: string; total: number; last_scan_time: string | null } | null>(null) +// ★ 探测失败标记:网络抖动时绝不能把「没查到」当成「没有盘点」—— +// 否则界面会退回「开始新盘点」,库管一点就新建会话,把多人协同拆开 +const probeFailed = ref(false) const isSuperAdmin = computed(() => userStore.role === 'SUPER_ADMIN') @@ -740,6 +758,7 @@ const handleCompanyChange = async (val: string) => { clearPersistedSession() activeSession.value = null serverDraftCount.value = 0 + probeFailed.value = false persistCompany(val) await checkServerDraft() } @@ -759,9 +778,11 @@ const checkServerDraft = async () => { ? { session_id: data.session_id, total: data.total || 0, last_scan_time: data.last_scan_time || null } : null serverDraftCount.value = data.total || 0 + probeFailed.value = false } catch (e) { - activeSession.value = null - serverDraftCount.value = 0 + // ★ 探测失败 ≠ 没有盘点。保持 activeSession 不变并把界面切到「重试」, + // 宁可挡住也不能让库管误开新会话。 + probeFailed.value = true } } @@ -1428,6 +1449,13 @@ const goToVarianceReview = () => { color: #909399; text-align: center; } +/* 探测失败提示 */ +.probe-failed { + font-size: 13px; + color: #e6a23c; + text-align: center; + line-height: 1.5; +} /* 场景 A 的进度提示与次要入口 */ .active-session-tip { font-size: 12px;