feat(tournament): enhance PDF generation for missing participant data
- Updated the TournamentPlacementsTab component to include phone numbers in the PDF generation for participants with missing data. - Improved the layout of the PDF by adjusting column widths and changing the orientation to landscape. - Enhanced internationalization by adding new translation keys for "phone", "generatingPDF", and "page" across multiple languages. - Updated the button text to reflect the PDF generation status more accurately.
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
|
||||
<div v-if="isMiniChampionship && (participants.length > 0 || externalParticipants.length > 0)" class="missing-data-pdf" style="margin-top: 1.5rem;">
|
||||
<button @click="generateMissingDataPDF" class="btn-primary" :disabled="pdfLoading">
|
||||
{{ pdfLoading ? $t('messages.loading') + '...' : $t('tournaments.missingDataPDF') }}
|
||||
{{ pdfLoading ? $t('tournaments.generatingPDF') : $t('tournaments.missingDataPDF') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -586,6 +586,13 @@ export default {
|
||||
email = member.email;
|
||||
}
|
||||
|
||||
let phone = '';
|
||||
if (member.contacts && Array.isArray(member.contacts)) {
|
||||
phone = member.contacts.filter(c => c.type === 'phone').map(c => c.value).join(', ');
|
||||
} else if (member.phone) {
|
||||
phone = member.phone;
|
||||
}
|
||||
|
||||
const name = `${member.firstName || ''} ${member.lastName || ''}`.trim();
|
||||
const gender = member.gender && member.gender !== 'unknown' ? member.gender : null;
|
||||
|
||||
@@ -594,7 +601,8 @@ export default {
|
||||
birthDate: member.birthDate || null,
|
||||
gender,
|
||||
address: address || null,
|
||||
email: email || null
|
||||
email: email || null,
|
||||
phone: phone || null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -610,12 +618,13 @@ export default {
|
||||
birthDate: src.birthDate || null,
|
||||
gender,
|
||||
address: src.address || null,
|
||||
email: src.email || null
|
||||
email: src.email || null,
|
||||
phone: src.phone || null
|
||||
});
|
||||
}
|
||||
|
||||
// 2. Nur Teilnehmer mit fehlenden Daten filtern
|
||||
const fields = ['birthDate', 'gender', 'address', 'email'];
|
||||
const fields = ['birthDate', 'gender', 'address', 'email', 'phone'];
|
||||
const playersWithMissing = allPlayerData.filter(p =>
|
||||
fields.some(f => !p[f])
|
||||
);
|
||||
@@ -629,7 +638,7 @@ export default {
|
||||
playersWithMissing.sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
// 3. PDF erzeugen
|
||||
const pdf = new jsPDF('p', 'mm', 'a4');
|
||||
const pdf = new jsPDF('l', 'mm', 'a4');
|
||||
const margin = 15;
|
||||
const t = this.$t;
|
||||
|
||||
@@ -666,6 +675,7 @@ export default {
|
||||
t('members.birthdate'),
|
||||
t('members.gender'),
|
||||
t('tournaments.address'),
|
||||
t('tournaments.phone'),
|
||||
t('members.emailAddress')
|
||||
]];
|
||||
|
||||
@@ -674,6 +684,7 @@ export default {
|
||||
p.birthDate ? formatDate(p.birthDate) : linePlaceholder,
|
||||
p.gender ? formatGender(p.gender) : linePlaceholder,
|
||||
p.address || linePlaceholder,
|
||||
p.phone || linePlaceholder,
|
||||
p.email || linePlaceholder
|
||||
]);
|
||||
|
||||
@@ -696,11 +707,12 @@ export default {
|
||||
fontSize: 9
|
||||
},
|
||||
columnStyles: {
|
||||
0: { cellWidth: 35 },
|
||||
0: { cellWidth: 40 },
|
||||
1: { cellWidth: 28 },
|
||||
2: { cellWidth: 25 },
|
||||
3: { cellWidth: 45 },
|
||||
4: { cellWidth: 45 }
|
||||
3: { cellWidth: 50 },
|
||||
4: { cellWidth: 40 },
|
||||
5: { cellWidth: 50 }
|
||||
},
|
||||
didParseCell: (data) => {
|
||||
// Platzhalter-Zeilen grau und kursiv markieren
|
||||
@@ -718,9 +730,9 @@ export default {
|
||||
pdf.setFontSize(8);
|
||||
pdf.setTextColor(150);
|
||||
pdf.text(
|
||||
`${t('tournaments.missingDataPDFTitle')} – ${new Date().toLocaleDateString('de-DE')} – Seite ${i}/${pageCount}`,
|
||||
`${t('tournaments.missingDataPDFTitle')} – ${new Date().toLocaleDateString('de-DE')} – ${t('tournaments.page')} ${i}/${pageCount}`,
|
||||
margin,
|
||||
290
|
||||
200
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "Bitte d'fehlende Date (markiert mit ____) bi de Teilnehmer nochfroge und do notiere.",
|
||||
"allDataComplete": "Alli Teilnehmerdaten sind vollständig.",
|
||||
"address": "Adrässe",
|
||||
"phone": "Telefon",
|
||||
"generatingPDF": "PDF wird erstellt...",
|
||||
"page": "Siite",
|
||||
"dataNotRecorded": "No nid erfasst"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,6 +280,9 @@
|
||||
"missingDataPDFSubtitle": "Bitte die fehlenden Daten (markiert mit ____) bei den Teilnehmern erfragen und hier notieren.",
|
||||
"allDataComplete": "Alle Teilnehmerdaten sind vollständig.",
|
||||
"address": "Adresse",
|
||||
"phone": "Telefon",
|
||||
"generatingPDF": "PDF wird erstellt...",
|
||||
"page": "Seite",
|
||||
"dataNotRecorded": "Noch nicht erfasst"
|
||||
},
|
||||
"permissions": {
|
||||
|
||||
@@ -586,6 +586,9 @@
|
||||
"missingDataPDFSubtitle": "Bitte die fehlenden Daten (markiert mit ____) bei den Teilnehmern erfragen und hier notieren.",
|
||||
"allDataComplete": "Alle Teilnehmerdaten sind vollständig.",
|
||||
"address": "Adresse",
|
||||
"phone": "Telefon",
|
||||
"generatingPDF": "PDF wird erstellt...",
|
||||
"page": "Seite",
|
||||
"create": "Erstellen",
|
||||
"exportPDF": "PDF exportieren",
|
||||
"playInGroups": "Spielen in Gruppen",
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "Please collect the missing data (marked with ____) from participants and note them here.",
|
||||
"allDataComplete": "All participant data is complete.",
|
||||
"address": "Address",
|
||||
"phone": "Phone",
|
||||
"generatingPDF": "Generating PDF...",
|
||||
"page": "Page",
|
||||
"dataNotRecorded": "Not yet recorded"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "Please collect the missing data (marked with ____) from participants and note them here.",
|
||||
"allDataComplete": "All participant data is complete.",
|
||||
"address": "Address",
|
||||
"phone": "Phone",
|
||||
"generatingPDF": "Generating PDF...",
|
||||
"page": "Page",
|
||||
"dataNotRecorded": "Not yet recorded"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "Please collect the missing data (marked with ____) from participants and note them here.",
|
||||
"allDataComplete": "All participant data is complete.",
|
||||
"address": "Address",
|
||||
"phone": "Phone",
|
||||
"generatingPDF": "Generating PDF...",
|
||||
"page": "Page",
|
||||
"dataNotRecorded": "Not yet recorded"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "Por favor, recopile los datos faltantes (marcados con ____) de los participantes y anótelos aquí.",
|
||||
"allDataComplete": "Todos los datos de los participantes están completos.",
|
||||
"address": "Dirección",
|
||||
"phone": "Teléfono",
|
||||
"generatingPDF": "Generando PDF...",
|
||||
"page": "Página",
|
||||
"dataNotRecorded": "Aún no registrado"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "Pakikolekta ang nawawalang datos (may markang ____) mula sa mga kalahok at itala dito.",
|
||||
"allDataComplete": "Kumpleto na ang lahat ng datos ng mga kalahok.",
|
||||
"address": "Address",
|
||||
"phone": "Telepono",
|
||||
"generatingPDF": "Gumagawa ng PDF...",
|
||||
"page": "Pahina",
|
||||
"dataNotRecorded": "Hindi pa naitala"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "Veuillez collecter les données manquantes (marquées ____) auprès des participants et les noter ici.",
|
||||
"allDataComplete": "Toutes les données des participants sont complètes.",
|
||||
"address": "Adresse",
|
||||
"phone": "Téléphone",
|
||||
"generatingPDF": "Génération du PDF...",
|
||||
"page": "Page",
|
||||
"dataNotRecorded": "Pas encore enregistré"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "Si prega di raccogliere i dati mancanti (contrassegnati con ____) dai partecipanti e annotarli qui.",
|
||||
"allDataComplete": "Tutti i dati dei partecipanti sono completi.",
|
||||
"address": "Indirizzo",
|
||||
"phone": "Telefono",
|
||||
"generatingPDF": "Generazione PDF...",
|
||||
"page": "Pagina",
|
||||
"dataNotRecorded": "Non ancora registrato"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "不足しているデータ(____で表示)を参加者から収集し、ここに記入してください。",
|
||||
"allDataComplete": "すべての参加者データが揃っています。",
|
||||
"address": "住所",
|
||||
"phone": "電話",
|
||||
"generatingPDF": "PDF作成中...",
|
||||
"page": "ページ",
|
||||
"dataNotRecorded": "未登録"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "Proszę zebrać brakujące dane (oznaczone ____) od uczestników i zanotować je tutaj.",
|
||||
"allDataComplete": "Wszystkie dane uczestników są kompletne.",
|
||||
"address": "Adres",
|
||||
"phone": "Telefon",
|
||||
"generatingPDF": "Generowanie PDF...",
|
||||
"page": "Strona",
|
||||
"dataNotRecorded": "Jeszcze nie wprowadzono"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "กรุณาเก็บข้อมูลที่ขาดหาย (ทำเครื่องหมาย ____) จากผู้เข้าร่วมและจดบันทึกที่นี่",
|
||||
"allDataComplete": "ข้อมูลผู้เข้าร่วมทั้งหมดครบถ้วน",
|
||||
"address": "ที่อยู่",
|
||||
"phone": "โทรศัพท์",
|
||||
"generatingPDF": "กำลังสร้าง PDF...",
|
||||
"page": "หน้า",
|
||||
"dataNotRecorded": "ยังไม่ได้บันทึก"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "Pakikolekta ang nawawalang datos (may markang ____) mula sa mga kalahok at itala dito.",
|
||||
"allDataComplete": "Kumpleto na ang lahat ng datos ng mga kalahok.",
|
||||
"address": "Address",
|
||||
"phone": "Telepono",
|
||||
"generatingPDF": "Gumagawa ng PDF...",
|
||||
"page": "Pahina",
|
||||
"dataNotRecorded": "Hindi pa naitala"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@
|
||||
"missingDataPDFSubtitle": "请向参赛者收集缺失数据(标记为____)并在此记录。",
|
||||
"allDataComplete": "所有参赛者数据已完整。",
|
||||
"address": "地址",
|
||||
"phone": "电话",
|
||||
"generatingPDF": "正在生成PDF...",
|
||||
"page": "页",
|
||||
"dataNotRecorded": "尚未录入"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user