fix: 移动端全览树/卡片模式兼容 WAREHOUSE 仓储节点
- WorkspaceArea/TaskSwipeCards 的 isMainFn 与主线子任务过滤加 WAREHOUSE
- 扫码入库/出库节点回到中央主干道,不再渲染在左侧分支
- TaskSwipeCards 操作人防御性渲染:仓储任务显示 📦 MOM 仓储系统,不崩不丢
This commit is contained in:
@ -43,8 +43,11 @@
|
||||
|
||||
<view class="tc-meta">
|
||||
<view class="tc-meta-row">
|
||||
<text class="tc-meta-label">👤 负责人</text>
|
||||
<text class="tc-meta-val">{{ formatUserName(card.assignee_id) || '未分配' }}</text>
|
||||
<!-- 仓储任务:assignee 为 null,直接显示系统名,不取用户头像 -->
|
||||
<text v-if="isWarehouseTask(card)" class="tc-meta-label">📦 仓储</text>
|
||||
<text v-else class="tc-meta-label">👤 负责人</text>
|
||||
<text v-if="isWarehouseTask(card)" class="tc-meta-val">MOM 仓储系统</text>
|
||||
<text v-else class="tc-meta-val">{{ formatUserName(card.assignee_id) || '未分配' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -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; },
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user