adrema/resources/js/views/subscription/SubscriptionForm.vue

44 lines
1.0 KiB
Vue
Raw Normal View History

2021-07-04 01:44:41 +02:00
<template>
2022-12-04 23:40:35 +01:00
<form id="subedit" class="p-6 grid gap-4 justify-start" @submit.prevent="submit">
<save-button form="subedit"></save-button>
2021-07-04 01:44:41 +02:00
<f-text id="name" v-model="inner.name" label="Name" required></f-text>
2022-08-23 23:49:19 +02:00
<f-select
id="fee_id"
name="fee_id"
:options="fees"
v-model="inner.fee_id"
label="Nami-Beitrag"
required
></f-select>
2022-11-17 20:56:52 +01:00
<f-text id="amount" v-model="inner.amount" label="Interner Beitrag" mode="area" required></f-text>
2021-07-04 01:44:41 +02:00
</form>
</template>
<script>
export default {
2022-08-23 23:49:19 +02:00
data: function () {
2021-07-04 01:44:41 +02:00
return {
inner: {},
};
},
props: {
data: {},
fees: {},
mode: {},
},
methods: {
submit() {
this.mode === 'create'
? this.$inertia.post(`/subscription`, this.inner)
: this.$inertia.patch(`/subscription/${this.inner.id}`, this.inner);
2022-08-23 23:49:19 +02:00
},
2021-07-04 01:44:41 +02:00
},
created() {
this.inner = this.data;
2022-08-23 23:49:19 +02:00
},
2021-07-04 01:44:41 +02:00
};
</script>