diff --git a/src/modules/05_leave/componenst/Forms/01_SickForm.vue b/src/modules/05_leave/componenst/Forms/01_SickForm.vue index e341e8c..acc1605 100644 --- a/src/modules/05_leave/componenst/Forms/01_SickForm.vue +++ b/src/modules/05_leave/componenst/Forms/01_SickForm.vue @@ -26,7 +26,7 @@ const formData = reactive({ leaveNo: "", startLeaveDate: null, endLeaveDate: null, - halfDay: "half_day_morning", + halfDay: "day", contractTel: "", leaveTotal: "", leaveContactTel: "", @@ -100,11 +100,11 @@ function onValidate() { } const isReadOnly = computed(() => { - const condition = formData.halfDay === "half_day_morning" || formData.halfDay === "half_day_afternoon" - if (condition) { - formData.endLeaveDate = null // Set formData.endLeaveDate to null + const conditionHalfDay = formData.halfDay === "half_day_morning" || formData.halfDay === "half_day_afternoon" + if (conditionHalfDay) { + formData.endLeaveDate = formData.startLeaveDate // Set formData.endLeaveDate to null } - return condition + return conditionHalfDay }) console.log(isReadOnly.value) @@ -185,6 +185,7 @@ console.log(isReadOnly.value) :enableTimePicker="false" week-start="0" :readonly="isReadOnly" + :min-date="formData.startLeaveDate ? new Date(formData.startLeaveDate.getTime() + 24 * 60 * 60 * 1000) : null" >