Remodel of Profile System

Added isCompany to Customers
changes in workingtimes.vue
This commit is contained in:
2024-03-17 11:01:19 +01:00
parent 874ff01551
commit aef8cce755
16 changed files with 349 additions and 168 deletions

View File

@@ -9,6 +9,19 @@ const itemInfo = ref({
resources: []
})
const mapResources = () => {
itemInfo.value.resources.map(resource => {
return {
id: resource.id,
type: resource.type
}
})
}
const setupPage = () => {
if(route.query.start) itemInfo.value.start = route.query.start.replace(" ", "+")
@@ -47,17 +60,18 @@ setupPage()
>
<USelectMenu
v-model="itemInfo.resources"
:options="dataStore.getResources"
:options="dataStore.getResourcesList"
option-attribute="title"
value-attribute="id"
multiple
@change=""
onChange="mapResources"
>
<template #label>
<span v-if="itemInfo.resources.length == 0">Keine Ressourcen ausgewählt</span>
<span v-else >{{ itemInfo.resources.length }} ausgewählt</span>
</template>
</USelectMenu>
{{dataStore.getResourcesList}}
</UFormGroup>
<UFormGroup
label="Titel:"

View File

@@ -59,6 +59,8 @@
<script setup>
import {useSearch} from "~/composables/useSearch.js";
definePageMeta({
middleware: "auth"
})
@@ -124,7 +126,7 @@ const columns = computed(() => templateColumns.filter((column) => selectedColumn
const searchString = ref('')
const filteredRows = computed(() => {
/*const filteredRows = computed(() => {
if(!searchString.value) {
return dataStore.contacts
}
@@ -134,7 +136,12 @@ const filteredRows = computed(() => {
return String(value).toLowerCase().includes(searchString.value.toLowerCase())
})
})
})*/
const filteredRows = computed(() => {
return useSearch(searchString.value, dataStore.contacts)
})
</script>
<style scoped>

View File

@@ -54,7 +54,7 @@ const tabItems = computed(() => {
},
{
label: "Vorschau",
disabled: !itemInfo.value.customer && !itemInfo.value.contact
disabled: !itemInfo.value.customer
}
]
})
@@ -259,7 +259,10 @@ const getDocumentData = () => {
//Compile Start & EndText
const templateStartText = Handlebars.compile(itemInfo.value.startText);
const templateEndText = Handlebars.compile(itemInfo.value.endText);
console.log(templateStartText({vorname: contactData.firstName, nachname: contactData.lastName}))
console.log(templateStartText({
vorname: contactData ? contactData.firstName : "",
nachname: contactData ? contactData.lastName : ""
}))
console.log(templateEndText({zahlungsziel_in_tagen: 14}))
@@ -289,7 +292,10 @@ const getDocumentData = () => {
title: itemInfo.value.title,
description: itemInfo.value.description,
endText: templateEndText({zahlungsziel_in_tagen: itemInfo.value.paymentDays}),
startText: templateStartText({vorname: contactData.firstName, nachname: contactData.lastName}),
startText: templateStartText({
vorname: contactData ? contactData.firstName : "",
nachname: contactData ? contactData.lastName : ""
}),
rows: rows,
total: documentTotal.value
}
@@ -504,9 +510,11 @@ setupPage()
class="flex-auto"
>
<UButton
:color="itemInfo.contact ? 'primary' : 'rose'"
color="none"
variant="outline"
class="flex-1 justify-between">
class="flex-1 justify-between"
:disabled="!itemInfo.customer"
>
{{dataStore.getContactById(itemInfo.contact) ? dataStore.getContactById(itemInfo.contact).fullName : "Kein Kontakt ausgewählt"}}
<UIcon name="i-heroicons-chevron-right-20-solid" class="w-5 h-5 transition-transform text-gray-400 dark:text-gray-500" :class="['transform rotate-90']" />

View File

@@ -20,7 +20,8 @@ const itemInfo = ref({
infoData: {
country: "Deutschland"
},
active: true
active: true,
isCompany: true
})
//Functions
@@ -225,6 +226,13 @@ setupPage()
/>
</UFormGroup>
</UTooltip>
<UFormGroup
label="Firmenkunde:"
>
<UCheckbox
v-model="itemInfo.isCompany"
/>
</UFormGroup>
<UFormGroup
label="Notizen:"
>

View File

@@ -2,7 +2,7 @@
<UDashboardNavbar title="Kunden" :badge="filteredRows.length">
<template #right>
<UInput
ref="searchinput"
id="searchinput"
v-model="searchString"
icon="i-heroicons-funnel"
autocomplete="off"
@@ -45,6 +45,10 @@
@select="(i) => router.push(`/customers/show/${i.id}`) "
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Kunden anzuzeigen' }"
>
<template #isCompany-data="{row}">
<span v-if="row.isCompany">Firmenkunden</span>
<span v-else>Privatkunde</span>
</template>
<template #active-data="{row}">
<span v-if="row.active" class="text-primary-500">Aktiv</span>
<span v-else class="text-rose-500">Gesperrt</span>
@@ -85,6 +89,11 @@ const templateColumns = [
label: "Name",
sortable: true
},
{
key: "isCompany",
label: "Typ",
sortable: true
},
{
key: "notes",
label: "Notizen",

View File

@@ -81,8 +81,12 @@ setupPage()
<div
v-if="item.label === 'Informationen'"
>
<div class="truncate">
<p v-if="currentItem.sellingPrice">Verkaufspreis: {{String(Number(currentItem.sellingPrice).toFixed(2)).replace(".",",")}} </p>
<p>Beschreibung:</p>
<pre>{{currentItem.description}}</pre>
</div>
<span v-if="currentItem.sellingPrice">Verkaufspreis: {{String(Number(currentItem.sellingPrice).toFixed(2)).replace(".",",")}} <br></span>
</div>
<div

View File

@@ -2,7 +2,7 @@
<UDashboardNavbar title="Lieferanten" :badge="filteredRows.length">
<template #right>
<UInput
ref="searchinput"
id="searchinput"
v-model="searchString"
icon="i-heroicons-funnel"
autocomplete="off"

View File

@@ -445,10 +445,10 @@ const setState = async (newState) => {
</template>
<template #start-data="{row}">
{{dayjs(row.start, "HH:mm:ssZ").format("HH:mm")}} Uhr
{{dayjs(row.start, "HH:mm:ss").format("HH:mm")}} Uhr
</template>
<template #end-data="{row}">
{{dayjs(row.end, "HH:mm:ssZ").format("HH:mm")}} Uhr
{{dayjs(row.end, "HH:mm:ss").format("HH:mm")}} Uhr
</template>
<template #duration-data="{row}">
{{getDuration(row).composed}}