fix: format address & card height

This commit is contained in:
puriphatt 2024-11-11 12:11:54 +07:00
parent eaa55c7ae4
commit 2bfb90beab
4 changed files with 112 additions and 36 deletions

View file

@ -52,6 +52,7 @@ import TableEmpoloyee from 'src/components/03_customer-management/TableEmpoloyee
import HistoryEditComponent from 'src/components/03_customer-management/HistoryEditComponent.vue';
import { calculateAge, toISOStringWithTimezone } from 'src/utils/datetime';
import { runOcr, parseResultMRZ } from 'src/utils/ocr';
import { formatAddress } from 'src/utils/address';
import {
UploadFileGroup,
FormTm6,
@ -1291,19 +1292,37 @@ const emptyCreateDialog = ref(false);
<q-td v-if="fieldSelected.includes('address')">
{{
locale === 'eng'
? `${props.row.branch[0].addressEN}, ${props.row.branch[0].mooEN && `${$t('form.moo')} ${props.row.branch[0].mooEN},`} ${props.row.branch[0].soiEN && `${$t('form.soi')} ${props.row.branch[0].soiEN},`} ${props.row.branch[0].moo && `${props.row.branch[0].streetEN} Rd,`} ${props.row.branch[0].subDistrict.nameEN}, ${props.row.branch[0].district.nameEN}, ${props.row.branch[0].province.nameEN} ${props.row.branch[0].subDistrict.zipCode}` ||
'-'
: `${props.row.branch[0].address}, ${props.row.branch[0].moo && `${$t('form.moo')} ${props.row.branch[0].moo},`} ${props.row.branch[0].soi && `${$t('form.soi')} ${props.row.branch[0].soi},`} ${props.row.branch[0].street && `${$t('form.road')} ${props.row.branch[0].street},`} ${props.row.branch[0].subDistrict.name}, ${props.row.branch[0].district.name}, ${props.row.branch[0].province.name} ${props.row.branch[0].subDistrict.zipCode}` ||
'-'
formatAddress({
address: props.row.branch[0].address,
addressEN: props.row.branch[0].addressEN,
moo: props.row.branch[0].moo,
mooEN: props.row.branch[0].mooEN,
soi: props.row.branch[0].soi,
soiEN: props.row.branch[0].soiEN,
street: props.row.branch[0].street,
streetEN: props.row.branch[0].streetEN,
province: props.row.branch[0].province,
district: props.row.branch[0].district,
subDistrict: props.row.branch[0].subDistrict,
en: $i18n.locale === 'eng',
})
}}
<q-tooltip>
{{
locale === 'eng'
? `${props.row.branch[0].addressEN}, ${props.row.branch[0].mooEN && `${$t('form.moo')} ${props.row.branch[0].mooEN},`} ${props.row.branch[0].soiEN && `${$t('form.soi')} ${props.row.branch[0].soiEN},`} ${props.row.branch[0].moo && `${props.row.branch[0].streetEN} Rd,`} ${props.row.branch[0].subDistrict.nameEN}, ${props.row.branch[0].district.nameEN}, ${props.row.branch[0].province.nameEN} ${props.row.branch[0].subDistrict.zipCode}` ||
'-'
: `${props.row.branch[0].address}, ${props.row.branch[0].moo && `${$t('form.moo')} ${props.row.branch[0].moo},`} ${props.row.branch[0].soi && `${$t('form.soi')} ${props.row.branch[0].soi},`} ${props.row.branch[0].street && `${$t('form.road')} ${props.row.branch[0].street},`} ${props.row.branch[0].subDistrict.name}, ${props.row.branch[0].district.name}, ${props.row.branch[0].province.name} ${props.row.branch[0].subDistrict.zipCode}` ||
'-'
formatAddress({
address: props.row.branch[0].address,
addressEN: props.row.branch[0].addressEN,
moo: props.row.branch[0].moo,
mooEN: props.row.branch[0].mooEN,
soi: props.row.branch[0].soi,
soiEN: props.row.branch[0].soiEN,
street: props.row.branch[0].street,
streetEN: props.row.branch[0].streetEN,
province: props.row.branch[0].province,
district: props.row.branch[0].district,
subDistrict: props.row.branch[0].subDistrict,
en: $i18n.locale === 'eng',
})
}}
</q-tooltip>
</q-td>
@ -1447,10 +1466,10 @@ const emptyCreateDialog = ref(false);
</template>
<template v-slot:item="props">
<div class="col-12 col-md-6">
<div class="col-12 col-md-6 column">
<BranchCard
i18n-key="customer.table"
class="surface-1"
class="surface-1 col"
:virtual-branch="props.row.virtual"
:id="`branch-card-${props.row.name}`"
:class="{
@ -1489,6 +1508,7 @@ const emptyCreateDialog = ref(false);
})
"
>
<!-- Lorem ipsum dolor sit amet consectetur adipisicing elit. Nesciunt dolores reprehenderit consequatur totam quidem minima esse quo ex labore ea! Laborum aliquid optio, quia voluptatem quis voluptas. Libero, placeat voluptatum? -->
<template #image>
<q-avatar size="3rem">
<q-img