diff --git a/src/api/11_discipline/api.discipline.ts b/src/api/11_discipline/api.discipline.ts index e9731bf54..978f0447d 100644 --- a/src/api/11_discipline/api.discipline.ts +++ b/src/api/11_discipline/api.discipline.ts @@ -16,8 +16,9 @@ export default { /**ลบ ช่องทางการร้องเรียน * @param id type */ - complaintListOp:()=>`${disciplineMain}/complaint_Channel`, - complaintChannelbyId: (id: string) => `${disciplineMain}/complaint_Channel/${id}`, + complaintListOp: () => `${disciplineMain}/complaint_Channel`, + complaintChannelbyId: (id: string) => + `${disciplineMain}/complaint_Channel/${id}`, complaintAdd: () => `${disciplineMain}/complaint`, complaintbyId: (id: string) => `${disciplineMain}/complaint/${id}`, complaintReject: (id: string) => `${disciplineMain}/complaint/reject/${id}`, @@ -46,7 +47,7 @@ export default { investigateReject: (id: string) => `${investigate}/reject/${id}`, investigateResume: (id: string) => `${investigate}/resume/${id}`, investigateApprove: (id: string) => `${investigate}/approve/${id}`, - + investigateCalendar: () => `${investigate}/calendar`, /** ระบบวินัยเรื่องสอบสวน */ disciplineDisciplinary: () => `${discipline}`, @@ -62,16 +63,18 @@ export default { disciplinaryResume: (id: string) => `${discipline}/resume/${id}`, disciplinaryApprove: (id: string) => `${discipline}/approve/${id}`, disciplinarySuspend: (id: string) => `${discipline}/suspend/${id}`, + disciplinaryCalendar: () => `${discipline}/calendar`, /** รายการผลการพิจารณาทางวินัย*/ listResult: () => `${disciplineMain}/result`, listResultById: (id: string) => `${disciplineMain}/result/${id}`, /** ผู้ถูกพักราชการ */ - suspendMain:(page: number, pageSize: number, keyword: string) => `${suspend}?page=${page}&pageSize=${pageSize}&keyword=${keyword}`, + suspendMain: (page: number, pageSize: number, keyword: string) => + `${suspend}?page=${page}&pageSize=${pageSize}&keyword=${keyword}`, suspendById: (id: string) => `${suspend}/${id}`, suspendReport: () => `${suspend}/report`, - reportresult:(id:string)=>`${disciplineMain}/result/report/${id}`, + reportresult: (id: string) => `${disciplineMain}/result/report/${id}`, }; 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/CalandarDialog.vue b/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue index 085d41dda..59df5232c 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue @@ -14,39 +14,26 @@ 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..a061b9dd9 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Calendar.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Calendar.vue @@ -7,17 +7,22 @@ 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; - -import type { DataDateMonthObject } from "@/modules/09_leave/interface/response/leave"; +const { monthYear2Thai, showLoader, hideLoader, messageError } = mixin; +const $q = useQuasar(); /** * Option ของปฏิทิน */ + const fullCalendar = ref(); //ref calendar const calendarOptions = ref({ plugins: [ @@ -47,64 +52,7 @@ const calendarOptions = ref({ eventBorderColor: "#50a5fc", displayEventTime: false, editable: true, - events: [ - { - groupId: "3", - title: "ลากิจส่วนตัว", - start: "2023-10-10", - allDay: true, - status: "done", - color: "#E3FDDA", - }, - { - groupId: "3", - title: "ลากิจส่วนตัว", - start: "2023-11-10", - allDay: true, - status: "done", - color: "#E3FDDA", - }, - { - groupId: "3", - title: "ลากิจส่วนตัว", - start: "2023-10-11", - allDay: true, - status: "done", - color: "#E3FDDA", - }, - { - groupId: "3", - title: "ลากิจส่วนตัว", - start: "2023-10-12", - allDay: true, - status: "done", - color: "#E3FDDA", - }, - { - groupId: "3", - title: "ลากิจส่วนตัว", - start: "2023-10-13", - allDay: true, - status: "done", - color: "#E3FDDA", - }, - { - groupId: "2", - title: "ลาป่วย", - start: "2023-10-19", - allDay: true, - status: "proceed", - color: "#e4f3ff", - }, - { - groupId: "1", - title: "ลาป่วย", - start: "2023-10-20", - allDay: true, - status: "new", - color: "#FFF1CC", - }, - ], + events: [], }); /** @@ -123,41 +71,64 @@ const reason = ref("ยกเลิกการลา"); const model = ref(null); const modeCancel = ref(true); +async function fetchCalendar() { + showLoader(); + await http + .post(config.API.investigateCalendar(), { + year: dateMonth.value.year, + mounth: dateMonth.value.month, + }) + .then((res) => { + console.log(res); + const data = [ + { + groupId: "2", + title: "ลากิจส่วนตัว", + start: "2023-12-12", + end: "2024-01-02", + allDay: true, + status: "done", + color: "#E3FDDA", + }, + ]; + calendarOptions.value.events = data; + }) + .catch((err) => { + messageError($q, err); + }) + .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(); }); +/** function เปลี่ยนปฎิทิน*/ function changCalendar() { - const calen = fullCalendar.value.getApi(); - const date = new Date(dateMonth.value.year, dateMonth.value.month); - calen.gotoDate(date); + fetchCalendar(); } -/** - * ค่า 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 +139,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(), @@ -261,7 +212,7 @@ const monthYearThai = (val: DataDateMonthObject) => {
{{ arg.event.title }}
- { round size="8px" @click="cancel(arg.event.title)" - /> + /> -->
-
+ +
{ name="mdi-circle" class="q-mr-sm" /> - สถานะอยู่ระหว่างดำเนินการ + สืบสวน
-
+
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 () => { 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/EditPage.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue index c143a0bb9..5712f444f 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue @@ -228,12 +228,14 @@ function confirmEndInvestigate() { showLoader(); http .get(config.API.disciplinaryReject(id.value)) - .then((res) => {}) + .then((res) => { + success($q, "ยุติเรื่องสำเร็จ"); + }) .catch((e) => { messageError($q, e); }) .finally(() => { - success($q, "ยุติเรื่องสำเร็จ"); + fetchDetailDisciplinary(); }); } diff --git a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue index ee22ac3cc..c4b2cbebd 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue @@ -690,7 +690,7 @@ onMounted(async () => { outlined dense :input-style=" - isReadonly ? { color: 'teal' } : { color: 'black' } + isReadonly ? { color: 'black' } : { color: 'teal' } " class="col-xs-12 col-sm-4" hide-bottom-space @@ -742,7 +742,7 @@ onMounted(async () => { ref="disciplinaryDateAllegationRef" outlined :input-style=" - isReadonly ? { color: 'teal' } : { color: 'black' } + isReadonly ? { color: 'black' } : { color: 'teal' } " dense class="col-xs-12 col-sm-4" @@ -830,8 +830,8 @@ onMounted(async () => { outlined :input-style=" isReadonly - ? { color: 'teal' } - : { color: 'black' } + ? { color: 'black' } + : { color: 'teal' } " dense lazy-rules @@ -924,8 +924,8 @@ onMounted(async () => { lazy-rules :input-style=" isReadonly - ? { color: 'teal' } - : { color: 'black' } + ? { color: 'black' } + : { color: 'teal' } " hide-bottom-space borderless @@ -986,7 +986,7 @@ onMounted(async () => { class="full-width" hide-bottom-space :input-style=" - isReadonly ? { color: 'teal' } : { color: 'black' } + isReadonly ? { color: 'black' } : { color: 'teal' } " :model-value=" formData.disciplinaryDateEvident != null @@ -1038,7 +1038,7 @@ onMounted(async () => { ref="disciplinaryDateResultRef" outlined :input-style=" - isReadonly ? { color: 'teal' } : { color: 'black' } + isReadonly ? { color: 'black' } : { color: 'teal' } " dense class="full-width" 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 @@