修复考核调研已处理列表返回

This commit is contained in:
chenpei 2026-07-08 13:11:31 +08:00
parent 631b004529
commit 9135a160ea

View File

@ -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,