adrema/resources/js/views/member/Payments.vue

52 lines
2.0 KiB
Vue
Raw Normal View History

2021-07-04 16:56:07 +02:00
<template>
<div class="sidebar flex flex-col">
2021-07-04 16:56:07 +02:00
<sidebar-header :links="value.links" @close="$inertia.visit('/member')" title="Zahlungen"></sidebar-header>
<div class="custom-table custom-table-light custom-table-sm text-sm flex-grow">
2021-07-04 16:56:07 +02:00
<header>
<div>Nr</div>
<div>Status</div>
<div>Beitrag</div>
<div></div>
</header>
<div v-for="payment, index in value.data.payments">
<div v-text="payment.nr"></div>
<div v-text="payment.status_name"></div>
<div v-text="payment.subscription_name"></div>
<div class="flex">
<inertia-link :href="`/member/${value.data.id}/payment/${payment.id}/edit`" class="inline-flex btn btn-warning btn-sm"><sprite src="pencil"></sprite></inertia-link>
2021-07-04 17:03:56 +02:00
<inertia-link v-show="!payment.is_accepted" href="#" @click.prevent="accept(payment)" class="inline-flex btn btn-success btn-sm"><sprite src="check"></sprite></inertia-link>
2021-07-04 16:56:07 +02:00
<inertia-link href="#" @click.prevent="remove(payment)" class="inline-flex btn btn-danger btn-sm"><sprite src="trash"></sprite></inertia-link>
</div>
</div>
</div>
<div class="flex flex-col pb-6 px-6">
<a href="#" class="text-center btn btn-primary">Rechnung erstellen</a>
<a href="#" class="text-center mt-1 btn btn-primary">Erinnerung erstellen</a>
</div>
2021-07-04 16:56:07 +02:00
</div>
</template>
<script>
import SidebarHeader from '../../components/SidebarHeader.vue';
export default {
components: { SidebarHeader },
methods: {
remove(payment) {
this.$inertia.delete(`/member/${this.value.data.id}/payment/${payment.id}`);
2021-07-04 17:03:56 +02:00
},
accept(payment) {
this.$inertia.patch(`/member/${this.value.data.id}/payment/${payment.id}`, { ...payment, status_id: 3 });
2021-07-04 16:56:07 +02:00
}
},
props: {
value: {}
}
};
</script>