Restructured Project Rep
This commit is contained in:
117
pages/settings/tenant.vue
Normal file
117
pages/settings/tenant.vue
Normal file
@@ -0,0 +1,117 @@
|
||||
<script setup>
|
||||
|
||||
const dataStore = useDataStore()
|
||||
const supabase = useSupabaseClient()
|
||||
|
||||
const features = ref(dataStore.ownTenant.features)
|
||||
const businessInfo = ref(dataStore.ownTenant.businessInfo)
|
||||
|
||||
const updateTenant = async (newData) => {
|
||||
const {data,error} = await supabase.from("tenants")
|
||||
.update(newData)
|
||||
.eq("id",dataStore.currentTenant)
|
||||
.select()
|
||||
|
||||
if (error) console.log(error)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UDashboardNavbar title="Firmeneinstellungen">
|
||||
|
||||
</UDashboardNavbar>
|
||||
<UTabs
|
||||
class="p-5"
|
||||
:items="[
|
||||
{
|
||||
label: 'Rechnung & Kontakt'
|
||||
},{
|
||||
label: 'Lizenz'
|
||||
},{
|
||||
label: 'Funktionen'
|
||||
},{
|
||||
label: 'Bankkonten'
|
||||
},{
|
||||
label: 'Tags'
|
||||
}
|
||||
]"
|
||||
>
|
||||
<template #item="{item}">
|
||||
<UCard class="mt-5">
|
||||
<div v-if="item.label === 'Rechnung & Kontakt'">
|
||||
<UForm class="w-1/2">
|
||||
<UFormGroup
|
||||
label="Firmenname:"
|
||||
>
|
||||
<UInput v-model="businessInfo.name"/>
|
||||
</UFormGroup>
|
||||
<UFormGroup
|
||||
label="Straße + Hausnummer:"
|
||||
>
|
||||
<UInput v-model="businessInfo.street"/>
|
||||
</UFormGroup>
|
||||
<UFormGroup
|
||||
label="PLZ + Ort"
|
||||
class="w-full"
|
||||
>
|
||||
<InputGroup class="w-full">
|
||||
<UInput v-model="businessInfo.zip"/>
|
||||
<UInput v-model="businessInfo.city" class="flex-auto"/>
|
||||
</InputGroup>
|
||||
</UFormGroup>
|
||||
<UButton
|
||||
class="mt-3"
|
||||
@click="updateTenant({businessInfo: businessInfo})"
|
||||
>
|
||||
Speichern
|
||||
</UButton>
|
||||
</UForm>
|
||||
</div>
|
||||
<div v-else-if="item.label === 'Funktionen'">
|
||||
<UAlert
|
||||
title="Funktionen ausblenden"
|
||||
description="Nur Funktionen mit gesetztem Haken sind im Unternehmen verfügbar. Diese Einstellungen gelten für alle Mitarbeiter und sind unabhängig von Berechtigungen."
|
||||
color="rose"
|
||||
variant="outline"
|
||||
class="mb-5"
|
||||
/>
|
||||
<UCheckbox
|
||||
label="Kalendar"
|
||||
v-model="features.calendar"
|
||||
@change="updateTenant({features: features})"
|
||||
/>
|
||||
<UCheckbox
|
||||
label="Plantafel"
|
||||
v-model="features.planningBoard"
|
||||
@change="updateTenant({features: features})"
|
||||
/>
|
||||
<UCheckbox
|
||||
label="Zeiterfassung"
|
||||
v-model="features.timeTracking"
|
||||
@change="updateTenant({features: features})"
|
||||
/>
|
||||
<UCheckbox
|
||||
label="Anwesenheiten"
|
||||
v-model="features.workingTimeTracking"
|
||||
@change="updateTenant({features: features})"
|
||||
/>
|
||||
<UCheckbox
|
||||
label="Verträge"
|
||||
v-model="features.contracts"
|
||||
@change="updateTenant({features: features})"
|
||||
/>
|
||||
<UCheckbox
|
||||
label="Fahrzeuge"
|
||||
v-model="features.vehicles"
|
||||
@change="updateTenant({features: features})"
|
||||
/>
|
||||
</div>
|
||||
</UCard>
|
||||
</template>
|
||||
</UTabs>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user