diff --git a/src/modules/21_report/views/02_reportRegistry.vue b/src/modules/21_report/views/02_reportRegistry.vue index aefc97908..73e760dd0 100644 --- a/src/modules/21_report/views/02_reportRegistry.vue +++ b/src/modules/21_report/views/02_reportRegistry.vue @@ -256,7 +256,7 @@ const columns = computed(() => { headerStyle: "font-size: 14px", style: "font-size: 14px", format(val, row) { - return val ? date2Thai(row.dateAppointFull) : ""; + return val ? date2Thai(val) : ""; }, sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), @@ -541,8 +541,7 @@ async function onSearch() { gender: item.gender ?? "-", status: item.relationship ?? "-", education: item.degree ?? "-", - dateAppoint: item.dateAppoint ? date2Thai(item.dateAppoint) : "-", - dateAppointFull: item.dateAppoint, + dateAppoint: item.dateAppoint ?? "-", age: item.age ?? "-", currentPosition: item.currentPosition ?? "-", lengthPosition: item.lengthPosition ?? "-", @@ -564,8 +563,12 @@ async function onSearch() { function exportToExcel() { const newData = rows.value.map((e: any) => { - const { dateAppointFull, profileId, empType, ...rest } = e; - return { ...rest, dateRetireLaw: date2Thai(e.dateRetireLaw) }; + const { profileId, empType, ...rest } = e; + return { + ...rest, + dateAppoint: date2Thai(e.dateAppoint), + dateRetireLaw: date2Thai(e.dateRetireLaw), + }; }); const headers = columns.value?.map((item: any) => item.label) || []; // หัวคอลัมน์ภาษาไทย