From c836944f9215f34fb7a75edc662a66fb3c22b60e Mon Sep 17 00:00:00 2001 From: duxingchen Date: Thu, 6 Aug 2026 08:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E:=20=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E8=BD=AC=E5=87=BA=E5=8A=9F=E8=83=BD=20=E2=80=94=20=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=9C=A8=E5=BA=93=E6=97=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=F0=9F=93=A4=E8=BD=AC=E5=87=BA=E6=8C=89=E9=92=AE+=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E5=88=9B=E5=BB=BA=E4=BB=BB=E5=8A=A1+=E6=9B=B4?= =?UTF-8?q?=E6=96=B0location?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- track-uniapp/src/pages/scan/detail.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/track-uniapp/src/pages/scan/detail.vue b/track-uniapp/src/pages/scan/detail.vue index 2fa2e9d..1de5181 100644 --- a/track-uniapp/src/pages/scan/detail.vue +++ b/track-uniapp/src/pages/scan/detail.vue @@ -31,6 +31,11 @@ + + + 📤 该产品在仓库中 — 点击此处转出派发给指定人员 + + @@ -178,7 +183,8 @@ export default { onTaskNameChange(e) { const idx = e.detail.value; this.firstForm.taskNameIdx = idx; this.firstForm.task_name = TASK_NAME_OPTIONS[idx]; }, onAssigneeChange(e) { const idx = e.detail.value; const u = this.users[idx]; if (u) { this.firstForm.assigneeIdx = idx; this.firstForm.assignee_id = u.username; this.firstForm.assigneeLabel = `${u.full_name} (${u.username})`; } }, openCreateFirstTask() { this.firstForm = { task_name: TASK_NAME_OPTIONS[0], taskNameIdx: 0, assignee_id: this.users.length > 0 ? this.users[0].username : "", assigneeLabel: this.users.length > 0 ? `${this.users[0].full_name} (${this.users[0].username})` : "", assigneeIdx: 0, note: "", autoReceive: true }; this.createFirstVisible = true; }, - async doCreateFirstTask() { this.firstSaving = true; try { const task = await post("/tasks/", { product_id: this.product.id, task_name: this.firstForm.task_name, assignee_id: this.firstForm.assignee_id, notify_parent_on_complete: false, remark: this.firstForm.note.trim() || undefined }); if (this.firstForm.autoReceive) { try { const opId = this.currentUsername || this.currentUserId; await post(`/tasks/${task.id}/receive?operator_id=${encodeURIComponent(opId)}`, { remark: this.firstForm.note.trim() || undefined }); } catch {} } uni.showToast({ title: this.firstForm.autoReceive ? "已创建并接收" : "已创建", icon: "success" }); this.createFirstVisible = false; this.doQuery(this.product.serial_number); } catch {} finally { this.firstSaving = false; } }, + openCheckout() { this.openCreateFirstTask(); }, + async doCreateFirstTask() { this.firstSaving = true; try { const task = await post("/tasks/", { product_id: this.product.id, task_name: this.firstForm.task_name, assignee_id: this.firstForm.assignee_id, notify_parent_on_complete: false, remark: this.firstForm.note.trim() || undefined }); if (this.firstForm.autoReceive) { try { const opId = this.currentUsername || this.currentUserId; await post(`/tasks/${task.id}/receive?operator_id=${encodeURIComponent(opId)}`, { remark: this.firstForm.note.trim() || undefined }); } catch {} } if (this.product.current_location_id === 'virtual_warehouse') { try { await patch(`/products/${this.product.id}`, { current_location_id: this.firstForm.assignee_id }); } catch {} } uni.showToast({ title: this.firstForm.autoReceive ? "已创建并接收" : "已创建", icon: "success" }); this.createFirstVisible = false; this.doQuery(this.product.serial_number); } catch {} finally { this.firstSaving = false; } }, openRecordPopup(task) { this.recordPopup = { visible: true, task }; this.recordForm = { recordId: null, remark: "", images: [], pendingCount: 0 }; this.isUploading = false; }, openEditRecord({ task, record }) { this.recordPopup = { visible: true, task }; this.recordForm = { recordId: record.id, remark: record.remark || "", images: record.images || [], pendingCount: 0 }; this.isUploading = false; }, @@ -288,5 +294,6 @@ export default { .picker-placeholder { color: #9ca3af; } .picker-arrow { font-size: 12px; color: #9ca3af; margin-left: 8px; } .warehouse-hint { font-size: 13px; background: #ede9fe; color: #7c3aed; padding: 10px 14px; border-radius: 10px; margin: 8px 0; text-align: center; } +.wh-checkout-bar { font-size: 14px; font-weight: 700; background: #ede9fe; color: #7c3aed; padding: 14px; border-radius: 12px; text-align: center; margin-bottom: 12px; border: 2px dashed #a78bfa; } .preview-hint { font-size: 12px; background: #f0fdf4; color: #16a34a; padding: 8px 10px; border-radius: 8px; margin: 6px 0; }