feat(address): remove ',' and use addressFormat on BasicInformation(customer employee)
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 8s

This commit is contained in:
puriphatt 2025-04-04 10:51:26 +07:00
parent 174c30875e
commit 80f68cd702
2 changed files with 56 additions and 22 deletions

View file

@ -11,6 +11,7 @@ import {
} from 'components/button';
import { useI18n } from 'vue-i18n';
import useOptionStore from 'stores/options';
import { formatAddress } from 'src/utils/address';
const { locale } = useI18n();
@ -195,9 +196,20 @@ defineEmits<{
<span v-if="scope.opt.province" class="col">
{{ $t('general.address') }}
{{
$i18n.locale === 'eng'
? `${scope.opt.addressEN || ''}, ${scope.opt.mooEN && `${$t('form.moo')} ${scope.opt.mooEN},`} ${scope.opt.soiEN && `${$t('form.soi')} ${scope.opt.soiEN},`} ${scope.opt.streetEN && `${scope.opt.streetEN} Rd,`} ${scope.opt.subDistrict.nameEN || ''}, ${scope.opt.district.nameEN || ''}, ${scope.opt.province.nameEN || ''}`
: `${scope.opt.address || ''}, ${scope.opt.moo && `${$t('form.moo')} ${scope.opt.moo},`} ${scope.opt.soi && `${$t('form.soi')} ${scope.opt.soi},`} ${scope.opt.street && `${$t('form.road')} ${scope.opt.street},`} ${scope.opt.subDistrict.name || ''}, ${scope.opt.district.name || ''}, ${scope.opt.province.name || ''}`
formatAddress({
address: scope.opt.address,
addressEN: scope.opt.addressEN,
moo: scope.opt.moo,
mooEN: scope.opt.mooEN,
soi: scope.opt.soi,
soiEN: scope.opt.soiEN,
street: scope.opt.street,
streetEN: scope.opt.streetEN,
subDistrict: scope.opt.subDistrict,
district: scope.opt.district,
province: scope.opt.province,
en: $i18n.locale === 'eng',
})
}}
{{ scope.opt.subDistrict?.zipCode || '' }}
</span>
@ -252,9 +264,20 @@ defineEmits<{
{{ $t('general.address') }}
{{
$i18n.locale === 'eng'
? `${scope.opt.addressEN || ''}, ${scope.opt.mooEN && `${$t('form.moo')} ${scope.opt.mooEN},`} ${scope.opt.soiEN && `${$t('form.soi')} ${scope.opt.soiEN},`} ${scope.opt.streetEN && `${scope.opt.streetEN} Rd,`} ${scope.opt.subDistrict.nameEN || ''}, ${scope.opt.district.nameEN || ''}, ${scope.opt.province.nameEN || ''}`
: `${scope.opt.address || ''}, ${scope.opt.moo && `${$t('form.moo')} ${scope.opt.moo},`} ${scope.opt.soi && `${$t('form.soi')} ${scope.opt.soi},`} ${scope.opt.street && `${$t('form.road')} ${scope.opt.street},`} ${scope.opt.subDistrict.name || ''}, ${scope.opt.district.name || ''}, ${scope.opt.province.name || ''}`
formatAddress({
address: scope.opt.address,
addressEN: scope.opt.addressEN,
moo: scope.opt.moo,
mooEN: scope.opt.mooEN,
soi: scope.opt.soi,
soiEN: scope.opt.soiEN,
street: scope.opt.street,
streetEN: scope.opt.streetEN,
subDistrict: scope.opt.subDistrict,
district: scope.opt.district,
province: scope.opt.province,
en: $i18n.locale === 'eng',
})
}}
{{ scope.opt.subDistrict?.zipCode || '' }}
<q-tooltip v-if="scope.opt.customer && scope.opt.province">
@ -262,9 +285,20 @@ defineEmits<{
{{ $t('general.address') }}
{{
$i18n.locale === 'eng'
? `${scope.opt.addressEN || ''}, ${scope.opt.mooEN && `${$t('form.moo')} ${scope.opt.mooEN},`} ${scope.opt.soiEN && `${$t('form.soi')} ${scope.opt.soiEN},`} ${scope.opt.streetEN && `${scope.opt.streetEN} Rd,`} ${scope.opt.subDistrict.nameEN || ''}, ${scope.opt.district.nameEN || ''}, ${scope.opt.province.nameEN || ''}`
: `${scope.opt.address || ''}, ${scope.opt.moo && `${$t('form.moo')} ${scope.opt.moo},`} ${scope.opt.soi && `${$t('form.soi')} ${scope.opt.soi},`} ${scope.opt.street && `${$t('form.road')} ${scope.opt.street},`} ${scope.opt.subDistrict.name || ''}, ${scope.opt.district.name || ''}, ${scope.opt.province.name || ''}`
formatAddress({
address: scope.opt.address,
addressEN: scope.opt.addressEN,
moo: scope.opt.moo,
mooEN: scope.opt.mooEN,
soi: scope.opt.soi,
soiEN: scope.opt.soiEN,
street: scope.opt.street,
streetEN: scope.opt.streetEN,
subDistrict: scope.opt.subDistrict,
district: scope.opt.district,
province: scope.opt.province,
en: $i18n.locale === 'eng',
})
}}
{{ scope.opt.subDistrict?.zipCode || '' }}
</q-tooltip>