feat(移动端): 流转树在库任务显示『谁转入在库』

- TreeCanvas 全屏流转树 + TaskTreeNode 内嵌树节点,在库/入库任务显示『📥 转入在库: 创建人』
- 复用 formatUserName 中文名映射
This commit is contained in:
2026-08-31 17:20:52 +08:00
parent 6eb81953f5
commit beeee57b75
2 changed files with 14 additions and 0 deletions

View File

@ -15,6 +15,8 @@
<text v-if="task.assignee_id">负责人: {{ task.assignee_id }}</text>
<text v-if="task.reject_reason" class="reject-reason">驳回: {{ task.reject_reason }}</text>
</view>
<!-- 📥 在库任务显示谁转入在库 -->
<text v-if="isWarehouseTask && task.created_by" class="warehouse-in">📥 转入在库: {{ formatUserName(task.created_by) }}</text>
<!-- 任务初始描述 / 交接备注常驻显示区别于动态日志 records -->
<view v-if="task.remark || task.description" class="task-initial-remark">
@ -82,6 +84,7 @@
<script>
import { getBaseUrl } from "../../../utils/request";
import { formatUserName } from "../../../utils/format";
export default {
name: "TaskTreeNode",
@ -101,6 +104,13 @@ export default {
console.log("task.description =", this.task.description);
},
computed: {
isWarehouseTask() {
return !!(this.task && (
String(this.task.task_name || '').includes('在库')
|| String(this.task.task_name || '').includes('入库')
|| this.task.assignee_id === 'virtual_warehouse'
));
},
canEditRecord() {
if (this.readonly) return false;
if (this.task.assignee_id == this.currentUserId) return true;
@ -178,6 +188,7 @@ export default {
.tag-fission { background: #7c3aed; }
.tnode-meta { margin-top: 2px; font-size: 11px; color: #9ca3af; display: flex; gap: 8px; flex-wrap: wrap; }
.reject-reason { color: #ef4444; }
.warehouse-in { display: block; margin-top: 4px; font-size: 11px; color: #059669; font-weight: 700; }
/* 任务初始描述(常驻,区别于动态记录) */
.task-initial-remark {

View File

@ -43,6 +43,8 @@
</view>
<text class="cn-assignee">{{ formatUserName(node.assignee_id) || '—' }}</text>
<text v-if="!node._isMain && node.parent && !node.parent._isMain" class="cn-nested-hint">协助: {{ formatUserName(node.parent.assignee_id) || '' }}</text>
<!-- 📥 在库任务显示谁转入在库 -->
<text v-if="(String(node.task_name || '').includes('在库') || String(node.task_name || '').includes('入库') || node.assignee_id === 'virtual_warehouse') && node.created_by" class="cn-warehouse-in">📥 转入在库: {{ formatUserName(node.created_by) }}</text>
<text class="cn-time"> {{ fmtDate(node.created_at) }}{{ node.completed_at ? '→' + fmtDate(node.completed_at) : '→至今' }}</text>
<text v-if="node.records && node.records.length" class="cn-records-mini">{{ node.records.length }}</text>
</view>
@ -321,6 +323,7 @@ export default {
.cn-badge-mini.s-archived { background: #ede9fe; color: #7c3aed; }
.cn-assignee { font-size: 10px; color: #6b7280; }
.cn-nested-hint { font-size: 8px; color: #a78bfa; font-weight: 600; }
.cn-warehouse-in { font-size: 9px; color: #059669; font-weight: 700; }
.cn-time { font-size: 9px; color: #9ca3af; }
.cn-records-mini { font-size: 9px; color: #2563eb; background: #eff6ff; padding: 1px 6px; border-radius: 6px; display: inline-block; width: max-content; }
</style>