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() {