hrms-mgt/src/modules/09_leave/views/WorkingMain.vue

126 lines
3.6 KiB
Vue
Raw Normal View History

2023-10-06 13:32:54 +07:00
<script setup lang="ts">
import { ref, onMounted } from "vue";
//import Stores
import { useCounterMixin } from "@/stores/mixin";
2023-10-20 10:31:07 +07:00
import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
2023-10-06 13:32:54 +07:00
//import Components
2023-10-20 10:31:07 +07:00
import TableList from "@/modules/09_leave/components/1_Work/TableList.vue";
2023-10-20 16:57:32 +07:00
import ToolBar from "@/modules/09_leave/components/1_Work/ToolBar.vue";
// import Type
import type {
TableRows,
DataRes,
} from "@/modules/09_leave/interface/response/work";
import ToolBarDate from "../components/1_Work/ToolBarDate.vue";
2023-10-06 13:32:54 +07:00
// use Store
const mixin = useCounterMixin();
const workStore = useWorklistDataStore();
const { date2Thai } = mixin;
2023-10-19 15:39:18 +07:00
const { fetchList } = workStore;
2023-10-06 13:32:54 +07:00
const tab = ref("1")
2023-10-06 13:32:54 +07:00
onMounted(() => {
fecthWorkList();
});
//เรียกข้อมูลรายการลงเวลาปฏิบัติงาน
function fecthWorkList() {
const listData: DataRes[] = [
2023-10-06 13:32:54 +07:00
{
fullName: "นายกัณฐิมา กาฬสินธ์ุ",
timeIn: "8:04",
coordinatesIn: "สำนักงาน",
latIn: "18.7903",
longIn: "99.0029",
timeOut: "18:04",
coordinatesOut: "สำนักงาน",
latOut: "18.7903",
longOut: "99.0029",
status: "normal",
date: new Date(new Date()),
2023-10-06 13:32:54 +07:00
},
{
fullName: "นายนครชัย วันดี",
timeIn: "8:04",
coordinatesIn: "สำนักงาน",
latIn: "18.7903",
longIn: "99.0029",
timeOut: "18:04",
coordinatesOut: "สำนักงาน",
latOut: "18.7903",
longOut: "99.0029",
status: "late",
date: new Date(new Date()),
2023-10-06 13:32:54 +07:00
},
{
fullName: "นายปิยรมย์ ศิริธาราฟ",
timeIn: "8:04",
coordinatesIn: "สำนักงาน",
latIn: "18.7903",
longIn: "99.0029",
timeOut: "18:04",
coordinatesOut: "สำนักงาน",
latOut: "18.7903",
longOut: "99.0029",
status: "absent",
date: new Date("2023-10-27"),
2023-10-06 13:32:54 +07:00
},
{
fullName: "นางสาวปลาทอง ใจกล้า",
timeIn: "8:04",
coordinatesIn: "สำนักงาน",
latIn: "18.7903",
longIn: "99.0029",
timeOut: "18:04",
coordinatesOut: "สำนักงาน",
latOut: "18.7903",
longOut: "99.0029",
status: "normal",
date: new Date("2023-10-27"),
2023-10-06 13:32:54 +07:00
},
];
2023-10-19 15:39:18 +07:00
fetchList(listData); // ส่งข้อมูลไปยัง stores
2023-10-06 13:32:54 +07:00
}
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการลงเวลาปฏงาน
</div>
<div>
<q-card bordered flat>
<q-tabs
v-model="tab"
dense
align="left"
inline-label
class="rounded-borders"
indicator-color="primary"
active-bg-color="teal-1"
active-class="text-primary"
>
<q-tab name="1" label="รายการลงเวลาที่ประมวลผลแล้ว"/>
<q-tab name="2" label="รายการลงเวลา" />
</q-tabs>
<q-separator />
<q-tab-panels v-model="tab" animated>
<q-tab-panel name="1">
<!-- <TableList1 /> -->
<ToolBar />
<TableList />
</q-tab-panel>
<q-tab-panel name="2">
<!-- <TabList2Vue /> -->
<ToolBarDate />
<TableList />
</q-tab-panel>
</q-tab-panels>
<!-- </q-card> -->
</q-card>
2023-10-06 13:32:54 +07:00
</div>
</template>
<style scoped></style>