Merge refactor/i18n into develop

This commit is contained in:
Methapon Metanipat 2024-08-26 16:24:08 +07:00
parent 3da5bf9079
commit c681b19e39
99 changed files with 2192 additions and 2987 deletions

View file

@ -135,7 +135,7 @@ onMounted(() => {
:readonly="readonly"
hide-bottom-space
class="col-12"
:label="$t('formDialogEmployerBranchCode')"
:label="$t('customer.form.branchCode')"
v-model="customerBranch"
:option-value="
(v) => ({
@ -154,7 +154,10 @@ onMounted(() => {
@filter="(val, update) => $emit('filterOwnerBranch', val, update)"
:rules="[
(val: string) =>
!!val || $t('selectValidate') + $t('formDialogEmployerBranchCode'),
!!val ||
$t('form.error.selectField', {
field: $t('customer.form.employerBranch'),
}),
]"
>
<template v-slot:option="scope">
@ -168,58 +171,57 @@ onMounted(() => {
</div>
<div class="q-mt-sm">
<div>
{{ scope.opt.code }} {{ $t('branchName') }}:
{{
$i18n.locale === 'en-US' ? scope.opt.nameEN : scope.opt.name
}}
{{ scope.opt.code }} {{ $t('general.name') }}:
<template v-if="scope.opt.customer.customerType === 'CORP'">
{{
$i18n.locale === 'eng'
? scope.opt.registerName
: scope.opt.registerNameEN
}}
</template>
<template v-else>
{{
$i18n.locale === 'eng'
? scope.opt.customer.firstNameEN ||
'-' + ' ' + scope.opt.customer.lastNameEN ||
''
: scope.opt.customer.firstName ||
'-' + ' ' + scope.opt.customer.lastName ||
''
}}
</template>
</div>
<div class="text-caption app-text-muted-2 q-mb-xs">
<div v-if="scope.opt.customer" class="col column">
<span>
{{ $t('customerBranchName') }}:
{{ $t('customerEmployee.form.employerSelect.branchName') }}:
{{
$i18n.locale === 'en-US'
? scope.opt.customer.customerNameEN
: scope.opt.customer.customerName
$i18n.locale === 'eng'
? scope.opt.registerNameEN
: scope.opt.registerName
}}
</span>
<span>
{{ $t('customerEmployee.form.employerSelect.branchName') }}:
{{
scope.opt.customer.customerType === 'PERS'
? $t('formDialogCustomerName')
: $t('companyOwnerName')
}}:
{{
$i18n.locale === 'en-US'
? scope.opt.customer.personName
: scope.opt.customer.personName
$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">
{{ $t('address') }}
{{ $t('general.address') }}
{{
$i18n.locale === 'en-US'
? scope.opt.addressEN
: scope.opt.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 || ''}`
}}
{{
$i18n.locale === 'en-US'
? scope.opt.subDistrict.nameEN
: scope.opt.subDistrict.name
}}
{{
$i18n.locale === 'en-US'
? scope.opt.district.nameEN
: scope.opt.district.name
}}
{{
$i18n.locale === 'en-US'
? scope.opt.province.nameEN
: scope.opt.province.name
}}
{{ scope.opt.zipCode }}
{{ scope.opt.subDistrict?.zipCode || '' }}
</div>
</div>
</div>
@ -235,90 +237,50 @@ onMounted(() => {
>
<div class="q-mr-sm">
{{ scope.opt.code }}
{{ $t('branchName') }}:
{{ $i18n.locale === 'en-US' ? scope.opt.nameEN : scope.opt.name }}
{{ $t('customerEmployee.form.employerSelect.branchName') }}:
{{
$i18n.locale === 'eng'
? scope.opt.registerNameEN
: scope.opt.registerName
}}
</div>
<div
class="text-caption app-text-muted-2"
v-if="scope.opt.customer && scope.opt.province"
>
{{ $t('customerBranchName') }}:
{{ $t('customerEmployee.form.employerSelect.branchName') }}:
{{
$i18n.locale === 'en-US'
? scope.opt.customer.customerNameEN
: scope.opt.customer.customerName
$i18n.locale === 'eng'
? scope.opt.customer.firstNameEN ||
'-' + ' ' + scope.opt.customer.lastNameEN
: scope.opt.customer.firstName ||
'-' + ' ' + scope.opt.customer.lastName
}}
{{ $t('general.address') }}
{{
scope.opt.customer.customerType === 'PERS'
? $t('formDialogCustomerName')
: $t('companyOwnerName')
}}:
{{
$i18n.locale === 'en-US'
? scope.opt.customer.personName
: scope.opt.customer.personName
$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 || ''}`
}}
{{ $t('address') }}
{{
$i18n.locale === 'en-US'
? scope.opt.addressEN
: scope.opt.address
}}
{{
$i18n.locale === 'en-US'
? scope.opt.subDistrict.nameEN
: scope.opt.subDistrict.name
}}
{{
$i18n.locale === 'en-US'
? scope.opt.district.nameEN
: scope.opt.district.name
}}
{{
$i18n.locale === 'en-US'
? scope.opt.province.nameEN
: scope.opt.province.name
}}
{{ scope.opt.zipCode }}
{{ scope.opt.subDistrict?.zipCode || '' }}
<q-tooltip v-if="scope.opt.customer && scope.opt.province">
{{ $t('customerBranchName') }}:
{{ $t('customerEmployee.form.employerSelect.branchName') }}:
{{
$i18n.locale === 'en-US'
? scope.opt.customer.customerNameEN
: scope.opt.customer.customerName
}}
{{
scope.opt.customer.customerType === 'PERS'
? $t('formDialogCustomerName')
: $t('companyOwnerName')
}}:
{{
$i18n.locale === 'en-US'
? scope.opt.customer.personName
: scope.opt.customer.personName
$i18n.locale === 'eng'
? scope.opt.customer.firstNameEN ||
'-' + ' ' + scope.opt.customer.lastNameEN
: scope.opt.customer.firstName ||
'-' + ' ' + scope.opt.customer.lastName
}}
{{ $t('address') }}
{{
$i18n.locale === 'en-US'
? scope.opt.addressEN
: scope.opt.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 || ''}`
}}
{{
$i18n.locale === 'en-US'
? scope.opt.subDistrict.nameEN
: scope.opt.subDistrict.name
}}
{{
$i18n.locale === 'en-US'
? scope.opt.district.nameEN
: scope.opt.district.name
}}
{{
$i18n.locale === 'en-US'
? scope.opt.province.nameEN
: scope.opt.province.name
}}
{{ scope.opt.zipCode }}
{{ scope.opt.zipCode || '' }}
</q-tooltip>
</div>
</div>
@ -343,7 +305,7 @@ onMounted(() => {
:readonly="readonly"
:disable="!readonly"
class="col-3"
:label="$t('formDialogEmployeeID')"
:label="$t('customerEmployee.form.employeeCode')"
v-model="code"
/>
@ -356,7 +318,7 @@ onMounted(() => {
hide-bottom-space
:readonly="readonly"
class="col-6"
:label="$t('formDialogEmployeeNRCNo')"
:label="$t('customerEmployee.form.nrcNo')"
:model-value="readonly ? nrcNo || '-' : nrcNo"
@update:model-value="(v) => (typeof v === 'string' ? (nrcNo = v) : '')"
/>