diff --git a/src/modules/04_registryNew/components/DialogAddData.vue b/src/modules/04_registryNew/components/DialogAddData.vue index 44b9f34ab..0ddfae294 100644 --- a/src/modules/04_registryNew/components/DialogAddData.vue +++ b/src/modules/04_registryNew/components/DialogAddData.vue @@ -119,6 +119,12 @@ function closeDialog() { clearFormData(); } +const calculateMaxDate = () => { + const today = new Date(); + today.setFullYear(today.getFullYear() - 18); + return today; +}; + function clearFormData() { formData.prefix = ""; formData.firstName = ""; @@ -195,7 +201,6 @@ watch( hide-bottom-space :rules="[ (val) => { - console.log(val); return val.length > 0 || 'กรุณาเลือกคำนำหน้าชื่อ'; }, ]" @@ -265,6 +270,8 @@ watch( autoApply borderless week-start="0" + :max-date="calculateMaxDate()" + :enableTimePicker="false" menu-class-name="modalfix" v-model="formData.birthDate" :locale="'th'" diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue index 8c2b3b577..996adf546 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue @@ -267,12 +267,17 @@ async function getData() { }); } +const calculateMaxDate = () => { + const today = new Date(); + today.setFullYear(today.getFullYear() - 18); + return today; +}; + async function editData() { showLoader(); await http .put(config.API.profileNewProfileById(id.value), { ...formData, - dateRetire: store.retireDate, }) .then((res) => { success($q, "บันทึกข้อมูลสำเร็จ"); @@ -550,7 +555,9 @@ onMounted(async () => {
{ nationality: null, ethnicity: null, birthDate: null, - dateRetire: null, - isProbation: false, - keycloak: "", phone: null, email: null, - position: "", lastName: "", firstName: "", prefix: "", diff --git a/src/modules/15_development/components/BasicInfo.vue b/src/modules/15_development/components/BasicInfo.vue index 1a6ea723f..90022418a 100644 --- a/src/modules/15_development/components/BasicInfo.vue +++ b/src/modules/15_development/components/BasicInfo.vue @@ -88,9 +88,11 @@ onMounted(() => { label="ชื่อโครงการ/กิจกรรม/หลักสูตร" rows="6" type="textarea" + hide-bottom-space :rules="[ (val:string) => !!val || `${'กรุณากรอกชื่อโครงการ/กิจกรรม/หลักสูตร'}`, + ]" />
@@ -101,6 +103,7 @@ onMounted(() => { v-model="formData.reason" label="หลักการและเหตุผล" rows="6" + hide-bottom-space type="textarea" :rules="[ (val:string) => @@ -115,6 +118,7 @@ onMounted(() => { v-model="formData.objective" label="วัตถุประสงค์" rows="6" + hide-bottom-space type="textarea" :rules="[ (val:string) =>