diff --git a/track-uniapp/src/pages/scan/components/TaskTreeNode.vue b/track-uniapp/src/pages/scan/components/TaskTreeNode.vue index f66dc3d..fc1aae7 100644 --- a/track-uniapp/src/pages/scan/components/TaskTreeNode.vue +++ b/track-uniapp/src/pages/scan/components/TaskTreeNode.vue @@ -87,6 +87,11 @@ export default { currentUsername: { type: String, default: "" }, }, emits: ["action", "editRecord", "viewRecords"], + mounted() { + console.log("TaskTreeNode task keys:", Object.keys(this.task)); + console.log("task.remark =", this.task.remark); + console.log("task.description =", this.task.description); + }, computed: { canEditRecord() { if (this.task.assignee_id == this.currentUserId) return true; diff --git a/track-uniapp/src/pages/scan/detail.vue b/track-uniapp/src/pages/scan/detail.vue index 09c5917..4640b66 100644 --- a/track-uniapp/src/pages/scan/detail.vue +++ b/track-uniapp/src/pages/scan/detail.vue @@ -252,8 +252,8 @@ - - + + 接收人 * @@ -265,19 +265,21 @@ - - + + + 📦 该任务将直接入库,任务状态变为「已入库」 + - - 将创建 {{ transferForm.assignees.length }}{{ transferForm.warehouse ? ' (+仓库)' : '' }} 个「{{ transferForm.next_task_name }}」任务 + + {{ isWarehouse ? '产品将入库并从个人待办中移除' : '将创建 1 个「' + transferForm.next_task_name + '」任务指派给 ' + (selectedUserName || '—') }} - + @@ -348,6 +350,9 @@ export default { const u = this.userOptions.find(u => u.id === this.transferForm.selectedUserId); return u ? u.name : ""; }, + isWarehouse() { + return this.transferForm.next_task_name === "🏭 入库 (virtual_warehouse)"; + }, activeTask() { // 查找树中第一个 WIP 或 PENDING 任务作为底部 Footer 的操作目标 const findActive = (tasks) => { @@ -644,7 +649,7 @@ export default { try { if (!this.userOptions.length) await this.loadUsers(); if (!this.processOptions.length) { - this.processOptions = [...TASK_NAME_OPTIONS]; + this.processOptions = ["🏭 入库 (virtual_warehouse)", ...TASK_NAME_OPTIONS]; } } finally { uni.hideLoading(); @@ -690,15 +695,16 @@ export default { }, async doTransfer() { this.actionLoading = true; - const finalAssignees = [...this.transferForm.assignees]; - if (this.transferForm.warehouse) finalAssignees.push("virtual_warehouse"); + const finalAssignees = this.isWarehouse + ? ["virtual_warehouse"] + : [...this.transferForm.assignees]; try { await post(`/tasks/${this.actionPopup.task.id}/transfer`, { next_assignees: finalAssignees, next_task_name: this.transferForm.next_task_name.trim(), note: this.transferForm.note.trim() || undefined, }); - uni.showToast({ title: "转交成功", icon: "success" }); + uni.showToast({ title: this.isWarehouse ? "已入库" : "转交成功", icon: "success" }); this.closeActionPopup(); this.doQuery(this.product.serial_number); } catch {} finally { this.actionLoading = false; } @@ -784,6 +790,7 @@ export default { .popup-tag-wh { background: #ede9fe; color: #7c3aed; } .popup-add-row { display: flex; gap: 6px; } .wh-label { font-size: 13px; display: flex; align-items: center; gap: 4px; margin-top: 6px; color: #6b7280; } +.warehouse-hint { font-size: 13px; background: #ede9fe; color: #7c3aed; padding: 10px 14px; border-radius: 10px; margin: 8px 0; text-align: center; } .preview-hint { font-size: 12px; background: #f0fdf4; color: #16a34a; padding: 8px 10px; border-radius: 8px; margin: 6px 0; } /* Picker & 表单 */