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">
|
||||||
<view class="tc-meta-row">
|
<view class="tc-meta-row">
|
||||||
<text class="tc-meta-label">👤 负责人</text>
|
<!-- 仓储任务:assignee 为 null,直接显示系统名,不取用户头像 -->
|
||||||
<text class="tc-meta-val">{{ formatUserName(card.assignee_id) || '未分配' }}</text>
|
<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>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -125,7 +128,7 @@ export default {
|
|||||||
tasks.forEach(t => { flatMap[t.id] = t; flatten(t.child_tasks); });
|
tasks.forEach(t => { flatMap[t.id] = t; flatten(t.child_tasks); });
|
||||||
};
|
};
|
||||||
flatten(this.product.task_tree);
|
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) => {
|
const traverse = (tasks, prefix) => {
|
||||||
if (!tasks) return;
|
if (!tasks) return;
|
||||||
let spawnIndex = 0;
|
let spawnIndex = 0;
|
||||||
@ -158,9 +161,9 @@ export default {
|
|||||||
lane.cards.push({ ...t, _key: t.id + '_' + lane._key, _isMain: lane._key === 'main' });
|
lane.cards.push({ ...t, _key: t.id + '_' + lane._key, _isMain: lane._key === 'main' });
|
||||||
|
|
||||||
if (t.child_tasks && t.child_tasks.length) {
|
if (t.child_tasks && t.child_tasks.length) {
|
||||||
// 1. 同一分支线性延续
|
// 1. 同一分支线性延续(含仓储任务)
|
||||||
const nextOnThisLane = t.child_tasks.filter(c =>
|
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);
|
followMain(nextOnThisLane, lane);
|
||||||
|
|
||||||
@ -189,6 +192,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatUserName,
|
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; },
|
getCardIdx(laneKey) { return this.cardIndices[laneKey] || 0; },
|
||||||
setCardIdx(laneKey, idx) { this.$set(this.cardIndices, laneKey, idx); },
|
setCardIdx(laneKey, idx) { this.$set(this.cardIndices, laneKey, idx); },
|
||||||
onLaneSwipe(e) { this.currentLane = e.detail.current; },
|
onLaneSwipe(e) { this.currentLane = e.detail.current; },
|
||||||
|
|||||||
@ -147,7 +147,7 @@ export default {
|
|||||||
},
|
},
|
||||||
focusTasks() {
|
focusTasks() {
|
||||||
const result = [];
|
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) => {
|
const walk = (tasks) => {
|
||||||
if (!tasks) return;
|
if (!tasks) return;
|
||||||
for (const t of tasks) {
|
for (const t of tasks) {
|
||||||
@ -207,7 +207,7 @@ export default {
|
|||||||
flatten(this.product.task_tree);
|
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) => {
|
const traverse = (tasks, prefix) => {
|
||||||
if (!tasks) return;
|
if (!tasks) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user