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"