Merge branch 'develop'

This commit is contained in:
AnandaTon 2023-11-20 18:01:42 +07:00
commit 79c0624731
3 changed files with 53 additions and 48 deletions

View file

@ -136,34 +136,34 @@ const columns = ref<QTableProps['columns']>([
headerStyle: 'font-size: 14px',
style: 'font-size: 14px; width:15%;',
},
// {
// name: "loIn",
// align: "left",
// label: "",
// sortable: true,
// field: "loIn",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
{
name: 'loIn',
align: 'left',
label: 'พิกัด',
sortable: true,
field: 'loIn',
headerStyle: 'font-size: 14px',
style: 'font-size: 14px',
},
// {
// name: "loOut",
// align: "left",
// label: "",
// sortable: true,
// field: "loOut",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
// {
// name: "status",
// align: "left",
// label: "",
// sortable: true,
// field: "status",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px; width:10%;",
// },
{
name: 'loOut',
align: 'left',
label: 'พิกัด',
sortable: true,
field: 'loOut',
headerStyle: 'font-size: 14px',
style: 'font-size: 14px',
},
{
name: 'status',
align: 'left',
label: 'สถานะ',
sortable: true,
field: 'status',
headerStyle: 'font-size: 14px',
style: 'font-size: 14px; width:10%;',
},
])
// popup
const modalPopup = ref<boolean>(false)

View file

@ -3,6 +3,12 @@ import { ref } from 'vue'
import http from '@/plugins/http'
import config from '@/app.config'
// importStores
import { useCounterMixin } from '@/stores/mixin'
const mixin = useCounterMixin()
const { date2Thai } = mixin
export const useChekIn = defineStore('checkin', () => {
const rows = ref<any>()
@ -10,35 +16,34 @@ export const useChekIn = defineStore('checkin', () => {
// console.log(data)
rows.value = []
const datalist = await data.map((e: any) => ({
id: e.id,
date: e.date,
// no: e.no,
// in: e.in,
// loIn: e.loIn,
// out: e.out,
// loOut: e.loOut,
// status: e.status,
// Morningstatus: convertStatus(e.Morningstatus),
// AfternoonStatus: convertStatus(e.AfternoonStatus),
// statusEdit: e.statusEdit,
id: e.checkInId,
date: date2Thai(e.checkInDate),
no: e.no,
in: e.checkInTime,
out: e.checkOutTime,
Morningstatus: convertStatus(e.checkInStatus),
AfternoonStatus: convertStatus(e.checkOutStatus),
loIn: e.checkInLocation,
loOut: e.checkOutLocation,
status: e.statusEdit,
// statusEditName: convertStatusEdit(e.statusEdit),
checkInTime: e.checkInTime,
checkInLocation: e.checkInLocation,
checkOutTime: e.checkOutTime,
checkOutLocation: e.checkOutLocation,
checkInStatus: convertStatus(e.checkInStatus),
checkOutStatus: convertStatus(e.checkOutStatus),
// checkInTime: e.checkInTime,
// checkInLocation: e.checkInLocation,
// checkOutTime: e.checkOutTime,
// checkOutLocation: e.checkOutLocation,
// checkInStatus: convertStatus(e.checkInStatus),
// checkOutStatus: convertStatus(e.checkOutStatus),
}))
rows.value = datalist
}
function convertStatus(status: string) {
switch (status) {
case '1':
case '':
return 'ขาดราชการ'
case '2':
case 'NORMAL':
return 'ปกติ'
case '3':
case 'LATE':
return 'สาย'
default:
return ''

View file

@ -27,7 +27,7 @@ onMounted(() => {
const fetchlistHistory = async () => {
showLoader()
await http
.get(config.API.history())
.get(config.API.history() + '?year=2023&page=1&pageSize=5&keyword=')
.then((res) => {
const data = res.data.result
fetchHistoryList(data)