Last commit before showcase.

This commit is contained in:
Simon Pocrnjič
2024-11-14 21:02:10 +01:00
parent 953ff38d64
commit ad8b3c07e1
16 changed files with 302 additions and 143 deletions
+21 -11
View File
@@ -21,14 +21,23 @@ const props = defineProps({
console.log(props.actions);
//Client and case person info card
const clientMainAddress = props.client.person.addresses.filter( a => a.type.id === 1 )[0] ?? '';
const personMainAddress = props.client_case.person.addresses.filter( a => a.type.id === 1 )[0] ?? '';
const getMainAddress = (adresses) => {
const addr = adresses.filter( a => a.type.id === 1 )[0] ?? '';
const country = addr.country !== '' ? ` - ${addr.country}` : '';
return addr.address !== '' ? addr.address + country : '';
}
const getMainPhone = (phones) => {
const pho = phones.filter( a => a.type.id === 1 )[0] ?? '';
const countryCode = pho.country_code !== null ? `+${pho.country_code} ` : '';
return pho.nu !== '' ? countryCode + pho.nu: '';
}
const clientInfo = new Object({
nu: props.client.person.nu,
full_name: props.client.person.full_name,
main_address: (clientMainAddress.country !== '') ? `${clientMainAddress.address} - ${clientMainAddress.country}` : clientMainAddress.address,
main_address: getMainAddress(props.client.person.addresses),
main_phone: getMainPhone(props.client.person.phones),
tax_number: props.client.person.tax_number,
social_security_number: props.client.person.social_security_number,
description: props.client.person.description
@@ -37,7 +46,8 @@ const clientInfo = new Object({
const casePersonInfo = new Object({
nu: props.client_case.person.nu,
full_name: props.client_case.person.full_name,
main_address: (personMainAddress.country !== '') ? `${personMainAddress.address} - ${personMainAddress.country}` : personMainAddress.address,
main_address: getMainAddress(props.client_case.person.addresses),
main_phone: getMainPhone(props.client_case.person.phones),
tax_number: props.client_case.person.tax_number,
social_security_number: props.client_case.person.social_security_number,
description: props.client_case.person.description
@@ -77,7 +87,7 @@ const closeDrawer = () => {
<SectionTitle>
<template #title>
<FwbA class= "hover:text-blue-500" :href="route('client.show', client)">
Client
{{ clientInfo.full_name }}
</FwbA>
</template>
@@ -101,7 +111,7 @@ const closeDrawer = () => {
<div class="mx-auto max-w-4x1 p-3">
<SectionTitle>
<template #title>
Case
Primer - oseba
</template>
</SectionTitle>
@@ -125,10 +135,10 @@ const closeDrawer = () => {
<div class="flex justify-between p-3">
<SectionTitle>
<template #title>
Contracts
Pogodbe
</template>
</SectionTitle>
<FwbButton @click="openDrawerCreateContract">Add new</FwbButton>
<FwbButton @click="openDrawerCreateContract">Nova</FwbButton>
</div>
<ContractTable
:client_case="client_case"
@@ -146,10 +156,10 @@ const closeDrawer = () => {
<div class="flex justify-between p-3">
<SectionTitle>
<template #title>
Activities
Aktivnosti
</template>
</SectionTitle>
<FwbButton @click="openDrawerAddActivity">Add new</FwbButton>
<FwbButton @click="openDrawerAddActivity">Nova</FwbButton>
</div>
<ActivityTable
:client_case="client_case"