From 18e1e0d2bd4d475eb91079b4137935ff319294cf Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Tue, 21 Nov 2023 10:29:11 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=A7=E0=B8=B4?= =?UTF-8?q?=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/EditPage.vue | 37 ++ .../2_InvestigateFacts/EditPage.vue | 30 +- .../components/2_InvestigateFacts/Form.vue | 353 +++++++++--------- .../3_InvestigateDisciplinary/EditPage.vue | 68 ++-- 4 files changed, 277 insertions(+), 211 deletions(-) diff --git a/src/modules/11_discipline/components/1_Complaint/EditPage.vue b/src/modules/11_discipline/components/1_Complaint/EditPage.vue index e62edf161..4429996c0 100644 --- a/src/modules/11_discipline/components/1_Complaint/EditPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/EditPage.vue @@ -2,11 +2,16 @@ import { onMounted, reactive, ref } from "vue"; import Form from "@/modules/11_discipline/components/1_Complaint/Form.vue"; import { useRouter, useRoute } from "vue-router"; +import { useQuasar } from "quasar"; import type { FormData, ArrayPerson, } from "@/modules/11_discipline/interface/request/complaint"; +import { useCounterMixin } from "@/stores/mixin"; +const $q = useQuasar(); +const mixin = useCounterMixin() +const { dialogConfirm } = mixin const router = useRouter(); const route = useRoute(); const id = ref(route.params.id as string); @@ -75,6 +80,35 @@ async function onSubmit() { router.push(`/discipline/complaints`); } +/** ยืนยัน มีมูลส่งไปสืบสวน */ +function sentInvestigate(){ + dialogConfirm($q,()=> confirmSentInvestigate(),'ยืนยันส่งไปสืบสวน','ต้องการยืนยันส่งไปสืบสวนใช่หรือไม่?') +} + +/** ยืนยัน ยุติเรื่อง */ +function endInvestigate(){ + dialogConfirm($q,()=> confirmEndInvestigate(),'ยืนยันยุติเรื่อง','ต้องการยืนยันยุติเรื่องใช่หรือไม่?') +} + +/** ยืนยัน ยกเลิกการยุติเรื่อง */ +function cancelInvestigate(){ + dialogConfirm($q,()=> confirmCancelInvestigate(),'ยืนยันยกเลิกการยุติเรื่อง','ต้องการยืนยันยกเลิกการยุติเรื่องใช่หรือไม่?') +} + +/** ฟังชั่น มีมูลส่งไปสืบสวน*/ +function confirmSentInvestigate(){ + console.log('sent') +} + +/** ฟังชั่น ยุติเรื่อง*/ +function confirmEndInvestigate(){ + console.log('sent') +} + +/** ฟังชั่น ยกเลิกการยุติเรื่อง*/ +function confirmCancelInvestigate(){ + console.log('sent') +} /** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */ onMounted(() => { console.log(data); @@ -101,16 +135,19 @@ onMounted(() => { v-if="data.complaintStatus === 'NEW'" label="มีมูลส่งไปสืบสวน" color="public" + @click="sentInvestigate" /> diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue index 792bc8fb5..402afa4b0 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue @@ -3,7 +3,12 @@ import { onMounted, reactive, ref } from "vue"; import Form from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; import type { FormData } from "@/modules/11_discipline/interface/request/investigate"; import { useRouter, useRoute } from "vue-router"; +import { useCounterMixin } from "@/stores/mixin"; +import { useQuasar } from "quasar"; +const $q = useQuasar() +const mixin = useCounterMixin() +const { dialogConfirm } = mixin const router = useRouter(); const route = useRoute(); const id = ref(route.params.id as string); @@ -45,7 +50,6 @@ const fetchData = async () => { data.daysExtend = null; data.statusResult = "ไม่ระบุ"; data.causeText = ""; - data.complaintStatus = "NEW"; }; /** @@ -58,6 +62,16 @@ async function onSubmit(id:string){ router.push(`/discipline/investigatefacts`); }; +/** ยืนยัน ส่งไปสอบสวน */ +function sentInvestigate(){ + dialogConfirm($q,()=> confirmSentInvestigate(),'ยืนยันส่งไปสอบสวน','ต้องการยืนยันส่งไปสอบสวนใช่หรือไม่?') +} + +/** ฟังชั่น ส่งไปสอบสวน*/ +function confirmSentInvestigate(){ + console.log('sent') +} + /** โหลดข้อมูลเมื่อเข้าหน้านี้ */ onMounted(() => { fetchData(); @@ -81,19 +95,9 @@ onMounted(() => {
- -
diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index 8cd3a852b..ae1fb1ade 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -13,10 +13,10 @@ import { diffDates } from "@fullcalendar/core/internal"; const $q = useQuasar(); /**เรียกใช้ store */ -const investigateFactStore = useInvestigateFactStore(); -const mixin = useCounterMixin(); -const { filterFnOptionsType } = investigateFactStore; -const { date2Thai, dialogConfirm } = mixin; +const investigateFactStore = useInvestigateFactStore(); +const mixin = useCounterMixin(); +const { filterFnOptionsType } = investigateFactStore; +const { date2Thai, dialogConfirm } = mixin; const complaintsOptions = ref([]); const isUpdate = ref(false); @@ -65,7 +65,7 @@ const formData = reactive({ daysExtend: null, statusResult: "ยังไม่ระบุ", causeText: "", - complaintStatus:'' + complaintStatus: "", }); /** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ @@ -132,7 +132,7 @@ function calEndDate(val: string) { formData.dateEnd = new Date(dateNew.setDate(date.getDate() + Number(val))); } -/** +/** * เช็คข้อมูลจาก props * เมื่อมีข้อมูล * เก็บข้อมูลลง formData @@ -158,9 +158,9 @@ watch(props.data, async () => { }); + -
- -
+
+ +
-
- + +
-
- วันที่สืบสวน - -
+ วันที่สืบสวน + +
+
+
+
+
-
- -
-
{ +
+
{ - +
+ +
{
- -
+
+ +
-
- -
+
+ +
-
- - - -
+
+ + + +
-
- -
+
+ +
-
- + + + +
+ +
+
+ - - -
- -
-
- - -
+ > + +
-
- - -
+
+ +
+
diff --git a/src/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue index c37eb7b45..14be718e6 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue @@ -3,12 +3,15 @@ import { onMounted, reactive, ref } from "vue"; import Form from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue"; import type { FormData } from "@/modules/11_discipline/interface/request/disciplinary"; import { useRouter, useRoute } from "vue-router"; - +import { useCounterMixin } from "@/stores/mixin"; +import { useQuasar } from "quasar"; +const $q = useQuasar(); +const mixin = useCounterMixin(); +const { dialogConfirm } = mixin; const router = useRouter(); const route = useRoute(); const id = ref(route.params.id as string); - /** ข้อมูล v-model ของฟอร์ม */ const data = reactive({ complaint: "", @@ -34,36 +37,51 @@ const data = reactive({ /** จำลองข้อมูลจาก api */ const fetchData = async () => { - data.complaint = "test1" - data.dateInvestigate = new Date("2023-11-08T14:58:00") - data.dateAllegation = new Date("2023-11-08T14:58:00") - data.dateEvident = new Date("2023-11-08T14:58:00") - data.casefault = "test1" - data.typefault = "2" - data.faultLevel = "2" - data.refLaw = "test" - data.detailComplaint = "รายละเอียด" - data.whereInvestigate = "ที่ไหน" - data.trueDetail = "รายละเอียด" - data.evidence = "รายละเอียด" - data.recordAccuser = "รายละเอียด" - data.witnesses = "รายละเอียด" - data.InvestResults = "รายละเอียด" - data.filesEvidence = null - data.filesRecordAccuser = null - data.filesWitnesses = null - data.filesEtc = null + data.complaint = "test1"; + data.dateInvestigate = new Date("2023-11-08T14:58:00"); + data.dateAllegation = new Date("2023-11-08T14:58:00"); + data.dateEvident = new Date("2023-11-08T14:58:00"); + data.casefault = "test1"; + data.typefault = "2"; + data.faultLevel = "2"; + data.refLaw = "test"; + data.detailComplaint = "รายละเอียด"; + data.whereInvestigate = "ที่ไหน"; + data.trueDetail = "รายละเอียด"; + data.evidence = "รายละเอียด"; + data.recordAccuser = "รายละเอียด"; + data.witnesses = "รายละเอียด"; + data.InvestResults = "รายละเอียด"; + data.filesEvidence = null; + data.filesRecordAccuser = null; + data.filesWitnesses = null; + data.filesEtc = null; }; /** * บันทึกข้อมูลที่เเก้ไข * @param id ระบุ บุคคล */ -const onSubmit = async (id:string) => { +const onSubmit = async (id: string) => { console.log("edit"); router.push(`/discipline/disciplinary`); }; +/** ยืนยัน ส่งไปออกคำสั่ง */ +function sentIssue() { + dialogConfirm( + $q, + () => confirmSentIssue(), + "ยืนยันส่งไปออกคำสั่ง", + "ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?" + ); +} + +/** ฟังชั่น ส่งไปออกคำสั่ง*/ +function confirmSentIssue() { + console.log("sent"); +} + /** โหลดข้อมูลเมื่อเข้าหน้านี้ */ onMounted(() => { fetchData(); @@ -82,7 +100,11 @@ onMounted(() => { class="q-mr-sm" @click="$router.push(`/discipline/disciplinary`)" /> - แก้ไขการสอบสวนความผิดทางวินัย {{ id }}#id +
แก้ไขการสอบสวนความผิดทางวินัย {{ id }}#id
+ +
+ +