diff --git a/frontend/src/components/AccidentFormDialog.vue b/frontend/src/components/AccidentFormDialog.vue index 4154a9c..4b962e4 100644 --- a/frontend/src/components/AccidentFormDialog.vue +++ b/frontend/src/components/AccidentFormDialog.vue @@ -93,7 +93,18 @@ export default { : this.participants) : []; const participantSet = new Set(participantIds); - return this.members.filter(m => participantSet.has(m.id)); + const filtered = this.members.filter(m => participantSet.has(m.id)); + // Alphabetisch sortieren nach Nachname, dann Vorname + return filtered.sort((a, b) => { + const lastNameA = (a.lastName || '').toLowerCase(); + const lastNameB = (b.lastName || '').toLowerCase(); + if (lastNameA !== lastNameB) { + return lastNameA.localeCompare(lastNameB, 'de'); + } + const firstNameA = (a.firstName || '').toLowerCase(); + const firstNameB = (b.firstName || '').toLowerCase(); + return firstNameA.localeCompare(firstNameB, 'de'); + }); }, isValid() { return this.localAccident.memberId && this.localAccident.accident && this.localAccident.accident.trim() !== '';