จัดโค้ด เรื่อง เรื่องร้องเรียน
This commit is contained in:
parent
5b47826667
commit
aeaa8c8df2
5 changed files with 103 additions and 80 deletions
|
|
@ -1,17 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import Form from "@/modules/11_discipline/components/1_Complaint/Form.vue";
|
||||
import type { FormData } from "@/modules/11_discipline/interface/request/complaint";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { FormData } from "@/modules/11_discipline/interface/request/complaint";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
// get ข้อมูลเก่ากรณีแก้ไขข้อมูล
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
const data = reactive<FormData>({
|
||||
complainantType: "",
|
||||
complainant: "",
|
||||
|
|
@ -28,8 +25,9 @@ const data = reactive<FormData>({
|
|||
petitioner: "",
|
||||
files: null,
|
||||
});
|
||||
|
||||
/** ดึงค่าจาก api */
|
||||
const fetchData = async () => {
|
||||
// ดึงค่าจาก api
|
||||
data.complainantType = "2"
|
||||
data.complainant = "1"
|
||||
data.office = "0"
|
||||
|
|
@ -46,12 +44,16 @@ const fetchData = async () => {
|
|||
data.files = ""
|
||||
};
|
||||
|
||||
// แก้ไขข้อมูล
|
||||
const onSubmit = async () => {
|
||||
// put
|
||||
/** ฟังชั่น แก้ไข */
|
||||
async function onSubmit() {
|
||||
console.log("edit");
|
||||
router.push(`/discipline/complaints`);
|
||||
};
|
||||
|
||||
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue