Changes
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<script setup lang="ts">
|
<script setup>
|
||||||
import { DatePicker as VCalendarDatePicker } from 'v-calendar'
|
import { DatePicker as VCalendarDatePicker } from 'v-calendar'
|
||||||
import 'v-calendar/dist/style.css'
|
import 'v-calendar/dist/style.css'
|
||||||
|
|
||||||
@@ -6,6 +6,10 @@ const props = defineProps({
|
|||||||
modelValue: {
|
modelValue: {
|
||||||
type: Date,
|
type: Date,
|
||||||
default: null
|
default: null
|
||||||
|
},
|
||||||
|
mode: {
|
||||||
|
type: String,
|
||||||
|
default: "date"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -37,6 +41,8 @@ const attrs = [{
|
|||||||
<template>
|
<template>
|
||||||
<VCalendarDatePicker
|
<VCalendarDatePicker
|
||||||
v-model="date"
|
v-model="date"
|
||||||
|
:mode="props.mode"
|
||||||
|
is24hr
|
||||||
transparent
|
transparent
|
||||||
borderless
|
borderless
|
||||||
:attributes="attrs"
|
:attributes="attrs"
|
||||||
|
|||||||
@@ -337,6 +337,10 @@ let links = [
|
|||||||
label: "Mitarbeiter",
|
label: "Mitarbeiter",
|
||||||
to: "/profiles",
|
to: "/profiles",
|
||||||
icon: "i-heroicons-clipboard-document-list"
|
icon: "i-heroicons-clipboard-document-list"
|
||||||
|
},{
|
||||||
|
label: "Firmeneinstellungen",
|
||||||
|
to: "/settings/tenant",
|
||||||
|
icon: "i-heroicons-clipboard-document-list"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,23 +1,81 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import Axios from "axios"
|
|
||||||
|
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
const bankingStore = useBankingStore()
|
||||||
|
const dataStore = useDataStore()
|
||||||
|
|
||||||
const newAccounts = ref([])
|
const newAccounts = ref([])
|
||||||
|
const selectedInstitution = ref("")
|
||||||
|
const institutions = ref([])
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
|
const {data,error} = await axios({
|
||||||
|
url:`http://localhost:3002/banking/institutions`,
|
||||||
|
method: "GET"
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(data)
|
||||||
|
console.log(error)
|
||||||
|
|
||||||
|
institutions.value = data
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const createLink = async () => {
|
||||||
|
const {data,error} = await axios({
|
||||||
|
method: "POST",
|
||||||
|
url:`http://localhost:3002/banking/link?tenant=${dataStore.currentTenant}&institution_id=${selectedInstitution.value}`,
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(data)
|
||||||
|
console.log(error)
|
||||||
|
|
||||||
|
if(data.link) {
|
||||||
|
window.open(data.link,"_blank")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setupPage()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
New
|
<UDashboardNavbar
|
||||||
<UButton
|
title="Neues Bankkonto anbinden"
|
||||||
@click="setupPage"
|
|
||||||
>
|
>
|
||||||
Setup
|
|
||||||
</UButton>
|
</UDashboardNavbar>
|
||||||
|
|
||||||
|
<UDashboardToolbar>
|
||||||
|
<template #right>
|
||||||
|
<UButton
|
||||||
|
@click="createLink"
|
||||||
|
>
|
||||||
|
Weiter
|
||||||
|
</UButton>
|
||||||
|
</template>
|
||||||
|
</UDashboardToolbar>
|
||||||
|
|
||||||
|
<UForm class="p-5">
|
||||||
|
<UFormGroup
|
||||||
|
label="Bank auswählen:"
|
||||||
|
>
|
||||||
|
<USelectMenu
|
||||||
|
:options="institutions"
|
||||||
|
searchable
|
||||||
|
v-model="selectedInstitution"
|
||||||
|
value-attribute="id"
|
||||||
|
option-attribute="name"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
|
|
||||||
|
</UForm>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
35
spaces/pages/settings/tenant.vue
Normal file
35
spaces/pages/settings/tenant.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script setup>
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<UDashboardNavbar title="Firmeneinstellungen">
|
||||||
|
|
||||||
|
</UDashboardNavbar>
|
||||||
|
<UTabs
|
||||||
|
class="p-5"
|
||||||
|
:items="[
|
||||||
|
{
|
||||||
|
label: 'Rechnung & Kontakt'
|
||||||
|
},{
|
||||||
|
label: 'Lizenz'
|
||||||
|
},{
|
||||||
|
label: 'Bankkonten'
|
||||||
|
},{
|
||||||
|
label: 'Tags'
|
||||||
|
}
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<template #item="{item}">
|
||||||
|
<UCard class="mt-5">
|
||||||
|
<div v-if="item.label === 'Rechnung & Kontakt'">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</UCard>
|
||||||
|
</template>
|
||||||
|
</UTabs>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -53,7 +53,6 @@ const itemInfo = ref({
|
|||||||
start: new Date(),
|
start: new Date(),
|
||||||
end: "",
|
end: "",
|
||||||
notes: null,
|
notes: null,
|
||||||
state: "Entwurf"
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -153,15 +152,22 @@ const stopStartedTime = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dataStore.workingtimes.find(time => time.profile == dataStore.getOwnProfile.id && !time.end)) {
|
if(dataStore.workingtimes.find(time => time.profile === dataStore.getOwnProfile.id && !time.end)) {
|
||||||
runningTimeInfo.value = dataStore.workingtimes.find(time => time.profile == dataStore.getOwnProfile.id && !time.end)
|
runningTimeInfo.value = dataStore.workingtimes.find(time => time.profile === dataStore.getOwnProfile.id && !time.end)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const createTime = async () => {
|
const createTime = async () => {
|
||||||
|
|
||||||
|
const date = dayjs(itemInfo.value.start).format("YYYY-MM-DD")
|
||||||
|
const start = dayjs(itemInfo.value.start).format("HH:mm:ssZ")
|
||||||
|
const end = dayjs(itemInfo.value.end).format("HH:mm:ssZ")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const {data,error} = await supabase
|
const {data,error} = await supabase
|
||||||
.from("times")
|
.from("workingtimes")
|
||||||
.insert({...itemInfo.value, tenant: dataStore.currentTenant})
|
.insert({...itemInfo.value, date,start,end, tenant: dataStore.currentTenant})
|
||||||
.select()
|
.select()
|
||||||
|
|
||||||
if(error) {
|
if(error) {
|
||||||
@@ -227,7 +233,7 @@ const setState = async (newState) => {
|
|||||||
Start
|
Start
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UButton
|
||||||
@click="configTimeMode = 'create'; itemInfo = {start: new Date(), end: new Date(), profile: dataStore.getOwnProfile.id, state: 'Entwurf'}; showConfigTimeModal = true"
|
@click="configTimeMode = 'create'; itemInfo = {start: new Date(), end: new Date(), profile: dataStore.getOwnProfile.id}; showConfigTimeModal = true"
|
||||||
>
|
>
|
||||||
Erstellen
|
Erstellen
|
||||||
</UButton>
|
</UButton>
|
||||||
@@ -282,7 +288,39 @@ const setState = async (newState) => {
|
|||||||
<UButton color="gray" variant="ghost" icon="i-heroicons-x-mark-20-solid" class="-my-1" @click="showConfigTimeModal = false" />
|
<UButton color="gray" variant="ghost" icon="i-heroicons-x-mark-20-solid" class="-my-1" @click="showConfigTimeModal = false" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<UFormGroup
|
<UFormGroup label="Start:" >
|
||||||
|
<UPopover :popper="{ placement: 'bottom-start' }">
|
||||||
|
<UButton
|
||||||
|
variant="outline"
|
||||||
|
icon="i-heroicons-calendar-days-20-solid"
|
||||||
|
:label="itemInfo.start ? dayjs(itemInfo.start).format('DD.MM.YYYY HH:mm') : 'Datum auswählen'"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<template #panel="{ close }">
|
||||||
|
<LazyDatePicker
|
||||||
|
v-model="itemInfo.start"
|
||||||
|
mode="dateTime"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</UPopover>
|
||||||
|
</UFormGroup>
|
||||||
|
<UFormGroup label="Ende:" >
|
||||||
|
<UPopover :popper="{ placement: 'bottom-start' }">
|
||||||
|
<UButton
|
||||||
|
variant="outline"
|
||||||
|
icon="i-heroicons-calendar-days-20-solid"
|
||||||
|
:label="itemInfo.end ? dayjs(itemInfo.end).format('HH:mm') : 'Datum auswählen'"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<template #panel="{ close }">
|
||||||
|
<LazyDatePicker
|
||||||
|
v-model="itemInfo.end"
|
||||||
|
mode="time"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</UPopover>
|
||||||
|
</UFormGroup>
|
||||||
|
<!-- <UFormGroup
|
||||||
label="Start:"
|
label="Start:"
|
||||||
:help="itemInfo.state !== 'Entwurf' ? 'Bearbeiten der Startzeit nicht möglich' : ''"
|
:help="itemInfo.state !== 'Entwurf' ? 'Bearbeiten der Startzeit nicht möglich' : ''"
|
||||||
>
|
>
|
||||||
@@ -315,10 +353,10 @@ const setState = async (newState) => {
|
|||||||
:preview-format="format"
|
:preview-format="format"
|
||||||
:disabled="configTimeMode === 'create' ? false : itemInfo.state !== 'Entwurf'"
|
:disabled="configTimeMode === 'create' ? false : itemInfo.state !== 'Entwurf'"
|
||||||
/>
|
/>
|
||||||
</UFormGroup>
|
</UFormGroup>-->
|
||||||
<UFormGroup
|
<UFormGroup
|
||||||
label="Benutzer:"
|
label="Benutzer:"
|
||||||
:help="itemInfo.state !== 'Entwurf' ? 'Bearbeiten des Benutzers nicht möglich' : ''"
|
:help="false ? 'Bearbeiten des Benutzers nicht möglich' : ''"
|
||||||
>
|
>
|
||||||
<USelectMenu
|
<USelectMenu
|
||||||
:options="dataStore.profiles"
|
:options="dataStore.profiles"
|
||||||
@@ -360,10 +398,11 @@ const setState = async (newState) => {
|
|||||||
</UButton>
|
</UButton>
|
||||||
<UTooltip
|
<UTooltip
|
||||||
text="Eingereichte Zeiten können nur noch durch Manager bearbeitet werden"
|
text="Eingereichte Zeiten können nur noch durch Manager bearbeitet werden"
|
||||||
|
v-if="itemInfo.state === 'Entwurf'"
|
||||||
>
|
>
|
||||||
<UButton
|
<UButton
|
||||||
@click="setState('Eingereicht')"
|
@click="setState('Eingereicht')"
|
||||||
v-if="itemInfo.state === 'Entwurf'"
|
|
||||||
>
|
>
|
||||||
Einreichen
|
Einreichen
|
||||||
</UButton>
|
</UButton>
|
||||||
|
|||||||
Reference in New Issue
Block a user