fix(03): customer fallback avatar

This commit is contained in:
puriphatt 2024-08-06 08:11:49 +00:00
parent 48f2dcde46
commit 9f86229bd2
2 changed files with 19 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 KiB

After

Width:  |  Height:  |  Size: 283 KiB

Before After
Before After

View file

@ -550,8 +550,8 @@ function createEmployeeForm() {
? customerStats.map((v) => ({
count:
v.name === 'CORP'
? statsCustomerType?.CORP ?? 0
: statsCustomerType?.PERS ?? 0,
? (statsCustomerType?.CORP ?? 0)
: (statsCustomerType?.PERS ?? 0),
label:
v.name === 'CORP'
? 'customerLegalEntity'
@ -1539,7 +1539,7 @@ function createEmployeeForm() {
{
icon: 'mdi-clock-outline',
value: props.row.dateOfBirth
? calculateAge(props.row.dateOfBirth) ?? ''
? (calculateAge(props.row.dateOfBirth) ?? '')
: '',
},
],
@ -2040,10 +2040,24 @@ function createEmployeeForm() {
!customerFormState.customerImageUrl ||
customerFormState.dialogType === 'edit'
"
:fallback-url="`/images/customer-${customerFormData.customerType}-avartar.png`"
clear-button
@save="() => {}"
></ImageUploadDialog>
>
<template #error>
<div class="full-height full-width" style="background: white">
<div
class="full-height full-width flex justify-center items-center"
:style="`background: ${customerFormData.customerType === 'CORP' ? '#5f1775' : '#347454'}`"
>
<q-img
:src="`/images/customer-${customerFormData.customerType}-avartar.png`"
fit="contain"
style="height: 100%"
/>
</div>
</div>
</template>
</ImageUploadDialog>
<ImageUploadDialog
ref="dialogEmployeeImageUpload"