From 79cf1d0f715b056cd15472a627e61a098a6dafe5 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Tue, 9 Jan 2024 15:07:36 +0700 Subject: [PATCH 1/5] research nodes tree --- src/modules/02_organizational/router.ts | 13 + .../02_organizational/views/TreeTest.vue | 370 ++++++++++++++++++ 2 files changed, 383 insertions(+) create mode 100644 src/modules/02_organizational/views/TreeTest.vue diff --git a/src/modules/02_organizational/router.ts b/src/modules/02_organizational/router.ts index cec042ef6..add08831a 100644 --- a/src/modules/02_organizational/router.ts +++ b/src/modules/02_organizational/router.ts @@ -21,6 +21,9 @@ const ManageReport2Add = () => const ManageReport2History = () => import("@/modules/02_organizational/views/ManageReport2History.vue"); +const TreeTestPage = () => + import("@/modules/02_organizational/views/TreeTest.vue"); + export default [ { path: "/organizational/mapping", @@ -122,4 +125,14 @@ export default [ Role: "organization", }, }, + { + path: "/tree-test", + name: "treeTest", + component: TreeTestPage, + meta: { + Auth: true, + Key: [14], + Role: "organization", + }, + }, ]; diff --git a/src/modules/02_organizational/views/TreeTest.vue b/src/modules/02_organizational/views/TreeTest.vue new file mode 100644 index 000000000..58e446b5f --- /dev/null +++ b/src/modules/02_organizational/views/TreeTest.vue @@ -0,0 +1,370 @@ + + + + + \ No newline at end of file From 4960a0d9604426599a7585c5615e10c5eeb2d950 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 9 Jan 2024 15:49:50 +0700 Subject: [PATCH 2/5] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=A2=20=E0=B8=9A=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B6?= =?UTF-8?q?=E0=B8=81=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82=E0=B8=9B?= =?UTF-8?q?=E0=B8=8F=E0=B8=B4=E0=B8=97=E0=B8=B4=E0=B8=99=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=99=E0=B8=97=E0=B8=B3=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/09_leave/components/1_Work/DialogEdit.vue | 2 +- src/modules/09_leave/views/ChangeRoundMain.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/09_leave/components/1_Work/DialogEdit.vue b/src/modules/09_leave/components/1_Work/DialogEdit.vue index 86351b1cb..a6140e6ca 100644 --- a/src/modules/09_leave/components/1_Work/DialogEdit.vue +++ b/src/modules/09_leave/components/1_Work/DialogEdit.vue @@ -55,7 +55,7 @@ async function onClickSave() { dialogConfirm($q, async () => { console.log(body); - success($q, "บันทึกข้อมูสำเร็จ"); + success($q, "บันทึกข้อมูลสำเร็จ"); props.close?.(); }); } diff --git a/src/modules/09_leave/views/ChangeRoundMain.vue b/src/modules/09_leave/views/ChangeRoundMain.vue index 8a4a7b2a3..ed6d7b1b2 100644 --- a/src/modules/09_leave/views/ChangeRoundMain.vue +++ b/src/modules/09_leave/views/ChangeRoundMain.vue @@ -73,7 +73,7 @@ function save() { dialogConfirm($q, async () => { showLoader(); await http - .post(config.API.leaveWorkByid(detailByid.value.profileId), { + .put(config.API.leaveWorkByid(detailByid.value.profileId), { work: dateWork.value, }) .then(() => { From 53cbf74f52ab7560322b711fba2ad25d745a86a6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 9 Jan 2024 16:34:26 +0700 Subject: [PATCH 3/5] =?UTF-8?q?API=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=E0=B8=AA=E0=B8=96=E0=B8=B2=E0=B8=99=E0=B8=B0=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=82=E0=B9=89=E0=B8=B2-?= =?UTF-8?q?=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/09_leave/api.leave.ts | 2 ++ .../09_leave/components/1_Work/DialogEdit.vue | 29 ++++++++++++++----- .../09_leave/components/1_Work/Tab1.vue | 1 + .../09_leave/components/1_Work/TableList.vue | 11 ++++++- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/api/09_leave/api.leave.ts b/src/api/09_leave/api.leave.ts index 895ef2019..0ef73073e 100644 --- a/src/api/09_leave/api.leave.ts +++ b/src/api/09_leave/api.leave.ts @@ -9,6 +9,8 @@ export default { logRecord: () => `${leave}/log-record`, timeRecord: () => `${leave}/time-record`, recordById: (id: string, type: string) => `${leave}/${type}/${id}`, + leaveEditCheckin: (id: string) => `${leave}/admin/edit/checkin/${id}`, + /** เปลี่ยนแปลงลงเวลา*/ leaveSearch: () => `${leave}/search`, leaveRound: () => `${leave}/round`, diff --git a/src/modules/09_leave/components/1_Work/DialogEdit.vue b/src/modules/09_leave/components/1_Work/DialogEdit.vue index a6140e6ca..767f3ea06 100644 --- a/src/modules/09_leave/components/1_Work/DialogEdit.vue +++ b/src/modules/09_leave/components/1_Work/DialogEdit.vue @@ -12,7 +12,7 @@ import { useCounterMixin } from "@/stores/mixin"; const $q = useQuasar(); const mixin = useCounterMixin(); -const { dialogConfirm, success } = mixin; +const { dialogConfirm, success, showLoader, hideLoader, messageError } = mixin; const props = defineProps({ modal: { @@ -27,6 +27,10 @@ const props = defineProps({ type: Function, require: true, }, + fetchData: { + type: Function, + require: true, + }, }); const morningStatus = ref(""); @@ -48,15 +52,26 @@ async function onClickSave() { afternoonStatusRef.value?.validate(); if (!morningStatusRef.value.hasError && !afternoonStatusRef.value.hasError) { const body = { - morningStatus: morningStatus.value, - afternoonStatus: afternoonStatus.value, + checkInStatus: morningStatus.value, + checkOutStatus: afternoonStatus.value, reason: reason.value, }; - dialogConfirm($q, async () => { - console.log(body); - success($q, "บันทึกข้อมูลสำเร็จ"); - props.close?.(); + dialogConfirm($q, async () => { + showLoader(); + await http + .put(config.API.leaveEditCheckin(props.detail?.id), body) + .then(() => { + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + props.fetchData?.(); + props.close?.(); + }); }); } } diff --git a/src/modules/09_leave/components/1_Work/Tab1.vue b/src/modules/09_leave/components/1_Work/Tab1.vue index ec4859380..0629258b9 100644 --- a/src/modules/09_leave/components/1_Work/Tab1.vue +++ b/src/modules/09_leave/components/1_Work/Tab1.vue @@ -206,6 +206,7 @@ onMounted(async () => { :maxPage="maxPage" @update:pagination="updatePaging" :tab="'time-record'" + :fetchData="fetchListTimeRecord" /> diff --git a/src/modules/09_leave/components/1_Work/TableList.vue b/src/modules/09_leave/components/1_Work/TableList.vue index 9c52c2e43..e286ee364 100644 --- a/src/modules/09_leave/components/1_Work/TableList.vue +++ b/src/modules/09_leave/components/1_Work/TableList.vue @@ -39,6 +39,10 @@ const props = defineProps({ type: String, require: true, }, + fetchData: { + type: Function, + require: true, + }, }); const emit = defineEmits(["update:pagination"]); @@ -203,6 +207,11 @@ onMounted(() => { :close="closeDetail" /> - + From cd06223e26aea77a8ed3e9931fbf2e90bd95ea8d Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 9 Jan 2024 16:46:17 +0700 Subject: [PATCH 4/5] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20UI?= =?UTF-8?q?=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82=E0=B8=AA?= =?UTF-8?q?=E0=B8=96=E0=B8=B2=E0=B8=99=E0=B8=B0=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B9=80=E0=B8=82=E0=B9=89=E0=B8=B2-=E0=B8=AD=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/09_leave/components/1_Work/DialogEdit.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/09_leave/components/1_Work/DialogEdit.vue b/src/modules/09_leave/components/1_Work/DialogEdit.vue index 767f3ea06..8e74947e9 100644 --- a/src/modules/09_leave/components/1_Work/DialogEdit.vue +++ b/src/modules/09_leave/components/1_Work/DialogEdit.vue @@ -96,7 +96,7 @@ watch(