Merge refactor/i18n into develop
This commit is contained in:
parent
3da5bf9079
commit
c681b19e39
99 changed files with 2192 additions and 2987 deletions
|
|
@ -86,7 +86,7 @@ defineProps<{
|
|||
]"
|
||||
class="branch-card__data"
|
||||
>
|
||||
<div>{{ $t(key) }}</div>
|
||||
<div>{{ $t(`branch.card.${key}`) }}</div>
|
||||
<div>{{ data[key as keyof typeof data] }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -110,10 +110,10 @@ watch(
|
|||
spaced="lg"
|
||||
/>
|
||||
<span class="col-12 app-text-muted-2 flex justify-between items-center">
|
||||
{{ `${$t('bankBookNo')} ${i + 1}` }}
|
||||
{{ `${$t('branch.form.bankAccountNo')} ${i + 1}` }}
|
||||
<div class="row items-center">
|
||||
<div style="height: 30.8px" />
|
||||
{{ $t('accountStatus') }}
|
||||
{{ $t('branch.form.bankAccountStatus') }}
|
||||
<ToggleButton
|
||||
id="toggle-bank-status"
|
||||
:disable="readonly"
|
||||
|
|
@ -145,9 +145,10 @@ watch(
|
|||
input-debounce="0"
|
||||
option-label="label"
|
||||
lazy-rules="ondemand"
|
||||
class="col-3"
|
||||
class="col-12 col-md-4"
|
||||
autocomplete="off"
|
||||
:dense="dense"
|
||||
:label="$t('bankBook')"
|
||||
:label="$t('branch.form.bank')"
|
||||
:options="bankBookOptions"
|
||||
:readonly="readonly"
|
||||
:hide-dropdown-icon="readonly"
|
||||
|
|
@ -195,7 +196,7 @@ watch(
|
|||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
{{ $t('noResults') }}
|
||||
{{ $t('general.noData') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
|
@ -203,51 +204,17 @@ watch(
|
|||
<q-input
|
||||
outlined
|
||||
for="input-bankbook"
|
||||
class="col-3"
|
||||
class="col-4"
|
||||
lazy-rules="ondemand"
|
||||
hide-bottom-space
|
||||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:label="$t('accountNumber')"
|
||||
:maxlength="13"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
(val.length >= 7 && val.length <= 13) ||
|
||||
$t('form.error.please', { msg: $t('accountNumber') }),
|
||||
]"
|
||||
:model-value="readonly ? book.accountNumber || '-' : book.accountNumber"
|
||||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (book.accountNumber = v) : '')
|
||||
"
|
||||
/>
|
||||
<q-input
|
||||
outlined
|
||||
for="input-bankbook"
|
||||
class="col-3"
|
||||
lazy-rules="ondemand"
|
||||
hide-bottom-space
|
||||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:label="$t('bankBranch')"
|
||||
:label="$t('branch.form.bankBranch')"
|
||||
:model-value="readonly ? book.bankBranch || '-' : book.bankBranch"
|
||||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (book.bankBranch = v) : '')
|
||||
"
|
||||
/>
|
||||
<q-input
|
||||
outlined
|
||||
for="input-bankbook"
|
||||
class="col-3"
|
||||
lazy-rules="ondemand"
|
||||
hide-bottom-space
|
||||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:label="$t('accountName')"
|
||||
:model-value="readonly ? book.accountName || '-' : book.accountName"
|
||||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (book.accountName = v) : '')
|
||||
"
|
||||
/>
|
||||
<q-select
|
||||
outlined
|
||||
clearable
|
||||
|
|
@ -261,9 +228,10 @@ watch(
|
|||
input-debounce="0"
|
||||
option-label="label"
|
||||
lazy-rules="ondemand"
|
||||
class="col-4"
|
||||
class="col-12 col-md-4"
|
||||
autocomplete="off"
|
||||
:dense="dense"
|
||||
:label="$t('bankType')"
|
||||
:label="$t('branch.form.bankAccountType')"
|
||||
:options="accountTypeOptions"
|
||||
:readonly="readonly"
|
||||
:hide-dropdown-icon="readonly"
|
||||
|
|
@ -278,11 +246,46 @@ watch(
|
|||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
{{ $t('noResults') }}
|
||||
{{ $t('general.noData') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<q-input
|
||||
outlined
|
||||
for="input-bankbook"
|
||||
class="col-12 col-md-4"
|
||||
lazy-rules="ondemand"
|
||||
hide-bottom-space
|
||||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:label="$t('branch.form.bankAccountNumber')"
|
||||
:maxlength="13"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
(val.length >= 7 && val.length <= 13) ||
|
||||
$t('form.error.please', { msg: $t('accountNumber') }),
|
||||
]"
|
||||
:model-value="readonly ? book.accountNumber || '-' : book.accountNumber"
|
||||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (book.accountNumber = v) : '')
|
||||
"
|
||||
/>
|
||||
|
||||
<q-input
|
||||
outlined
|
||||
for="input-bankbook"
|
||||
class="col-12 col-md-4"
|
||||
lazy-rules="ondemand"
|
||||
hide-bottom-space
|
||||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:label="$t('branch.form.bankAccountName')"
|
||||
:model-value="readonly ? book.accountName || '-' : book.accountName"
|
||||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (book.accountName = v) : '')
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@ defineProps<{
|
|||
name="mdi-account-outline"
|
||||
style="background-color: var(--surface-3)"
|
||||
/>
|
||||
{{ $t(`branchAdminTitle`) }}
|
||||
{{ $t(`branch.form.group.admin`) }}
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<template v-if="!admin">
|
||||
<span>{{ $t('branchAdminNone') }}</span>
|
||||
<span>{{ $t('general.noData') }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="row items-center">
|
||||
|
|
@ -47,9 +47,9 @@ defineProps<{
|
|||
<div class="col column q-pl-md">
|
||||
<span>
|
||||
{{
|
||||
$i18n.locale === 'en-US'
|
||||
? admin.firstNameEN + ' ' + admin.lastNameEN
|
||||
: admin.firstName + ' ' + admin.lastName
|
||||
$i18n.locale === 'eng'
|
||||
? admin.firstNameEN || '-' + ' ' + admin.lastNameEN
|
||||
: admin.firstName || '-' + ' ' + admin.lastName
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -36,12 +36,8 @@ defineProps<{
|
|||
outlined
|
||||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col-3"
|
||||
:label="
|
||||
typeBranch === 'headOffice'
|
||||
? $t('formDialogInputEmailHq')
|
||||
: $t('formDialogInputEmailSubBranch')
|
||||
"
|
||||
class="col-12 col-md-4"
|
||||
:label="$t('form.email')"
|
||||
for="input-email"
|
||||
:model-value="readonly ? email || '-' : email"
|
||||
@update:model-value="(v) => (typeof v === 'string' ? (email = v) : '')"
|
||||
|
|
@ -62,12 +58,8 @@ defineProps<{
|
|||
outlined
|
||||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col-3"
|
||||
:label="
|
||||
typeBranch === 'headOffice'
|
||||
? $t('formDialogInputTelephoneHq')
|
||||
: $t('formDialogInputTelephoneSubBranch')
|
||||
"
|
||||
class="col-12 col-md-4"
|
||||
:label="$t('form.telephone')"
|
||||
for="input-telephone-no"
|
||||
:model-value="readonly ? telephoneNo || '-' : telephoneNo"
|
||||
@update:model-value="
|
||||
|
|
@ -90,53 +82,51 @@ defineProps<{
|
|||
outlined
|
||||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col-3"
|
||||
class="col-12 col-md-4"
|
||||
label="Line ID"
|
||||
for="input-line-id"
|
||||
:model-value="readonly ? lineId || '-' : lineId"
|
||||
@update:model-value="(v) => (typeof v === 'string' ? (lineId = v) : '')"
|
||||
/>
|
||||
|
||||
<div class="col-12 row q-col-gutter-sm">
|
||||
<q-input
|
||||
lazy-rules="ondemand"
|
||||
:dense="dense"
|
||||
outlined
|
||||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col-3"
|
||||
:label="$t('formDialogInputContactName')"
|
||||
for="input-contact-name"
|
||||
:model-value="readonly ? contactName || '-' : contactName"
|
||||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (contactName = v) : '')
|
||||
"
|
||||
/>
|
||||
<q-input
|
||||
lazy-rules="ondemand"
|
||||
:dense="dense"
|
||||
outlined
|
||||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col-12 col-md-4"
|
||||
:label="$t('branch.form.contactName')"
|
||||
for="input-contact-name"
|
||||
:model-value="readonly ? contactName || '-' : contactName"
|
||||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (contactName = v) : '')
|
||||
"
|
||||
/>
|
||||
|
||||
<q-input
|
||||
lazy-rules="ondemand"
|
||||
:dense="dense"
|
||||
outlined
|
||||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col-3"
|
||||
:label="$t('formDialogInputTelephoneContact')"
|
||||
for="input-contact"
|
||||
:model-value="readonly ? contact || '-' : contact"
|
||||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (contact = v) : '')
|
||||
"
|
||||
>
|
||||
<template #prepend>
|
||||
<q-icon
|
||||
color="primary"
|
||||
name="mdi-phone-outline"
|
||||
size="xs"
|
||||
class="q-mr-xs"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
<q-input
|
||||
lazy-rules="ondemand"
|
||||
:dense="dense"
|
||||
outlined
|
||||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col-12 col-md-4"
|
||||
:label="$t('branch.form.contactTelephone')"
|
||||
for="input-contact"
|
||||
:model-value="readonly ? contact || '-' : contact"
|
||||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (contact = v) : '')
|
||||
"
|
||||
>
|
||||
<template #prepend>
|
||||
<q-icon
|
||||
color="primary"
|
||||
name="mdi-phone-outline"
|
||||
size="xs"
|
||||
class="q-mr-xs"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted } from 'vue';
|
||||
|
||||
const code = defineModel<string>('code');
|
||||
const codeSubBranch = defineModel<string>('codeSubBranch');
|
||||
const taxNo = defineModel<string>('taxNo');
|
||||
|
|
@ -40,13 +38,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
|||
</div>
|
||||
|
||||
<div class="col-12 row q-col-gutter-sm">
|
||||
<div
|
||||
class="col-6 row q-col-gutter-sm"
|
||||
:class="{
|
||||
'col-8': typeBranch !== 'headOffice',
|
||||
'col-6': typeBranch === 'headOffice',
|
||||
}"
|
||||
>
|
||||
<div class="col-12 row q-col-gutter-sm">
|
||||
<q-input
|
||||
lazy-rules="ondemand"
|
||||
:dense="dense"
|
||||
|
|
@ -55,13 +47,13 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
|||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col"
|
||||
:label="$t('formDialogHqAbbreviation')"
|
||||
:label="$t('branch.form.abbrev')"
|
||||
for="input-abbreviation"
|
||||
:model-value="view ? formatCode(abbreviation, 'code') : abbreviation"
|
||||
:rules="[
|
||||
(val) =>
|
||||
(val && val.length > 0 && /[a-zA-Z]+/.test(val)) ||
|
||||
$t('formDialogInputHqAbbreviation'),
|
||||
(val && val.length > 0 && /^[a-zA-Z]+$/.test(val)) ||
|
||||
$t('form.error.invalid'),
|
||||
]"
|
||||
@update:model-value="(v) => (abbreviation = v as string)"
|
||||
/>
|
||||
|
|
@ -73,7 +65,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
|||
:disable="!readonly"
|
||||
hide-bottom-space
|
||||
class="col"
|
||||
:label="$t('formDialogInputCode')"
|
||||
:label="$t('branch.form.code')"
|
||||
for="input-code"
|
||||
:model-value="view ? formatCode(code, 'number') : code"
|
||||
@update:model-value="(v) => (code = v as string)"
|
||||
|
|
@ -87,7 +79,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
|||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col"
|
||||
:label="$t('branchLabelCode')"
|
||||
:label="$t('branch.form.codeBranch')"
|
||||
for="input-code-sub-branch"
|
||||
:model-value="
|
||||
view ? formatCode(codeSubBranch, 'number') : codeSubBranch
|
||||
|
|
@ -102,12 +94,13 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
|||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col-5"
|
||||
:label="$t('formDialogInputTaxNo')"
|
||||
:label="$t('branch.form.taxNo')"
|
||||
v-model="taxNo"
|
||||
:rules="[
|
||||
(val) => (val && val.length > 0) || $t('form.error.required'),
|
||||
(val) =>
|
||||
(val && val.length === 13 && /[0-9]+/.test(val)) ||
|
||||
$t('formDialogInputTaxNoValidate'),
|
||||
$t('form.error.invalid'),
|
||||
]"
|
||||
for="input-tax-no"
|
||||
/>
|
||||
|
|
@ -123,16 +116,12 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
|||
class="col-6"
|
||||
:label="
|
||||
typeBranch === 'headOffice'
|
||||
? $t('formDialogInputNameHq')
|
||||
: $t('formDialogInputNameSubBranch')
|
||||
? $t('branch.form.headofficeName')
|
||||
: $t('branch.form.branchName')
|
||||
"
|
||||
v-model="name"
|
||||
:rules="[(val) => val && val.length > 0]"
|
||||
:error-message="
|
||||
typeBranch === 'headOffice'
|
||||
? $t('formDialogInputNameHqValidate')
|
||||
: $t('formDialogInputNameSubBranchValidate')
|
||||
"
|
||||
:error-message="$t('form.error.required')"
|
||||
for="input-name"
|
||||
/>
|
||||
<q-input
|
||||
|
|
@ -145,15 +134,11 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
|||
v-model="nameEN"
|
||||
:label="
|
||||
typeBranch === 'headOffice'
|
||||
? $t('formDialogInputNameHqEn')
|
||||
: $t('formDialogInputNameSubBranchEn')
|
||||
? $t('branch.form.headofficeNameEN')
|
||||
: $t('branch.form.branchNameEN')
|
||||
"
|
||||
:rules="[(val) => val && val.length > 0]"
|
||||
:error-message="
|
||||
typeBranch === 'headOffice'
|
||||
? $t('formDialogInputNameHqEnValidate')
|
||||
: $t('formDialogInputNameSubBranchEnValidate')
|
||||
"
|
||||
:error-message="$t('form.error.required')"
|
||||
for="input-name-en"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ defineProps<{
|
|||
"
|
||||
unelevated
|
||||
rounded
|
||||
:label="$t('formDialogBtnLocation')"
|
||||
:label="$t('branch.form.shareLocation')"
|
||||
@click="getLocation()"
|
||||
id="btn-get-location"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ defineEmits<{
|
|||
"
|
||||
unelevated
|
||||
rounded
|
||||
:label="$t('formDialogUploadQrCode')"
|
||||
:label="$t('general.upload')"
|
||||
@click="$emit('upload')"
|
||||
id="btn-upload-qr-code"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue