diff --git a/src/components/01_branch-management/FormBranchContact.vue b/src/components/01_branch-management/FormBranchContact.vue index 778f6aed..b878cacd 100644 --- a/src/components/01_branch-management/FormBranchContact.vue +++ b/src/components/01_branch-management/FormBranchContact.vue @@ -38,12 +38,16 @@ defineProps<{ hide-bottom-space class="col-12 col-md-4" :label="$t('form.email')" - :rules="[ - (v: string) => !!v || $t('form.error.required'), - (v: string) => - /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(v) || - $t('form.error.invalid'), - ]" + :rules=" + readonly + ? undefined + : [ + (v: string) => + !v || + /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(v) || + $t('form.error.invalid'), + ] + " for="input-email" :model-value="readonly ? email || '-' : email" @update:model-value="(v) => (typeof v === 'string' ? (email = v) : '')" diff --git a/src/components/02_personnel-management/FormPerson.vue b/src/components/02_personnel-management/FormPerson.vue index 76497c54..4135c00a 100644 --- a/src/components/02_personnel-management/FormPerson.vue +++ b/src/components/02_personnel-management/FormPerson.vue @@ -268,12 +268,16 @@ watch( outlined :readonly="readonly" :label="$t('form.email')" - :rules="[ - (v: string) => !!v || $t('form.error.required'), - (v: string) => - /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(v) || - $t('form.error.invalid'), - ]" + :rules=" + readonly + ? undefined + : [ + (v: string) => + !v || + /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(v) || + $t('form.error.invalid'), + ] + " class="col-md-3 col-6" :model-value="readonly ? email || '-' : email" @update:model-value="(v) => (typeof v === 'string' ? (email = v) : '')" diff --git a/src/pages/03_customer-management/components/employer/EmployerFormContact.vue b/src/pages/03_customer-management/components/employer/EmployerFormContact.vue index d571f6a7..8110f473 100644 --- a/src/pages/03_customer-management/components/employer/EmployerFormContact.vue +++ b/src/pages/03_customer-management/components/employer/EmployerFormContact.vue @@ -31,12 +31,16 @@ const telephone = defineModel('telephone'); hide-bottom-space class="col-md-6 col-12" :label="$t('form.email')" - :rules="[ - (v: string) => !!v || $t('form.error.required'), - (v: string) => - /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(v) || - $t('form.error.invalid'), - ]" + :rules=" + readonly + ? undefined + : [ + (v: string) => + !v || + /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(v) || + $t('form.error.invalid'), + ] + " v-model="mail" />