From 6c93b98190644f41fb929310a6eb4acbb0364464 Mon Sep 17 00:00:00 2001 From: duxingchen Date: Tue, 1 Sep 2026 17:42:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=85=A8?= =?UTF-8?q?=E8=A7=88=E6=A0=91/=E5=8D=A1=E7=89=87=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=20WAREHOUSE=20=E4=BB=93=E5=82=A8=E8=8A=82?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - WorkspaceArea/TaskSwipeCards 的 isMainFn 与主线子任务过滤加 WAREHOUSE - 扫码入库/出库节点回到中央主干道,不再渲染在左侧分支 - TaskSwipeCards 操作人防御性渲染:仓储任务显示 📦 MOM 仓储系统,不崩不丢 --- .../pages/scan/components/TaskSwipeCards.vue | 18 +++++++++++++----- .../pages/scan/components/WorkspaceArea.vue | 4 ++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/track-uniapp/src/pages/scan/components/TaskSwipeCards.vue b/track-uniapp/src/pages/scan/components/TaskSwipeCards.vue index 96f4d63..589c6f9 100644 --- a/track-uniapp/src/pages/scan/components/TaskSwipeCards.vue +++ b/track-uniapp/src/pages/scan/components/TaskSwipeCards.vue @@ -43,8 +43,11 @@ - 👤 负责人 - {{ formatUserName(card.assignee_id) || '未分配' }} + + 📦 仓储 + 👤 负责人 + MOM 仓储系统 + {{ formatUserName(card.assignee_id) || '未分配' }} @@ -125,7 +128,7 @@ export default { tasks.forEach(t => { flatMap[t.id] = t; flatten(t.child_tasks); }); }; flatten(this.product.task_tree); - const isMainFn = (t) => !t.parent_task_id || t.task_type === 'TRANSFER' || t.task_type === 'RECOVERY'; + const isMainFn = (t) => !t.parent_task_id || t.task_type === 'TRANSFER' || t.task_type === 'RECOVERY' || t.task_type === 'WAREHOUSE'; const traverse = (tasks, prefix) => { if (!tasks) return; let spawnIndex = 0; @@ -158,9 +161,9 @@ export default { lane.cards.push({ ...t, _key: t.id + '_' + lane._key, _isMain: lane._key === 'main' }); if (t.child_tasks && t.child_tasks.length) { - // 1. 同一分支线性延续 + // 1. 同一分支线性延续(含仓储任务) const nextOnThisLane = t.child_tasks.filter(c => - c.task_type === 'TRANSFER' || c.task_type === 'RECOVERY' + c.task_type === 'TRANSFER' || c.task_type === 'RECOVERY' || c.task_type === 'WAREHOUSE' ); followMain(nextOnThisLane, lane); @@ -189,6 +192,11 @@ export default { }, methods: { formatUserName, + // ★ 仓储系统任务(扫码入库/扫码出库):assignee 为 null,防御性渲染 + isWarehouseTask(t) { + const name = String((t && t.task_name) || ""); + return name.includes("扫码") || (t && t.task_type === "WAREHOUSE"); + }, getCardIdx(laneKey) { return this.cardIndices[laneKey] || 0; }, setCardIdx(laneKey, idx) { this.$set(this.cardIndices, laneKey, idx); }, onLaneSwipe(e) { this.currentLane = e.detail.current; }, diff --git a/track-uniapp/src/pages/scan/components/WorkspaceArea.vue b/track-uniapp/src/pages/scan/components/WorkspaceArea.vue index 1260cde..e13247a 100644 --- a/track-uniapp/src/pages/scan/components/WorkspaceArea.vue +++ b/track-uniapp/src/pages/scan/components/WorkspaceArea.vue @@ -147,7 +147,7 @@ export default { }, focusTasks() { const result = []; - const isMainFn = (t) => !t.parent_task_id || t.task_type === 'TRANSFER' || t.task_type === 'RECOVERY'; + const isMainFn = (t) => !t.parent_task_id || t.task_type === 'TRANSFER' || t.task_type === 'RECOVERY' || t.task_type === 'WAREHOUSE'; const walk = (tasks) => { if (!tasks) return; for (const t of tasks) { @@ -207,7 +207,7 @@ export default { flatten(this.product.task_tree); // 🚀 仅凭基因字段判定,移除危险的状态兜底 - const isMainFn = (t) => !t.parent_task_id || t.task_type === 'TRANSFER' || t.task_type === 'RECOVERY'; + const isMainFn = (t) => !t.parent_task_id || t.task_type === 'TRANSFER' || t.task_type === 'RECOVERY' || t.task_type === 'WAREHOUSE'; const traverse = (tasks, prefix) => { if (!tasks) return;