2020-06-02 23:45:25 +02:00
|
|
|
<template>
|
2023-04-29 23:41:26 +02:00
|
|
|
<page-layout page-class="pb-6">
|
2023-05-20 02:38:38 +02:00
|
|
|
<template #toolbar>
|
2023-10-18 01:11:36 +02:00
|
|
|
<page-toolbar-button :href="meta.links.create" color="primary" icon="plus">Mitglied
|
|
|
|
anlegen</page-toolbar-button>
|
|
|
|
<page-toolbar-button v-if="hasModule('bill')" :href="meta.links.allpayment" color="primary"
|
|
|
|
icon="invoice">Rechnungen erstellen</page-toolbar-button>
|
|
|
|
<page-toolbar-button v-if="hasModule('bill')" :href="meta.links.sendpayment" color="info"
|
|
|
|
icon="envelope">Rechnungen versenden</page-toolbar-button>
|
2023-05-20 02:38:38 +02:00
|
|
|
</template>
|
2023-07-27 17:22:06 +02:00
|
|
|
<ui-popup v-if="deleting !== null" heading="Mitglied löschen?" @close="deleting.reject()">
|
2023-05-09 01:34:19 +02:00
|
|
|
<div>
|
|
|
|
<p class="mt-4">Das Mitglied "{{ deleting.member.fullname }}" löschen?</p>
|
2023-10-18 01:11:36 +02:00
|
|
|
<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>
|
2023-07-27 17:22:06 +02:00
|
|
|
<ui-note v-if="deleting.member.has_nami" class="mt-5" type="danger">
|
2023-10-18 01:11:36 +02:00
|
|
|
Dieses Mitglied ist in NaMi vorhanden und wird daher in NaMi abgemeldet werden. Sofern
|
|
|
|
"Datenweiterverwendung" eingeschaltet ist, wird das Mitglied auf inaktiv gesetzt.
|
2023-05-19 01:06:46 +02:00
|
|
|
</ui-note>
|
2023-05-09 01:34:19 +02:00
|
|
|
<div class="grid grid-cols-2 gap-3 mt-6">
|
2023-07-27 17:22:06 +02:00
|
|
|
<a href="#" class="text-center btn btn-danger" @click.prevent="deleting.resolve">Mitglied loschen</a>
|
|
|
|
<a href="#" class="text-center btn btn-primary" @click.prevent="deleting.reject">Abbrechen</a>
|
2023-05-09 01:34:19 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-05-19 01:06:46 +02:00
|
|
|
</ui-popup>
|
2023-08-20 23:37:11 +02:00
|
|
|
<page-filter breakpoint="xl">
|
2023-10-18 01:11:36 +02:00
|
|
|
<f-text id="search" :model-value="getFilter('search')" name="search" label="Suchen …" size="sm"
|
|
|
|
@update:model-value="setFilter('search', $event)"></f-text>
|
|
|
|
<f-switch v-show="hasModule('bill')" id="ausstand" :model-value="getFilter('ausstand')" label="Nur Ausstände"
|
|
|
|
size="sm" @update:model-value="setFilter('ausstand', $event)"></f-switch>
|
|
|
|
<f-multipleselect id="group_ids" :options="meta.groups" :model-value="getFilter('group_ids')"
|
|
|
|
label="Gruppierungen" size="sm" name="group_ids"
|
|
|
|
@update:model-value="setFilter('group_ids', $event)"></f-multipleselect>
|
|
|
|
<f-select v-show="hasModule('bill')" id="billKinds" name="billKinds" :options="meta.billKinds"
|
|
|
|
:model-value="getFilter('bill_kind')" label="Rechnung" size="sm"
|
|
|
|
@update:model-value="setFilter('bill_kind', $event)"></f-select>
|
|
|
|
<f-multipleselect id="activity_ids" :options="meta.filterActivities" :model-value="getFilter('activity_ids')"
|
|
|
|
label="Tätigkeiten" size="sm" name="activity_ids"
|
|
|
|
@update:model-value="setFilter('activity_ids', $event)"></f-multipleselect>
|
|
|
|
<f-multipleselect id="subactivity_ids" :options="meta.filterSubactivities"
|
|
|
|
:model-value="getFilter('subactivity_ids')" label="Untertätigkeiten" size="sm" name="subactivity_ids"
|
|
|
|
@update:model-value="setFilter('subactivity_ids', $event)"></f-multipleselect>
|
2023-03-15 00:08:20 +01:00
|
|
|
<button class="btn btn-primary label mr-2" @click.prevent="exportMembers">
|
2023-07-06 13:56:19 +02:00
|
|
|
<ui-sprite class="w-3 h-3 xl:mr-2" src="save"></ui-sprite>
|
2023-03-15 00:08:20 +01:00
|
|
|
<span class="hidden xl:inline">Exportieren</span>
|
|
|
|
</button>
|
2023-08-20 23:37:11 +02:00
|
|
|
</page-filter>
|
2021-08-22 05:51:25 +02:00
|
|
|
|
2022-11-24 00:59:40 +01:00
|
|
|
<table cellspacing="0" cellpadding="0" border="0" class="custom-table custom-table-sm hidden md:table">
|
2021-08-22 19:31:20 +02:00
|
|
|
<thead>
|
|
|
|
<th></th>
|
|
|
|
<th>Nachname</th>
|
|
|
|
<th>Vorname</th>
|
2023-08-20 23:37:11 +02:00
|
|
|
<th class="!hidden 2xl:!table-cell">Ort</th>
|
2021-08-22 19:31:20 +02:00
|
|
|
<th>Tags</th>
|
2023-08-20 23:37:11 +02:00
|
|
|
<th class="!hidden xl:!table-cell">Alter</th>
|
|
|
|
<th v-show="hasModule('bill')" class="!hidden xl:!table-cell">Rechnung</th>
|
2021-11-19 00:53:19 +01:00
|
|
|
<th v-show="hasModule('bill')">Ausstand</th>
|
2021-08-22 19:31:20 +02:00
|
|
|
<th></th>
|
|
|
|
</thead>
|
2021-04-11 02:55:26 +02:00
|
|
|
|
2023-07-27 17:22:06 +02:00
|
|
|
<tr v-for="(member, index) in data" :key="index">
|
2023-06-14 17:10:50 +02:00
|
|
|
<td><ui-age-groups :member="member"></ui-age-groups></td>
|
2021-08-22 19:31:20 +02:00
|
|
|
<td v-text="member.lastname"></td>
|
|
|
|
<td v-text="member.firstname"></td>
|
2023-08-20 23:37:11 +02:00
|
|
|
<td class="!hidden 2xl:!table-cell" v-text="member.full_address"></td>
|
2023-07-27 17:22:06 +02:00
|
|
|
<td>
|
|
|
|
<tags :member="member"></tags>
|
|
|
|
</td>
|
2023-08-20 23:37:11 +02:00
|
|
|
<td class="!hidden xl:!table-cell" v-text="member.age"></td>
|
|
|
|
<td v-show="hasModule('bill')" class="!hidden xl:!table-cell">
|
2023-05-19 01:06:46 +02:00
|
|
|
<ui-label :value="member.bill_kind_name" fallback="kein"></ui-label>
|
2021-08-22 19:31:20 +02:00
|
|
|
</td>
|
2021-11-19 00:53:19 +01:00
|
|
|
<td v-show="hasModule('bill')">
|
2023-05-19 01:06:46 +02:00
|
|
|
<ui-label :value="member.pending_payment" fallback="---"></ui-label>
|
2021-08-22 19:31:20 +02:00
|
|
|
</td>
|
2022-11-18 15:55:44 +01:00
|
|
|
<td>
|
2023-09-12 16:54:13 +02:00
|
|
|
<actions :member="member" @sidebar="openSidebar($event, member)" @remove="remove(member)"></actions>
|
2021-08-22 19:31:20 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2021-04-11 02:55:26 +02:00
|
|
|
|
2022-11-24 00:59:40 +01:00
|
|
|
<div class="md:hidden p-3 grid gap-3">
|
2023-08-20 22:47:17 +02:00
|
|
|
<ui-box v-for="(member, index) in data" :key="index" class="relative" :heading="member.fullname">
|
2023-07-27 17:22:06 +02:00
|
|
|
<template #in-title>
|
2023-06-14 17:10:50 +02:00
|
|
|
<ui-age-groups class="ml-2" :member="member" icon-class="w-4 h-4"></ui-age-groups>
|
2023-07-27 17:22:06 +02:00
|
|
|
</template>
|
2022-11-24 00:59:40 +01:00
|
|
|
<div class="text-xs text-gray-200" v-text="member.full_address"></div>
|
2022-12-05 00:21:24 +01:00
|
|
|
<div class="flex items-center mt-1 space-x-4">
|
2022-11-24 00:59:40 +01:00
|
|
|
<tags :member="member"></tags>
|
2023-10-18 01:11:36 +02:00
|
|
|
<ui-label v-show="hasModule('bill')" class="text-gray-100 block" :value="member.pending_payment"
|
|
|
|
fallback=""></ui-label>
|
2022-11-24 00:59:40 +01:00
|
|
|
</div>
|
2023-10-18 01:11:36 +02:00
|
|
|
<actions class="mt-2" :member="member" @sidebar="openSidebar($event, member)" @remove="remove(member)">
|
|
|
|
</actions>
|
2022-11-24 00:59:40 +01:00
|
|
|
<div class="absolute right-0 top-0 h-full flex items-center mr-2">
|
2023-10-18 01:11:36 +02:00
|
|
|
<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>
|
2022-11-24 00:59:40 +01:00
|
|
|
</div>
|
2023-05-19 01:06:46 +02:00
|
|
|
</ui-box>
|
2022-11-24 00:59:40 +01:00
|
|
|
</div>
|
|
|
|
|
2021-04-11 02:55:26 +02:00
|
|
|
<div class="px-6">
|
2023-10-31 10:38:32 +01:00
|
|
|
<ui-pagination class="mt-4" :value="meta" @reload="reloadPage"></ui-pagination>
|
2021-04-11 02:55:26 +02:00
|
|
|
</div>
|
2021-07-04 16:56:07 +02:00
|
|
|
|
2023-10-13 13:07:16 +02:00
|
|
|
<ui-sidebar v-if="single !== null" @close="closeSidebar">
|
2023-10-18 01:11:36 +02:00
|
|
|
<member-payments v-if="single.type === 'payment'" :url="single.model.links.payment_index"
|
|
|
|
@close="closeSidebar"></member-payments>
|
|
|
|
<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>
|
2023-10-13 13:07:16 +02:00
|
|
|
</ui-sidebar>
|
2023-04-29 23:41:26 +02:00
|
|
|
</page-layout>
|
2020-06-02 23:45:25 +02:00
|
|
|
</template>
|
|
|
|
|
2023-07-27 17:22:06 +02:00
|
|
|
<script setup>
|
2022-02-12 14:47:07 +01:00
|
|
|
import MemberPayments from './MemberPayments.vue';
|
|
|
|
import MemberMemberships from './MemberMemberships.vue';
|
2022-02-12 14:28:56 +01:00
|
|
|
import MemberCourses from './MemberCourses.vue';
|
2023-07-06 13:56:19 +02:00
|
|
|
import Tags from './Tags.vue';
|
|
|
|
import Actions from './index/Actions.vue';
|
2023-10-18 01:11:36 +02:00
|
|
|
import { indexProps, useIndex } from '../../composables/useIndex.js';
|
|
|
|
import { ref, defineProps } from 'vue';
|
2020-06-02 23:45:25 +02:00
|
|
|
|
2023-07-27 17:22:06 +02:00
|
|
|
const single = ref(null);
|
|
|
|
const deleting = ref(null);
|
2021-08-22 05:15:56 +02:00
|
|
|
|
2023-07-27 17:22:06 +02:00
|
|
|
const props = defineProps(indexProps);
|
2023-10-31 10:38:32 +01:00
|
|
|
var { router, data, meta, getFilter, setFilter, filterString, reloadPage } = useIndex(props.data, 'member');
|
2021-08-22 04:28:11 +02:00
|
|
|
|
2023-07-27 17:22:06 +02:00
|
|
|
function exportMembers() {
|
|
|
|
window.open(`/member-export?filter=${filterString.value}`);
|
|
|
|
}
|
2021-07-04 16:56:07 +02:00
|
|
|
|
2023-07-27 17:22:06 +02:00
|
|
|
async function remove(member) {
|
|
|
|
new Promise((resolve, reject) => {
|
2023-10-18 01:11:36 +02:00
|
|
|
deleting.value = { resolve, reject, member };
|
2023-07-27 17:22:06 +02:00
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
router.delete(`/member/${member.id}`);
|
|
|
|
deleting.value = null;
|
|
|
|
})
|
|
|
|
.catch(() => (deleting.value = null));
|
|
|
|
}
|
2021-07-04 19:09:59 +02:00
|
|
|
|
2023-09-12 16:54:13 +02:00
|
|
|
function openSidebar(type, model) {
|
|
|
|
single.value = {
|
|
|
|
type: type,
|
|
|
|
model: model,
|
|
|
|
};
|
2023-07-27 17:22:06 +02:00
|
|
|
}
|
|
|
|
function closeSidebar() {
|
|
|
|
single.value = null;
|
|
|
|
}
|
2020-06-02 23:45:25 +02:00
|
|
|
</script>
|