From 6ff749ab5f4dc73119ac1d4855b38f95e9744371 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 6 Feb 2026 10:32:36 +0700 Subject: [PATCH] fix: rules prefix --- .../components/detail/PersonalInformation/01_Profile.vue | 4 +++- .../08_registryEmployee/components/DialogAddEmployee.vue | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue index 7bdf10fe0..439bbd7c7 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue @@ -589,10 +589,11 @@ onMounted(() => { option-label="name" option-value="name" v-model="formData.prefix" + clearable class="inputgreen" :options="store.Ops.prefixOps" :label="dataLabel.prefix" - :rules="[(val: string) => !!val || `${'กรุณาเลือก คำนำหน้าชื่อ'}`]" + :rules="[(val: string) => !!formData.rank || !!formData.prefix || `${'กรุณาเลือกคำนำหน้าชื่อ หรือยศ'}`]" @filter="(inputValue: string, doneFn: Function) => filterSelector(inputValue, doneFn, 'prefixOps' )" @@ -613,6 +614,7 @@ onMounted(() => { input-debounce="0" option-label="name" option-value="name" + :rules="[(val: string) => !!formData.rank || !!formData.prefix || `${'กรุณาเลือกคำนำหน้าชื่อ หรือยศ'}`]" v-model="formData.rank" class="inputgreen" :options="store.Ops.rankOps" diff --git a/src/modules/08_registryEmployee/components/DialogAddEmployee.vue b/src/modules/08_registryEmployee/components/DialogAddEmployee.vue index 74698a63a..1335913db 100644 --- a/src/modules/08_registryEmployee/components/DialogAddEmployee.vue +++ b/src/modules/08_registryEmployee/components/DialogAddEmployee.vue @@ -328,6 +328,7 @@ watch( map-options hide-selected fill-input + clearable hide-bottom-space input-debounce="0" option-label="name" @@ -336,7 +337,7 @@ watch( class="inputgreen" :options="prefixOps" label="คำนำหน้าชื่อ" - :rules="[(val: string) => !!val || `${'กรุณาเลือก คำนำหน้าชื่อ'}`]" + :rules="[(val: string) => !!formData.rank || !!formData.prefix || `${'กรุณาเลือกคำนำหน้าชื่อ หรือยศ'}`]" @filter="(inputValue: string, doneFn: Function) => filterSelector(inputValue, doneFn, 'prefix' )" @@ -360,6 +361,7 @@ watch( v-model="formData.rank" class="inputgreen" :options="rankOps" + :rules="[(val: string) => !!formData.rank || !!formData.prefix || `${'กรุณาเลือกคำนำหน้าชื่อ หรือยศ'}`]" label="ยศ" @filter="(inputValue: string, doneFn: Function) => filterSelector(inputValue, doneFn, 'rank'