diff --git a/backend/app/schemas/task.py b/backend/app/schemas/task.py
index a0e11c8..62d7ba1 100644
--- a/backend/app/schemas/task.py
+++ b/backend/app/schemas/task.py
@@ -123,6 +123,7 @@ class TaskResponse(BaseModel):
status: str
notify_parent_on_complete: bool
is_rework: bool = False
+ remark: str | None = None
reject_reason: str | None = None
received_at: datetime | None = None
completed_at: datetime | None = None
diff --git a/track-uniapp/src/pages/scan/components/TaskTreeNode.vue b/track-uniapp/src/pages/scan/components/TaskTreeNode.vue
index a8df9eb..f66dc3d 100644
--- a/track-uniapp/src/pages/scan/components/TaskTreeNode.vue
+++ b/track-uniapp/src/pages/scan/components/TaskTreeNode.vue
@@ -51,23 +51,23 @@
›
-
+
- {{ formatTime(task.records[0].created_at) }}
+ {{ formatTime(latestRecord.created_at) }}
- ✏️
- 🗑️
+ ✏️
+ 🗑️
-
-
+
+
@@ -89,13 +89,17 @@ export default {
emits: ["action", "editRecord", "viewRecords"],
computed: {
canEditRecord() {
- // 双重宽松匹配:assignee_id 可能是数字ID或用户名字符串
if (this.task.assignee_id == this.currentUserId) return true;
if (this.task.assignee_id == this.currentUsername) return true;
if (this.currentUser && this.currentUser.id == this.task.assignee_id) return true;
if (this.currentUser && this.currentUser.username == this.task.assignee_id) return true;
return false;
},
+ latestRecord() {
+ const recs = this.task.records;
+ if (!recs || !recs.length) return null;
+ return [...recs].sort((a, b) => new Date(b.created_at) - new Date(a.created_at))[0];
+ },
},
methods: {
imageUrl(url) {