diff --git a/src/modules/21_report/views/02_reportRegistry.vue b/src/modules/21_report/views/02_reportRegistry.vue index 400374095..952ee0e22 100644 --- a/src/modules/21_report/views/02_reportRegistry.vue +++ b/src/modules/21_report/views/02_reportRegistry.vue @@ -126,6 +126,7 @@ const visibleColumnsBase = ref([ "position", "posType", "posLevel", + "positionArea", "org", "positionExecutive", "gender", @@ -189,7 +190,7 @@ const columns = computed(() => { { name: "posType", align: "left", - label: "ตำแหน่งประเภท", + label: employeeClass.value === "officer" ? "ตำแหน่งประเภท" : "กลุ่มงาน", sortable: true, field: "posType", headerStyle: "font-size: 14px", @@ -200,7 +201,7 @@ const columns = computed(() => { { name: "posLevel", align: "left", - label: "ระดับ", + label: employeeClass.value === "officer" ? "ระดับ" : "ระดับชั้นงาน", sortable: true, field: "posLevel", headerStyle: "font-size: 14px", @@ -208,6 +209,17 @@ const columns = computed(() => { sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "positionArea", + align: "left", + label: "ด้าน/สาขา", + sortable: true, + field: "positionArea", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "org", align: "left", @@ -354,7 +366,9 @@ const columns = computed(() => { const visibleColumns = computed(() => { return employeeClass.value === "officer" ? visibleColumnsBase.value - : visibleColumnsBase.value.filter((e: string) => e !== "positionExecutive"); + : visibleColumnsBase.value.filter( + (e: string) => e !== "positionExecutive" && e !== "positionArea" + ); }); const typeTerm = ref(""); @@ -600,6 +614,7 @@ async function onSearch() { ) ?? "-", empType: employeeClass.value, dateRetireLaw: item.dateRetireLaw ?? "-", + positionArea: item.positionArea ?? "-", })); }) .catch((e) => { @@ -616,7 +631,7 @@ async function onSearch() { function exportToExcel() { const newData = rows.value.map((e: any) => { - const { profileId, empType, ...rest } = e; + const { profileId, empType, positionArea, positionExecutive, ...rest } = e; return { ...rest, dateAppoint: date2Thai(e.dateAppoint), @@ -627,7 +642,13 @@ function exportToExcel() { }; }); - const headers = columns.value?.map((item: any) => item.label) || []; // หัวคอลัมน์ภาษาไทย + const headers = + columns.value + ?.filter( + (x: any) => + x.field !== "positionExecutive" && x.field !== "positionArea" + ) + .map((item: any) => item.label) || []; // หัวคอลัมน์ภาษาไทย const worksheet = XLSX.utils.json_to_sheet(newData, { header: visibleColumns.value, }); @@ -826,28 +847,7 @@ watch( > - +
- - + />
@@ -1354,7 +1309,7 @@ watch( dense v-model="positionArea" borderless - label=" ด้านสาขา" + label=" ด้าน/สาขา" class="bg-white full-width" >