From 9135a160ea3c05fc65e707ca892b4f72e4b29b3b Mon Sep 17 00:00:00 2001 From: chenpei Date: Wed, 8 Jul 2026 13:11:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=80=83=E6=A0=B8=E8=B0=83?= =?UTF-8?q?=E7=A0=94=E5=B7=B2=E5=A4=84=E7=90=86=E5=88=97=E8=A1=A8=E8=BF=94?= =?UTF-8?q?=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/performance-survey-service.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/performance-survey-service.ts b/lib/performance-survey-service.ts index c8dc7c1a..bbc9e342 100644 --- a/lib/performance-survey-service.ts +++ b/lib/performance-survey-service.ts @@ -639,6 +639,19 @@ export async function listPerformanceSurveys(session: Session | null) { }, }) + const submittedAssignments = await prisma.performanceSurveyAssignment.findMany({ + where: { + evaluatorKey: ctx.evaluatorKey, + status: 'submitted', + }, + include: { + survey: true, + target: true, + }, + orderBy: { submittedAt: 'desc' }, + take: 100, + }) + const managerWhere = ctx.isDepartmentAdmin ? ctx.isSystemAdmin ? {} @@ -713,6 +726,18 @@ export async function listPerformanceSurveys(session: Session | null) { templateCode: assignment.survey.templateCode, submittedAt: assignment.submittedAt, })), + submitted: submittedAssignments.map((assignment) => ({ + assignmentId: assignment.id, + surveyId: assignment.surveyId, + targetId: assignment.targetId, + title: assignment.survey.title, + status: assignment.status, + surveyStatus: assignment.survey.status, + dueAt: assignment.survey.dueAt, + targetName: assignment.target.targetName, + templateCode: assignment.survey.templateCode, + submittedAt: assignment.submittedAt, + })), created: createdSurveys.map((survey) => ({ id: survey.id, title: survey.title,