fix: conventStatus

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-03-05 15:33:17 +07:00
parent e5328c9eb6
commit 6a7f1a4ef7

View file

@ -96,7 +96,7 @@ const columns = ref<QTableProps["columns"]>([
sortable: true,
field: "status",
format(val, row) {
return conventStatus(val);
return conventStatus(val, row.type);
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -187,10 +187,21 @@ function onDetail(id: string) {
}
/** ฟังก์ชั่นแปลงสถานะ */
function conventStatus(val: string) {
function conventStatus(val: string, type: string) {
// DOMESTICE
// NOABROAD ()
// ABROAD ()
// EXECUTIVE ()
// STUDY
// TRAINING
switch (val) {
case "PENDING":
return "อยู่ระหว่างศึกษา";
if (type === "TRAINING") {
return "อยู่ระหว่างฝึกอบรม";
} else if (type === "DOMESTICE" || type === "STUDY") {
return "อยู่ระหว่างศึกษา";
}
return "-";
case "REPORTED":
return "รายงานตัวกลับเข้าปฏิบัติราชการแล้ว";
case "GRADUATE":
@ -198,7 +209,7 @@ function conventStatus(val: string) {
case "NOTGRADUATE":
return "เรียนไม่จบ";
default:
break;
return "-";
}
}