From 601e288457c451a5615b78296664df319f9a8192 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 31 Oct 2023 14:55:55 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20UI=20?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5?= =?UTF-8?q?=E0=B8=87=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 --- .../components/1_Work/DialogDetail.vue | 4 ++-- .../09_leave/components/1_Work/ToolBar.vue | 19 ++++++++++------ .../09_leave/components/2_Leave/ToolBar.vue | 14 ++++++------ .../09_leave/interface/response/work.ts | 5 +++-- src/modules/09_leave/stores/WorkStore.ts | 22 ++++++++++++------- src/modules/09_leave/views/WorkingMain.vue | 12 +++++----- .../components/1_Complaint/MainPage.vue | 1 + 7 files changed, 45 insertions(+), 32 deletions(-) diff --git a/src/modules/09_leave/components/1_Work/DialogDetail.vue b/src/modules/09_leave/components/1_Work/DialogDetail.vue index bb668e52e..a02604db2 100644 --- a/src/modules/09_leave/components/1_Work/DialogDetail.vue +++ b/src/modules/09_leave/components/1_Work/DialogDetail.vue @@ -92,7 +92,7 @@ function colsePopup() { -
+
diff --git a/src/modules/09_leave/components/1_Work/ToolBar.vue b/src/modules/09_leave/components/1_Work/ToolBar.vue index cf91a2bca..f00acfb44 100644 --- a/src/modules/09_leave/components/1_Work/ToolBar.vue +++ b/src/modules/09_leave/components/1_Work/ToolBar.vue @@ -11,8 +11,8 @@ const { filterFn, searchDataFn } = workStore; diff --git a/src/modules/09_leave/components/2_Leave/ToolBar.vue b/src/modules/09_leave/components/2_Leave/ToolBar.vue index 3cdb35df5..31d4aca07 100644 --- a/src/modules/09_leave/components/2_Leave/ToolBar.vue +++ b/src/modules/09_leave/components/2_Leave/ToolBar.vue @@ -7,8 +7,8 @@ const { searchDataFn, filterOption } = leaveStore; diff --git a/src/modules/09_leave/interface/response/work.ts b/src/modules/09_leave/interface/response/work.ts index 5c16cf207..50bfc3b4d 100644 --- a/src/modules/09_leave/interface/response/work.ts +++ b/src/modules/09_leave/interface/response/work.ts @@ -8,8 +8,9 @@ interface TableRows { coordinatesOut: string latOut: string longOut: string - status: string - date: String | null + status: string | undefined + date: string | null + } interface DataRes { fullName: string diff --git a/src/modules/09_leave/stores/WorkStore.ts b/src/modules/09_leave/stores/WorkStore.ts index bb1dae063..d91efe185 100644 --- a/src/modules/09_leave/stores/WorkStore.ts +++ b/src/modules/09_leave/stores/WorkStore.ts @@ -13,7 +13,7 @@ export const useWorklistDataStore = defineStore("work", () => { const visibleColumns = ref([]); const dataMain = ref([]) function fetchList(data: DataRes[]) { - let datalist = data.map((e: DataRes) => ({ + let datalist: TableRows[] = data.map((e: DataRes) => ({ fullName: e.fullName, timeIn: e.timeIn, coordinatesIn: e.coordinatesIn, @@ -33,11 +33,17 @@ export const useWorklistDataStore = defineStore("work", () => { //ค้นหาข้อมูล const filterTable = ref('') - const selectDate = ref(null); + const selectDate = ref(new Date()); const selectStatus = ref('all') const optionStatusMain = ref([]) const optionStatus = ref([]) function searchDataFn(searchDate: any, searchStatus: any) { + let a = new Date(searchDate);// วันที่เลือก + let b = new Date(); // วันที่ปัจจุบัน + if (a > b) { + selectDate.value = new Date() + searchDate = new Date() + } searchStatus = searchStatus || "all"; if (searchDate == null && searchStatus == "all") { rows.value = dataMain.value @@ -84,12 +90,12 @@ export const useWorklistDataStore = defineStore("work", () => { // convertSatatus function convertSatatus(val: string) { switch (val) { - case "1": - return "ลงเวลาเรียบร้อย" - case "2": - return "สายทำงานครบ" - default: - return "ยังไม่ได้ลงเวลา" + case "normal": + return "ปกติ" + case "late": + return "สาย" + case "absent": + return "ขาดราชการ" } } return { diff --git a/src/modules/09_leave/views/WorkingMain.vue b/src/modules/09_leave/views/WorkingMain.vue index 23941c4ec..6580dc807 100644 --- a/src/modules/09_leave/views/WorkingMain.vue +++ b/src/modules/09_leave/views/WorkingMain.vue @@ -33,8 +33,8 @@ function fecthWorkList() { coordinatesOut: "สำนักงาน", latOut: "18.7903", longOut: "99.0029", - status: "1", - date: new Date("2023-10-27"), + status: "normal", + date: new Date(new Date()), }, { fullName: "นายนครชัย วันดี", @@ -46,8 +46,8 @@ function fecthWorkList() { coordinatesOut: "สำนักงาน", latOut: "18.7903", longOut: "99.0029", - status: "2", - date: new Date("2023-10-28"), + status: "late", + date: new Date(new Date()), }, { fullName: "นายปิยรมย์ ศิริธาราฟ", @@ -59,7 +59,7 @@ function fecthWorkList() { coordinatesOut: "สำนักงาน", latOut: "18.7903", longOut: "99.0029", - status: "3", + status: "absent", date: new Date("2023-10-27"), }, { @@ -72,7 +72,7 @@ function fecthWorkList() { coordinatesOut: "สำนักงาน", latOut: "18.7903", longOut: "99.0029", - status: "1", + status: "normal", date: new Date("2023-10-27"), }, ]; diff --git a/src/modules/11_discipline/components/1_Complaint/MainPage.vue b/src/modules/11_discipline/components/1_Complaint/MainPage.vue index 32560b97d..a66d1273b 100644 --- a/src/modules/11_discipline/components/1_Complaint/MainPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/MainPage.vue @@ -86,6 +86,7 @@ function redirectToPageadd() { outlined v-model="filterTable" label="ค้นหา" + debounce="300" >