From fd200ca7b3fef89cfe059eb839c344fea19ff981 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 6 Dec 2023 10:02:18 +0700 Subject: [PATCH 1/3] =?UTF-8?q?calendar=20=E0=B8=A7=E0=B8=B4=E0=B8=99?= =?UTF-8?q?=E0=B8=B1=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2_InvestigateFacts/CalandarDialog.vue | 48 ++++++++--------- .../2_InvestigateFacts/Calendar.vue | 51 +++++-------------- 2 files changed, 39 insertions(+), 60 deletions(-) diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue b/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue index 085d41dda..b7faab59d 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue @@ -14,26 +14,28 @@ const props = defineProps({ }); + + + diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Calendar.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Calendar.vue index ba2503546..24beb865d 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Calendar.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Calendar.vue @@ -11,13 +11,14 @@ import listPlugin from "@fullcalendar/list"; import { useCounterMixin } from "@/stores/mixin"; const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { monthYear2Thai } = mixin; +const { monthYear2Thai, showLoader, hideLoader } = mixin; import type { DataDateMonthObject } from "@/modules/09_leave/interface/response/leave"; /** * Option ของปฏิทิน */ + const fullCalendar = ref(); //ref calendar const calendarOptions = ref({ plugins: [ @@ -127,37 +128,33 @@ const modeCancel = ref(true); * เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้ */ onMounted(async () => { - if (fullCalendar !== undefined) { - const calen = fullCalendar.value.getApi(); - const date = new Date(dateMonth.value.year, dateMonth.value.month); - calen.gotoDate(date); - } + showLoader(); + setTimeout(() => { + if (fullCalendar !== undefined) { + const calen = fullCalendar.value.getApi(); + const date = new Date(dateMonth.value.year, dateMonth.value.month); + calen.gotoDate(date); + } + hideLoader(); + }, 1000); }); +/** function เปลี่ยนปฎิทิน*/ function changCalendar() { const calen = fullCalendar.value.getApi(); const date = new Date(dateMonth.value.year, dateMonth.value.month); calen.gotoDate(date); } -/** - * ค่า props(วันเดือนปีที่เลือก) ตอนอัพเดท ค่าฏิทินให้อัพเดทใหม่ - */ -// watch(props, async (count, prevCount) => { -// const calen = fullCalendar.value.getApi(); -// const date = new Date(props.dateYear, props.dateMonth); -// calen.gotoDate(date); -// }); - /** * ฟังก์ชั่นยกเลิก model * @param text */ -const cancel = async (text: string) => { +async function cancel(text: string) { title.value = text; modalCancel.value = true; modeCancel.value = true; -}; +} /** * ฟังก์ชั่นเปิด model * @param text @@ -168,26 +165,6 @@ const view = async (text: string) => { modeCancel.value = false; }; -// filter calendar left -const filterLists = ref([ - { - id: "x1", - name: "นางสาววารุณี แต้มคู", - color: "green", - }, - { - id: "x2", - name: "นางสาวสมศรี ใจดี", - color: "grey", - }, - { - id: "x3", - name: "นายสมชาย สุขใจ", - color: "grey", - }, -]); -const filterVal = ref(["x1"]); - const dateMonth = ref({ month: new Date().getMonth(), year: new Date().getFullYear(), From c4a341531660300e8270184742aee092b33169b4 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 6 Dec 2023 10:46:52 +0700 Subject: [PATCH 2/3] =?UTF-8?q?=E0=B9=80=E0=B9=80=E0=B8=81=E0=B9=89=20?= =?UTF-8?q?=E0=B8=A7=E0=B8=B4=E0=B8=99=E0=B8=B1=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Complaint/Form.vue | 6 +++--- .../components/2_InvestigateFacts/EditPage.vue | 11 +++++------ .../components/2_InvestigateFacts/Form.vue | 4 ++-- .../3_InvestigateDisciplinary/EditPage.vue | 6 ++++-- .../3_InvestigateDisciplinary/Form.vue | 16 ++++++++-------- .../11_discipline/components/PopupSendToNext.vue | 7 +++++-- 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index 26e9f4df4..0004ca486 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -624,7 +624,7 @@ onMounted(() => { ref="dateReceivedRef" outlined dense - :input-style="isReadonly ? { color: 'teal' }:{color:'black'}" + :input-style="isReadonly ? { color: 'black' }:{color:'teal'}" :readonly="isReadonly" hide-bottom-space class="full-width datepicker" @@ -701,7 +701,7 @@ onMounted(() => { for="inputDateconsideration" ref="dateConsiderationRef" outlined - :input-style="isReadonly ? { color: 'teal' }:{color:'black'}" + :input-style="isReadonly ? { color: 'black' }:{color:'teal'}" dense class="full-width datepicker" :model-value=" @@ -774,7 +774,7 @@ onMounted(() => { for="inputDatewarn" ref="dateNotificationRef" outlined - :input-style="isReadonly ? { color: 'teal' }:{color:'black'}" + :input-style="isReadonly ? { color: 'black' }:{color:'teal'}" dense :readonly="isReadonly" hide-bottom-space diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue index 7384801a5..964d3274d 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue @@ -139,7 +139,7 @@ function getData() { .get(config.API.investigateById(id.value)) .then((res) => { const dataList = res.data.result; - console.log(dataList) + console.log(dataList); data.id = dataList.id; data.idComplaint = dataList.idComplaint; data.respondentType = dataList.respondentType; @@ -160,7 +160,7 @@ function getData() { data.investigationStatusResult = dataList.investigationStatusResult; data.investigationExtendStatus = dataList.investigationExtendStatus; data.investigationDaysExtend = dataList.investigationDaysExtend; - console.log(dataList) + console.log(dataList); }) .catch((e) => { messageError($q, e); @@ -222,7 +222,7 @@ function sentConfirmNoPerson() { .finally(() => { hideLoader(); getData(); - router.push(`/discipline/investigatefacts`) + router.push(`/discipline/investigatefacts`); }); } @@ -261,13 +261,12 @@ function confirmEndInvestigate() { http .get(config.API.investigateReject(id.value)) .then((res) => { - + success($q, "ยุติเรื่องสำเร็จ"); }) .catch((e) => { messageError($q, e); }) .finally(async () => { - success($q, "ยุติเรื่องสำเร็จ"); await getData(); }); } @@ -407,4 +406,4 @@ watch( padding: 0; background-color: #f0f3f3; } - \ No newline at end of file + diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index 6ac48141d..3c8b525f3 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -765,7 +765,7 @@ onMounted(async () => { for="#date" class="full-width cursor-pointer" ref="dateRef" - :input-style="isReadonly ? { color: 'teal' }:{color:'black'}" + :input-style="isReadonly ? { color: 'black' }:{color:'teal'}" :readonly="isReadonly" outlined dense @@ -852,7 +852,7 @@ onMounted(async () => {
-
+ +
{ name="mdi-circle" class="q-mr-sm" /> - สถานะอยู่ระหว่างดำเนินการ + สืบสวน
-
+
diff --git a/src/modules/11_discipline/components/3_InvestigateDisciplinary/CalandarDialog.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/CalandarDialog.vue index 085d41dda..0666fd8fe 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/CalandarDialog.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/CalandarDialog.vue @@ -1,6 +1,6 @@ + + + diff --git a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Calendar.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Calendar.vue index ba2503546..432e01e2d 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Calendar.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Calendar.vue @@ -7,13 +7,18 @@ import timeGridPlugin from "@fullcalendar/timegrid"; import interactionPlugin from "@fullcalendar/interaction"; import allLocales from "@fullcalendar/core/locales-all"; import listPlugin from "@fullcalendar/list"; +import { useQuasar } from "quasar"; +import config from "@/app.config"; +import http from "@/plugins/http"; + +import type { DataDateMonthObject } from "@/modules/09_leave/interface/response/leave"; import { useCounterMixin } from "@/stores/mixin"; const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { monthYear2Thai } = mixin; +const { monthYear2Thai, showLoader, hideLoader, messageError } = mixin; -import type { DataDateMonthObject } from "@/modules/09_leave/interface/response/leave"; +const $q = useQuasar(); /** * Option ของปฏิทิน @@ -123,21 +128,48 @@ const reason = ref("ยกเลิกการลา"); const model = ref(null); const modeCancel = ref(true); +async function fetchCalendar() { + showLoader(); + await http + .post(config.API.disciplinaryCalendar(), { + year: dateMonth.value.year, + mouth: dateMonth.value.month, + }) + .then((res) => { + console.log(res); + }) + .catch((err) => { + messageError($q); + }) + .finally(() => { + setTimeout(() => { + if (fullCalendar !== undefined) { + const calen = fullCalendar.value.getApi(); + const date = new Date(dateMonth.value.year, dateMonth.value.month); + calen.gotoDate(date); + } + hideLoader(); + }, 1000); + }); +} + /** * เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้ */ onMounted(async () => { - if (fullCalendar !== undefined) { - const calen = fullCalendar.value.getApi(); - const date = new Date(dateMonth.value.year, dateMonth.value.month); - calen.gotoDate(date); - } + fetchCalendar(); + // if (fullCalendar !== undefined) { + // const calen = fullCalendar.value.getApi(); + // const date = new Date(dateMonth.value.year, dateMonth.value.month); + // calen.gotoDate(date); + // } }); function changCalendar() { - const calen = fullCalendar.value.getApi(); - const date = new Date(dateMonth.value.year, dateMonth.value.month); - calen.gotoDate(date); + fetchCalendar(); + // const calen = fullCalendar.value.getApi(); + // const date = new Date(dateMonth.value.year, dateMonth.value.month); + // calen.gotoDate(date); } /** @@ -274,7 +306,7 @@ const monthYearThai = (val: DataDateMonthObject) => {
-
+ +
{ name="mdi-circle" class="q-mr-sm" /> - สถานะอยู่ระหว่างดำเนินการ + สอบสวน
-
+
diff --git a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue index 9e516f714..ce8ff48e4 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue @@ -1,10 +1,10 @@