diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index d12fdcb90..5ead0b113 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -2,12 +2,12 @@ import { ref, onMounted, reactive, watch } from "vue"; import { useQuasar } from "quasar"; import { useRouter } from "vue-router"; - +import type { QTableProps } from "quasar"; /** import Type */ import type { DataOption } from "@/modules/11_discipline/interface/index/Main"; import type { FormData, - MyObjectComplaintsRef, + MyObjectComplaintsRef,DataAddRequest } from "@/modules/11_discipline/interface/request/complaint"; /** importStroe*/ @@ -109,6 +109,84 @@ const receivecomplaintstoptions = ref([ { id: "6", name: "บอกกล่าว" }, ]); +/** หัวตาราง */ +const columns = ref([ + { + name: "no", + align: "left", + label: "ลำดับ", + sortable: false, + field: "no", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "cardId", + align: "left", + label: "เลขบัตรประชาชน", + sortable: true, + field: "cardId", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "fullName", + align: "left", + label: "ชื่อ - นามสกุล", + sortable: true, + field: "fullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "position", + align: "left", + label: "ตำแหน่ง", + sortable: true, + field: "position", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "level", + align: "left", + label: "ระดับ", + sortable: true, + field: "level", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "degree", + align: "left", + label: "วุฒิการศึกษา", + sortable: true, + field: "degree", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "oc", + align: "left", + label: "สังกัด", + sortable: true, + field: "oc", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, +]); + +/** หัวข้อที่เเสดงในตาราง */ +const visibleColumns = ref([ + "no", + "cardId", + "fullName", + "position", + "level", + "degree", + "oc", +]); + /** * รับค่าผู้ถูกร้องเรียน * @param val บุคคล หน่วยงาน กทม @@ -211,7 +289,48 @@ function onSubmit() { ); } -/** +/**ชั่งฟังเพิ่มข้อมูล ลง ตาราง */ +async function addDatainTable() { + console.log("test"); + const listData: DataAddRequest[] = [ + { + id: "001", + cardId: "0000000000001", + prefix: "นาง", + firstName: "ศิรินภา", + lastName: "คงน้อย", + position: "ตำเเหน่ง1", + level: "level1", + degree: "ป.ตรี", + oc: "สำนักงาน 1", + }, + { + id: "002", + cardId: "0000000000002", + prefix: "นาย", + firstName: "แก้ว", + lastName: "คำ", + position: "ตำแหน่ง2", + level: "level2", + degree: "ป.โท", + oc: "สำนักงาน 2", + }, + { + id: "003", + cardId: "0000000000003", + prefix: "นาย", + firstName: "ภัทรานุย", + lastName: "คงนอย", + position: "ตำแหน่ง2", + level: "level3", + degree: "ป.เอก", + oc: "สำนักงาน 3", + }, + ]; + await complainstStore.fetchComplainstAdd(listData); +} + +/** * เช็คข้อมูลจาก props * เมื่อมีข้อมูล * เก็บข้อมูลลง formData @@ -232,6 +351,11 @@ watch(props.data, async () => { formData.petitioner = props.data.petitioner; formData.files = props.data.files; }); + +onMounted(() => { + complainstStore.columns = columns.value; + complainstStore.visibleColumns = visibleColumns.value; +});