diff --git a/src/components/TableHistory.vue b/src/components/TableHistory.vue index 5d13e66..e364015 100644 --- a/src/components/TableHistory.vue +++ b/src/components/TableHistory.vue @@ -62,15 +62,15 @@ const selected = ref([]) const columns = ref( props.tab == 'history' ? [ - { - name: 'checkInDate', - align: 'left', - label: 'วัน/เดือน/ปี', - sortable: true, - field: 'checkInDate', - headerStyle: 'font-size: 14px', - style: 'font-size: 14px; width:15%;', - }, + // { + // name: 'checkInDate', + // align: 'left', + // label: 'วัน/เดือน/ปี', + // sortable: true, + // field: 'checkInDate', + // headerStyle: 'font-size: 14px', + // style: 'font-size: 14px; width:15%;', + // }, { name: 'checkInTime', align: 'left', @@ -79,6 +79,9 @@ const columns = ref( field: 'checkInTime', headerStyle: 'font-size: 14px', style: 'font-size: 14px; width:15%;', + format: (val: string, row: DataCheckIn) => { + return `${row.checkInDate} ${val} น.` + }, }, { name: 'checkInLocation', @@ -107,7 +110,9 @@ const columns = ref( headerStyle: 'font-size: 14px', style: 'font-size: 14px; width:15%;', format: (val: string, row: DataCheckIn) => { - return row.checkOutStatus != '-' && val ? val : '-' + return row.checkOutStatus != '-' && val + ? `${row.checkOutDate} ${val} น.` + : '-' }, }, { @@ -182,7 +187,6 @@ const columns = ref( ) const visibleColumns = ref([ 'checkInDateTime', - 'checkInDate', 'checkInTime', 'checkInLocation', 'checkInStatus', diff --git a/src/interface/index/Main.ts b/src/interface/index/Main.ts index 14def36..5d82bd2 100644 --- a/src/interface/index/Main.ts +++ b/src/interface/index/Main.ts @@ -38,6 +38,7 @@ interface DataCheckIn { checkInLocation: string checkInStatus: string checkInTime: string + checkOutDate: string checkOutLocation: string checkOutStatus: string checkOutTime: string diff --git a/src/stores/chekin.ts b/src/stores/chekin.ts index bf27004..69017f6 100644 --- a/src/stores/chekin.ts +++ b/src/stores/chekin.ts @@ -33,6 +33,7 @@ export const useChekIn = defineStore('checkin', () => { editStatus: e.editStatus != '' ? convertEditStatus(e.editStatus) : '', editReason: e.editReason, isEdit: e.isEdit, + checkOutDate: e.checkOutDate ? date2Thai(e.checkOutDate) : null, })) rows.value = dataList }