2023-11-06 15:13:36 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { onMounted, reactive, ref } from "vue";
|
2023-11-22 11:26:10 +07:00
|
|
|
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
|
|
|
|
import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง
|
2023-11-06 15:13:36 +07:00
|
|
|
import type { FormData } from "@/modules/11_discipline/interface/request/investigate";
|
|
|
|
|
import { useRouter, useRoute } from "vue-router";
|
2023-11-21 12:53:05 +07:00
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
2023-11-22 11:26:10 +07:00
|
|
|
import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore";
|
2023-11-21 10:29:11 +07:00
|
|
|
import { useQuasar } from "quasar";
|
2023-11-06 15:13:36 +07:00
|
|
|
|
2023-11-21 12:53:05 +07:00
|
|
|
const $q = useQuasar();
|
|
|
|
|
const mixin = useCounterMixin();
|
2023-11-22 11:26:10 +07:00
|
|
|
const store = useInvestigateFactStore();
|
2023-11-21 12:53:05 +07:00
|
|
|
const { dialogConfirm } = mixin;
|
2023-11-06 15:13:36 +07:00
|
|
|
const router = useRouter();
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
const id = ref<string>(route.params.id as string);
|
|
|
|
|
|
2023-11-10 13:35:26 +07:00
|
|
|
/** ข้อมูล v-model ของฟอร์ม */
|
2023-11-06 15:13:36 +07:00
|
|
|
const data = reactive<FormData>({
|
|
|
|
|
complaint: "",
|
|
|
|
|
complaintdetail: "",
|
|
|
|
|
detail: "",
|
|
|
|
|
fault: "",
|
|
|
|
|
other: "",
|
|
|
|
|
evidenceFiles: null,
|
|
|
|
|
fileComplaint: null,
|
|
|
|
|
clickTime: false,
|
|
|
|
|
date: null,
|
2023-11-08 15:25:01 +07:00
|
|
|
dateEnd: new Date(),
|
2023-11-06 15:13:36 +07:00
|
|
|
investigation: "",
|
2023-11-08 15:25:01 +07:00
|
|
|
daysExtend: null,
|
|
|
|
|
statusResult: "",
|
|
|
|
|
causeText: "",
|
2023-11-21 12:53:05 +07:00
|
|
|
complaintStatus: "NEW",
|
2023-11-06 15:13:36 +07:00
|
|
|
});
|
2023-11-08 15:25:01 +07:00
|
|
|
|
2023-11-10 13:35:26 +07:00
|
|
|
/** จำลองข้อมูลจาก api */
|
2023-11-06 15:13:36 +07:00
|
|
|
const fetchData = async () => {
|
|
|
|
|
// ดึงค่าจาก api
|
|
|
|
|
data.complaint = "เรื่องที่ 1";
|
|
|
|
|
data.complaintdetail = "รายละเอียด";
|
|
|
|
|
data.detail = "รายละเอียด";
|
|
|
|
|
data.fault = "001";
|
|
|
|
|
data.other = "";
|
|
|
|
|
data.evidenceFiles = null;
|
|
|
|
|
data.fileComplaint = null;
|
|
|
|
|
data.clickTime = false;
|
|
|
|
|
data.date = new Date("2023-11-07T14:58:00");
|
|
|
|
|
data.dateEnd = new Date("2023-11-08T14:58:00");
|
|
|
|
|
data.investigation = "002";
|
2023-11-08 15:25:01 +07:00
|
|
|
data.daysExtend = null;
|
|
|
|
|
data.statusResult = "ไม่ระบุ";
|
|
|
|
|
data.causeText = "";
|
2023-11-06 15:13:36 +07:00
|
|
|
};
|
|
|
|
|
|
2023-11-10 13:35:26 +07:00
|
|
|
/**
|
|
|
|
|
* บันทึกข้อมูลที่เเก้ไข
|
|
|
|
|
* @param id ระบุ บุคคล
|
|
|
|
|
*/
|
2023-11-21 12:53:05 +07:00
|
|
|
async function onSubmit(id: string) {
|
2023-11-06 15:13:36 +07:00
|
|
|
// put
|
2023-11-21 12:53:05 +07:00
|
|
|
console.log("edit", id);
|
2023-11-06 15:13:36 +07:00
|
|
|
router.push(`/discipline/investigatefacts`);
|
2023-11-21 12:53:05 +07:00
|
|
|
}
|
2023-11-10 13:35:26 +07:00
|
|
|
|
2023-11-21 10:29:11 +07:00
|
|
|
/** ยืนยัน ส่งไปสอบสวน */
|
2023-11-21 12:53:05 +07:00
|
|
|
function sentInvestigate() {
|
|
|
|
|
dialogConfirm(
|
|
|
|
|
$q,
|
|
|
|
|
() => confirmSentInvestigate(),
|
|
|
|
|
"ยืนยันส่งไปสอบสวน",
|
|
|
|
|
"ต้องการยืนยันส่งไปสอบสวนใช่หรือไม่?"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** ยืนยัน ยุติเรื่อง */
|
|
|
|
|
function endInvestigate() {
|
|
|
|
|
dialogConfirm(
|
|
|
|
|
$q,
|
|
|
|
|
() => confirmEndInvestigate(),
|
|
|
|
|
"ยืนยันยุติเรื่อง",
|
|
|
|
|
"ต้องการยืนยันยุติเรื่องใช่หรือไม่?"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** ยืนยัน ยกเลิกการยุติเรื่อง */
|
|
|
|
|
function cancelInvestigate() {
|
|
|
|
|
dialogConfirm(
|
|
|
|
|
$q,
|
|
|
|
|
() => confirmCancelInvestigate(),
|
|
|
|
|
"ยืนยันยกเลิกการยุติเรื่อง",
|
|
|
|
|
"ต้องการยืนยันยกเลิกการยุติเรื่องใช่หรือไม่?"
|
|
|
|
|
);
|
2023-11-21 10:29:11 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** ฟังชั่น ส่งไปสอบสวน*/
|
2023-11-21 12:53:05 +07:00
|
|
|
function confirmSentInvestigate() {
|
|
|
|
|
console.log("sent");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** ฟังชั่น ยุติเรื่อง*/
|
|
|
|
|
function confirmEndInvestigate() {
|
|
|
|
|
console.log("sent");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** ฟังชั่น ยกเลิกการยุติเรื่อง*/
|
|
|
|
|
function confirmCancelInvestigate() {
|
|
|
|
|
console.log("sent");
|
2023-11-21 10:29:11 +07:00
|
|
|
}
|
|
|
|
|
|
2023-11-10 13:35:26 +07:00
|
|
|
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
fetchData();
|
|
|
|
|
});
|
2023-11-06 15:13:36 +07:00
|
|
|
</script>
|
2023-11-08 15:25:01 +07:00
|
|
|
|
2023-11-06 15:13:36 +07:00
|
|
|
<template>
|
|
|
|
|
<div class="col-xs-12 col-sm-12 col-md-11">
|
|
|
|
|
<div class="toptitle col-12 row items-center">
|
|
|
|
|
<q-btn
|
|
|
|
|
icon="mdi-arrow-left"
|
|
|
|
|
unelevated
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
flat
|
|
|
|
|
color="primary"
|
|
|
|
|
class="q-mr-sm"
|
|
|
|
|
@click="$router.push(`/discipline/investigatefacts`)"
|
|
|
|
|
/>
|
2023-11-16 16:02:18 +07:00
|
|
|
<div class="q-ma-none">แก้ไขรายการสืบสวนข้อเท็จจริง {{ id }}#id</div>
|
|
|
|
|
<q-space />
|
|
|
|
|
<div class="q-gutter-x-sm">
|
|
|
|
|
<q-btn
|
2023-11-21 12:53:05 +07:00
|
|
|
v-if="data.complaintStatus === 'NEW'"
|
2023-11-21 10:29:11 +07:00
|
|
|
label="ส่งไปสอบสวน"
|
2023-11-16 16:02:18 +07:00
|
|
|
color="public"
|
2023-11-21 10:29:11 +07:00
|
|
|
@click="sentInvestigate"
|
2023-11-16 16:02:18 +07:00
|
|
|
/>
|
2023-11-21 12:53:05 +07:00
|
|
|
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="data.complaintStatus === 'NEW'"
|
|
|
|
|
label="ยุติเรื่อง"
|
|
|
|
|
color="red-7"
|
|
|
|
|
@click="endInvestigate"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="data.complaintStatus === 'STOP'"
|
|
|
|
|
label="ยกเลิกการยุติเรื่อง"
|
|
|
|
|
color="red-7"
|
|
|
|
|
@click="cancelInvestigate"
|
|
|
|
|
/>
|
2023-11-16 16:02:18 +07:00
|
|
|
</div>
|
2023-11-06 15:13:36 +07:00
|
|
|
</div>
|
2023-11-22 16:22:53 +07:00
|
|
|
<q-card flat class="col-12">
|
2023-11-22 11:26:10 +07:00
|
|
|
<q-tabs
|
|
|
|
|
v-model="store.tabMenu"
|
|
|
|
|
dense
|
|
|
|
|
align="left"
|
|
|
|
|
inline-label
|
|
|
|
|
class="rounded-borders"
|
|
|
|
|
indicator-color="primary"
|
|
|
|
|
active-bg-color="teal-1"
|
|
|
|
|
active-class="text-primary"
|
|
|
|
|
>
|
|
|
|
|
<q-tab name="complaints" label="เรื่องร้องเรียน" />
|
|
|
|
|
<q-tab name="investigatefacts" label="สืบสวนข้อเท็จจริง" />
|
|
|
|
|
</q-tabs>
|
|
|
|
|
<q-separator />
|
|
|
|
|
<q-tab-panels v-model="store.tabMenu" animated>
|
|
|
|
|
<q-tab-panel name="complaints">
|
|
|
|
|
<FormComplaints :on-submit="onSubmit" />
|
|
|
|
|
</q-tab-panel>
|
|
|
|
|
<q-tab-panel name="investigatefacts">
|
|
|
|
|
<FormInvestigatefacts :on-submit="onSubmit" :data="data" />
|
|
|
|
|
</q-tab-panel>
|
|
|
|
|
</q-tab-panels>
|
|
|
|
|
</q-card>
|
2023-11-06 15:13:36 +07:00
|
|
|
|
2023-11-22 11:26:10 +07:00
|
|
|
<!-- <Form :on-submit="onSubmit" :data="data" /> -->
|
2023-11-06 15:13:36 +07:00
|
|
|
</div>
|
|
|
|
|
</template>
|
2023-11-22 16:22:53 +07:00
|
|
|
<style scoped>
|
|
|
|
|
.q-tab-panel {
|
|
|
|
|
padding: 0;
|
|
|
|
|
background-color: #f0f3f3;
|
|
|
|
|
}
|
|
|
|
|
</style>
|