From 61ce6f966ca7c0f5c836be1b0e79c91b2c8ee263 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Wed, 13 Dec 2023 11:37:17 +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=20=E0=B9=81=E0=B8=A5=E0=B8=B0=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B8=94=E0=B8=B6=E0=B8=87=E0=B8=82=E0=B9=89?= =?UTF-8?q?=E0=B8=AD=E0=B8=A1=E0=B8=B9=E0=B8=A5=E0=B9=83=E0=B8=99=E0=B8=AA?= =?UTF-8?q?=E0=B9=88=E0=B8=A7=E0=B8=99=E0=B8=82=E0=B8=AD=E0=B8=87=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B9=81?= =?UTF-8?q?=E0=B8=A5=E0=B8=B0=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=E0=B8=9E=E0=B8=B4=E0=B9=80?= =?UTF-8?q?=E0=B8=A8=E0=B8=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormTime.vue | 28 ++++++++++++++--------- src/interface/response/checkin.ts | 2 +- src/stores/chekin.ts | 2 ++ src/views/HistoryView.vue | 38 +++++++++++++++---------------- 4 files changed, 39 insertions(+), 31 deletions(-) diff --git a/src/components/FormTime.vue b/src/components/FormTime.vue index 030dbc5..51a19b7 100644 --- a/src/components/FormTime.vue +++ b/src/components/FormTime.vue @@ -28,11 +28,14 @@ const props = defineProps({ fetchData: { type: Function, require: true, + default: () => { + console.log('fetchData func') + }, }, }) const dataByIdVal = ref([]) -const date = ref(null) +const date = ref(null) const checkboxIn = ref(false) const checkboxOut = ref(false) const reason = ref('') @@ -78,7 +81,7 @@ function onCkickSave() { ) ) { dialogConfirm($q, async () => { - const data: FormTimeStemp = { + const data: FormTimeStemp = await { checkDate: date.value, checkInEdit: checkboxIn.value, checkOutEdit: checkboxOut.value, @@ -86,8 +89,6 @@ function onCkickSave() { } createListTime(data) }) - } else { - console.log('ไม่ผ่าน ') } } @@ -106,7 +107,7 @@ async function createListTime(data: FormTimeStemp) { }) .finally(() => { props.closePopup?.() - props.fetchData?.() + props.fetchData() }) } @@ -118,7 +119,9 @@ onMounted(() => { if (dataByIdVal.value == null) { statusAction.value = true } else { - date.value = new Date(dataByIdVal.value.checkInDateTime) + date.value = moment(new Date(dataByIdVal.value.checkInDateTime)).format( + 'YYYY-MM-DD' + ) } }) @@ -153,14 +156,15 @@ watch( - +