From 52cfa6e0af5a99f1b533a2431d3c330b1be1874b Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 16 Mar 2026 10:14:03 +0700 Subject: [PATCH] fix(registry): add reactive-rules rule prefix rank --- .../detail/PersonalInformation/01_Profile.vue | 12 ++++++++++-- 1 file changed, 10 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 8f54e02cd..7730029f7 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue @@ -406,6 +406,12 @@ function calculateMinDate() { return today; } +function prefixRankRule() { + return [ + () => !!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ", + ]; +} + /** ดูการเปลี่ยนแปลงของวันเกิดเมื่อมีการเปลี่ยนแปลงจะคำนวนอายูใหม่*/ watch( () => formData.birthDate, @@ -599,7 +605,8 @@ onMounted(() => { class="inputgreen" :options="store.Ops.prefixOps" :label="dataLabel.prefix" - :rules="[(val: string) => !!formData.rank || !!formData.prefix || `${'กรุณาเลือกคำนำหน้าชื่อ หรือยศ'}`]" + :rules="prefixRankRule()" + reactive-rules @filter="(inputValue: string, doneFn: Function) => filterSelector(inputValue, doneFn, 'prefixOps' )" @@ -620,7 +627,8 @@ onMounted(() => { input-debounce="0" option-label="name" option-value="name" - :rules="[(val: string) => !!formData.rank || !!formData.prefix || `${'กรุณาเลือกคำนำหน้าชื่อ หรือยศ'}`]" + :rules="prefixRankRule()" + reactive-rules v-model="formData.rank" class="inputgreen" :options="store.Ops.rankOps"