이미 사용된 타입휴가 활성화 방지
This commit is contained in:
parent
44de501340
commit
0636f74c9b
@ -143,6 +143,12 @@ const calendarOptions = reactive({
|
||||
dateClick: handleDateClick,
|
||||
datesSet: handleMonthChange,
|
||||
events: calendarEvents,
|
||||
customButtons: {
|
||||
today: {
|
||||
text: 'TODAY',
|
||||
click: () => fullCalendarRef.value?.getApi().today(),
|
||||
},
|
||||
},
|
||||
});
|
||||
// 캘린더 월 변경
|
||||
function handleMonthChange(viewInfo) {
|
||||
@ -178,6 +184,21 @@ function handleDateClick(info) {
|
||||
|
||||
const isMyVacation = myVacations.value.some(vac => vac.date.substring(0, 10) === clickedDateStr && !vac.receiverId);
|
||||
|
||||
if (!selectedDates.value.has(clickedDateStr) && isMyVacation && halfDayType.value) {
|
||||
const existingVacation = myVacations.value.find(vac => vac.date.substring(0, 10) === clickedDateStr && !vac.receiverId);
|
||||
const selectedType =
|
||||
halfDayType.value === "AM" ? "700101" :
|
||||
halfDayType.value === "PM" ? "700102" : "700103";
|
||||
if (existingVacation.type === selectedType) {
|
||||
toastStore.onToast("이미 사용한 연차입니다.", "e");
|
||||
if (halfDayButtonsRef.value) {
|
||||
halfDayButtonsRef.value.resetHalfDay();
|
||||
}
|
||||
halfDayType.value = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 이미 활성화된 날짜를 한 번 더 클릭하면 비활성화
|
||||
if (currentValue && currentValue !== "delete") {
|
||||
selectedDates.value.delete(clickedDateStr);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user