Changes
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user