2023-11-06 15:13:36 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
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";
|
|
|
|
|
|
|
|
|
|
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-16 16:02:18 +07:00
|
|
|
complaintStatus: ""
|
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-16 16:02:18 +07:00
|
|
|
data.complaintStatus = "NEW";
|
2023-11-06 15:13:36 +07:00
|
|
|
};
|
|
|
|
|
|
2023-11-10 13:35:26 +07:00
|
|
|
/**
|
|
|
|
|
* บันทึกข้อมูลที่เเก้ไข
|
|
|
|
|
* @param id ระบุ บุคคล
|
|
|
|
|
*/
|
|
|
|
|
async function onSubmit(id:string){
|
2023-11-06 15:13:36 +07:00
|
|
|
// put
|
2023-11-10 13:35:26 +07:00
|
|
|
console.log("edit",id);
|
2023-11-06 15:13:36 +07:00
|
|
|
router.push(`/discipline/investigatefacts`);
|
|
|
|
|
};
|
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
|
|
|
|
|
v-if="data.complaintStatus === 'NEW'"
|
|
|
|
|
label="มีมูลส่งไปออกคำสั่ง"
|
|
|
|
|
color="public"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="data.complaintStatus === 'NEW'"
|
|
|
|
|
label="ยุติเรื่อง"
|
|
|
|
|
color="red-7"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="data.complaintStatus === 'STOP'"
|
|
|
|
|
label="ยกเลิกการยุติเรื่อง"
|
|
|
|
|
color="red-7"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2023-11-06 15:13:36 +07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Form :on-submit="onSubmit" :data="data" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|