This commit is contained in:
2024-03-12 13:38:24 +01:00
parent 423b2638aa
commit 6791342879
5 changed files with 160 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
<script setup lang="ts">
<script setup>
import { DatePicker as VCalendarDatePicker } from 'v-calendar'
import 'v-calendar/dist/style.css'
@@ -6,6 +6,10 @@ const props = defineProps({
modelValue: {
type: Date,
default: null
},
mode: {
type: String,
default: "date"
}
})
@@ -37,6 +41,8 @@ const attrs = [{
<template>
<VCalendarDatePicker
v-model="date"
:mode="props.mode"
is24hr
transparent
borderless
:attributes="attrs"

View File

@@ -337,6 +337,10 @@ let links = [
label: "Mitarbeiter",
to: "/profiles",
icon: "i-heroicons-clipboard-document-list"
},{
label: "Firmeneinstellungen",
to: "/settings/tenant",
icon: "i-heroicons-clipboard-document-list"
}
]
},

View File

@@ -1,23 +1,81 @@
<script setup>
import Axios from "axios"
import axios from "axios";
const bankingStore = useBankingStore()
const dataStore = useDataStore()
const newAccounts = ref([])
const selectedInstitution = ref("")
const institutions = ref([])
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>
<template>
New
<UButton
@click="setupPage"
<UDashboardNavbar
title="Neues Bankkonto anbinden"
>
Setup
</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>
<style scoped>

View 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>

View File

@@ -53,7 +53,6 @@ const itemInfo = ref({
start: new Date(),
end: "",
notes: null,
state: "Entwurf"
})
@@ -153,15 +152,22 @@ const stopStartedTime = async () => {
}
}
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)
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)
}
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
.from("times")
.insert({...itemInfo.value, tenant: dataStore.currentTenant})
.from("workingtimes")
.insert({...itemInfo.value, date,start,end, tenant: dataStore.currentTenant})
.select()
if(error) {
@@ -227,7 +233,7 @@ const setState = async (newState) => {
Start
</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
</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" />
</div>
</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:"
:help="itemInfo.state !== 'Entwurf' ? 'Bearbeiten der Startzeit nicht möglich' : ''"
>
@@ -315,10 +353,10 @@ const setState = async (newState) => {
:preview-format="format"
:disabled="configTimeMode === 'create' ? false : itemInfo.state !== 'Entwurf'"
/>
</UFormGroup>
</UFormGroup>-->
<UFormGroup
label="Benutzer:"
:help="itemInfo.state !== 'Entwurf' ? 'Bearbeiten des Benutzers nicht möglich' : ''"
:help="false ? 'Bearbeiten des Benutzers nicht möglich' : ''"
>
<USelectMenu
:options="dataStore.profiles"
@@ -360,10 +398,11 @@ const setState = async (newState) => {
</UButton>
<UTooltip
text="Eingereichte Zeiten können nur noch durch Manager bearbeitet werden"
v-if="itemInfo.state === 'Entwurf'"
>
<UButton
@click="setState('Eingereicht')"
v-if="itemInfo.state === 'Entwurf'"
>
Einreichen
</UButton>