2023-06-13 22:03:32 +02:00
|
|
|
<template>
|
|
|
|
<page-layout>
|
|
|
|
<template #toolbar>
|
|
|
|
<page-toolbar-button :href="meta.links.index" color="primary" icon="undo">Zurück</page-toolbar-button>
|
|
|
|
</template>
|
2023-07-06 13:56:19 +02:00
|
|
|
<template #right>
|
2023-06-13 22:03:32 +02:00
|
|
|
<f-save-button form="form"></f-save-button>
|
2023-07-06 13:56:19 +02:00
|
|
|
</template>
|
|
|
|
<form id="form" class="p-3 grid gap-3" @submit.prevent="submit">
|
2023-06-14 17:29:22 +02:00
|
|
|
<ui-box heading="Metadatem">
|
|
|
|
<div class="grid gap-4 sm:grid-cols-2">
|
|
|
|
<f-text id="name" name="name" v-model="model.name" label="Name" size="sm" required></f-text>
|
|
|
|
<f-select id="gateway_id" name="gateway_id" :options="meta.gateways" v-model="model.gateway_id" label="Verbindung" size="sm" required></f-select>
|
|
|
|
</div>
|
|
|
|
</ui-box>
|
2023-06-14 23:20:37 +02:00
|
|
|
<ui-box heading="Filterregeln" v-if="members !== null">
|
2023-06-13 22:03:32 +02:00
|
|
|
<div class="grid gap-4 sm:grid-cols-2">
|
2023-06-14 17:10:50 +02:00
|
|
|
<f-multipleselect
|
|
|
|
id="activity_ids"
|
|
|
|
name="activity_ids"
|
2023-06-14 23:20:37 +02:00
|
|
|
:options="members.meta.filterActivities"
|
2023-06-14 17:10:50 +02:00
|
|
|
v-model="model.filter.activity_ids"
|
2023-07-06 13:56:19 +02:00
|
|
|
@update:modelValue="reload(1)"
|
2023-06-14 17:10:50 +02:00
|
|
|
label="Tätigkeit"
|
|
|
|
size="sm"
|
|
|
|
></f-multipleselect>
|
|
|
|
<f-multipleselect
|
|
|
|
id="subactivity_ids"
|
|
|
|
name="subactivity_ids"
|
2023-06-14 23:20:37 +02:00
|
|
|
:options="members.meta.filterSubactivities"
|
2023-06-14 17:10:50 +02:00
|
|
|
v-model="model.filter.subactivity_ids"
|
2023-07-06 13:56:19 +02:00
|
|
|
@update:modelValue="reload(1)"
|
2023-06-14 17:10:50 +02:00
|
|
|
label="Unterttätigkeit"
|
|
|
|
size="sm"
|
|
|
|
></f-multipleselect>
|
2023-06-14 17:29:22 +02:00
|
|
|
<f-multipleselect
|
2023-07-10 11:36:58 +02:00
|
|
|
id="include"
|
|
|
|
name="include"
|
2023-06-14 23:20:37 +02:00
|
|
|
:options="members.meta.members"
|
2023-07-10 11:36:58 +02:00
|
|
|
v-model="model.filter.include"
|
2023-07-06 13:56:19 +02:00
|
|
|
@update:modelValue="reload(1)"
|
2023-06-14 17:29:22 +02:00
|
|
|
label="Zusätzliche Mitglieder"
|
|
|
|
size="sm"
|
|
|
|
></f-multipleselect>
|
2023-07-10 11:36:58 +02:00
|
|
|
<f-multipleselect
|
|
|
|
id="exclude"
|
|
|
|
name="exclude"
|
|
|
|
:options="members.meta.members"
|
|
|
|
v-model="model.filter.exclude"
|
|
|
|
@update:modelValue="reload(1)"
|
|
|
|
label="Mitglieder ausschließen"
|
|
|
|
size="sm"
|
|
|
|
></f-multipleselect>
|
2023-06-14 23:20:37 +02:00
|
|
|
<f-multipleselect
|
|
|
|
id="groupIds"
|
|
|
|
name="groupIds"
|
|
|
|
:options="members.meta.groups"
|
|
|
|
v-model="model.filter.group_ids"
|
2023-07-06 13:56:19 +02:00
|
|
|
@update:modelValue="reload(1)"
|
2023-06-14 23:20:37 +02:00
|
|
|
label="Gruppierungen"
|
|
|
|
size="sm"
|
|
|
|
></f-multipleselect>
|
2023-06-13 22:03:32 +02:00
|
|
|
</div>
|
|
|
|
</ui-box>
|
2023-06-14 17:10:50 +02:00
|
|
|
<ui-box heading="Mitglieder" v-if="members !== null">
|
|
|
|
<table cellspacing="0" cellpadding="0" border="0" class="custom-table custom-table-sm hidden md:table">
|
|
|
|
<thead>
|
|
|
|
<th></th>
|
|
|
|
<th>Nachname</th>
|
|
|
|
<th>Vorname</th>
|
|
|
|
<th>E-Mail-Adresse</th>
|
|
|
|
<th>E-Mail-Adresse Eltern</th>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tr v-for="(member, index) in members.data" :key="index">
|
|
|
|
<td><ui-age-groups :member="member"></ui-age-groups></td>
|
|
|
|
<td v-text="member.lastname"></td>
|
|
|
|
<td v-text="member.firstname"></td>
|
|
|
|
<td v-text="member.email"></td>
|
|
|
|
<td v-text="member.email_parents"></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<ui-pagination class="mt-4" @reload="reload" :value="members.meta" :only="['data']"></ui-pagination>
|
2023-06-13 22:03:32 +02:00
|
|
|
</ui-box>
|
|
|
|
</form>
|
|
|
|
</page-layout>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-06-14 17:10:50 +02:00
|
|
|
import indexHelpers from '../../mixins/indexHelpers.js';
|
2023-06-14 23:20:37 +02:00
|
|
|
import hasFlash from '../../mixins/hasFlash.js';
|
2023-06-14 17:10:50 +02:00
|
|
|
|
2023-06-13 22:03:32 +02:00
|
|
|
export default {
|
2023-06-14 23:20:37 +02:00
|
|
|
mixins: [indexHelpers, hasFlash],
|
2023-06-14 17:10:50 +02:00
|
|
|
|
2023-06-13 22:03:32 +02:00
|
|
|
data: function () {
|
|
|
|
return {
|
2023-06-15 00:08:01 +02:00
|
|
|
model: this.data === undefined ? {...this.meta.default_model} : {...this.data},
|
2023-06-14 17:10:50 +02:00
|
|
|
members: null,
|
2023-06-13 22:03:32 +02:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
data: {},
|
|
|
|
meta: {},
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2023-06-14 17:10:50 +02:00
|
|
|
async reload(page) {
|
2023-06-13 22:03:32 +02:00
|
|
|
this.members = (
|
2023-06-14 17:10:50 +02:00
|
|
|
await this.axios.post('/api/member/search', {
|
|
|
|
page: page || 1,
|
|
|
|
filter: this.toFilterString(this.model.filter),
|
2023-06-13 22:03:32 +02:00
|
|
|
})
|
|
|
|
).data;
|
|
|
|
},
|
2023-06-14 23:20:37 +02:00
|
|
|
|
|
|
|
async submit() {
|
2023-07-06 13:56:19 +02:00
|
|
|
this.model.id ? await this.axios.patch(this.model.links.update, this.model) : await this.axios.post('/maildispatcher', this.model);
|
|
|
|
this.$inertia.visit(this.meta.links.index);
|
2023-06-14 23:20:37 +02:00
|
|
|
},
|
2023-06-13 22:03:32 +02:00
|
|
|
},
|
|
|
|
|
2023-06-14 17:10:50 +02:00
|
|
|
async created() {
|
|
|
|
this.reload();
|
|
|
|
},
|
2023-06-13 22:03:32 +02:00
|
|
|
};
|
|
|
|
</script>
|