Compare commits
3 Commits
c6072a6ac3
...
11530c575b
Author | SHA1 | Date |
---|---|---|
philipp lang | 11530c575b | |
philipp lang | 78920e8aef | |
philipp lang | aa64d1ceb6 |
|
@ -155,6 +155,7 @@ class MemberResource extends JsonResource
|
|||
'members' => Member::ordered()->get()->map(fn ($member) => ['id' => $member->id, 'name' => $member->fullname]),
|
||||
'links' => [
|
||||
'index' => route('member.index'),
|
||||
'store' => route('member.store'),
|
||||
],
|
||||
'default_membership_filter' => [
|
||||
'group_ids' => [],
|
||||
|
|
|
@ -92,6 +92,8 @@ services:
|
|||
|
||||
socketi:
|
||||
image: quay.io/soketi/soketi:89604f268623cf799573178a7ba56b7491416bde-16-debian
|
||||
ports:
|
||||
- '6001:6001'
|
||||
environment:
|
||||
SOKETI_DEFAULT_APP_ID: adremaid
|
||||
SOKETI_DEFAULT_APP_KEY: adremakey
|
||||
|
@ -104,6 +106,8 @@ services:
|
|||
|
||||
meilisearch:
|
||||
image: getmeili/meilisearch:v1.6
|
||||
ports:
|
||||
- '7700:7700'
|
||||
volumes:
|
||||
- ./data/meilisearch:/meili_data
|
||||
env_file:
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
<template>
|
||||
<button :form="form" type="submit" class="flex items-center transition-all justify-center w-8 h-8 bg-primary-700 hover:bg-primary-600 rounded" v-tooltip="`speichern`">
|
||||
<ui-sprite class="w-4 h-4 text-white" src="save"></ui-sprite>
|
||||
<button
|
||||
v-tooltip="`speichern`"
|
||||
:form="form"
|
||||
type="submit"
|
||||
class="flex items-center transition-all justify-center w-8 h-8 bg-primary-700 hover:bg-primary-600 rounded group-[.is-toolbar]:bg-transparent group-[.is-toolbar]:items-start"
|
||||
>
|
||||
<ui-sprite class="w-4 h-4 text-white group-[.is-toolbar]:w-6 group-[.is-toolbar]:h-6 group-[.is-toolbar]:text-zinc-400" src="save"></ui-sprite>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
class="relative rounded-lg p-8 bg-zinc-800 shadow-2xl shadow-black border border-zinc-700 border-solid w-full max-h-full flex flex-col overflow-auto"
|
||||
:class="full ? 'h-full' : innerWidth"
|
||||
>
|
||||
<div class="absolute top-0 right-0 mt-6 mr-6 flex space-x-6">
|
||||
<div class="absolute top-0 right-0 mt-6 mr-6 flex space-x-6 group is-toolbar">
|
||||
<slot name="actions"></slot>
|
||||
<a href="#" @click.prevent="$emit('close')">
|
||||
<ui-sprite src="close" class="text-zinc-400 w-6 h-6"></ui-sprite>
|
||||
</a>
|
||||
</div>
|
||||
<h3 v-if="heading" class="font-semibold text-primary-200 text-xl" v-html="heading"></h3>
|
||||
<div class="text-primary-100 group is-popup grow flex flex-col">
|
||||
<div class="text-primary-100 group is-popup grow flex flex-col mt-4">
|
||||
<suspense>
|
||||
<div>
|
||||
<slot></slot>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div>
|
||||
<f-select id="connection" v-model="innerConnection" label="Verbindung" name="connection" class="mt-2" :options="data"></f-select>
|
||||
<f-select id="connection" v-model="innerConnection" label="Verbindung" name="connection" :options="data"></f-select>
|
||||
|
||||
<div v-if="innerConnection" class="mt-4">
|
||||
<div class="flex space-x-3 items-center bg-zinc-700 rounded-lg mt-3 py-1 px-2">
|
||||
|
|
|
@ -58,7 +58,11 @@ export function useIndex(props, siteName) {
|
|||
single.value = JSON.parse(JSON.stringify(model));
|
||||
}
|
||||
|
||||
async function submit() {
|
||||
async function submit(data = null) {
|
||||
if (data !== null) {
|
||||
single.value = data;
|
||||
}
|
||||
|
||||
single.value.id ? await axios.patch(single.value.links.update, single.value) : await axios.post(inner.meta.value.links.store, single.value);
|
||||
reload();
|
||||
single.value = null;
|
||||
|
@ -105,6 +109,7 @@ export function useIndex(props, siteName) {
|
|||
axios,
|
||||
setFilter,
|
||||
getFilter,
|
||||
filterString,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -7,34 +7,34 @@
|
|||
<f-save-button form="actionform"></f-save-button>
|
||||
</template>
|
||||
<form id="actionform" class="grow p-3" @submit.prevent="submit">
|
||||
<ui-popup heading="Neue Untertätigkeit" v-if="mode === 'edit' && currentSubactivity !== null" @close="currentSubactivity = null">
|
||||
<subactivity-form class="mt-4" v-if="currentSubactivity" :value="currentSubactivity" @stored="reloadSubactivities" @updated="mergeSubactivity"></subactivity-form>
|
||||
<ui-popup v-if="mode === 'edit' && currentSubactivity !== null" heading="Neue Untertätigkeit" @close="currentSubactivity = null">
|
||||
<subactivity-form v-if="currentSubactivity" :value="currentSubactivity" @stored="reloadSubactivities" @updated="mergeSubactivity"></subactivity-form>
|
||||
</ui-popup>
|
||||
<div class="flex space-x-3">
|
||||
<f-text id="name" v-model="inner.name" label="Name" required></f-text>
|
||||
<f-switch v-model="inner.is_filterable" name="is_filterable" id="is_filterable" label="Filterbar"></f-switch>
|
||||
<f-switch id="is_filterable" v-model="inner.is_filterable" name="is_filterable" label="Filterbar"></f-switch>
|
||||
</div>
|
||||
<div class="flex space-x-3 items-center mt-6 mb-2">
|
||||
<f-checkboxes-label>Untertätigkeiten</f-checkboxes-label>
|
||||
<ui-icon-button icon="plus" v-if="mode === 'edit'" @click.prevent="currentSubactivity = inner.subactivity_model">Neu</ui-icon-button>
|
||||
<ui-icon-button v-if="mode === 'edit'" icon="plus" @click.prevent="currentSubactivity = inner.subactivity_model">Neu</ui-icon-button>
|
||||
</div>
|
||||
<div class="grid gap-2 sm:grid-cols-2 md:grid-cols-4">
|
||||
<div v-for="option in subactivities" class="flex items-center space-x-2">
|
||||
<a
|
||||
href="#"
|
||||
v-if="mode === 'edit'"
|
||||
@click.prevent="currentSubactivity = option"
|
||||
href="#"
|
||||
class="transition hover:bg-yellow-600 group w-5 h-5 rounded-full flex items-center justify-center flex-none"
|
||||
@click.prevent="currentSubactivity = option"
|
||||
>
|
||||
<ui-sprite src="pencil" class="text-yellow-800 w-3 h-3 group-hover:text-yellow-200 transition"></ui-sprite>
|
||||
</a>
|
||||
<f-switch
|
||||
inline
|
||||
size="sm"
|
||||
:id="`subactivities-${option.id}`"
|
||||
:key="option.id"
|
||||
v-model="inner.subactivities"
|
||||
inline
|
||||
size="sm"
|
||||
name="subactivities[]"
|
||||
:id="`subactivities-${option.id}`"
|
||||
:value="option.id"
|
||||
:label="option.name"
|
||||
></f-switch>
|
||||
|
@ -49,6 +49,11 @@ import {defineAsyncComponent} from 'vue';
|
|||
import {useToast} from 'vue-toastification';
|
||||
|
||||
export default {
|
||||
|
||||
props: {
|
||||
data: {},
|
||||
meta: {},
|
||||
},
|
||||
setup() {
|
||||
const toast = useToast();
|
||||
|
||||
|
@ -63,11 +68,6 @@ export default {
|
|||
};
|
||||
},
|
||||
|
||||
props: {
|
||||
data: {},
|
||||
meta: {},
|
||||
},
|
||||
|
||||
components: {
|
||||
'subactivity-form': defineAsyncComponent(() => import('./SubactivityForm.vue')),
|
||||
},
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</template>
|
||||
<ui-popup v-if="deleting !== null" heading="Bitte bestätigen" @close="deleting = null">
|
||||
<div>
|
||||
<p class="mt-4">Diese Aktivität löschen?</p>
|
||||
<p>Diese Aktivität löschen?</p>
|
||||
<div class="grid grid-cols-2 gap-3 mt-6">
|
||||
<a href="#" class="text-center btn btn-danger" @click.prevent="remove">Löschen</a>
|
||||
<a href="#" class="text-center btn btn-primary" @click.prevent="deleting = null">Abbrechen</a>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<ui-popup v-if="deleting !== null" :heading="`Veranstaltung ${deleting.name} löschen?`" @close="deleting = null">
|
||||
<div>
|
||||
<p class="mt-4">Diese Veranstaltung löschen?</p>
|
||||
<p>Diese Veranstaltung löschen?</p>
|
||||
<div class="grid grid-cols-2 gap-3 mt-6">
|
||||
<a
|
||||
href="#"
|
||||
|
@ -24,7 +24,7 @@
|
|||
</ui-popup>
|
||||
|
||||
<ui-popup v-if="single !== null && single.config === null" heading="Vorlage auswählen" @close="cancel">
|
||||
<div class="mt-3 grid gap-3 grid-cols-2">
|
||||
<div class="grid gap-3 grid-cols-2">
|
||||
<a v-for="(template, index) in meta.templates" :key="index" class="py-2 px-3 border rounded bg-zinc-800 hover:bg-zinc-700 transition" href="#" @click.prevent="setTemplate(template)">
|
||||
<span v-text="template.name"></span>
|
||||
</a>
|
||||
|
@ -36,7 +36,7 @@
|
|||
</ui-popup>
|
||||
|
||||
<ui-popup v-if="single !== null && single.config !== null" :heading="`Veranstaltung ${single.id ? 'bearbeiten' : 'erstellen'}`" full @close="cancel">
|
||||
<div class="flex flex-col mt-3">
|
||||
<div class="flex flex-col">
|
||||
<ui-tabs v-model="active" :entries="tabs"></ui-tabs>
|
||||
<div v-show="active === 0" class="grid grid-cols-2 gap-3">
|
||||
<div class="flex space-x-3">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="mt-4">
|
||||
<div>
|
||||
<f-text id="search_string" v-model="searchString" label="Mitglied finden"></f-text>
|
||||
</div>
|
||||
<div v-if="results !== null" class="mt-5 sm:mt-10 space-y-2">
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
</ui-popup>
|
||||
<ui-popup v-if="deleting !== null" heading="Teilnehmer*in löschen?" @close="deleting = null">
|
||||
<div>
|
||||
<p class="mt-4">Den*Die Teilnehmer*in löschen?</p>
|
||||
<p>Den*Die Teilnehmer*in löschen?</p>
|
||||
<div class="grid grid-cols-2 gap-3 mt-6">
|
||||
<a href="#" class="text-center btn btn-danger" @click.prevent="handleDelete">Mitglied loschen</a>
|
||||
<a href="#" class="text-center btn btn-primary" @click.prevent="deleting = null">Abbrechen</a>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<ui-popup v-if="deleting !== null" :heading="`Formular-Vorlage ${deleting.name} löschen?`" @close="deleting = null">
|
||||
<div>
|
||||
<p class="mt-4">Diese Formular-Vorlage löschen?</p>
|
||||
<p>Diese Formular-Vorlage löschen?</p>
|
||||
<div class="grid grid-cols-2 gap-3 mt-6">
|
||||
<a
|
||||
href="#"
|
||||
|
@ -24,7 +24,7 @@
|
|||
</ui-popup>
|
||||
|
||||
<ui-popup v-if="single !== null" :heading="`Vorlage ${single.id ? 'bearbeiten' : 'erstellen'}`" full @close="cancel">
|
||||
<div class="flex flex-col mt-3">
|
||||
<div class="flex flex-col">
|
||||
<ui-tabs v-model="activeTab" :entries="tabs"></ui-tabs>
|
||||
<form-builder v-if="activeTab === 0" v-model="single.config" :meta="meta">
|
||||
<template #meta>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<ui-popup v-if="massstore !== null" heading="Massenrechnung anlegen" @close="massstore = null">
|
||||
<form @submit.prevent="sendMassstore">
|
||||
<section class="grid grid-cols-2 gap-3 mt-6">
|
||||
<section class="grid grid-cols-2 gap-3">
|
||||
<f-text id="year" v-model="massstore.year" label="Jahr" required></f-text>
|
||||
</section>
|
||||
<section class="flex mt-4 space-x-2">
|
||||
|
@ -19,7 +19,7 @@
|
|||
</ui-popup>
|
||||
<ui-popup v-if="deleting !== null" heading="Rechnung löschen?" @close="deleting = null">
|
||||
<div>
|
||||
<p class="mt-4">Diese Rechnung löschen?</p>
|
||||
<p>Diese Rechnung löschen?</p>
|
||||
<div class="grid grid-cols-2 gap-3 mt-6">
|
||||
<a
|
||||
href="#"
|
||||
|
@ -35,7 +35,7 @@
|
|||
</div>
|
||||
</ui-popup>
|
||||
<ui-popup v-if="single !== null" :heading="`Rechnung ${single.id ? 'bearbeiten' : 'erstellen'}`" inner-width="max-w-4xl" @close="cancel">
|
||||
<form class="grid grid-cols-2 gap-3 mt-4" @submit.prevent="submit">
|
||||
<form class="grid grid-cols-2 gap-3" @submit.prevent="submit">
|
||||
<ui-box heading="Für Mitglied anlegen" container-class="flex space-x-3" class="col-span-full">
|
||||
<f-select id="forMemberMember" v-model="forMember.member_id" name="forMemberMember" :options="meta.members" label="Mitglied"></f-select>
|
||||
<f-select id="forMemberSubscription" v-model="forMember.subscription_id" name="forMemberSubscription" :options="meta.subscriptions" label="Beitrag"></f-select>
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
<template #toolbar>
|
||||
<page-toolbar-button :href="data.meta.links.create" color="primary" icon="plus">Verteiler erstellen</page-toolbar-button>
|
||||
</template>
|
||||
<ui-popup heading="Verteiler löschen?" v-if="deleting !== null" @close="deleting.reject()">
|
||||
<ui-popup v-if="deleting !== null" heading="Verteiler löschen?" @close="deleting.reject()">
|
||||
<div>
|
||||
<p class="mt-4">Den Verteiler "{{ deleting.dispatcher.name }}" löschen?</p>
|
||||
<p>Den Verteiler "{{ deleting.dispatcher.name }}" löschen?</p>
|
||||
<div class="grid grid-cols-2 gap-3 mt-6">
|
||||
<a href="#" @click.prevent="deleting.resolve()" class="text-center btn btn-danger">Löschen</a>
|
||||
<a href="#" @click.prevent="deleting.reject()" class="text-center btn btn-primary">Abbrechen</a>
|
||||
<a href="#" class="text-center btn btn-danger" @click.prevent="deleting.resolve()">Löschen</a>
|
||||
<a href="#" class="text-center btn btn-primary" @click.prevent="deleting.reject()">Abbrechen</a>
|
||||
</div>
|
||||
</div>
|
||||
</ui-popup>
|
||||
|
@ -32,7 +32,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<i-link :href="dispatcher.links.edit" class="mr-1 inline-flex btn btn-warning btn-sm"><ui-sprite src="pencil"></ui-sprite></i-link>
|
||||
<button @click.prevent="remove(dispatcher)" class="inline-flex btn btn-danger btn-sm"><ui-sprite src="trash"></ui-sprite></button>
|
||||
<button class="inline-flex btn btn-danger btn-sm" @click.prevent="remove(dispatcher)"><ui-sprite src="trash"></ui-sprite></button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -41,6 +41,9 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
data: {},
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
deleting: null,
|
||||
|
@ -60,8 +63,5 @@ export default {
|
|||
});
|
||||
},
|
||||
},
|
||||
props: {
|
||||
data: {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<page-layout>
|
||||
<!--
|
||||
<template #toolbar>
|
||||
<page-toolbar-button :href="meta.links.index" color="primary" icon="undo">zurück</page-toolbar-button>
|
||||
<page-toolbar-button v-if="mode === 'edit'" :href="data.links.show" color="primary" icon="eye">anschauen</page-toolbar-button>
|
||||
|
@ -7,175 +7,179 @@
|
|||
<template #right>
|
||||
<f-save-button form="memberedit"></f-save-button>
|
||||
</template>
|
||||
<form id="memberedit" class="flex grow relative" @submit.prevent="submit">
|
||||
<ui-popup v-if="conflict === true" heading="Ein Konflikt ist aufgetreten">
|
||||
<div>
|
||||
<p class="mt-4">Dieses Mitglied wurde vorher bereits aktualisiert. Daher könnte ein Update zu Datenverlust führen.</p>
|
||||
<p class="mt-2">Wir empfehlen, die Daten aus NaMi zunächst neu zu synchronisieren und dann die Änderungen hier in der Adrema erneut vorzunehmen.</p>
|
||||
<div class="grid grid-cols-2 gap-3 mt-6">
|
||||
<a href="#" class="text-center btn btn-primary" @click.prevent="resync">Neu synchronisieren</a>
|
||||
<a href="#" class="text-center btn btn-danger" @click.prevent="forceWrite">Änderungen schreiben</a>
|
||||
-->
|
||||
<form id="memberedit" class="flex grow relative" @submit.prevent="submit">
|
||||
<ui-popup v-if="conflict === true" heading="Ein Konflikt ist aufgetreten">
|
||||
<div>
|
||||
<p>Dieses Mitglied wurde vorher bereits aktualisiert. Daher könnte ein Update zu Datenverlust führen.</p>
|
||||
<p class="mt-2">Wir empfehlen, die Daten aus NaMi zunächst neu zu synchronisieren und dann die Änderungen hier in der Adrema erneut vorzunehmen.</p>
|
||||
<div class="grid grid-cols-2 gap-3 mt-6">
|
||||
<a href="#" class="text-center btn btn-primary" @click.prevent="load">Neu synchronisieren</a>
|
||||
<a href="#" class="text-center btn btn-danger" @click.prevent="forceWrite">Änderungen schreiben</a>
|
||||
</div>
|
||||
</div>
|
||||
</ui-popup>
|
||||
|
||||
<!-- ***************************** Hauptbereich ****************************** -->
|
||||
<div class="grow grid md:grid-cols-2 gap-3">
|
||||
<ui-box heading="Stammdaten">
|
||||
<div class="grid sm:grid-cols-2 gap-3">
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<f-select id="gender_id" v-model="inner.gender_id" name="gender_id" :options="meta.genders" label="Geschlecht" size="sm"></f-select>
|
||||
<f-text id="salutation" v-model="inner.salutation" size="sm" label="Anrede"></f-text>
|
||||
</div>
|
||||
<f-select id="nationality_id" v-model="inner.nationality_id" :options="meta.nationalities" label="Staatsangehörigkeit" name="nationality_id" size="sm"></f-select>
|
||||
<f-text id="firstname" v-model="inner.firstname" size="sm" label="Vorname" required></f-text>
|
||||
<f-text id="lastname" v-model="inner.lastname" size="sm" label="Nachname" required></f-text>
|
||||
<f-text id="address" v-model="inner.address" size="sm" label="Adresse"></f-text>
|
||||
<f-text id="further_address" v-model="inner.further_address" size="sm" label="Adresszusatz"></f-text>
|
||||
<f-text id="zip" v-model="inner.zip" size="sm" label="PLZ"></f-text>
|
||||
<f-text id="location" v-model="inner.location" size="sm" label="Ort"></f-text>
|
||||
<f-text id="birthday" v-model="inner.birthday" type="date" size="sm" label="Geburtsdatum"></f-text>
|
||||
<f-select id="region_id" v-model="inner.region_id" :options="meta.regions" name="region_id" label="Bundesland" size="sm"></f-select>
|
||||
<f-select id="country_id" v-model="inner.country_id" :options="meta.countries" label="Land" name="country_id" size="sm" required></f-select>
|
||||
<f-text id="other_country" v-model="inner.other_country" label="Andere Staatsangehörigkeit" size="sm"></f-text>
|
||||
</div>
|
||||
</ui-box>
|
||||
<ui-box heading="Kontakt">
|
||||
<div class="grid gap-3 sm:grid-cols-2">
|
||||
<f-text id="main_phone" v-model="inner.main_phone" size="sm" label="Telefon (Eltern)"></f-text>
|
||||
<f-text id="mobile_phone" v-model="inner.mobile_phone" size="sm" label="Handy (Eltern)"></f-text>
|
||||
<f-text id="work_phone" v-model="inner.work_phone" size="sm" label="Tel geschäftlich (Eltern)"></f-text>
|
||||
<f-text id="children_phone" v-model="inner.children_phone" size="sm" label="Telefon (Kind)"></f-text>
|
||||
<f-text id="email" v-model="inner.email" size="sm" label="E-Mail"></f-text>
|
||||
<f-text id="email_parents" v-model="inner.email_parents" size="sm" label="E-Mail eltern"></f-text>
|
||||
<f-text id="fax" v-model="inner.fax" size="sm" label="Fax"></f-text>
|
||||
<f-textarea id="letter_address" v-model="inner.letter_address" class="sm:col-span-2" :rows="3" label="Brief-Adresse" size="sm"></f-textarea>
|
||||
</div>
|
||||
</ui-box>
|
||||
<ui-box heading="System">
|
||||
<div class="grid gap-3">
|
||||
<f-select id="bill_kind" v-model="inner.bill_kind" :options="meta.billKinds" label="Rechnung versenden über" name="bill_kind" size="sm"></f-select>
|
||||
<f-select id="subscription_id" v-model="inner.subscription_id" :options="meta.subscriptions" label="Beitrag" name="subscription_id" size="sm"></f-select>
|
||||
<f-switch id="has_nami" v-model="inner.has_nami" name="has_nami" size="sm" label="In Nami eintragen"></f-switch>
|
||||
<f-switch id="send_newspaper" v-model="inner.send_newspaper" name="send_newspaper" label="Mittendrin versenden" size="sm"></f-switch>
|
||||
<f-text id="joined_at" v-model="inner.joined_at" class="sm:col-span-2" type="date" label="Eintrittsdatum" size="sm" required></f-text>
|
||||
<f-textarea id="comment" v-model="inner.comment" :rows="3" class="col-span-2" label="Kommentar" size="sm"></f-textarea>
|
||||
<div v-if="!inner.id || (original.has_nami === false && inner.has_nami === true)" class="contents">
|
||||
<f-select
|
||||
id="first_activity_id"
|
||||
v-model="inner.first_activity_id"
|
||||
:options="meta.formCreateActivities"
|
||||
label="Erste Tätigkeit"
|
||||
name="first_activity_id"
|
||||
size="sm"
|
||||
required
|
||||
></f-select>
|
||||
<f-select
|
||||
v-if="inner.first_activity_id"
|
||||
id="first_subactivity_id"
|
||||
v-model="inner.first_subactivity_id"
|
||||
:options="meta.formCreateSubactivities[inner.first_activity_id]"
|
||||
label="Erste Untertätigkeit"
|
||||
name="first_subactivity_id"
|
||||
size="sm"
|
||||
required
|
||||
></f-select>
|
||||
</div>
|
||||
</div>
|
||||
</ui-popup>
|
||||
|
||||
<!-- ***************************** Hauptbereich ****************************** -->
|
||||
<div class="grow grid md:grid-cols-2 gap-3 p-3">
|
||||
<ui-box heading="Stammdaten">
|
||||
<div class="grid sm:grid-cols-2 gap-3">
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<f-select id="gender_id" v-model="inner.gender_id" name="gender_id" :options="meta.genders" label="Geschlecht" size="sm"></f-select>
|
||||
<f-text id="salutation" v-model="inner.salutation" size="sm" label="Anrede"></f-text>
|
||||
</ui-box>
|
||||
<ui-box heading="Prävention">
|
||||
<div class="grid sm:grid-cols-[minmax(min-content,max-content)_minmax(min-content,max-content)] gap-2">
|
||||
<div class="grid grid-cols-[minmax(min-content,max-content)_8rem] gap-1">
|
||||
<f-switch id="has_efz" v-model="hasEfz" name="has_efz" size="sm" label="Führungszeugnis eingesehen"></f-switch>
|
||||
<div>
|
||||
<f-text v-if="inner.efz !== null" id="efz" v-model="inner.efz" type="date" label="am" size="sm"></f-text>
|
||||
</div>
|
||||
<f-select id="nationality_id" v-model="inner.nationality_id" :options="meta.nationalities" label="Staatsangehörigkeit" name="nationality_id" size="sm"></f-select>
|
||||
<f-text id="firstname" v-model="inner.firstname" size="sm" label="Vorname" required></f-text>
|
||||
<f-text id="lastname" v-model="inner.lastname" size="sm" label="Nachname" required></f-text>
|
||||
<f-text id="address" v-model="inner.address" size="sm" label="Adresse"></f-text>
|
||||
<f-text id="further_address" v-model="inner.further_address" size="sm" label="Adresszusatz"></f-text>
|
||||
<f-text id="zip" v-model="inner.zip" size="sm" label="PLZ"></f-text>
|
||||
<f-text id="location" v-model="inner.location" size="sm" label="Ort"></f-text>
|
||||
<f-text id="birthday" v-model="inner.birthday" type="date" size="sm" label="Geburtsdatum"></f-text>
|
||||
<f-select id="region_id" v-model="inner.region_id" :options="meta.regions" name="region_id" label="Bundesland" size="sm"></f-select>
|
||||
<f-select id="country_id" v-model="inner.country_id" :options="meta.countries" label="Land" name="country_id" size="sm" required></f-select>
|
||||
<f-text id="other_country" v-model="inner.other_country" label="Andere Staatsangehörigkeit" size="sm"></f-text>
|
||||
</div>
|
||||
</ui-box>
|
||||
<ui-box heading="Kontakt">
|
||||
<div class="grid gap-3 sm:grid-cols-2">
|
||||
<f-text id="main_phone" v-model="inner.main_phone" size="sm" label="Telefon (Eltern)"></f-text>
|
||||
<f-text id="mobile_phone" v-model="inner.mobile_phone" size="sm" label="Handy (Eltern)"></f-text>
|
||||
<f-text id="work_phone" v-model="inner.work_phone" size="sm" label="Tel geschäftlich (Eltern)"></f-text>
|
||||
<f-text id="children_phone" v-model="inner.children_phone" size="sm" label="Telefon (Kind)"></f-text>
|
||||
<f-text id="email" v-model="inner.email" size="sm" label="E-Mail"></f-text>
|
||||
<f-text id="email_parents" v-model="inner.email_parents" size="sm" label="E-Mail eltern"></f-text>
|
||||
<f-text id="fax" v-model="inner.fax" size="sm" label="Fax"></f-text>
|
||||
<f-textarea id="letter_address" v-model="inner.letter_address" class="sm:col-span-2" :rows="3" label="Brief-Adresse" size="sm"></f-textarea>
|
||||
</div>
|
||||
</ui-box>
|
||||
<ui-box heading="System">
|
||||
<div class="grid gap-3">
|
||||
<f-select id="bill_kind" v-model="inner.bill_kind" :options="meta.billKinds" label="Rechnung versenden über" name="bill_kind" size="sm"></f-select>
|
||||
<f-select id="subscription_id" v-model="inner.subscription_id" :options="meta.subscriptions" label="Beitrag" name="subscription_id" size="sm"></f-select>
|
||||
<f-switch id="has_nami" v-model="inner.has_nami" name="has_nami" size="sm" label="In Nami eintragen"></f-switch>
|
||||
<f-switch id="send_newspaper" v-model="inner.send_newspaper" name="send_newspaper" label="Mittendrin versenden" size="sm"></f-switch>
|
||||
<f-text id="joined_at" v-model="inner.joined_at" class="sm:col-span-2" type="date" label="Eintrittsdatum" size="sm" required></f-text>
|
||||
<f-textarea id="comment" v-model="inner.comment" :rows="3" class="col-span-2" label="Kommentar" size="sm"></f-textarea>
|
||||
<div v-if="mode === 'create' || (original.has_nami === false && inner.has_nami === true)" class="contents">
|
||||
<f-select
|
||||
id="first_activity_id"
|
||||
v-model="inner.first_activity_id"
|
||||
:options="meta.formCreateActivities"
|
||||
label="Erste Tätigkeit"
|
||||
name="first_activity_id"
|
||||
<f-switch id="has_ps" v-model="hasPs" name="has_ps" size="sm" label="Hat Präventionsschulung"></f-switch>
|
||||
<div>
|
||||
<f-text v-if="inner.ps_at !== null" id="ps_at" v-model="inner.ps_at" type="date" label="am" size="sm"></f-text>
|
||||
</div>
|
||||
<f-switch id="has_more_ps" v-model="hasMorePs" name="has_more_ps" size="sm" label="Hat Vertiefungsschulung"></f-switch>
|
||||
<div>
|
||||
<f-text v-if="inner.more_ps_at !== null" id="more_ps_at" v-model="inner.more_ps_at" type="date" label="am" size="sm"></f-text>
|
||||
</div>
|
||||
<f-switch id="is_recertified" v-model="isRecertified" name="is_recertified" size="sm" label="Hat Rezertifizierung"></f-switch>
|
||||
<div>
|
||||
<f-text v-if="inner.recertified_at !== null" id="recertified_at" v-model="inner.recertified_at" type="date" label="am" size="sm"></f-text>
|
||||
</div>
|
||||
<f-switch id="has_without_education" v-model="hasWithoutEducation" name="has_without_education" label="Einsatz ohne Schulung" size="sm"></f-switch>
|
||||
<div>
|
||||
<f-text
|
||||
v-if="inner.without_education_at !== null"
|
||||
id="without_education_at"
|
||||
v-model="inner.without_education_at"
|
||||
name="without_education_at"
|
||||
type="date"
|
||||
label="am"
|
||||
size="sm"
|
||||
required
|
||||
></f-select>
|
||||
<f-select
|
||||
v-if="inner.first_activity_id"
|
||||
id="first_subactivity_id"
|
||||
v-model="inner.first_subactivity_id"
|
||||
:options="meta.formCreateSubactivities[inner.first_activity_id]"
|
||||
label="Erste Untertätigkeit"
|
||||
name="first_subactivity_id"
|
||||
size="sm"
|
||||
required
|
||||
></f-select>
|
||||
></f-text>
|
||||
</div>
|
||||
<f-switch id="has_without_efz" v-model="hasWithoutEfz" name="has_without_efz" size="sm" label="Einsatz ohne EFZ"></f-switch>
|
||||
<div>
|
||||
<f-text v-if="inner.without_efz_at !== null" id="without_efz_at" v-model="inner.without_efz_at" type="date" label="am" size="sm"></f-text>
|
||||
</div>
|
||||
</div>
|
||||
</ui-box>
|
||||
<ui-box heading="Prävention">
|
||||
<div class="grid sm:grid-cols-[minmax(min-content,max-content)_minmax(min-content,max-content)] gap-2">
|
||||
<div class="grid grid-cols-[minmax(min-content,max-content)_8rem] gap-1">
|
||||
<f-switch id="has_efz" v-model="hasEfz" name="has_efz" size="sm" label="Führungszeugnis eingesehen"></f-switch>
|
||||
<div>
|
||||
<f-text v-if="inner.efz !== null" id="efz" v-model="inner.efz" type="date" label="am" size="sm"></f-text>
|
||||
</div>
|
||||
<f-switch id="has_ps" v-model="hasPs" name="has_ps" size="sm" label="Hat Präventionsschulung"></f-switch>
|
||||
<div>
|
||||
<f-text v-if="inner.ps_at !== null" id="ps_at" v-model="inner.ps_at" type="date" label="am" size="sm"></f-text>
|
||||
</div>
|
||||
<f-switch id="has_more_ps" v-model="hasMorePs" name="has_more_ps" size="sm" label="Hat Vertiefungsschulung"></f-switch>
|
||||
<div>
|
||||
<f-text v-if="inner.more_ps_at !== null" id="more_ps_at" v-model="inner.more_ps_at" type="date" label="am" size="sm"></f-text>
|
||||
</div>
|
||||
<f-switch id="is_recertified" v-model="isRecertified" name="is_recertified" size="sm" label="Hat Rezertifizierung"></f-switch>
|
||||
<div>
|
||||
<f-text v-if="inner.recertified_at !== null" id="recertified_at" v-model="inner.recertified_at" type="date" label="am" size="sm"></f-text>
|
||||
</div>
|
||||
<f-switch id="has_without_education" v-model="hasWithoutEducation" name="has_without_education" label="Einsatz ohne Schulung" size="sm"></f-switch>
|
||||
<div>
|
||||
<f-text
|
||||
v-if="inner.without_education_at !== null"
|
||||
id="without_education_at"
|
||||
v-model="inner.without_education_at"
|
||||
name="without_education_at"
|
||||
type="date"
|
||||
label="am"
|
||||
size="sm"
|
||||
></f-text>
|
||||
</div>
|
||||
<f-switch id="has_without_efz" v-model="hasWithoutEfz" name="has_without_efz" size="sm" label="Einsatz ohne EFZ"></f-switch>
|
||||
<div>
|
||||
<f-text v-if="inner.without_efz_at !== null" id="without_efz_at" v-model="inner.without_efz_at" type="date" label="am" size="sm"></f-text>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid gap-1">
|
||||
<f-switch id="has_svk" v-model="inner.has_svk" name="has_svk" size="sm" label="SVK unterschrieben"></f-switch>
|
||||
<f-switch id="has_vk" v-model="inner.has_vk" name="has_vk" size="sm" label="Verhaltenskodex unterschrieben"></f-switch>
|
||||
<f-switch id="multiply_pv" v-model="inner.multiply_pv" name="multiply_pv" label="Multiplikator*in Präventionsschulung" size="sm"></f-switch>
|
||||
<f-switch id="multiply_more_pv" v-model="inner.multiply_more_pv" name="multiply_more_pv" label="Multiplikator*in Vertiefungsschulung" size="sm"></f-switch>
|
||||
</div>
|
||||
<div class="grid gap-1">
|
||||
<f-switch id="has_svk" v-model="inner.has_svk" name="has_svk" size="sm" label="SVK unterschrieben"></f-switch>
|
||||
<f-switch id="has_vk" v-model="inner.has_vk" name="has_vk" size="sm" label="Verhaltenskodex unterschrieben"></f-switch>
|
||||
<f-switch id="multiply_pv" v-model="inner.multiply_pv" name="multiply_pv" label="Multiplikator*in Präventionsschulung" size="sm"></f-switch>
|
||||
<f-switch id="multiply_more_pv" v-model="inner.multiply_more_pv" name="multiply_more_pv" label="Multiplikator*in Vertiefungsschulung" size="sm"></f-switch>
|
||||
</div>
|
||||
</ui-box>
|
||||
</div>
|
||||
</form>
|
||||
</page-layout>
|
||||
</div>
|
||||
</ui-box>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import {ref, computed, inject} from 'vue';
|
||||
const axios = inject('axios');
|
||||
const emit = defineEmits(['submit']);
|
||||
|
||||
function issetComputed(val) {
|
||||
return {
|
||||
set(v) {
|
||||
this.inner[val] = v ? '' : null;
|
||||
inner.value[val] = v ? '' : null;
|
||||
},
|
||||
get() {
|
||||
return this.inner[val] !== null;
|
||||
return inner.value[val] !== null;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default {
|
||||
props: {
|
||||
mode: {},
|
||||
data: {},
|
||||
conflict: {},
|
||||
meta: {},
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
original: this.mode === 'create' ? {...this.meta.default} : {...this.data},
|
||||
inner: this.mode === 'create' ? {...this.meta.default} : {...this.data},
|
||||
active: 0,
|
||||
};
|
||||
},
|
||||
const props = defineProps({
|
||||
data: {},
|
||||
conflict: {},
|
||||
model: {},
|
||||
meta: {},
|
||||
});
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
this.mode === 'create' ? this.$inertia.post(`/member`, this.inner) : this.$inertia.patch(`/member/${this.inner.id}`, this.inner);
|
||||
},
|
||||
resync() {
|
||||
this.$inertia.get(`/member/${this.inner.id}/resync`);
|
||||
},
|
||||
forceWrite() {},
|
||||
},
|
||||
const inner = ref({});
|
||||
const original = ref({});
|
||||
const activeTab = ref(0);
|
||||
const tabs = ref([{title: 'Kontakt'}, {title: 'System'}, {title: 'Prävention'}]);
|
||||
|
||||
computed: {
|
||||
hasEfz: issetComputed('efz'),
|
||||
hasPs: issetComputed('ps_at'),
|
||||
hasMorePs: issetComputed('more_ps_at'),
|
||||
isRecertified: issetComputed('recertified_at'),
|
||||
hasWithoutEfz: issetComputed('without_efz_at'),
|
||||
hasWithoutEducation: issetComputed('without_education_at'),
|
||||
},
|
||||
};
|
||||
async function load() {
|
||||
if (props.model.id) {
|
||||
const response = await axios.get(props.model.links.show);
|
||||
inner.value = response.data.data;
|
||||
} else {
|
||||
inner.value = props.model;
|
||||
original.value = props.model;
|
||||
}
|
||||
}
|
||||
|
||||
await load();
|
||||
|
||||
async function submit() {
|
||||
emit('submit', inner.value);
|
||||
}
|
||||
|
||||
const hasEfz = computed(issetComputed('efz'));
|
||||
const hasPs = computed(issetComputed('ps_at'));
|
||||
const hasMorePs = computed(issetComputed('more_ps_at'));
|
||||
const isRecertified = computed(issetComputed('recertified_at'));
|
||||
const hasWithoutEfz = computed(issetComputed('without_efz_at'));
|
||||
const hasWithoutEducation = computed(issetComputed('without_education_at'));
|
||||
</script>
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
<template>
|
||||
<page-layout page-class="pb-6">
|
||||
<template #toolbar>
|
||||
<page-toolbar-button :href="meta.links.create" color="primary" icon="plus">Mitglied anlegen</page-toolbar-button>
|
||||
<page-toolbar-button color="primary" icon="plus" @click="create">Mitglied anlegen</page-toolbar-button>
|
||||
</template>
|
||||
<ui-popup v-if="single !== null" :heading="single.id ? 'Mitglied bearbeiten' : 'Mitglied erstellen'" full @close="cancel">
|
||||
<v-form :meta="meta" :model="single" @submit="submit"></v-form>
|
||||
<template #actions>
|
||||
<f-save-button form="memberedit"></f-save-button>
|
||||
</template>
|
||||
</ui-popup>
|
||||
<ui-popup v-if="deleting !== null" heading="Mitglied löschen?" @close="deleting.reject()">
|
||||
<div>
|
||||
<p class="mt-4">Das Mitglied "{{ deleting.member.fullname }}" löschen?</p>
|
||||
<p>Das Mitglied "{{ deleting.member.fullname }}" löschen?</p>
|
||||
<p class="mt-2">Alle Zuordnungen (Ausbildungen, Rechnungen, Zahlungen, Tätigkeiten) werden ebenfalls entfernt.</p>
|
||||
<ui-note v-if="!deleting.member.has_nami" class="mt-5" type="warning"> Dieses Mitglied ist nicht in NaMi vorhanden und wird daher nur in der AdReMa gelöscht werden. </ui-note>
|
||||
<ui-note v-if="deleting.member.has_nami" class="mt-5" type="danger">
|
||||
|
@ -18,7 +24,7 @@
|
|||
</div>
|
||||
</ui-popup>
|
||||
<ui-popup v-if="membershipFilters !== null" heading="Nach Mitgliedschaften filtern" full @close="membershipFilters = null">
|
||||
<button class="btn btn-primary label mt-2" @click.prevent="membershipFilters.push({...meta.default_membership_filter})">
|
||||
<button class="btn btn-primary label" @click.prevent="membershipFilters.push({...meta.default_membership_filter})">
|
||||
<ui-sprite class="w-3 h-3 xl:mr-2" src="plus"></ui-sprite>
|
||||
<span class="hidden xl:inline">Hinzufügen</span>
|
||||
</button>
|
||||
|
@ -109,7 +115,7 @@
|
|||
<ui-label :value="member.pending_payment" fallback="---"></ui-label>
|
||||
</td>
|
||||
<td>
|
||||
<actions :member="member" @sidebar="openSidebar($event, member)" @remove="remove(member)"></actions>
|
||||
<actions :member="member" @sidebar="openSidebar($event, member)" @edit="edit(member)" @show="show(member)" @remove="remove(member)"></actions>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -124,7 +130,7 @@
|
|||
<tags :member="member"></tags>
|
||||
<ui-label v-show="hasModule('bill')" class="text-gray-100 block" :value="member.pending_payment" fallback=""></ui-label>
|
||||
</div>
|
||||
<actions class="mt-2" :member="member" @sidebar="openSidebar($event, member)" @remove="remove(member)"> </actions>
|
||||
<actions class="mt-2" :member="member" @sidebar="openSidebar($event, member)" @edit="edit(member)" @remove="remove(member)"> </actions>
|
||||
<div class="absolute right-0 top-0 h-full flex items-center mr-2">
|
||||
<i-link v-tooltip="`Details`" :href="member.links.show"><ui-sprite src="chevron" class="w-6 h-6 text-teal-100 -rotate-90"></ui-sprite></i-link>
|
||||
</div>
|
||||
|
@ -135,10 +141,10 @@
|
|||
<ui-pagination class="mt-4" :value="meta" @reload="reloadPage"></ui-pagination>
|
||||
</div>
|
||||
|
||||
<ui-sidebar v-if="single !== null" @close="closeSidebar">
|
||||
<member-invoice-positions v-if="single.type === 'invoicePosition'" :url="single.model.links.invoiceposition_index" @close="closeSidebar"></member-invoice-positions>
|
||||
<member-memberships v-if="single.type === 'membership'" :url="single.model.links.membership_index" @close="closeSidebar"></member-memberships>
|
||||
<member-courses v-if="single.type === 'courses'" :url="single.model.links.course_index" @close="closeSidebar"></member-courses>
|
||||
<ui-sidebar v-if="sidebar !== null" @close="closeSidebar">
|
||||
<member-invoice-positions v-if="sidebar.type === 'invoicePosition'" :url="sidebar.model.links.invoiceposition_index" @close="closeSidebar"></member-invoice-positions>
|
||||
<member-memberships v-if="sidebar.type === 'membership'" :url="sidebar.model.links.membership_index" @close="closeSidebar"></member-memberships>
|
||||
<member-courses v-if="sidebar.type === 'courses'" :url="sidebar.model.links.course_index" @close="closeSidebar"></member-courses>
|
||||
</ui-sidebar>
|
||||
</page-layout>
|
||||
</template>
|
||||
|
@ -149,20 +155,25 @@ import MemberMemberships from './MemberMemberships.vue';
|
|||
import MemberCourses from './MemberCourses.vue';
|
||||
import Tags from './Tags.vue';
|
||||
import Actions from './index/Actions.vue';
|
||||
import { indexProps, useIndex } from '../../composables/useIndex.js';
|
||||
import VForm from './VForm.vue';
|
||||
import { indexProps, useIndex } from '../../composables/useInertiaApiIndex.js';
|
||||
import { ref, defineProps } from 'vue';
|
||||
|
||||
const single = ref(null);
|
||||
const sidebar = ref(null);
|
||||
const deleting = ref(null);
|
||||
const membershipFilters = ref(null);
|
||||
|
||||
const props = defineProps(indexProps);
|
||||
var { router, data, meta, getFilter, setFilter, filterString, reloadPage } = useIndex(props.data, 'member');
|
||||
var { router, data, meta, getFilter, setFilter, reloadPage, edit, create, single, cancel, submit, filterString } = useIndex(props.data, 'member');
|
||||
|
||||
function exportMembers() {
|
||||
window.open(`/member-export?filter=${filterString.value}`);
|
||||
}
|
||||
|
||||
function show(member) {
|
||||
console.log(member);
|
||||
}
|
||||
|
||||
async function remove(member) {
|
||||
new Promise((resolve, reject) => {
|
||||
deleting.value = { resolve, reject, member };
|
||||
|
@ -175,12 +186,12 @@ async function remove(member) {
|
|||
}
|
||||
|
||||
function openSidebar(type, model) {
|
||||
single.value = {
|
||||
sidebar.value = {
|
||||
type: type,
|
||||
model: model,
|
||||
};
|
||||
}
|
||||
function closeSidebar() {
|
||||
single.value = null;
|
||||
sidebar.value = null;
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="flex space-x-1">
|
||||
<i-link v-tooltip="`Details`" :href="member.links.show" class="inline-flex btn btn-primary btn-sm"><ui-sprite src="eye"></ui-sprite></i-link>
|
||||
<i-link v-tooltip="`Bearbeiten`" :href="member.links.edit" class="inline-flex btn btn-warning btn-sm"><ui-sprite src="pencil"></ui-sprite></i-link>
|
||||
<a v-tooltip="`Details`" href="#" class="inline-flex btn btn-primary btn-sm" @click.prevent="$emit('show')"><ui-sprite src="eye"></ui-sprite></a>
|
||||
<a v-tooltip="`Bearbeiten`" href="#" class="inline-flex btn btn-warning btn-sm" @click.prevent="$emit('edit')"><ui-sprite src="pencil"></ui-sprite></a>
|
||||
<a v-show="hasModule('bill')" v-tooltip="`Zahlungen`" href="#" class="inline-flex btn btn-info btn-sm" @click.prevent="$emit('sidebar', 'invoicePosition')"
|
||||
><ui-sprite src="money"></ui-sprite
|
||||
></a>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</template>
|
||||
<ui-popup v-if="single !== null" :heading="single.id ? 'Verbindung bearbeiten' : 'Neue Verbindung'" @close="cancel">
|
||||
<form @submit.prevent="submit">
|
||||
<section class="grid grid-cols-2 gap-3 mt-6">
|
||||
<section class="grid grid-cols-2 gap-3">
|
||||
<f-text id="name" v-model="single.name" name="name" label="Bezeichnung" required></f-text>
|
||||
<f-select
|
||||
id="type"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</template>
|
||||
<ui-popup v-if="single !== null" :heading="single.id ? 'Verbindung bearbeiten' : 'Neue Verbindung'" @close="cancel">
|
||||
<form @submit.prevent="submit">
|
||||
<section class="grid grid-cols-2 gap-3 mt-6">
|
||||
<section class="grid grid-cols-2 gap-3">
|
||||
<f-text id="name" v-model="single.name" label="Bezeichnung" required></f-text>
|
||||
<f-text id="domain" v-model="single.domain" label="Domain" required></f-text>
|
||||
<f-select
|
||||
|
|
Loading…
Reference in New Issue