Changes
This commit is contained in:
@@ -17,7 +17,7 @@ const {type} = props
|
|||||||
|
|
||||||
defineShortcuts({
|
defineShortcuts({
|
||||||
'backspace': () => {
|
'backspace': () => {
|
||||||
router.push(`/${type}`)
|
router.push(`/standardEntity/${type}`)
|
||||||
},
|
},
|
||||||
'arrowleft': () => {
|
'arrowleft': () => {
|
||||||
if(openTab.value > 0){
|
if(openTab.value > 0){
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ const setupPage = async () => {
|
|||||||
products.value = (await useSupabaseSelect("products","*"))
|
products.value = (await useSupabaseSelect("products","*"))
|
||||||
productcategories.value = (await useSupabaseSelect("productcategories","*"))
|
productcategories.value = (await useSupabaseSelect("productcategories","*"))
|
||||||
customers.value = (await useSupabaseSelect("customers","*","customerNumber"))
|
customers.value = (await useSupabaseSelect("customers","*","customerNumber"))
|
||||||
|
console.log(customers.value)
|
||||||
contacts.value = (await useSupabaseSelect("contacts","*"))
|
contacts.value = (await useSupabaseSelect("contacts","*"))
|
||||||
texttemplates.value = (await useSupabaseSelect("texttemplates","*"))
|
texttemplates.value = (await useSupabaseSelect("texttemplates","*"))
|
||||||
if(productcategories.value.length > 0) selectedProductcategorie.value = productcategories.value[0].id
|
if(productcategories.value.length > 0) selectedProductcategorie.value = productcategories.value[0].id
|
||||||
@@ -229,7 +230,8 @@ const setDocumentTypeConfig = (withTexts = false) => {
|
|||||||
|
|
||||||
const setCustomerData = () => {
|
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
|
itemInfo.value.contact = null
|
||||||
if(customer) {
|
if(customer) {
|
||||||
itemInfo.value.address.street = customer.infoData.street
|
itemInfo.value.address.street = customer.infoData.street
|
||||||
@@ -1008,7 +1010,7 @@ const setRowData = (row) => {
|
|||||||
searchable
|
searchable
|
||||||
searchable-placeholder="Suche..."
|
searchable-placeholder="Suche..."
|
||||||
v-model="itemInfo.customer"
|
v-model="itemInfo.customer"
|
||||||
@input="setCustomerData"
|
@change="setCustomerData"
|
||||||
class="flex-auto mr-2"
|
class="flex-auto mr-2"
|
||||||
>
|
>
|
||||||
<UButton
|
<UButton
|
||||||
@@ -1016,7 +1018,7 @@ const setRowData = (row) => {
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
class="w-full"
|
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']" />
|
<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>
|
</UButton>
|
||||||
@@ -1042,7 +1044,7 @@ const setRowData = (row) => {
|
|||||||
<template #description>
|
<template #description>
|
||||||
Kundennr: {{customers.find(i => i.id === itemInfo.customer).customerNumber}}<br>
|
Kundennr: {{customers.find(i => i.id === itemInfo.customer).customerNumber}}<br>
|
||||||
Typ: {{customers.find(i => i.id === itemInfo.customer).isCompany ? 'Firma' : 'Privat'}}<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>
|
</template>
|
||||||
|
|
||||||
</UAlert>
|
</UAlert>
|
||||||
|
|||||||
Reference in New Issue
Block a user