From a95c320cf5cfa52f081db11b6fbf24de92e4ec42 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Tue, 21 Nov 2023 10:56:37 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87?= =?UTF-8?q?=E0=B8=9C=E0=B8=A5=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=87?= =?UTF-8?q?=E0=B9=80=E0=B8=A7=E0=B8=A5=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableHistory.vue | 135 +++++++++++++++++++------------- src/stores/chekin.ts | 27 +++---- src/views/HistoryView.vue | 63 +-------------- 3 files changed, 94 insertions(+), 131 deletions(-) diff --git a/src/components/TableHistory.vue b/src/components/TableHistory.vue index 87c989b..95d0c05 100644 --- a/src/components/TableHistory.vue +++ b/src/components/TableHistory.vue @@ -9,6 +9,8 @@ import { useChekIn } from '@/stores/chekin' import Popup from '@/components/PopUp.vue' const stores = useChekIn() + +/** props from page */ const props = defineProps({ paging: { type: Boolean, @@ -16,7 +18,7 @@ const props = defineProps({ }, pageSize: { type: Number, - defualt: 25, + defualt: 10, }, page: { type: Number, @@ -90,79 +92,72 @@ async function updatePagination(newPagination: any) { props.changePage(1, newPagination.rowsPerPage, true) initialPagination.value = newPagination } + +/** column history table */ const columns = ref([ { - name: 'date', + name: 'checkInDate', align: 'left', label: 'วัน/เดือน/ปี', sortable: true, - field: 'date', + field: 'checkInDate', headerStyle: 'font-size: 14px', style: 'font-size: 14px; width:15%;', }, { - name: 'in', + name: 'checkInTime', align: 'left', label: 'เวลาเข้างาน', sortable: true, - field: 'in', + field: 'checkInTime', headerStyle: 'font-size: 14px', style: 'font-size: 14px; width:15%;', }, { - name: 'loIn', + name: 'checkInLocation', align: 'left', label: 'พิกัด', sortable: true, - field: 'loIn', + field: 'checkInLocation', headerStyle: 'font-size: 14px', style: 'font-size: 14px', }, { - name: 'out', - align: 'left', - label: 'เวลาออกงาน', - sortable: true, - field: 'out', - headerStyle: 'font-size: 14px', - style: 'font-size: 14px; width:15%;', - }, - { - name: 'loOut', - align: 'left', - label: 'พิกัด', - sortable: true, - field: 'loOut', - headerStyle: 'font-size: 14px', - style: 'font-size: 14px', - }, - { - name: 'Morningstatus', + name: 'checkInStatus', align: 'left', label: 'สถานะช่วงเช้า', sortable: true, - field: 'Morningstatus', + field: 'checkInStatus', headerStyle: 'font-size: 14px', style: 'font-size: 14px; width:15%;', }, { - name: 'AfternoonStatus', + name: 'checkOutTime', + align: 'left', + label: 'เวลาออกงาน', + sortable: true, + field: 'checkOutTime', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px; width:15%;', + }, + { + name: 'checkOutLocation', + align: 'left', + label: 'พิกัด', + sortable: true, + field: 'checkOutLocation', + headerStyle: 'font-size: 14px', + style: 'font-size: 14px', + }, + { + name: 'checkOutStatus', align: 'left', label: 'สถานะช่วงบ่าย', sortable: true, - field: 'AfternoonStatus', + field: 'checkOutStatus', headerStyle: 'font-size: 14px', style: 'font-size: 14px; width:15%;', - }, - { - name: 'status', - align: 'left', - label: 'สถานะ', - sortable: true, - field: 'status', - headerStyle: 'font-size: 14px', - style: 'font-size: 14px; width:10%;', - }, + } ]) // popup const modalPopup = ref(false) @@ -174,9 +169,11 @@ function openPopup(data: any) { titlePopup.value = title dataRow.value = data } + function closePopup() { modalPopup.value = false } + function classStatus(status: string) { switch (status) { case 'ขาดราชการ': @@ -189,11 +186,24 @@ function classStatus(status: string) { break } } + const pagination = ref({ page: 1, - rowsPerPage: 10, + rowsPerPage: 2, }) + +const checkRequestEdit = (checkInStatus: string, checkOutStatus: string) => { + if ( + checkInStatus === 'ขาด' || + checkInStatus === 'สาย' || + checkOutStatus === 'ขาด' || + checkOutStatus === 'สาย' + ) + return true + else false +} + + +