diff --git a/frontend/src/components/TaskCard.vue b/frontend/src/components/TaskCard.vue index 4741b28..86eafec 100644 --- a/frontend/src/components/TaskCard.vue +++ b/frontend/src/components/TaskCard.vue @@ -67,6 +67,9 @@
{{ subTask.itemNo || `子任务${index + 1}` }}: {{ subTask.receiverName || '待接单' }} + + 完成截止日期: {{ getSubTaskDeadline(subTask) }} + {{ getSubTaskStatusText(subTask.status) }} @@ -162,6 +165,8 @@ interface TaskItem { itemNo?: string receiverName?: string status: string + createTime?: string + estimatedHours?: number } interface Task { @@ -334,6 +339,17 @@ const getSubTaskStatusClass = (status: string) => { } return classMap[status] || '' } + +// 计算子任务完成截止日期(从接单开始计算+预计完成需要的时间) +const getSubTaskDeadline = (subTask: TaskItem) => { + if (!subTask.createTime || !subTask.estimatedHours) return null + // 从创建时间(接单时间)开始计算 + const startTime = dayjs(subTask.createTime) + // 计算截止时间:创建时间 + 预计工时 + const deadline = startTime.add(subTask.estimatedHours, 'hour') + // 格式化为"XX月XX日XX时" + return deadline.format('MM月DD日HH时') +}