Participant mangement
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user