diff --git a/src/modules/06_retirement/components/ListRetirement/TableList.vue b/src/modules/06_retirement/components/ListRetirement/TableList.vue index 0ffa0a3f0..1f8d1b26b 100644 --- a/src/modules/06_retirement/components/ListRetirement/TableList.vue +++ b/src/modules/06_retirement/components/ListRetirement/TableList.vue @@ -33,105 +33,9 @@ const filter = ref(""); const statusUpload = ref(); const modalEdit = ref(false); const textReport = ref(""); -const columns = ref([ - { - name: "order", - label: "ลำดับ", - title: "ลำดับ", - field: "order", - align: "left", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "name", - align: "left", - label: "ชื่อ - นามสกุล", - title: "ชื่อ - นามสกุล", - field: "name", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "organizationOrganization", - align: "left", - label: "สังกัด", - title: "สังกัด", - field: "organizationOrganization", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionEmployeeGroup", - align: "left", - label: "กลุ่มงาน", - title: "กลุ่มงาน", - // subtitle: "ในสายงาน/ระดับ", - field: "positionEmployeeGroup", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionEmployeePosition", - align: "left", - label: "ตำแหน่ง", - title: "ตำแหน่ง", - // subtitle: "ประเภท", - field: "positionEmployeePosition", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionEmployeeLevel", - align: "left", - label: "ระดับชั้น", - title: "ระดับชั้น", - // subtitle: "ทางการบริหาร", - field: "positionEmployeeLevel", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, +const employeeType = ref("OFFICER") - { - name: "positionNumber", - align: "left", - label: "ตำแหน่ง (เลขที่) ", - title: "ตำแหน่ง", - subtitle: "เลขที่", - field: "positionNumber", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "govGroup", - align: "left", - label: "ส่วนราชการ (ระดับฝ่าย/กลุ่มงาน/ส่วน)", - title: "ส่วนราชการ", - subtitle: "ระดับฝ่าย/กลุ่มงาน/ส่วน", - field: "govGroup", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "govOffice", - align: "left", - label: "ส่วนราชการ (ระดับสถาบัน/สำนักงาน/กอง)", - title: "ส่วนราชการ", - subtitle: "ระดับสถาบัน/สำนักงาน/กอง", - field: "govOffice", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "bureau", - align: "left", - label: "หน่วยงาน", - title: "หน่วยงาน", - field: "bureau", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, -]); +const columns = ref([]) const rows = ref([]); const visibleColumns = ref([ "order", @@ -140,6 +44,8 @@ const visibleColumns = ref([ "positionEmployeePosition", "positionEmployeeLevel", "positionEmployeeGroup", + "organizationAgency", + "organizationGovernmentAgency", "positionNumber", "govGroup", "govOffice", @@ -172,6 +78,8 @@ const fecthlistprofile = async (id: string) => { statusReport.value = res.data.result.json; typeReport.value = res.data.result.typeReport; textReport.value = res.data.result.detail; + employeeType.value = res.data.result.type; + // รายชื่อผู้เกษียณอายุราชการ rows.value = res.data.result.profile.map((e: any) => ({ id: e.id, @@ -179,10 +87,12 @@ const fecthlistprofile = async (id: string) => { order: e.order, name: e.fullName, organizationOrganization: e.organizationOrganization, - positionEmployeePosition: e.positionEmployeePosition, - positionEmployeeLevel: e.positionEmployeeLevel, - positionNumber: e.posNoEmployee, - positionEmployeeGroup: e.positionEmployeeGroup, + positionEmployeePosition: res.data.result.type == 'OFFICER' ? e.positionType : e.positionEmployeePosition, + positionEmployeeLevel: res.data.result.type == 'OFFICER' ? (e.positionExecutive != null ? e.positionExecutive : "-") : e.positionEmployeeLevel, + positionNumber: res.data.result.type == 'OFFICER' ? e.posNo : e.posNoEmployee, + positionEmployeeGroup: res.data.result.type == 'OFFICER' ? e.position : e.positionEmployeeGroup, + organizationAgency: e.organizationAgency, + organizationGovernmentAgency: e.organizationGovernmentAgency, bureau: e.oc, reason: e.reason, remove: e.remove, @@ -195,9 +105,110 @@ const fecthlistprofile = async (id: string) => { messageError($q, e); }) .finally(() => { + columns.value = [ + { + name: "order", + label: "ลำดับ", + title: "ลำดับ", + field: "order", + align: "left", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "name", + align: "left", + label: "ชื่อ - นามสกุล", + title: "ชื่อ - นามสกุล", + field: "name", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "organizationOrganization", + align: "left", + label: "สังกัด", + title: "สังกัด", + field: "organizationOrganization", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "positionEmployeeGroup", + align: "left", + label: employeeType.value == "OFFICER" ? "ตำแหน่ง (ในสายงาน/ระดับ)" : "กลุ่มงาน", + title: employeeType.value == "OFFICER" ? "ตำแหน่ง" : "กลุ่มงาน", + subtitle: employeeType.value == "OFFICER" ? "ในสายงาน/ระดับ" : "", + field: "positionEmployeeGroup", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "positionEmployeePosition", + align: "left", + label: employeeType.value == "OFFICER" ? "ตำแหน่ง (ประเภท)" : "ตำแหน่ง", + title: employeeType.value == "OFFICER" ? "ตำแหน่ง" : "ตำแหน่ง", + subtitle: employeeType.value == "OFFICER" ? "ประเภท" : "", + field: "positionEmployeePosition", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "positionEmployeeLevel", + align: "left", + label: employeeType.value == "OFFICER" ? "ตำแหน่ง (ทางการบริหาร)" : "ระดับชั้น", + title: employeeType.value == "OFFICER" ? "ตำแหน่ง" : "ระดับชั้น", + subtitle: employeeType.value == "OFFICER" ? "ทางการบริหาร" : "", + field: "positionEmployeeLevel", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + + { + name: "positionNumber", + align: "left", + label: "ตำแหน่ง (เลขที่) ", + title: "ตำแหน่ง", + subtitle: "เลขที่", + field: "positionNumber", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "organizationAgency", + align: "left", + label: "ส่วนราชการ (ระดับฝ่าย/กลุ่มงาน/ส่วน)", + title: "ส่วนราชการ", + subtitle: "ระดับฝ่าย/กลุ่มงาน/ส่วน", + field: "organizationAgency", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "organizationGovernmentAgency", + align: "left", + label: "ส่วนราชการ (ระดับสถาบัน/สำนักงาน/กอง)", + title: "ส่วนราชการ", + subtitle: "ระดับสถาบัน/สำนักงาน/กอง", + field: "organizationGovernmentAgency", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "bureau", + align: "left", + label: "หน่วยงาน", + title: "หน่วยงาน", + field: "bureau", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + ]; + hideLoader(); }); }; + // เช็คสถานะการอัพโหลด const fecthCheck = async (id: string) => { await http @@ -371,154 +382,69 @@ const paginationLabel = (start: number, end: number, total: number) => {