diff --git a/src/modules/09_leave/components/3_WorkTime/DialogForm.vue b/src/modules/09_leave/components/3_WorkTime/DialogForm.vue new file mode 100644 index 000000000..1cd0e7aaf --- /dev/null +++ b/src/modules/09_leave/components/3_WorkTime/DialogForm.vue @@ -0,0 +1,216 @@ + + + + diff --git a/src/modules/09_leave/components/3_WorkTime/MainPage.vue b/src/modules/09_leave/components/3_WorkTime/MainPage.vue new file mode 100644 index 000000000..859550277 --- /dev/null +++ b/src/modules/09_leave/components/3_WorkTime/MainPage.vue @@ -0,0 +1,211 @@ + + + diff --git a/src/modules/09_leave/interface/request/workTime.ts b/src/modules/09_leave/interface/request/workTime.ts new file mode 100644 index 000000000..ebffb8c71 --- /dev/null +++ b/src/modules/09_leave/interface/request/workTime.ts @@ -0,0 +1,21 @@ +interface workingTimeDataRowType { + morning: string + morningEnd: string + afternoon: string + afternoonEnd: string + reason: string + status: number +} + +interface formData { + morning:string + morningEnd:string + afternoon:string + afternoonEnd:string + reason:string + status:boolean +} +export type { + workingTimeDataRowType, + formData +} \ No newline at end of file diff --git a/src/modules/09_leave/router.ts b/src/modules/09_leave/router.ts index 36c344e81..90ee3a0f9 100644 --- a/src/modules/09_leave/router.ts +++ b/src/modules/09_leave/router.ts @@ -4,6 +4,7 @@ const leaveMain = () => import("@/modules/09_leave/views/LeaveListMain.vue"); const reportMain = () => import("@/modules/09_leave/views/ReportMain.vue") const leaveDetail = () => import("@/modules//09_leave/components/2_Leave/DetailLeave.vue") const RoundMain = () => import("@/modules/09_leave/views/RoundMain.vue") +const workingtime = () => import('@/modules/09_leave/components/3_WorkTime/MainPage.vue') export default [ { @@ -56,5 +57,15 @@ export default [ Role: "coin", }, }, + { + path: "/workingtime", + name: "/working-time", + component: workingtime, + meta: { + Auth: true, + Key: [9], + Role: "coin", + }, + }, ] \ No newline at end of file diff --git a/src/modules/09_leave/stores/WorkTimeStore.ts b/src/modules/09_leave/stores/WorkTimeStore.ts new file mode 100644 index 000000000..778469448 --- /dev/null +++ b/src/modules/09_leave/stores/WorkTimeStore.ts @@ -0,0 +1,117 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import type { QTableProps } from "quasar"; +import type { workingTimeDataRowType } from '@/modules/09_leave/interface/request/workTime' + +export const useWorkTimeStore = defineStore("WorkTimeStore", () => { + const rows = ref([]) + + const visibleColumns = ref([ + "round", + "morning", + "morningEnd", + "afternoon", + "afternoonEnd", + "reason", + "status", + ]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง + + // หัวตาราง + const columns = ref([ + + { + name: "round", + align: "left", + label: "รอบ", + sortable: true, + field: "round", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "morning", + align: "left", + label: "รอบเช้า", + sortable: true, + field: "morning", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "morningEnd", + align: "left", + label: "รอบออก", + sortable: true, + field: "morningEnd", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "afternoon", + align: "left", + label: "รอบบ่าย", + sortable: true, + field: "afternoon", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "afternoonEnd", + align: "left", + label: "รอบออก", + sortable: true, + field: "afternoonEnd", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "reason", + align: "left", + label: "คำอธิบาย", + sortable: true, + field: "reason", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "status", + align: "center", + label: "สถานะการใช้งาน", + sortable: false, + field: "status", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + ]); + function fecthList(data: workingTimeDataRowType[]) { + let datalist: workingTimeDataRowType[] = data.map((e: workingTimeDataRowType) => { + return { + round:`${e.morning}-${e.afternoonEnd}`, + morning: e.morning, + morningEnd: e.morningEnd, + afternoon: e.afternoon, + afternoonEnd: e.afternoonEnd, + reason: e.reason === '' ? '-':e.reason, + status: e.status, + }; + }); + rows.value = datalist; + } + + return { + fecthList, + rows, + visibleColumns, + columns + }; +}) \ No newline at end of file diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue index cc1a92d0f..72eb8c80f 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue @@ -34,23 +34,19 @@ const resetFilter = () => { }; const attrs = ref(useAttrs()); -const paging = ref(true); const pagination = ref({ // sortBy: "desc", descending: false, page: 1, rowsPerPage: 10, }); -const paginationLabel = (start: string, end: string, total: string) => { - if (paging.value == true) return " " + start + "-" + end + " ใน " + total; - else return start + "-" + end + " ใน " + total; -}; + const clickAdd = () => { router.push(`/discipline/investigatefacts/add`); }; -onMounted(() => { - fecthList([ +onMounted(async() => { + await fecthList([ { subject: "ทุจริตในหน้าที่", interrogated: "ศิรินภา คงน้อยี่", @@ -156,7 +152,6 @@ onMounted(() => { class="custom-header-table" v-bind="attrs" :visible-columns="dataInvestigate.visibleColumns" - :pagination-label="paginationLabel" v-model:pagination="pagination" >