This commit is contained in:
2024-12-30 11:22:58 +01:00
parent d5ef6469bd
commit 9a70879778
2 changed files with 7 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ const {type} = props
defineShortcuts({
'backspace': () => {
router.push(`/${type}`)
router.push(`/standardEntity/${type}`)
},
'arrowleft': () => {
if(openTab.value > 0){

View File

@@ -86,6 +86,7 @@ const setupPage = async () => {
products.value = (await useSupabaseSelect("products","*"))
productcategories.value = (await useSupabaseSelect("productcategories","*"))
customers.value = (await useSupabaseSelect("customers","*","customerNumber"))
console.log(customers.value)
contacts.value = (await useSupabaseSelect("contacts","*"))
texttemplates.value = (await useSupabaseSelect("texttemplates","*"))
if(productcategories.value.length > 0) selectedProductcategorie.value = productcategories.value[0].id
@@ -229,7 +230,8 @@ const setDocumentTypeConfig = (withTexts = false) => {
const setCustomerData = () => {
let customer = customers.find(i => i.id === itemInfo.value.customer)
let customer = customers.value.find(i => i.id === itemInfo.value.customer)
console.log(customer)
itemInfo.value.contact = null
if(customer) {
itemInfo.value.address.street = customer.infoData.street
@@ -1008,7 +1010,7 @@ const setRowData = (row) => {
searchable
searchable-placeholder="Suche..."
v-model="itemInfo.customer"
@input="setCustomerData"
@change="setCustomerData"
class="flex-auto mr-2"
>
<UButton
@@ -1016,7 +1018,7 @@ const setRowData = (row) => {
variant="outline"
class="w-full"
>
{{itemInfo.customer ? customers.find(i => i.id === iteminfo.customer).name : "Kein Kunde ausgewählt"}}
{{itemInfo.customer ? customers.find(i => i.id === itemInfo.customer).name : "Kein Kunde 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']" />
</UButton>
@@ -1042,7 +1044,7 @@ const setRowData = (row) => {
<template #description>
Kundennr: {{customers.find(i => i.id === itemInfo.customer).customerNumber}}<br>
Typ: {{customers.find(i => i.id === itemInfo.customer).isCompany ? 'Firma' : 'Privat'}}<br>
Notizen: <span class="truncate">{{customers.find(i => i.id === row.customer).notes}}</span>
Notizen: <span class="truncate">{{customers.find(i => i.id === itemInfo.customer).notes}}</span>
</template>
</UAlert>