diff --git a/track-uniapp/src/pages/scan/components/TaskTreeNode.vue b/track-uniapp/src/pages/scan/components/TaskTreeNode.vue index a6df9f5..76d5bd8 100644 --- a/track-uniapp/src/pages/scan/components/TaskTreeNode.vue +++ b/track-uniapp/src/pages/scan/components/TaskTreeNode.vue @@ -12,11 +12,12 @@ {{ task.task_name }} - 负责人: {{ task.assignee_id }} + + 负责人: {{ formatUserName(task.assignee_id) }} 驳回: {{ task.reject_reason }} - - 📥 转入在库: {{ formatUserName(task.created_by) }} + + 📥 转入在库: {{ formatUserName(task.assignee_id) }} @@ -42,6 +43,7 @@ :currentUserId="currentUserId" :currentUsername="currentUsername" :readonly="readonly" + :has-children="!!(child.child_tasks && child.child_tasks.length)" :isLast="idx === task.child_tasks.length - 1" @action="(e) => $emit('action', e)" @editRecord="(e) => $emit('editRecord', e)" @@ -151,6 +153,7 @@ export default { case "WIP": return "s-blue"; case "COMPLETED": return "s-green"; case "REJECTED": return "s-red"; + case "OUTBOUND": return "s-outbound"; default: return "s-gray"; } }, @@ -179,6 +182,7 @@ export default { .s-blue { border-left-color: #3b82f6; } .s-green { border-left-color: #22c55e; } .s-red { border-left-color: #ef4444; } +.s-outbound { border-left-color: #4f46e5; } .tnode-body { flex: 1; min-width: 0; } .tnode-name-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; } @@ -232,6 +236,7 @@ export default { .s-blue .badge { background: #dbeafe; color: #1d4ed8; } .s-green .badge { background: #dcfce7; color: #15803d; } .s-red .badge { background: #fce4ec; color: #be123c; } +.s-outbound .badge { background: #e0e7ff; color: #4338ca; } .tnode-children { position: relative; } diff --git a/track-uniapp/src/pages/scan/components/TreeCanvas.vue b/track-uniapp/src/pages/scan/components/TreeCanvas.vue index b7b3489..d37ce94 100644 --- a/track-uniapp/src/pages/scan/components/TreeCanvas.vue +++ b/track-uniapp/src/pages/scan/components/TreeCanvas.vue @@ -1,13 +1,12 @@ diff --git a/track-uniapp/src/pages/scan/detail.vue b/track-uniapp/src/pages/scan/detail.vue index 24d8ec9..56282fe 100644 --- a/track-uniapp/src/pages/scan/detail.vue +++ b/track-uniapp/src/pages/scan/detail.vue @@ -9,7 +9,7 @@ 宏观状态 - {{ product.overall_status || '未激活 — 点击发起首道工序' }} + {{ product.overall_status || '未激活 — 点击发起首道工序' }} @@ -58,7 +58,9 @@ @viewRecords="handleViewRecords" /> - + @@ -219,7 +221,7 @@ import WorkspaceArea from "./components/WorkspaceArea.vue"; import TreeCanvas from "./components/TreeCanvas.vue"; import TaskSwipeCards from "./components/TaskSwipeCards.vue"; -const OVERALL_OPTIONS = ["备货", "生产", "测试", "维修", "在库"]; +const OVERALL_OPTIONS = ["备货", "生产", "测试", "维修", "在库", "已入库", "已出库"]; const TASK_NAME_OPTIONS = ["备货", "生产", "测试", "维修", "在库"]; const STATUS_MAP = { PENDING: "待接收", WIP: "进行中", COMPLETED: "已完成", REJECTED: "已驳回", ARCHIVED: "已入库", CANCELED: "已撤回" }; @@ -319,6 +321,14 @@ export default { toggleMode() { if (this.currentMode === 'workspace') this.currentMode = 'swipe'; else if (this.currentMode === 'swipe') this.currentMode = 'tree'; else this.currentMode = 'workspace'; }, async handleSetOverallStatus(status) { try { this.product = await patch(`/products/scan/${this.product.serial_number}/status`, { status }); uni.showToast({ title: `状态已更新: ${status}`, icon: "success" }); this.showStatusPicker = false; } catch {} }, + // 宏观状态语义色:已入库=灰,已出库=靛蓝,待仓库收货=橙,其余默认蓝 + overallStatusClass(status) { + if (!status) return 'overall-empty'; + if (status === '已入库') return 'overall-archived'; + if (status === '已出库') return 'overall-outbound'; + if (status === '待仓库收货') return 'overall-warehouse'; + return ''; + }, openEditProduct() { this.editForm = { order_no: this.product.order_no || "", external_serial: this.product.external_serial || "" }; this.editProductVisible = true; }, async doEditProduct() { this.editSaving = true; try { this.product = await patch(`/products/${this.product.id}`, { order_no: this.editForm.order_no.trim(), external_serial: this.editForm.external_serial.trim() }); uni.showToast({ title: "已保存", icon: "success" }); this.editProductVisible = false; } catch {} finally { this.editSaving = false; } }, @@ -476,6 +486,9 @@ export default { .overall-label { font-size: 13px; color: #6b7280; } .overall-val { font-size: 15px; font-weight: 700; color: #2563eb; flex: 1; } .overall-empty { color: #ef4444; } +.overall-archived { color: #6b7280; } /* 已入库:灰 */ +.overall-outbound { color: #4f46e5; } /* 已出库:靛蓝 */ +.overall-warehouse { color: #ea580c; } /* 待仓库收货:橙 */ .overall-arrow { font-size: 12px; color: #9ca3af; } .card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); flex-shrink: 0; min-height: 120px; } .card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 6px; }