From e5b201a0408a2cadef15519b02f82364ce09584e Mon Sep 17 00:00:00 2001 From: duxingchen Date: Wed, 5 Aug 2026 15:25:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84:=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E4=B8=AD=E9=97=B4=E5=86=97=E4=BD=99=E6=8C=89?= =?UTF-8?q?=E9=92=AE=20+=20=E8=BD=AC=E4=BA=A4=E5=BC=B9=E7=AA=97=E6=8E=A5?= =?UTF-8?q?=E5=85=A5=E7=9C=9F=E5=AE=9E=E7=94=A8=E6=88=B7/=E5=B7=A5?= =?UTF-8?q?=E5=BA=8FAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/scan/components/TaskTreeNode.vue | 24 --------------- track-uniapp/src/pages/scan/detail.vue | 30 ++++++++++++++----- 2 files changed, 22 insertions(+), 32 deletions(-) diff --git a/track-uniapp/src/pages/scan/components/TaskTreeNode.vue b/track-uniapp/src/pages/scan/components/TaskTreeNode.vue index 04ca546..a8df9eb 100644 --- a/track-uniapp/src/pages/scan/components/TaskTreeNode.vue +++ b/track-uniapp/src/pages/scan/components/TaskTreeNode.vue @@ -26,18 +26,6 @@ {{ statusLabel(task.status) }} - - - - - - - - diff --git a/track-uniapp/src/pages/scan/detail.vue b/track-uniapp/src/pages/scan/detail.vue index 79fb6a7..09c5917 100644 --- a/track-uniapp/src/pages/scan/detail.vue +++ b/track-uniapp/src/pages/scan/detail.vue @@ -326,13 +326,8 @@ export default { currentUserId: "", currentUsername: "", // Picker 数据源 - processOptions: ["备货", "生产", "测试", "维修", "质检", "打包"], - userOptions: [ - { id: "duxingchen", name: "杜邢宸" }, - { id: "zhangsan", name: "张三" }, - { id: "lisi", name: "李四" }, - { id: "wangwu", name: "王五" }, - ], + processOptions: [], + userOptions: [], // 任务操作 actionPopup: { visible: false, type: "", task: null }, actionLoading: false, @@ -429,6 +424,11 @@ export default { async loadUsers() { try { this.users = await get("/users/", { limit: 200 }); + // 同步填充 Picker 使用的 userOptions(接口返回 id/username/full_name) + this.userOptions = (this.users || []).map(u => ({ + id: u.username || u.id, + name: u.full_name || u.username, + })); } catch { /* 静默 */ } }, loadCurrentUser() { @@ -634,9 +634,23 @@ export default { }, // ---- 任务操作 ---- - handleTaskAction({ task, type, record }) { + async handleTaskAction({ task, type, record }) { if (type === "record") { this.openRecordPopup(task); return; } if (type === "deleteRecord") { this.doDeleteRecord(record); return; } + + // 转交时异步拉取真实工序和用户数据 + if (type === "transfer") { + uni.showLoading({ title: "加载数据..." }); + try { + if (!this.userOptions.length) await this.loadUsers(); + if (!this.processOptions.length) { + this.processOptions = [...TASK_NAME_OPTIONS]; + } + } finally { + uni.hideLoading(); + } + } + this.actionPopup = { visible: true, type, task }; this.rejectReason = ""; this.transferForm = { next_task_name: "", assignees: [], selectedUserId: "", warehouse: false, note: "" };