feat: rule validate employee
This commit is contained in:
parent
6c54c80289
commit
93697fd8cc
4 changed files with 127 additions and 74 deletions
|
|
@ -135,12 +135,17 @@ defineProps<{
|
|||
<template #trigger>
|
||||
<q-input
|
||||
id="input-birth-date"
|
||||
hide-bottom-space
|
||||
:label="$t('formDialogInputBirthDate')"
|
||||
:dense="dense"
|
||||
:outlined="readonly ? false : outlined"
|
||||
:readonly="readonly"
|
||||
:borderless="readonly"
|
||||
:model-value="birthDate ? dateFormat(birthDate) : ''"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
!!val || $t('selectValidate') + $t('formDialogInputBirthDate'),
|
||||
]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
@ -150,15 +155,6 @@ defineProps<{
|
|||
color="positive"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="birthDate && !readonly"
|
||||
name="mdi-close"
|
||||
class="cursor-pointer"
|
||||
size="xs"
|
||||
@click="birthDate = undefined"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</VueDatePicker>
|
||||
|
|
@ -175,6 +171,7 @@ defineProps<{
|
|||
<q-select
|
||||
v-if="employee"
|
||||
id="select-gender"
|
||||
hide-bottom-space
|
||||
:dense="dense"
|
||||
:outlined="readonly ? false : outlined"
|
||||
:readonly="readonly"
|
||||
|
|
@ -188,10 +185,15 @@ defineProps<{
|
|||
option-value="value"
|
||||
v-model="gender"
|
||||
:options="userStore.userOption.genderOpts"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
!!val || $t('selectValidate') + $t('formDialogInputGender'),
|
||||
]"
|
||||
/>
|
||||
<q-select
|
||||
v-if="employee"
|
||||
id="select-nationality"
|
||||
hide-bottom-space
|
||||
:dense="dense"
|
||||
:outlined="readonly ? false : outlined"
|
||||
:readonly="readonly"
|
||||
|
|
@ -206,6 +208,10 @@ defineProps<{
|
|||
option-value="label"
|
||||
v-model="nationality"
|
||||
:options="userStore.userOption.nationalityOpts"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
!!val || $t('selectValidate') + $t('formDialogInputNationality'),
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
<q-separator
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue