diff --git a/src/modules/21_report/views/02_reportRegistry.vue b/src/modules/21_report/views/02_reportRegistry.vue index fe89e9a45..1b3963df7 100644 --- a/src/modules/21_report/views/02_reportRegistry.vue +++ b/src/modules/21_report/views/02_reportRegistry.vue @@ -342,7 +342,10 @@ const columns = computed(() => { { name: "positionDate", align: "left", - label: "ระยะเวลาดำรงตำแหน่ง (สายงาน) ปัจจุบัน", + label: + employeeClass.value === "officer" + ? "ระยะเวลาดำรงตำแหน่ง (สายงาน) ปัจจุบัน" + : "ระยะเวลาดำรงตำแหน่งปัจจุบัน", sortable: true, field: "positionDate", headerStyle: "font-size: 14px", @@ -379,7 +382,10 @@ const visibleColumns = computed(() => { return employeeClass.value === "officer" ? visibleColumnsBase.value : visibleColumnsBase.value.filter( - (e: string) => e !== "positionExecutive" && e !== "positionArea" + (e: string) => + e !== "positionExecutive" && + e !== "positionArea" && + e !== "posExecutiveDate" ); }); @@ -649,7 +655,14 @@ async function onSearch() { function exportToExcel() { const newData = rows.value.map((e: any) => { - const { profileId, empType, positionArea, positionExecutive, ...rest } = e; + const { + profileId, + empType, + positionArea, + positionExecutive, + posExecutiveDate, + ...rest + } = e; return { ...rest, dateAppoint: date2Thai(e.dateAppoint), @@ -661,12 +674,17 @@ function exportToExcel() { }); const headers = - columns.value - ?.filter( - (x: any) => - x.field !== "positionExecutive" && x.field !== "positionArea" - ) - .map((item: any) => item.label) || []; // หัวคอลัมน์ภาษาไทย + employeeClass.value === "officer" + ? columns.value?.map((item: any) => item.label) || [] + : columns.value + ?.filter( + (x: any) => + x.field !== "positionExecutive" && + x.field !== "positionArea" && + x.field !== "posExecutiveDate" + ) + .map((item: any) => item.label) || []; // หัวคอลัมน์ภาษาไทย + const worksheet = XLSX.utils.json_to_sheet(newData, { header: visibleColumns.value, }); @@ -1544,7 +1562,11 @@ watch( @@ -1556,6 +1578,7 @@ watch( class="text-grey-8" /> +