diff --git a/src/modules/05_leave/components/ListView.vue b/src/modules/05_leave/components/ListView.vue index 08aba27..8eb1073 100644 --- a/src/modules/05_leave/components/ListView.vue +++ b/src/modules/05_leave/components/ListView.vue @@ -158,12 +158,28 @@ async function updatePagination(p: number, ps: number) { await fetchDataTable(); } +function convert(val: any) { + if (leaveType.value) { + const filtertype = leaveType.value.find( + (e: any) => e.id === val.leaveTypeId + ); + const type = filtertype?.code; + if (type == "LV-006" && val.hajjDayStatus == false) { + return "ลาอุปสมบท"; + } else if (type == "LV-006" && val.hajjDayStatus == true) { + return "ลาประกอบพิธีฮัจญ์"; + } else { + return val.leaveTypeName; + } + } +} + /** * เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้ */ onMounted(async () => { - await fetchDataTable(); await fectOptionType(); + await fetchDataTable(); });