fix: employee branch code

This commit is contained in:
puriphatt 2024-09-26 13:07:10 +07:00
parent ce5345eb02
commit 56736155e5

View file

@ -160,6 +160,8 @@ onMounted(() => {
]"
>
<template v-slot:option="scope">
<!-- {{ console.log(scope.opt) }} -->
<q-item
v-if="scope.opt"
v-bind="scope.itemProps"
@ -170,58 +172,42 @@ onMounted(() => {
</div>
<div class="q-mt-sm">
<div>
{{ scope.opt.code }} {{ $t('general.name') }}:
<template v-if="scope.opt.customer.customerType === 'CORP'">
<span v-if="scope.opt.customer.customerType">
{{ `${scope.opt.code} ${$t('general.name')}` }}:
{{
$i18n.locale === 'eng'
? scope.opt.registerName
: scope.opt.registerNameEN
scope.opt.customer.customerType === 'CORP'
? scope.opt.customerName
: $i18n.locale === 'eng'
? `${scope.opt.firstNameEN} ${scope.opt.lastNameEN}` ||
'-'
: `${scope.opt.firstName} ${scope.opt.lastName}` || '-'
}}
</template>
<template v-else>
{{
$i18n.locale === 'eng'
? scope.opt.customer.firstNameEN ||
'-' + ' ' + scope.opt.customer.lastNameEN ||
''
: scope.opt.customer.firstName ||
'-' + ' ' + scope.opt.customer.lastName ||
''
}}
</template>
</span>
</div>
<div class="text-caption app-text-muted-2 q-mb-xs">
<div v-if="scope.opt.customer" class="col column">
<span>
{{ $t('customerEmployee.form.employerSelect.branchName') }}:
{{
$i18n.locale === 'eng'
<span v-if="scope.opt.customer" class="col column">
{{ $t('customerEmployee.form.employerSelect.branchName') }}:
{{
scope.opt.customer.customerType === 'CORP'
? $i18n.locale === 'eng'
? scope.opt.registerNameEN
: scope.opt.registerName
}}
</span>
<span>
{{ $t('customerEmployee.form.employerSelect.branchName') }}:
{{
$i18n.locale === 'eng'
? scope.opt.customer.firstNameEN ||
'-' + ' ' + scope.opt.customer.lastNameEN
: scope.opt.customer.firstName ||
'-' + ' ' + scope.opt.customer.lastName
}}
</span>
</div>
<div v-if="scope.opt.province" class="col">
: $i18n.locale === 'eng'
? `${scope.opt.firstNameEN} ${scope.opt.lastNameEN}` ||
'-'
: `${scope.opt.firstName} ${scope.opt.lastName}` || '-'
}}
</span>
<span v-if="scope.opt.province" class="col">
{{ $t('general.address') }}
{{
$i18n.locale === 'eng'
? `${scope.opt.addressEN || ''} ${scope.opt.subDistrict.nameEN || ''} ${scope.opt.district.nameEN || ''} ${scope.opt.province.nameEN || ''}`
: `${scope.opt.address || ''} ${scope.opt.subDistrict.name || ''} ${scope.opt.district.name || ''} ${scope.opt.province.name || ''}`
? `${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.street')} ${scope.opt.street},`} ${scope.opt.subDistrict.name || ''}, ${scope.opt.district.name || ''}, ${scope.opt.province.name || ''}`
}}
{{ scope.opt.subDistrict?.zipCode || '' }}
</div>
</span>
</div>
</div>
</q-item>