diff --git a/src/modules/21_report/views/02_reportRegistry.vue b/src/modules/21_report/views/02_reportRegistry.vue index 634b800b1..c0b26a989 100644 --- a/src/modules/21_report/views/02_reportRegistry.vue +++ b/src/modules/21_report/views/02_reportRegistry.vue @@ -34,7 +34,8 @@ const storeReport = useReportStore(); const stroeRegistry = useRegistryNewDataStore(); const { fetchStructureTree } = useStructureTree(); const mixin = useCounterMixin(); -const { messageError, showLoader, hideLoader, date2Thai } = mixin; +const { messageError, showLoader, hideLoader, date2Thai, formatDatePosition } = + mixin; const loadingBtn = ref(false); const total = ref(0); @@ -121,8 +122,8 @@ const visibleColumnsBase = ref([ "dateAppoint", "dateRetireLaw", "age", - "currentPosition", - "lengthPosition", + "positionDate", + "levelDate", ]); const columns = computed(() => { @@ -289,22 +290,22 @@ const columns = computed(() => { a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "currentPosition", + name: "positionDate", align: "left", label: "ระยะเวลาดำรงตำแหน่งปัจจุบัน", sortable: true, - field: "currentPosition", + field: "positionDate", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "lengthPosition", + name: "levelDate", align: "left", label: "ระยะเวลาดำรงตำแหน่งในระดับปัจจุบัน", sortable: true, - field: "lengthPosition", + field: "levelDate", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -553,8 +554,18 @@ async function onSearch() { education: item.degree ?? "-", dateAppoint: item.dateAppoint ?? "-", age: item.age ?? "-", - currentPosition: item.currentPosition ?? "-", - lengthPosition: item.lengthPosition ?? "-", + positionDate: + formatDatePosition( + item.positionDate?.Years, + item.positionDate?.Months, + item.positionDate?.Days + ) ?? "-", + levelDate: + formatDatePosition( + item.levelDate?.posExecutiveYears, + item.levelDate?.posExecutiveMonths, + item.levelDate?.posExecutiveDays + ) ?? "-", empType: employeeClass.value, dateRetireLaw: item.dateRetireLaw ?? "-", }));