From cc2e45666e55a4d8e0a6331b6671f5509721166a Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 27 Nov 2023 11:30:23 +0700 Subject: [PATCH] =?UTF-8?q?API=20=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=AA?= =?UTF-8?q?=E0=B8=B7=E0=B8=9A=E0=B8=AA=E0=B8=A7=E0=B8=99=E0=B8=82=E0=B9=89?= =?UTF-8?q?=E0=B8=AD=E0=B9=80=E0=B8=97=E0=B9=87=E0=B8=88=E0=B8=88=E0=B8=A3?= =?UTF-8?q?=E0=B8=B4=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/11_discipline/api.discipline.ts | 2 +- .../components/1_Complaint/EditPage.vue | 94 +++++++++++- .../components/1_Complaint/Form.vue | 3 +- .../components/1_Complaint/Popup.vue | 121 +++------------- .../2_InvestigateFacts/EditPage.vue | 135 +++++++++++++++++- .../11_discipline/store/ComplaintsStore.ts | 1 + 6 files changed, 249 insertions(+), 107 deletions(-) diff --git a/src/api/11_discipline/api.discipline.ts b/src/api/11_discipline/api.discipline.ts index ee096a52f..fa3e31437 100644 --- a/src/api/11_discipline/api.discipline.ts +++ b/src/api/11_discipline/api.discipline.ts @@ -40,7 +40,7 @@ export default { investigateReject:(id:string) => `${investigate}/reject/${id}`, investigateResume:(id:string) => `${investigate}/resume/${id}`, - + investigateApprove:(id:string) => `${investigate}/approve/${id}`, /** ระบบวินัยเรื่องสอบสวน */ disciplineDisciplinary: () => `${discipline}/disciplinary`, diff --git a/src/modules/11_discipline/components/1_Complaint/EditPage.vue b/src/modules/11_discipline/components/1_Complaint/EditPage.vue index d4677495c..f791a63ae 100644 --- a/src/modules/11_discipline/components/1_Complaint/EditPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/EditPage.vue @@ -4,7 +4,7 @@ import Form from "@/modules/11_discipline/components/1_Complaint/Form.vue"; import Popup from "@/modules/11_discipline/components/1_Complaint/Popup.vue"; import { useRouter, useRoute } from "vue-router"; import { useQuasar } from "quasar"; - +import type { QTableProps } from "quasar"; import config from "@/app.config"; import http from "@/plugins/http"; @@ -14,7 +14,8 @@ import type { ArrayFileList, } from "@/modules/11_discipline/interface/request/complaint"; import { useCounterMixin } from "@/stores/mixin"; - +import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore"; +const complainstStore = useComplainstDataStore(); const $q = useQuasar(); const mixin = useCounterMixin(); const { @@ -134,6 +135,92 @@ const data = reactive({ // ]); // }; +const columns = ref([ + { + name: "no", + align: "left", + label: "ลำดับ", + sortable: false, + field: "no", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "idcard", + align: "left", + label: "เลขบัตรประชาชน", + sortable: true, + field: "idcard", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "name", + align: "left", + label: "ชื่อ - นามสกุล", + sortable: true, + field: "name", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "positionNo", + align: "left", + label: "ตำแหน่งเลขที่", + sortable: true, + field: "positionNo", + 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: "positionLevel", + align: "left", + label: "ระดับ", + sortable: true, + field: "positionLevel", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "salary", + align: "left", + label: "เงินเดือน", + sortable: true, + field: "salary", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "organization", + align: "left", + label: "หน่วยงาน", + sortable: true, + field: "organization", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, +]); +/** หัวข้อที่เเสดงในตาราง */ +const visibleColumns = ref([ + "no", + "idcard", + "name", + "positionNo", + "position", + "positionLevel", + "salary", + "organization", +]); + async function getData() { showLoader(); await http @@ -314,6 +401,9 @@ onMounted(() => { :modal="modalPopup" :close="closePopup" @return-person="emitPerson" + :rows="complainstStore.rowsAdd" + :columns="columns" + :visibleColumns="visibleColumns" /> diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index 4cd06341a..b5b4faf33 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -911,8 +911,7 @@ onMounted(() => { - -
+
"", }, + rows: { + type: Array, + default: [], + }, + columns: { + type: Array, + default: [], + }, + visibleColumns: { + type: Array, + default: [], + }, }); -const emit = defineEmits([ - "returnPerson" -]) +const emit = defineEmits(["returnPerson"]); /** หัวตาราง */ -const columns = ref([ - { - name: "no", - align: "left", - label: "ลำดับ", - sortable: false, - field: "no", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "idcard", - align: "left", - label: "เลขบัตรประชาชน", - sortable: true, - field: "idcard", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "name", - align: "left", - label: "ชื่อ - นามสกุล", - sortable: true, - field: "name", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionNo", - align: "left", - label: "ตำแหน่งเลขที่", - sortable: true, - field: "positionNo", - 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: "positionLevel", - align: "left", - label: "ระดับ", - sortable: true, - field: "positionLevel", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "salary", - align: "left", - label: "เงินเดือน", - sortable: true, - field: "salary", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "organization", - align: "left", - label: "หน่วยงาน", - sortable: true, - field: "organization", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, -]); -/** หัวข้อที่เเสดงในตาราง */ -const visibleColumns = ref([ - "no", - "idcard", - "name", - "positionNo", - "position", - "positionLevel", - "salary", - "organization", -]); + const selected = ref([]); const inspectionResults = ref(""); @@ -143,7 +69,7 @@ function onclickSend() { async () => { success($q, `ส่งข้อมูล${props.title}สำเร็จ`); console.log(selected.value); - emit('returnPerson',selected.value) + emit("returnPerson", selected.value); props.close?.(); }, `ยืนยันการส่ง${props.title}`, @@ -161,10 +87,9 @@ function onClickClose() { watch([() => props.modal], () => { inspectionResults.value = props.modal ? "" : ""; selected.value = props.modal ? [] : []; - if(props.modal === true){ - selected.value = complainstStore.rowsAdd; + if (props.modal === true) { + selected.value = props.rows; } - });