Some Changes

This commit is contained in:
2024-07-09 21:35:19 +02:00
parent 101b8d3361
commit eb4b8a8d9b
13 changed files with 436 additions and 170 deletions

View File

@@ -41,7 +41,7 @@ const itemInfo = ref({
rows: [
],
contactPerson: null,
contactPerson: dataStore.activeProfile.id,
contactPersonName: null,
contactTel: null,
contactEMail: null,
@@ -108,6 +108,8 @@ const setDocumentTypeConfig = () => {
}
const setCustomerData = () => {
let customer = dataStore.getCustomerById(itemInfo.value.customer)
itemInfo.value.contact = null
if(customer) {
@@ -118,13 +120,9 @@ const setCustomerData = () => {
}
}
const setContactPersonData = () => {
let profile = dataStore.activeProfile
//console.log(profile)
if(!itemInfo.value.contactPerson) itemInfo.value.contactPerson = profile.id
const setContactPersonData = async () => {
console.log(itemInfo.value.contactPerson)
let profile = await useSupabaseSelectSingle("profiles",itemInfo.value.contactPerson, '*')
itemInfo.value.contactPersonName = profile.fullName
itemInfo.value.contactTel = profile.mobileTel || profile.fixedTel || ""
@@ -607,6 +605,21 @@ setupPage()
>Kunde</UButton>
</InputGroup>
<UAlert
v-if="itemInfo.customer"
class="mt-2"
variant="solid"
color="white"
title="Info"
>
<template #description>
Kundennr: {{dataStore.getCustomerById(itemInfo.customer).customerNumber}}<br>
Typ: {{dataStore.getCustomerById(itemInfo.customer).isCompany ? 'Firma' : 'Privat'}}<br>
Notizen: <span class="truncate">{{dataStore.getCustomerById(itemInfo.customer).notes}}</span>
</template>
</UAlert>
</UFormGroup>
<UFormGroup
label="Ansprechpartner:"
@@ -796,6 +809,13 @@ setupPage()
{{dataStore.getCustomerById(project.customer).name}} - {{project.name}}
</template>
</USelectMenu>
<UButton
variant="outline"
color="rose"
v-if="itemInfo.project"
icon="i-heroicons-x-mark"
@click="itemInfo.project = null"
/>
<UButton
variant="outline"
v-if="itemInfo.project"