diff --git a/src/modules/05_leave/components/DialogDetail.vue b/src/modules/05_leave/components/DialogDetail.vue index 95c3136..dd0aece 100644 --- a/src/modules/05_leave/components/DialogDetail.vue +++ b/src/modules/05_leave/components/DialogDetail.vue @@ -269,7 +269,7 @@ async function fetchDataDetail(id: string) { formData.dear = data.dear ?? "-"; checkLeaveType( formData.leaveTypeId, - data.hajjDayStatus, + formData.ordainDayLocationName, formData.studyDayTrainingSubject ); }) @@ -289,7 +289,7 @@ async function fetchDataDetail(id: string) { */ function checkLeaveType( leaveTypeId: string, - hajjDayStatus: boolean, + ordainDayLocationName: string, studyDayTrainingSubject: string ) { if (props.leaveType) { @@ -301,9 +301,9 @@ function checkLeaveType( checkForm.value = "FormChildbirth"; } else if (type === "LV-005") { checkForm.value = "FormHoliday"; - } else if (type === "LV-006" && hajjDayStatus === true) { + } else if (type === "LV-006" && ordainDayLocationName === "") { checkForm.value = "FormHajj"; - } else if (type === "LV-006" && hajjDayStatus === false) { + } else if (type === "LV-006") { checkForm.value = "FormUpasom"; } else if (type === "LV-007") { checkForm.value = "FormCheckSelect"; diff --git a/src/modules/05_leave/components/ListView.vue b/src/modules/05_leave/components/ListView.vue index de3ceaf..c6ac5f1 100644 --- a/src/modules/05_leave/components/ListView.vue +++ b/src/modules/05_leave/components/ListView.vue @@ -154,9 +154,11 @@ function convert(val: any) { ); const type = filtertype?.code; if (type == "LV-006" && val.hajjDayStatus == false) { - return "ลาอุปสมบท"; + return "ลาอุปสมบทหรือการลาประกอบพิธีฮัจญ์ฯ"; + // return "ลาอุปสมบท"; รอ API } else if (type == "LV-006" && val.hajjDayStatus == true) { - return "ลาประกอบพิธีฮัจญ์"; + return "ลาอุปสมบทหรือการลาประกอบพิธีฮัจญ์ฯ"; + // return "ลาประกอบพิธีฮัจญ์"; รอ API } else { return val.leaveTypeName; } diff --git a/src/modules/05_leave/views/EditPage.vue b/src/modules/05_leave/views/EditPage.vue index 2d28a06..40107ac 100644 --- a/src/modules/05_leave/views/EditPage.vue +++ b/src/modules/05_leave/views/EditPage.vue @@ -114,9 +114,9 @@ const modelSpecific = computed(() => { (x) => x.id == formData.leaveTypeId )?.code; - if (code == "LV-006" && formData.hajjDayStatus == false) { + if (code == "LV-006" && formData.ordainDayLocationName != "") { return "b1"; - } else if (code == "LV-006" && formData.hajjDayStatus == true) { + } else if (code == "LV-006" && formData.ordainDayLocationName == "") { return "b2"; } else if (code == "LV-008" && formData.studyDayTrainingSubject == "") { return "s1";