From 2880ea6df7467483429a467985f7ea8ead4bdca0 Mon Sep 17 00:00:00 2001 From: duxingchen Date: Mon, 10 Aug 2026 10:58:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Grid=E5=9B=9E=E9=80=80grid-cols-12?= =?UTF-8?q?=E7=B2=BE=E7=A1=AE=E5=AF=B9=E9=BD=90+=E5=88=86=E7=BB=84?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E6=8C=89device/order=E5=88=87=E6=8D=A2+?= =?UTF-8?q?=E5=AE=8F=E8=A7=82=E7=8A=B6=E6=80=81receive/transfer=E5=8F=AA?= =?UTF-8?q?=E4=B8=BB=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/services/task_service.py | 9 ++- frontend/src/pages/admin/AdminTasksPage.tsx | 64 +++++++-------------- 2 files changed, 26 insertions(+), 47 deletions(-) diff --git a/backend/app/services/task_service.py b/backend/app/services/task_service.py index 3aa6c0f..962cdcb 100644 --- a/backend/app/services/task_service.py +++ b/backend/app/services/task_service.py @@ -546,8 +546,10 @@ async def receive_task( if product: if task.assignee_id: product.current_location_id = task.assignee_id - if task_name: - product.overall_status = task_name + if task_name and ( + not task.parent_task_id or task.task_type in ("TRANSFER", "RECOVERY") + ): + product.overall_status = task_name # 只主线任务同步宏观状态 await db.commit() await db.refresh(task) @@ -818,7 +820,8 @@ async def transfer_task( product.overall_status = "在库" elif real_branches: product.current_location_id = real_branches[0][1] - product.overall_status = real_branches[0][0] + if not task.parent_task_id or task.task_type in ("TRANSFER", "RECOVERY"): + product.overall_status = real_branches[0][0] # 🔧 位置回溯:如果有新任务创建,优先新任务负责人;否则回溯到父任务 if not real_branches and not has_warehouse: diff --git a/frontend/src/pages/admin/AdminTasksPage.tsx b/frontend/src/pages/admin/AdminTasksPage.tsx index 7476478..74aa112 100644 --- a/frontend/src/pages/admin/AdminTasksPage.tsx +++ b/frontend/src/pages/admin/AdminTasksPage.tsx @@ -326,9 +326,11 @@ export default function AdminTasksPage() {
- {group.orderNo === "未绑定订单" - ? "📋 未绑定订单" - : `📦 订单: ${group.orderNo}`} + {group.orderNo === "未绑定订单" || group.orderNo === "未命名设备" + ? "📋 未分类" + : groupBy === "device" + ? `⚙️ 设备: ${group.orderNo}` + : `📦 订单: ${group.orderNo}`} {group.products.length} 个产品 @@ -351,15 +353,15 @@ export default function AdminTasksPage() { {isOpen && (
{/* 表头 */} -
-
产品身份证
+
+
产品身份证
序列号
-
规格型号
+
规格型号
宏观状态
任务状态
-
当前位置
-
创建时间
-
操作
+
当前位置
+
创建时间
+
操作
{/* 产品行 */} @@ -374,41 +376,15 @@ export default function AdminTasksPage() { return (
-
-
- {p.serial_number} -
-
- {p.external_serial || "—"} -
-
- {p.spec_model || p.material_name || p.material_id || "—"} -
-
- - {p.overall_status || "—"} - -
-
- - {statusCfg.label} - -
-
- {p.current_location_id === "virtual_warehouse" ? ( - - 🏭 仓库 - - ) : ( - p.current_location_name || p.current_location_id || "—" - )} -
-
- {new Date(p.created_at).toLocaleDateString("zh-CN")} -
-
+
+
{p.serial_number}
+
{p.external_serial || "—"}
+
{p.spec_model || p.material_name || p.material_id || "—"}
+
{p.overall_status || "—"}
+
{statusCfg.label}
+
{p.current_location_id === "virtual_warehouse" ? (🏭 仓库) : (p.current_location_name || p.current_location_id || "—")}
+
{new Date(p.created_at).toLocaleDateString("zh-CN")}
+