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) => ({ ? customerStats.map((v) => ({
count: count:
v.name === 'CORP' v.name === 'CORP'
? statsCustomerType?.CORP ?? 0 ? (statsCustomerType?.CORP ?? 0)
: statsCustomerType?.PERS ?? 0, : (statsCustomerType?.PERS ?? 0),
label: label:
v.name === 'CORP' v.name === 'CORP'
? 'customerLegalEntity' ? 'customerLegalEntity'
@ -1539,7 +1539,7 @@ function createEmployeeForm() {
{ {
icon: 'mdi-clock-outline', icon: 'mdi-clock-outline',
value: props.row.dateOfBirth value: props.row.dateOfBirth
? calculateAge(props.row.dateOfBirth) ?? '' ? (calculateAge(props.row.dateOfBirth) ?? '')
: '', : '',
}, },
], ],
@ -2040,10 +2040,24 @@ function createEmployeeForm() {
!customerFormState.customerImageUrl || !customerFormState.customerImageUrl ||
customerFormState.dialogType === 'edit' customerFormState.dialogType === 'edit'
" "
:fallback-url="`/images/customer-${customerFormData.customerType}-avartar.png`"
clear-button clear-button
@save="() => {}" @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 <ImageUploadDialog
ref="dialogEmployeeImageUpload" ref="dialogEmployeeImageUpload"