From 66124a819d7676a180e4b53fff86769a4136de3a Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 4 Dec 2023 14:28:17 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Complaint/EditPage.vue | 1 + .../components/1_Complaint/Form.vue | 12 +- .../2_InvestigateFacts/EditPage.vue | 44 ++- .../components/2_InvestigateFacts/Form.vue | 3 + .../3_InvestigateDisciplinary/EditPage.vue | 4 + .../3_InvestigateDisciplinary/Form.vue | 361 +++++++++--------- .../components/PopupSendToNext.vue | 4 +- .../store/InvestigateDisStore.ts | 4 +- .../store/InvestigateFactStore.ts | 2 +- 9 files changed, 246 insertions(+), 189 deletions(-) diff --git a/src/modules/11_discipline/components/1_Complaint/EditPage.vue b/src/modules/11_discipline/components/1_Complaint/EditPage.vue index 961952540..535b74d34 100644 --- a/src/modules/11_discipline/components/1_Complaint/EditPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/EditPage.vue @@ -297,6 +297,7 @@ function confirmCancelInvestigate() { }) .finally(() => { hideLoader(); + success($q, "ยกเลิกยุติเรื่องสำเร็จ"); }); } diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index 6ffb3223f..26e9f4df4 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -185,7 +185,7 @@ function onSubmit() { async () => { if (mainStore.rowsAdd) { formData.persons = await mainStore.rowsAdd; - } + } await props.onSubmit(formData); isSave.value = false; }, @@ -624,6 +624,7 @@ onMounted(() => { ref="dateReceivedRef" outlined dense + :input-style="isReadonly ? { color: 'teal' }:{color:'black'}" :readonly="isReadonly" hide-bottom-space class="full-width datepicker" @@ -700,6 +701,7 @@ onMounted(() => { for="inputDateconsideration" ref="dateConsiderationRef" outlined + :input-style="isReadonly ? { color: 'teal' }:{color:'black'}" dense class="full-width datepicker" :model-value=" @@ -708,11 +710,10 @@ onMounted(() => { : null " :readonly="isReadonly" - label="วันที่กำหนดวันพิจารณา" + label="วันที่กำหนดพิจารณา" hide-bottom-space :rules="[ - (val) => - !!val || `${'กรุณาเลือกวันที่กำหนดวันพิจารณา'}`, + (val) => !!val || `${'กรุณาเลือกวันที่กำหนดพิจารณา'}`, ]" lazy-rules > @@ -773,6 +774,7 @@ onMounted(() => { for="inputDatewarn" ref="dateNotificationRef" outlined + :input-style="isReadonly ? { color: 'teal' }:{color:'black'}" dense :readonly="isReadonly" hide-bottom-space @@ -997,4 +999,4 @@ onMounted(() => { min-height: 25px; } -@/modules/11_discipline/store/store \ No newline at end of file +@/modules/11_discipline/store/store diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue index 563328d3a..7384801a5 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue @@ -2,7 +2,7 @@ import { onMounted, reactive, ref, watch } from "vue"; import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง -import { useRoute } from "vue-router"; +import { useRouter, useRoute } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore"; import { useDisciplineMainStore } from "@/modules/11_discipline/store/main"; @@ -25,6 +25,7 @@ const mixin = useCounterMixin(); const store = useInvestigateFactStore(); const { dialogConfirm, showLoader, success, hideLoader, messageError } = mixin; const route = useRoute(); +const router = useRouter(); const id = ref(route.params.id as string); /** ข้อมูล v-model ของฟอร์มสืบสวน */ @@ -138,9 +139,11 @@ function getData() { .get(config.API.investigateById(id.value)) .then((res) => { const dataList = res.data.result; + console.log(dataList) data.id = dataList.id; data.idComplaint = dataList.idComplaint; data.respondentType = dataList.respondentType; + data.organizationId = dataList.organizationId; data.persons = dataList.persons; data.investigationDetail = dataList.investigationDetail; data.investigationDetailOther = dataList.investigationDetailOther; @@ -157,6 +160,7 @@ function getData() { data.investigationStatusResult = dataList.investigationStatusResult; data.investigationExtendStatus = dataList.investigationExtendStatus; data.investigationDaysExtend = dataList.investigationDaysExtend; + console.log(dataList) }) .catch((e) => { messageError($q, e); @@ -193,13 +197,33 @@ async function onSubmit(data: any) { const modalPopup = ref(false); /** ยืนยัน ส่งไปสอบสวน */ function sentInvestigate() { - modalPopup.value = true; - // dialogConfirm( - // $q, - // () => confirmSentInvestigate(), - // "ยืนยันส่งไปสอบสวน", - // "ต้องการยืนยันส่งไปสอบสวนใช่หรือไม่?" - // ); + if (mainStore.rowsAdd.length > 0) { + modalPopup.value = true; + } else { + dialogConfirm( + $q, + () => sentConfirmNoPerson(), + "ยืนยันส่งไปสอบสวน", + "ต้องการยืนยันส่งไปสอบสวนใช่หรือไม่?" + ); + } +} + +function sentConfirmNoPerson() { + showLoader(); + http + .put(config.API.investigateApprove(id.value), { + persons: [], + }) + .then((res) => {}) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + getData(); + router.push(`/discipline/investigatefacts`) + }); } function closePopup() { @@ -237,12 +261,13 @@ function confirmEndInvestigate() { http .get(config.API.investigateReject(id.value)) .then((res) => { - success($q, "บันทึกข้อมูลสำเร็จ"); + }) .catch((e) => { messageError($q, e); }) .finally(async () => { + success($q, "ยุติเรื่องสำเร็จ"); await getData(); }); } @@ -260,6 +285,7 @@ function confirmCancelInvestigate() { }) .finally(() => { hideLoader(); + success($q, "ยกเลิกยุติเรื่องสำเร็จ"); }); } diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index 1a3044035..6ac48141d 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -219,6 +219,7 @@ watch(props.data, async () => { isUpdate.value = true; formData.id = props.data.id; formData.complaint = props.data.complaint; + formData.organizationId = props.data.organizationId; formData.respondentType = props.data.respondentType; formData.complaintdetail = props.data.complaintdetail; formData.investigationDescription = props.data.investigationDescription; @@ -764,6 +765,7 @@ onMounted(async () => { for="#date" class="full-width cursor-pointer" ref="dateRef" + :input-style="isReadonly ? { color: 'teal' }:{color:'black'}" :readonly="isReadonly" outlined dense @@ -850,6 +852,7 @@ onMounted(async () => { @@ -997,7 +1015,7 @@ onMounted(async () => { { + -
{ @update:pagination="updatePaging" @returnDirector="returnDirector" /> - \ No newline at end of file + diff --git a/src/modules/11_discipline/components/PopupSendToNext.vue b/src/modules/11_discipline/components/PopupSendToNext.vue index 89c69fbd2..0383e0f6b 100644 --- a/src/modules/11_discipline/components/PopupSendToNext.vue +++ b/src/modules/11_discipline/components/PopupSendToNext.vue @@ -67,8 +67,8 @@ function onclickSend() { emit("returnPerson", selected.value); props.close?.(); }, - `ยืนยันการส่ง${props.title}`, - `ต้องการยืนยันการส่ง${props.title}หรือไม่` + `ยืนยันการ${props.title}`, + `ต้องการยืนยันการ${props.title}หรือไม่` ); } diff --git a/src/modules/11_discipline/store/InvestigateDisStore.ts b/src/modules/11_discipline/store/InvestigateDisStore.ts index 49d327240..2281449f2 100644 --- a/src/modules/11_discipline/store/InvestigateDisStore.ts +++ b/src/modules/11_discipline/store/InvestigateDisStore.ts @@ -151,7 +151,7 @@ export const useInvestigateDisStore = defineStore( { name: "title", align: "left", - label: "เรื่อง", + label: "เรื่องร้องเรียน", sortable: true, field: "title", headerStyle: "font-size: 14px", @@ -160,7 +160,7 @@ export const useInvestigateDisStore = defineStore( { name: "respondentType", align: "left", - label: "ผู้ถูกสืบสวน", + label: "ผู้ถูกสอบสวน", sortable: true, field: "respondentType", headerStyle: "font-size: 14px", diff --git a/src/modules/11_discipline/store/InvestigateFactStore.ts b/src/modules/11_discipline/store/InvestigateFactStore.ts index ae88f08a0..b4ccac301 100644 --- a/src/modules/11_discipline/store/InvestigateFactStore.ts +++ b/src/modules/11_discipline/store/InvestigateFactStore.ts @@ -92,7 +92,7 @@ export const useInvestigateFactStore = defineStore( { name: "respondentType", align: "left", - label: "ผู้ถูกสอบสวน", + label: "ผู้ถูกสืบสวน", sortable: true, field: "respondentType", headerStyle: "font-size: 14px",