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;