Merge refactor/i18n into develop
This commit is contained in:
parent
3da5bf9079
commit
c681b19e39
99 changed files with 2192 additions and 2987 deletions
|
|
@ -137,7 +137,7 @@ watch(
|
|||
name="mdi-briefcase-outline"
|
||||
style="background-color: var(--surface-3)"
|
||||
/>
|
||||
{{ $t('formDialogTitleByType') }}
|
||||
{{ $t('personnel.form.workInformation') }}
|
||||
</div>
|
||||
<div class="col-12 row q-col-gutter-sm">
|
||||
<div
|
||||
|
|
@ -151,7 +151,7 @@ watch(
|
|||
:dense="dense"
|
||||
outlined
|
||||
:readonly="readonly"
|
||||
:label="$t('formDialogInputRegisNo')"
|
||||
:label="$t('personnel.form.regisNo')"
|
||||
class="col-12"
|
||||
:model-value="readonly ? registrationNo || '-' : registrationNo"
|
||||
@update:model-value="
|
||||
|
|
@ -163,7 +163,7 @@ watch(
|
|||
class="col-6"
|
||||
id="input-start-date"
|
||||
:readonly="readonly"
|
||||
:label="$t('formDialogInputStartDate')"
|
||||
:label="$t('personnel.form.startDate')"
|
||||
v-model="startDate"
|
||||
clearable
|
||||
/>
|
||||
|
|
@ -172,7 +172,7 @@ watch(
|
|||
class="col-6"
|
||||
id="input-retire-date"
|
||||
:readonly="readonly"
|
||||
:label="$t('formDialogInputRetireDate')"
|
||||
:label="$t('personnel.form.retireDate')"
|
||||
v-model="retireDate"
|
||||
clearable
|
||||
/>
|
||||
|
|
@ -196,7 +196,7 @@ watch(
|
|||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:label="$t('formDialogInputResponsibleArea')"
|
||||
:label="$t('personnel.form.responsibleArea')"
|
||||
:options="responsibleAreaOptions"
|
||||
@filter="responsibleAreaFilter"
|
||||
:model-value="readonly ? responsibleArea || '-' : responsibleArea"
|
||||
|
|
@ -208,7 +208,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>
|
||||
|
|
@ -225,7 +225,7 @@ watch(
|
|||
:dense="dense"
|
||||
outlined
|
||||
:readonly="readonly"
|
||||
:label="$t('formDialogInputDiscount')"
|
||||
:label="$t('personnel.form.discount')"
|
||||
class="col-12"
|
||||
type="textarea"
|
||||
:model-value="readonly ? discountCondition || '-' : discountCondition"
|
||||
|
|
@ -258,7 +258,7 @@ watch(
|
|||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:label="$t('formDialogInputSourceNationality')"
|
||||
:label="$t('personnel.form.sourceNationality')"
|
||||
:options="nationalityOptions"
|
||||
@filter="nationalityFilter"
|
||||
:model-value="readonly ? sourceNationality || '-' : sourceNationality"
|
||||
|
|
@ -270,7 +270,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>
|
||||
|
|
@ -293,7 +293,7 @@ watch(
|
|||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:label="$t('formDialogInputImportNationality')"
|
||||
:label="$t('personnel.form.importNationality')"
|
||||
:options="nationalityOptions"
|
||||
@filter="nationalityFilter"
|
||||
:model-value="readonly ? importNationality || '-' : importNationality"
|
||||
|
|
@ -305,7 +305,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>
|
||||
|
|
@ -328,7 +328,7 @@ watch(
|
|||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:label="$t('formDialogInputTrainingPlace')"
|
||||
:label="$t('personnel.form.trainingPlace')"
|
||||
:options="trainingPlaceOptions"
|
||||
@filter="trainingPlaceFilter"
|
||||
:model-value="readonly ? trainingPlace || '-' : trainingPlace"
|
||||
|
|
@ -340,7 +340,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>
|
||||
|
|
@ -351,7 +351,7 @@ watch(
|
|||
:dense="dense"
|
||||
outlined
|
||||
:readonly="readonly"
|
||||
:label="$t('formDialogInputCheckpoint')"
|
||||
:label="$t('personnel.form.checkpoint')"
|
||||
class="col-6"
|
||||
:model-value="readonly ? checkpoint || '-' : checkpoint"
|
||||
@update:model-value="
|
||||
|
|
@ -365,7 +365,7 @@ watch(
|
|||
:dense="dense"
|
||||
outlined
|
||||
:readonly="readonly"
|
||||
:label="$t('formDialogInputCheckpoint') + ' ENG'"
|
||||
:label="$t('personnel.form.checkpointEN')"
|
||||
class="col-6"
|
||||
:model-value="readonly ? checkpointEN || '-' : checkpointEN"
|
||||
@update:model-value="
|
||||
|
|
@ -381,7 +381,7 @@ watch(
|
|||
:readonly="readonly"
|
||||
multiple
|
||||
append
|
||||
:label="$t('formDialogAttachment')"
|
||||
:label="$t('personnel.form.attachment')"
|
||||
class="col-12"
|
||||
v-model="agencyFile"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ const userTypeOptions = ref<Record<string, unknown>[]>([]);
|
|||
const userTypeFilter = selectFilterOptionRefMod(
|
||||
ref(
|
||||
userStore.userOption.userTypeOpts.map((v) => ({
|
||||
label: t(v.label),
|
||||
label: t(`personnel.${v.label}`),
|
||||
value: v.value,
|
||||
})),
|
||||
),
|
||||
|
|
@ -101,20 +101,24 @@ onMounted(async () => {
|
|||
option-label="label"
|
||||
option-value="value"
|
||||
lazy-rules="ondemand"
|
||||
class="col-2"
|
||||
class="col-md-2 col-12"
|
||||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:label="$t('formDialogInputCode')"
|
||||
:label="$t('branch.form.code')"
|
||||
:options="hqOptions"
|
||||
:rules="[(val: string) => !!val || $t('formDialogInputHqIdValidate')]"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
!!val ||
|
||||
$t('form.error.selectField', { field: $t('branch.form.code') }),
|
||||
]"
|
||||
@update:model-value="(val: string) => selectHq(val)"
|
||||
@filter="hqFilter"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
{{ $t('noResults') }}
|
||||
{{ $t('general.noData') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
|
@ -133,11 +137,11 @@ onMounted(async () => {
|
|||
option-label="label"
|
||||
option-value="value"
|
||||
lazy-rules="ondemand"
|
||||
class="col-2"
|
||||
class="col-md-2 col-12"
|
||||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:label="$t('formDialogInputBrId')"
|
||||
:label="$t('branch.form.codeBranch')"
|
||||
:options="brOptions"
|
||||
@filter="brFilter"
|
||||
:model-value="readonly ? brId || '-' : brId"
|
||||
|
|
@ -147,7 +151,7 @@ onMounted(async () => {
|
|||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
{{ $t('noResults') }}
|
||||
{{ $t('general.noData') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
|
@ -162,13 +166,10 @@ onMounted(async () => {
|
|||
map-options
|
||||
options-dense
|
||||
hide-bottom-space
|
||||
class="col"
|
||||
:label="$t('formDialogInputUsername')"
|
||||
class="col-md col-12"
|
||||
:label="$t('personnel.form.username')"
|
||||
v-model="username"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
val.length > 2 || $t('formDialogInputUsernameValidate'),
|
||||
]"
|
||||
:rules="[(val: string) => val.length > 2 || $t('form.error.required')]"
|
||||
/>
|
||||
<q-select
|
||||
outlined
|
||||
|
|
@ -189,17 +190,21 @@ onMounted(async () => {
|
|||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:label="$t('formDialogInputUserType')"
|
||||
:label="$t('personnel.form.userType')"
|
||||
:options="userTypeOptions"
|
||||
:rules="[
|
||||
(val: string) => !!val || $t('formDialogInputUserTypeValidate'),
|
||||
(val: string) =>
|
||||
!!val ||
|
||||
$t('form.error.selectField', {
|
||||
field: $t('personnel.form.userType'),
|
||||
}),
|
||||
]"
|
||||
@filter="userTypeFilter"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
{{ $t('noResults') }}
|
||||
{{ $t('general.noData') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
|
@ -223,17 +228,21 @@ onMounted(async () => {
|
|||
v-model="userRole"
|
||||
:readonly="readonly"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:label="$t('userRole')"
|
||||
:label="$t('personnel.form.userRole')"
|
||||
:options="roleOptions"
|
||||
:rules="[
|
||||
(val: string) => !!val || $t('formDialogInputUserRoleValidate'),
|
||||
(val: string) =>
|
||||
!!val ||
|
||||
$t('form.error.selectField', {
|
||||
field: $t('personnel.form.userRole'),
|
||||
}),
|
||||
]"
|
||||
@filter="roleFilter"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
{{ $t('noResults') }}
|
||||
{{ $t('general.noData') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -2,21 +2,13 @@
|
|||
import { QSelect } from 'quasar';
|
||||
import useOptionStore from 'stores/options';
|
||||
import { selectFilterOptionRefMod } from 'stores/utils';
|
||||
import {
|
||||
dateFormat,
|
||||
calculateAge,
|
||||
parseAndFormatDate,
|
||||
disabledAfterToday,
|
||||
} from 'src/utils/datetime';
|
||||
import { calculateAge, disabledAfterToday } from 'src/utils/datetime';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { capitalize } from 'vue';
|
||||
import DatePicker from '../shared/DatePicker.vue';
|
||||
|
||||
const { locale } = useI18n();
|
||||
const optionStore = useOptionStore();
|
||||
const prefixName = defineModel<string | null>('prefixName');
|
||||
const prefixNameEN = defineModel<string | null>('prefixNameEn');
|
||||
const firstName = defineModel<string>('firstName');
|
||||
const lastName = defineModel<string>('lastName');
|
||||
const firstNameEN = defineModel<string>('firstNameEn');
|
||||
|
|
@ -125,12 +117,12 @@ watch(
|
|||
option-value="value"
|
||||
lazy-rules="ondemand"
|
||||
hide-dropdown-icon
|
||||
class="col-1"
|
||||
class="col-md-1 col-6"
|
||||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:options="prefixNameOptions"
|
||||
:for="`${prefixId}-select-prefix-name`"
|
||||
:label="$t('formDialogInputPrefixName')"
|
||||
:label="$t('personnel.form.prefixName')"
|
||||
@filter="prefixNameFilter"
|
||||
:model-value="readonly ? prefixName || '-' : prefixName"
|
||||
@update:model-value="
|
||||
|
|
@ -141,7 +133,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>
|
||||
|
|
@ -155,11 +147,9 @@ watch(
|
|||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col"
|
||||
:label="$t('formDialogInputFirstName')"
|
||||
:label="$t('personnel.form.firstName')"
|
||||
v-model="firstName"
|
||||
:rules="[
|
||||
(val: string) => !!val || $t('formDialogInputFirstNameValidate'),
|
||||
]"
|
||||
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||
/>
|
||||
|
||||
<q-input
|
||||
|
|
@ -169,8 +159,8 @@ watch(
|
|||
outlined
|
||||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col-3"
|
||||
:label="$t('formDialogInputMidName')"
|
||||
class="col-md-3 col-6"
|
||||
:label="$t('personnel.form.middleName')"
|
||||
:model-value="readonly ? midName || '-' : midName"
|
||||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (midName = v) : '')
|
||||
|
|
@ -186,11 +176,9 @@ watch(
|
|||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col"
|
||||
:label="$t('formDialogInputLastName')"
|
||||
:label="$t('personnel.form.lastName')"
|
||||
v-model="lastName"
|
||||
:rules="[
|
||||
(val: string) => !!val || $t('formDialogInputLastNameValidate'),
|
||||
]"
|
||||
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -203,8 +191,8 @@ watch(
|
|||
hide-bottom-space
|
||||
:readonly="readonly"
|
||||
:disable="!readonly"
|
||||
class="col-1"
|
||||
:label="$t('formDialogInputPrefixName')"
|
||||
class="col-md-1 col-6"
|
||||
:label="$t('personnel.form.prefixName')"
|
||||
:model-value="
|
||||
readonly
|
||||
? capitalize(prefixName || '') || '-'
|
||||
|
|
@ -224,11 +212,9 @@ watch(
|
|||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col"
|
||||
:label="$t('formDialogInputFirstNameEN')"
|
||||
:label="$t('personnel.form.firstNameEN')"
|
||||
v-model="firstNameEN"
|
||||
:rules="[
|
||||
(val: string) => !!val || $t('formDialogInputFirstNameENValidate'),
|
||||
]"
|
||||
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||
/>
|
||||
|
||||
<q-input
|
||||
|
|
@ -238,8 +224,8 @@ watch(
|
|||
outlined
|
||||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col-3"
|
||||
:label="$t('formDialogInputMidNameEN')"
|
||||
class="col-md-3 col-6"
|
||||
:label="$t('personnel.form.middleNameEN')"
|
||||
:model-value="readonly ? midNameEn || '-' : midNameEn"
|
||||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (midNameEn = v) : '')
|
||||
|
|
@ -254,11 +240,9 @@ watch(
|
|||
:readonly="readonly"
|
||||
hide-bottom-space
|
||||
class="col"
|
||||
:label="$t('formDialogInputLastNameEN')"
|
||||
:label="$t('personnel.form.lastNameEN')"
|
||||
v-model="lastNameEN"
|
||||
:rules="[
|
||||
(val: string) => !!val || $t('formDialogInputLastNameENValidate'),
|
||||
]"
|
||||
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -269,8 +253,8 @@ watch(
|
|||
:dense="dense"
|
||||
outlined
|
||||
:readonly="readonly"
|
||||
class="col-3"
|
||||
:label="$t('formDialogInputTelephone')"
|
||||
class="col-md-3 col-6"
|
||||
:label="$t('form.telephone')"
|
||||
:mask="readonly ? '' : '##########'"
|
||||
:model-value="readonly ? telephoneNo || '-' : telephoneNo"
|
||||
@update:model-value="
|
||||
|
|
@ -285,8 +269,8 @@ watch(
|
|||
:dense="dense"
|
||||
outlined
|
||||
:readonly="readonly"
|
||||
:label="$t('formDialogInputEmail')"
|
||||
class="col-3"
|
||||
:label="$t('form.email')"
|
||||
class="col-md-3 col-6"
|
||||
:model-value="readonly ? email || '-' : email"
|
||||
@update:model-value="(v) => (typeof v === 'string' ? (email = v) : '')"
|
||||
@clear="email = ''"
|
||||
|
|
@ -305,13 +289,13 @@ watch(
|
|||
option-label="label"
|
||||
option-value="value"
|
||||
lazy-rules="ondemand"
|
||||
class="col-2"
|
||||
class="col-md-2 col-6"
|
||||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:options="genderOptions"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:for="`${prefixId}-select-gender`"
|
||||
:label="$t('formDialogInputGender')"
|
||||
:label="$t('form.gender')"
|
||||
@filter="genderFilter"
|
||||
:model-value="readonly ? gender || '-' : gender"
|
||||
@update:model-value="(v) => (typeof v === 'string' ? (gender = v) : '')"
|
||||
|
|
@ -320,7 +304,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>
|
||||
|
|
@ -328,14 +312,15 @@ watch(
|
|||
|
||||
<DatePicker
|
||||
v-model="birthDate"
|
||||
class="col-2"
|
||||
class="col-md-2 col-6"
|
||||
:id="`${prefixId}-input-birth-date`"
|
||||
:readonly="readonly"
|
||||
:label="$t('formDialogInputBirthDate')"
|
||||
:label="$t('form.birthDate')"
|
||||
:disabled-dates="disabledAfterToday"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
!!val || $t('selectValidate') + $t('formDialogInputBirthDate'),
|
||||
!!val ||
|
||||
$t('form.error.selectField', { field: $t('form.birthDate') }),
|
||||
]"
|
||||
/>
|
||||
|
||||
|
|
@ -346,8 +331,8 @@ watch(
|
|||
:dense="dense"
|
||||
outlined
|
||||
readonly
|
||||
:label="$t('formDialogInputAge')"
|
||||
class="col-2"
|
||||
:label="$t('personnel.age')"
|
||||
class="col-md-2 col-12"
|
||||
:model-value="
|
||||
birthDate?.toString() === 'Invalid Date' ||
|
||||
birthDate?.toString() === undefined
|
||||
|
|
@ -377,17 +362,14 @@ watch(
|
|||
:options="genderOptions"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:for="`${prefixId}-select-gender`"
|
||||
:label="$t('formDialogInputGender')"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
!!val || $t('selectValidate') + $t('formDialogInputGender'),
|
||||
]"
|
||||
:label="$t('form.gender')"
|
||||
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||
@filter="genderFilter"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
{{ $t('noResults') }}
|
||||
{{ $t('general.noData') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
|
@ -413,17 +395,14 @@ watch(
|
|||
:options="nationalityOptions"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:for="`${prefixId}-select-nationality`"
|
||||
:label="$t('formDialogInputNationality')"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
!!val || $t('selectValidate') + $t('formDialogInputNationality'),
|
||||
]"
|
||||
:label="$t('general.nationality')"
|
||||
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||
@filter="nationalityFilter"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
{{ $t('noResults') }}
|
||||
{{ $t('general.noData') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue