--wip-- [skip ci]

This commit is contained in:
philipp lang 2024-09-12 11:14:59 +02:00
parent 9f97d37cc3
commit a4f084e590
4 changed files with 192 additions and 165 deletions

View File

@ -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:

View File

@ -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,6 +7,7 @@
<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>
@ -20,7 +21,7 @@
</ui-popup>
<!-- ***************************** Hauptbereich ****************************** -->
<div class="grow grid md:grid-cols-2 gap-3 p-3">
<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">
@ -129,53 +130,71 @@
</ui-box>
</div>
</form>
</page-layout>
</template>
<script>
<script setup>
import {ref, computed, inject} from 'vue';
const axios = inject('axios');
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: {
const props = defineProps({
mode: {},
data: {},
conflict: {},
model: {},
meta: {},
},
data: function () {
return {
original: this.mode === 'create' ? {...this.meta.default} : {...this.data},
inner: this.mode === 'create' ? {...this.meta.default} : {...this.data},
active: 0,
};
},
});
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();
// data: function () {
// return {
// original: this.mode === 'create' ? {...this.meta.default} : {...this.data},
// inner: this.mode === 'create' ? {...this.meta.default} : {...this.data},
// };
// },
//
// 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() {},
// },
//
// computed: {
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>

View File

@ -1,8 +1,11 @@
<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="Mitglied erstellen" full @close="cancel">
<v-form :meta="meta" :model="single"></v-form>
</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>
@ -109,7 +112,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)" @remove="remove(member)"></actions>
</td>
</tr>
</table>
@ -124,7 +127,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 +138,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,15 +152,16 @@ 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, filterString, reloadPage, edit, create, single, cancel } = useIndex(props.data, 'member');
function exportMembers() {
window.open(`/member-export?filter=${filterString.value}`);
@ -175,12 +179,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>

View File

@ -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="`Bearbeiten`" 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>