Participant mangement

This commit is contained in:
2026-04-11 22:17:38 +02:00
parent e6bd8c684d
commit ed7f887e3a
47 changed files with 1641 additions and 269 deletions

View File

@@ -1,14 +1,25 @@
<script setup>
import { reactive, watch } from "vue";
import {onMounted, reactive, watch} from "vue";
import AmountInput from "../../../../Views/Components/AmountInput.vue";
const props = defineProps({
const staticProps = defineProps({
editMode: Boolean,
participant: Object,
event: Object,
});
console.log(props.participant)
const props = reactive({
participant: staticProps.participant,
});
onMounted(async () => {
const response = await fetch('/api/v1/event/participant/' + staticProps.participant.identifier + '/');
const data = await response.json();
Object.assign(props, data);
console.log(props);
});
const emit = defineEmits([
'closeParticipantDetails',
@@ -67,8 +78,8 @@ watch(
form.contact_person = participant?.contact_person ?? '';
form.email_2 = participant?.email_2 ?? '';
form.phone_2 = participant?.phone_2 ?? '';
form.arrival = participant?.arrival ?? '';
form.departure = participant?.departure ?? '';
form.arrival = participant?.arrivalDate ?? '';
form.departure = participant?.departureDate ?? '';
form.participationType = participant?.participation_type ?? '';
form.eatingHabit = participant?.eating_habit ?? '';
form.allergies = participant?.allergies ?? '';
@@ -110,6 +121,7 @@ function enableEditMode() {
function saveParticipant() {
emit('saveParticipant', { ...form });
close();
}
</script>
@@ -124,7 +136,7 @@ function saveParticipant() {
<tr>
<th>Name</th>
<td>
<span v-if="!props.editMode">
<span v-if="!staticProps.editMode">
{{ props.participant.firstname }} {{ props.participant.lastname }}
</span>
<span v-else>
@@ -137,7 +149,7 @@ function saveParticipant() {
<tr>
<th>Pfadiname</th>
<td>
<span v-if="!props.editMode">{{ props.participant.nickname }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.nickname }}</span>
<input v-else v-model="form.nickname" type="text" />
</td>
</tr>
@@ -145,7 +157,7 @@ function saveParticipant() {
<tr>
<th>Anschrift</th>
<td>
<span v-if="!props.editMode">
<span v-if="!staticProps.editMode">
{{ props.participant.address_1 }}<br />
{{ props.participant.address_2 }}<br />
{{ props.participant.postcode }}
@@ -163,9 +175,9 @@ function saveParticipant() {
<tr>
<th>Stamm</th>
<td>
<span v-if="!props.editMode">{{ props.participant.localgroup }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.localgroup }}</span>
<select v-else v-model="form.localgroup">
<option v-for="group in props.event.contributingLocalGroups" :key="group.id" :value="group.slug">{{ group.name }}</option>
<option v-for="group in staticProps.event.contributingLocalGroups" :key="group.id" :value="group.slug">{{ group.name }}</option>
</select>
</td>
</tr>
@@ -173,7 +185,7 @@ function saveParticipant() {
<tr>
<th>Geburtsdatum</th>
<td>
<span v-if="!props.editMode">{{ props.participant.birthday }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.birthday }}</span>
<input v-else v-model="form.birthday" type="date" />
</td>
</tr>
@@ -186,7 +198,7 @@ function saveParticipant() {
<tr>
<th>E-Mail</th>
<td>
<span v-if="!props.editMode">{{ props.participant.email_1 }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.email_1 }}</span>
<input v-else v-model="form.email_1" type="email" />
</td>
</tr>
@@ -194,7 +206,7 @@ function saveParticipant() {
<tr>
<th>Telefon</th>
<td>
<span v-if="!props.editMode">{{ props.participant.phone_1 }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.phone_1 }}</span>
<input v-else v-model="form.phone_1" type="text" />
</td>
</tr>
@@ -202,7 +214,7 @@ function saveParticipant() {
<tr>
<th>Ansprechperson</th>
<td>
<span v-if="!props.editMode">{{ props.participant.contact_person }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.contact_person }}</span>
<input v-else v-model="form.contact_person" type="text" />
</td>
</tr>
@@ -210,7 +222,7 @@ function saveParticipant() {
<tr>
<th>Ansprechperson E-Mail</th>
<td>
<span v-if="!props.editMode">{{ props.participant.email_2 }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.email_2 }}</span>
<input v-else v-model="form.email_2" type="email" />
</td>
</tr>
@@ -218,7 +230,7 @@ function saveParticipant() {
<tr>
<th>Ansprechperson Telefon</th>
<td>
<span v-if="!props.editMode">{{ props.participant.phone_2 }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.phone_2 }}</span>
<input v-else v-model="form.phone_2" type="text" />
</td>
</tr>
@@ -233,24 +245,24 @@ function saveParticipant() {
<tr>
<th>Anreise</th>
<td>
<span v-if="!props.editMode">{{ props.participant.arrival }}</span>
<input v-else v-model="form.arrival" type="text" />
<span v-if="!staticProps.editMode">{{ props.participant.arrival }}</span>
<input v-else v-model="form.arrival" type="date" />
</td>
</tr>
<tr>
<th>Abreise</th>
<td>
<span v-if="!props.editMode">{{ props.participant.departure }}</span>
<input v-else v-model="form.departure" type="text" />
<span v-if="!staticProps.editMode">{{ props.participant.departure }}</span>
<input v-else v-model="form.departure" type="date" />
</td>
</tr>
<tr>
<th>Teilnahmegruppe</th>
<td>
<span v-if="!props.editMode">{{ props.participant.participationType }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.participationType }}</span>
<select v-else v-model="form.participationType">
<option
v-for="participationType in event.participationTypes"
v-for="participationType in staticProps.event.participationTypes"
:value="participationType.type.slug"
>
{{ participationType.type.name }}
@@ -261,10 +273,10 @@ function saveParticipant() {
<tr>
<th>Ernährung</th>
<td>
<span v-if="!props.editMode">{{ props.participant.eatingHabit }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.eatingHabit }}</span>
<select v-else v-model="form.eatingHabit">
<option
v-for="eatingHabit in event.eatingHabits"
v-for="eatingHabit in staticProps.event.eatingHabits"
:value="eatingHabit.slug"
>
{{ eatingHabit.name }}
@@ -275,7 +287,7 @@ function saveParticipant() {
<tr>
<th>eFZ-Status</th>
<td>
<span v-if="!props.editMode">{{ props.participant.efzStatusReadable }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.efzStatusReadable }}</span>
<select v-else v-model="form.cocStatus">
<option value="not_checked">Nicht geprüft</option>
<option value="not_required">Nicht erforderlich</option>
@@ -287,7 +299,7 @@ function saveParticipant() {
<tr>
<th>Beitrag</th>
<td>
<span v-if="!props.editMode">{{ props.participant.amountPaid.readable }} / {{ props.participant.amountExpected.readable }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.amountPaid.readable }} / {{ props.participant.amountExpected.readable }}</span>
<span v-else>
<AmountInput v-model="form.amountPaid" style="width:74px" /> Euro
/
@@ -304,28 +316,28 @@ function saveParticipant() {
<tr>
<th>Allergien</th>
<td>
<span v-if="!props.editMode">{{ props.participant.allergies }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.allergies }}</span>
<input type="text" v-else v-model="form.allergies" />
</td>
</tr>
<tr>
<th>Unverträglichkeiten</th>
<td>
<span v-if="!props.editMode">{{ props.participant.intolerances }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.intolerances }}</span>
<input type="text" v-else v-model="form.intolerances" />
</td>
</tr>
<tr>
<th>Medikamente</th>
<td>
<span v-if="!props.editMode">{{ props.participant.medications }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.medications }}</span>
<input type="text" v-else v-model="form.medications" />
</td>
</tr>
<tr>
<th>Erweiterte Erste Hilfe</th>
<td>
<span v-if="!props.editMode">{{ props.participant.extendedFirstAid }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.extendedFirstAid }}</span>
<select v-else v-model="form.extendedFirstAid">
<option value="FIRST_AID_PERMISSION_ALLOWED">Erlaubt</option>
<option value="FIRST_AID_PERMISSION_DENIED">Verweigert</option>
@@ -335,7 +347,7 @@ function saveParticipant() {
<tr>
<th>Badeerlaubnis</th>
<td>
<span v-if="!props.editMode">{{ props.participant.swimmingPermission }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.swimmingPermission }}</span>
<select v-else v-model="form.swimmingPermission">
<option value="SWIMMING_PERMISSION_ALLOWED">Vorhanden, kann schwimmen</option>
<option value="SWIMMING_PERMISSION_LIMITED">Vorhanden, kann nicht schwimmen</option>
@@ -346,14 +358,14 @@ function saveParticipant() {
<tr>
<th>Letzte Tetanus-Impfung</th>
<td>
<span v-if="!props.editMode">{{ props.participant.tetanusVaccination }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.tetanusVaccination }}</span>
<input v-else v-model="form.tetanusVaccination" type="date" />
</td>
</tr>
<tr>
<th>Anmerkungen</th>
<td>
<span v-if="!props.editMode">{{ props.participant.notes }}</span>
<span v-if="!staticProps.editMode">{{ props.participant.notes }}</span>
<textarea v-else v-model="form.notes"></textarea>
</td>
</tr>
@@ -362,12 +374,12 @@ function saveParticipant() {
</div>
</div>
<button v-if="!props.editMode" class="button" @click="enableEditMode">Bearbeiten</button>
<button v-if="!staticProps.editMode" class="button" @click="enableEditMode">Bearbeiten</button>
<button v-else class="button" @click="saveParticipant">Speichern</button>
<button class="button" @click="paymentComplete(props.participant)">Zahlung vollständig</button>
<button class="button" @click="markCocExisting(props.participant)">eFZ liegt vor</button>
<button class="button" @click="cancelParticipation(props.participant)">Abmelden</button>
<button v-if="!props.participant.unregistered" class="button" @click="paymentComplete(props.participant)">Zahlung vollständig</button>
<button v-if="!props.participant.unregistered" class="button" @click="markCocExisting(props.participant)">eFZ liegt vor</button>
<button v-if="!props.participant.unregistered" class="button" @click="cancelParticipation(props.participant)">Abmelden</button>
<button class="button" @click="close">Schließen</button>
</template>

View File

@@ -5,6 +5,7 @@ import ParticipantData from "./ParticipantData.vue";
import {toast} from "vue3-toastify";
import {useAjax} from "../../../../../resources/js/components/ajaxHandler.js";
import {format, getDay, getMonth, getYear} from "date-fns";
import AmountInput from "../../../../Views/Components/AmountInput.vue";
const props = defineProps({
data: {
@@ -41,18 +42,49 @@ function openParticipantDetails(input) {
editMode.value = false;
}
console.log(props.data.participants)
async function saveParticipant(formData) {
if (!showParticipant.value?.identifier) {
return;
}
const data = await request('/api/v1/event/participant/' + showParticipant.value.identifier + '/update', {
method: "POST",
body: JSON.stringify(formData),
body: formData,
});
if (data.status === 'success') {
toast.success(data.message ?? 'Änderungen gespeichert');
toast.success(data.message ?? 'Die Änderungen wurden gespichert. Die Liste wird beim nächsten Neuladen neu generiert.');
document.getElementById('participant-' + data.participant.identifier + '-fullname').innerHTML = data.participant.fullname;
document.getElementById('participant-' + data.participant.identifier + '-birthday').innerText = data.participant.birthday;
document.getElementById('participant-' + data.participant.identifier + '-age').innerText = data.participant.age;
document.getElementById('participant-' + data.participant.identifier + '-localgroup').innerText = data.participant.localgroup;
document.getElementById('participant-' + data.participant.identifier + '-arrival').innerText = data.participant.arrival;
document.getElementById('participant-' + data.participant.identifier + '-departure').innerText = data.participant.departure;
document.getElementById('participant-' + data.participant.identifier + '-email_1').innerText = data.participant.email_1;
document.getElementById('participant-' + data.participant.identifier + '-email_2').innerText = data.participant.email_2 ?? '--';
document.getElementById('participant-' + data.participant.identifier + '-phone_1').innerText = data.participant.phone_1;
document.getElementById('participant-' + data.participant.identifier + '-phone_2').innerText = data.participant.phone_2 ?? '--';
if (data.cocChanged) {
document.getElementById('participant-' + data.identifier + '-coc-status').innerText = data.coc.statusText;
document.getElementById('participant-' + data.identifier + '-coc-action').style.display=data.coc.action;
document.getElementById('participant-' + data.identifier + '-name').className = data.coc.class;
}
if (data.amountChanged) {
document.getElementById('participant-' + data.identifier + '-payment').removeAttribute('class');
document.getElementById('participant-' + data.identifier + '-paid').innerText = data.amount.paid;
document.getElementById('participant-' + data.identifier + '-expected').innerText = data.amount.expected;
document.getElementById('participant-' + data.identifier + '-actions').style.display=data.amount.actions;
document.getElementById('participant-' + data.identifier + '-payment').className = data.amount.class;
}
editMode.value = false;
} else {
toast.error(data.message ?? 'Speichern fehlgeschlagen');
@@ -146,16 +178,6 @@ const getRowClass = (participant) => {
return "";
};
const ensureGroupState = (groupKey) => {
if (searchTerms[groupKey] === undefined) {
searchTerms[groupKey] = "";
}
if (selectedStatuses[groupKey] === undefined) {
selectedStatuses[groupKey] = "all";
}
};
async function paymentComplete(participant) {
const data = await request('/api/v1/event/participant/' + participant.identifier + '/payment-complete', {
method: "POST",
@@ -189,26 +211,76 @@ async function markCocExisting(participant) {
}
function openCancelParticipationDialog(participant) {
showParticipant.value = participant;
openCancelDialog.value = true;
showParticipant = participant;
}
async function execCancelParticipation() {
openCancelDialog.value = false;
toast.success('Abmeldung erfolgreich')
const data = await request('/api/v1/event/participant/' + showParticipant.value.identifier + '/signoff', {
method: "POST",
body: {
cancel_date: document.getElementById('cancel_date').value,
},
});
if (data.status === 'success') {
toast.success(data.message);
document.getElementById('participant-' + data.identifier + '-common').style.display = 'none';
document.getElementById('participant-' + data.identifier + '-meta').style.display = 'none';
} else {
toast.error(data.message);
}
openCancelDialog.value = false;
}
async function execResignonParticipant(participant) {
const data = await request('/api/v1/event/participant/' + participant.identifier + '/re-signon', {
method: "POST",
});
if (data.status === 'success') {
toast.success(data.message);
document.getElementById('participant-' + data.identifier + '-common').style.display = 'none';
document.getElementById('participant-' + data.identifier + '-meta').style.display = 'none';
} else {
toast.error(data.message);
}
openCancelDialog.value = false;
}
function openPartialPaymentDialog(participant) {
showParticipant.value = participant;
openPartialPaymentDialogSwitch.value = true;
showParticipant = participant;
}
async function execPartialPayment() {
const data = await request('/api/v1/event/participant/' + showParticipant.value.identifier + '/partial-payment', {
method: "POST",
body: {
amount: document.getElementById('partial_payment_amount').value,
},
});
if (data.status === 'success') {
toast.success(data.message);
document.getElementById('participant-' + data.identifier + '-payment').removeAttribute('class');
document.getElementById('participant-' + data.identifier + '-paid').innerText = data.amount.paid;
document.getElementById('participant-' + data.identifier + '-expected').innerText = data.amount.expected;
document.getElementById('participant-' + data.identifier + '-actions').style.display=data.amount.actions;
document.getElementById('participant-' + data.identifier + '-payment').className = data.amount.class;
} else {
toast.error(data.message);
}
openPartialPaymentDialogSwitch.value = false;
toast.success('Teilzahlung erfolgreich')
}
</script>
@@ -237,58 +309,66 @@ async function execPartialPayment() {
v-for="participant in getFilteredParticipants(groupKey, participants)"
:key="participant.id"
>
<tr :class="getRowClass(participant)" :id="'participant-' + participant.identifier">
<tr :class="getRowClass(participant)" :id="'participant-' + participant.identifier + '-common'">
<td :id="'participant-' + participant.identifier +'-name'"
style="width: 300px;"
:class="participant.efz_status === 'checked_invalid' ? 'efz-invalid' :
participant.efz_status === 'not_checked' ? 'efz-not-checked' : ''">
<div v-html="participant.fullname" /><br />
Geburtsdatum: {{ participant.birthday }}<br />
Alter: {{ participant.age }} Jahre<br />
<div :id="'participant-' + participant.identifier +'-fullname'" v-html="participant.fullname" /><br />
Geburtsdatum: <label :id="'participant-' + participant.identifier +'-birthday'">{{ participant.birthday }}</label><br />
Alter: <label :id="'participant-' + participant.identifier +'-age'">{{ participant.age }}</label> Jahre<br />
<span>eFZ-Status: <label :id="'participant-' + participant.identifier +'-coc-status'">{{ participant.efzStatusReadable }}</label></span> &nbsp;
<span :id="'participant-' + participant.identifier +'-coc-action'" v-if="participant.efz_status !== 'checked_valid' && participant.efz_status !== 'not_required'" class="link" style="color: #3cb62e; font-size: 11pt;" @click="markCocExisting(participant)">Vorhanden?</span>
</td>
<td :id="'participant-' + participant.identifier +'-payment'" :class="participant.amount_left_value != 0 && !unregistered_at ? 'not-paid' : ''" style="width: 275px; '">
<td :id="'participant-' + participant.identifier +'-payment'" :class="participant.amount_left_value != 0 && !participant.unregistered ? 'not-paid' : ''" style="width: 275px; '">
Gezahlt: <label :id="'participant-' + participant.identifier + '-paid'">{{ participant?.amountPaid.readable }}</label> /<br />
Gesamt: {{ participant?.amountExpected.readable }}
Gesamt: <label :id="'participant-' + participant.identifier + '-expected'">{{ participant?.amountExpected.readable }}</label>
<br /><br />
<span v-if="participant.amount_left_value != 0 && !unregistered_at" :id="'participant-' + participant.identifier + '-actions'">
<span v-if="participant.amount_left_value != 0 && !participant.unregistered" :id="'participant-' + participant.identifier + '-actions'">
<span class="link" style="font-size:10pt;" @click="paymentComplete(participant)">Zahlung buchen</span> &nbsp;
<span class="link" style="font-size:10pt;" @click="openPartialPaymentDialog(participant)">Teilzahlung buchen</span>
</span>
</td>
<td>
{{ participant?.email_1 ?? "-" }}
<div v-if="participant?.email_2 && participant.email_2 !== participant.email_1" class="text-xs text-gray-500">
{{ participant.email_2 }}
</div>
<label :id="'participant-' + participant.identifier +'-email_1'" class="block-label">{{ participant?.email_1 ?? "-" }}</label>
<label :id="'participant-' + participant.identifier +'-email_2'" class="block-label">{{ participant.email_2 }}</label>
</td>
<td>
{{ participant?.phone_1 ?? "-" }}
<div v-if="participant?.phone_2 && participant.phone_2 !== participant.phone_1" class="text-xs text-gray-500">
{{ participant.phone_2 }}
</div>
<label :id="'participant-' + participant.identifier +'-phone_1'" class="block-label">{{ participant?.phone_1 }}</label>
<label :id="'participant-' + participant.identifier +'-phone_2'" class="block-label">{{ participant?.phone_2 }}</label>
</td>
</tr>
<tr class="participant-meta-row">
<tr class="participant-meta-row" :id="'participant-' + participant.identifier + '-meta'">
<td colspan="5" style="height: 15px !important; font-size: 9pt; background-color: #ffffff; border-top-style: none;">
{{ participant?.localgroup ?? "-" }} |
<strong> Anreise: </strong>{{ participant?.arrival ?? "-" }} |
<strong> Abreise: </strong>{{ participant?.departure ?? "-" }} |
<strong> Angemeldet am: </strong>{{ participant?.registerDate ?? "-" }} |
<label :id="'participant-' + participant.identifier +'-localgroup'">
{{ participant?.localgroup ?? "-" }}
</label> |
<strong> Anreise: </strong>
<label :id="'participant-' + participant.identifier +'-arrival'">
{{ participant?.arrival ?? "-" }}
</label>|
<strong> Abreise: </strong>
<label :id="'participant-' + participant.identifier +'-departure'">
{{ participant?.departure ?? "-" }}
</label> |
<label v-if="!participant.unregistered">
<strong> Angemeldet am: </strong>{{ participant?.registerDate ?? "-" }}
</label>
<label v-else>
<strong> Abgemeldet am: </strong>{{ participant?.unregisteredAt ?? "-" }}
</label> |
<span class="link" @click="openParticipantDetails(participant)">Details</span> |
<span class="link">E-Mail senden</span> |
<span @click="openCancelParticipationDialog(participant)" v-if="!unregistered_at" class="link" style="color: #da7070;">Abmelden</span>
<span v-else class="link" style="color: #3cb62e;">Wieder anmelden</span>
<span @click="openCancelParticipationDialog(participant)" v-if="!participant.unregistered" class="link" style="color: #da7070;">Abmelden</span>
<span v-else class="link" @click="execResignonParticipant(participant)" style="color: #3cb62e;">Wieder anmelden</span>
</td>
</tr>
</template>
@@ -331,6 +411,7 @@ async function execPartialPayment() {
<Modal
:show="openCancelDialog"
title="Anmeldung stornieren"
width="350px"
@close="openCancelDialog = false"
>
Datum der Abmeldung:
@@ -342,10 +423,12 @@ async function execPartialPayment() {
<Modal
:show="openPartialPaymentDialogSwitch"
title="Teilbetragszahlung"
width="350px"
@close="openPartialPaymentDialogSwitch = false"
>
Gesamtbetrag der Zahlung:
<input type="text" style="margin-top: 10px; width: 150px !important;" id="partial_payment_amount" /> Euro
<AmountInput type="text" v-model="showParticipant.amountExpected.short" style="margin-top: 10px; width: 100px !important;" id="partial_payment_amount" /> Euro /
{{showParticipant.amountExpected.readable}} Euro
<br /><br />
<button class="button" @click="execPartialPayment()">Teilbetrag buchen</button>
</Modal>
@@ -429,4 +512,8 @@ async function execPartialPayment() {
.efz-not-checked {
color: #8D914BFF; background-color: #F4E99EFF;
}
.block-label {
display: block;
}
</style>

View File

@@ -1,6 +1,4 @@
<script setup>
import AppLayout from "../../../../../resources/js/layouts/AppLayout.vue";
import ShadowedBox from "../../../../Views/Components/ShadowedBox.vue";
import {reactive, watch} from "vue";
import AmountInput from "../../../../Views/Components/AmountInput.vue";
import ErrorText from "../../../../Views/Components/ErrorText.vue";

View File

@@ -2,10 +2,6 @@
const props = defineProps({
event: Object
})
console.log(props.event)
</script>
<template>