2023-11-07 09:52:03 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { onMounted, reactive, ref } from "vue";
|
2023-11-10 15:32:11 +07:00
|
|
|
import Form from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue";
|
2023-11-07 09:52:03 +07:00
|
|
|
import type { FormData } from "@/modules/11_discipline/interface/request/disciplinary";
|
|
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
const id = ref<string>(route.params.id as string);
|
|
|
|
|
|
2023-11-10 15:32:11 +07:00
|
|
|
|
|
|
|
|
/** ข้อมูล v-model ของฟอร์ม */
|
2023-11-07 09:52:03 +07:00
|
|
|
const data = reactive<FormData>({
|
2023-11-10 15:32:11 +07:00
|
|
|
complaint: "",
|
2023-11-07 09:52:03 +07:00
|
|
|
dateInvestigate: null,
|
|
|
|
|
dateAllegation: null,
|
|
|
|
|
dateEvident: null,
|
|
|
|
|
casefault: "",
|
|
|
|
|
typefault: "",
|
|
|
|
|
faultLevel: "",
|
|
|
|
|
refLaw: "",
|
|
|
|
|
detailComplaint: "",
|
|
|
|
|
whereInvestigate: "",
|
|
|
|
|
trueDetail: "",
|
|
|
|
|
evidence: "",
|
|
|
|
|
recordAccuser: "",
|
|
|
|
|
witnesses: "",
|
|
|
|
|
InvestResults: "",
|
|
|
|
|
filesEvidence: null,
|
|
|
|
|
filesRecordAccuser: null,
|
|
|
|
|
filesWitnesses: null,
|
|
|
|
|
filesEtc: null,
|
|
|
|
|
});
|
2023-11-10 15:32:11 +07:00
|
|
|
|
|
|
|
|
/** จำลองข้อมูลจาก api */
|
2023-11-07 09:52:03 +07:00
|
|
|
const fetchData = async () => {
|
2023-11-10 15:32:11 +07:00
|
|
|
data.complaint = "test1"
|
2023-11-07 09:52:03 +07:00
|
|
|
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
|
|
|
|
|
};
|
|
|
|
|
|
2023-11-10 15:32:11 +07:00
|
|
|
/**
|
|
|
|
|
* บันทึกข้อมูลที่เเก้ไข
|
|
|
|
|
* @param id ระบุ บุคคล
|
|
|
|
|
*/
|
|
|
|
|
const onSubmit = async (id:string) => {
|
2023-11-07 09:52:03 +07:00
|
|
|
console.log("edit");
|
|
|
|
|
router.push(`/discipline/disciplinary`);
|
|
|
|
|
};
|
2023-11-10 15:32:11 +07:00
|
|
|
|
|
|
|
|
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
fetchData();
|
|
|
|
|
});
|
2023-11-07 09:52:03 +07:00
|
|
|
</script>
|
|
|
|
|
<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/disciplinary`)"
|
|
|
|
|
/>
|
|
|
|
|
แก้ไขการสอบสวนความผิดทางวินัย {{ id }}#id
|
|
|
|
|
</div>
|
|
|
|
|
<Form :on-submit="onSubmit" :data="data" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|