From ce3ad087de1d817760b1d7aa3844f5c78c843a4a Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Tue, 26 Dec 2023 18:24:22 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20ui=20?= =?UTF-8?q?=E0=B8=A7=E0=B8=B4=E0=B8=99=E0=B8=B1=E0=B8=A2=20=E0=B8=81?= =?UTF-8?q?=E0=B8=A3=E0=B8=A3=E0=B8=A1=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Complaint/Form.vue | 3 +- .../components/2_InvestigateFacts/Form.vue | 42 ++- .../3_InvestigateDisciplinary/Form.vue | 33 +- .../components/4_Result/Form.vue | 23 +- .../Director/DialogInvestigateTotal.vue | 197 +++++++++++ .../6_BasicInformation/Director/Form.vue | 318 +++++++++++++++--- .../6_BasicInformation/Director/MainPage.vue | 49 ++- .../interface/request/director.ts | 45 ++- 8 files changed, 590 insertions(+), 120 deletions(-) create mode 100644 src/modules/11_discipline/components/6_BasicInformation/Director/DialogInvestigateTotal.vue diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index c3fdee2ce..4c633cb38 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -19,7 +19,7 @@ import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue"; const $q = useQuasar(); const fileDocDataUpload = ref([]); - const channelOptions = ref([]); +const channelOptions = ref([]); /** เรียกใช้ store */ const mixin = useCounterMixin(); const mainStore = useDisciplineMainStore(); @@ -522,6 +522,7 @@ onMounted(() => {
{ return route.name === "/discipline-disciplinaryEdit" ? true : false; }); @@ -161,9 +162,7 @@ const dateEndInputStyle = computed(() => { new Date(currentDate.getTime() + 7 * 24 * 60 * 60 * 1000); console.log(isInNext7Days); - return isInNext7Days - ? { textDecoration: "underline", color: "red", borderColor: "red" } - : {}; + return isInNext7Days ? "input-alert" : ""; }); const initialPagination = ref({ @@ -307,10 +306,10 @@ watch(props.data, async () => { email: item.email, phone: item.phone, duty: item.duty, + check: "props", })); rows.value = dataMap; - const dataList = dataMap.map((item: any) => item.id); formData.directors = dataList; } @@ -481,6 +480,7 @@ async function getList() { function returnDirector(data: any) { const dataList = data.map((item: any) => item.id); formData.directors = dataList; + rows.value = data; changeFormData(); clickClose(); @@ -759,21 +759,14 @@ onMounted(async () => { {{ props.rowIndex + 1 }}
- ดูข้อมูลในทะเบียนประวัติดูข้อมูลในทะเบียนประวัติ +
{
diff --git a/src/modules/11_discipline/components/6_BasicInformation/Director/Form.vue b/src/modules/11_discipline/components/6_BasicInformation/Director/Form.vue index 045a516a1..65a5f7849 100644 --- a/src/modules/11_discipline/components/6_BasicInformation/Director/Form.vue +++ b/src/modules/11_discipline/components/6_BasicInformation/Director/Form.vue @@ -2,21 +2,26 @@ import { ref, reactive, watch } from "vue"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; +import type { QTableProps } from "quasar"; import type { FormData, FormRef, + typeOp, + ResponsePreson, + tableType, } from "@/modules/11_discipline/interface/request/director"; import http from "@/plugins/http"; import config from "@/app.config"; +import { useDisciplineMainStore } from "@/modules/11_discipline/store/main"; +const qualification = ref('') +const mainStore = useDisciplineMainStore(); +const searchRef = ref(null); +const rows = ref([]); +const search = ref(""); const $q = useQuasar(); const mixin = useCounterMixin(); -const { - messageError, - showLoader, - dialogMessageNotify, - hideLoader, -} = mixin; +const { messageError, showLoader, dialogMessageNotify, hideLoader } = mixin; /** * รับ props มาจาก page หลัก */ @@ -30,6 +35,12 @@ const props = defineProps({ default: () => "", }, }); +const type = ref("idcard"); +const typeOps = ref([ + { id: "idcard", name: "เลขประจำตัวประชาชน" }, + { id: "firstname", name: "ชื่อ" }, + { id: "lastname", name: "นามสกุล" }, +]); const isReadonly = ref(false); // อ่านได้อย่างเดียว const emit = defineEmits(["formDataReturn"]); /** @@ -65,7 +76,6 @@ watch(props.data, async () => { formData.position = props.data.position; formData.phone = props.data.phone; formData.email = props.data.email; - }); /** @@ -82,14 +92,111 @@ const formRef: FormRef = { firstname: firstnameRef, lastname: lastnameRef, position: positionRef, - phone: phoneRef, - email: emailRef, + // phone: phoneRef, + // email: emailRef, }; +const columnsRespondent = ref([ + { + name: "info", + align: "center", + label: "", + sortable: false, + field: "info", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + 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: "posNo", + // align: "left", + // label: "ตำแหน่งเลขที่", + // sortable: true, + // field: "posNo", + // 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 visibleColumnsRespondent = ref([ + "info", + "no", + // "idcard", + "name", + // "posNo", + "position", + // "positionLevel", + // "salary", + "organization", +]); + /** * เพิ่มบุคลากร */ - function addEmployee() { +function addEmployee() { if (idCard.value.length === 13) { console.log("idCard===>", idCard.value); showLoader(); @@ -150,6 +257,59 @@ function inputEdit(val: boolean) { "full-width cursor-pointer inputgreen": !val, }; } + +/** update เมื่อเปลี่ยน option */ +function updateSelect() { + search.value = ""; +} + +async function searchInput() { + searchRef.value.validate(); + if (!searchRef.value.hasError) { + showLoader(); + const body = { + fieldName: type.value, + keyword: search.value, + }; + await http + .post(config.API.searchPersonal(), body) + .then((res) => { + const data = res.data.result; + const list = data.map((e: ResponsePreson) => ({ + personId: e.personId, + idcard: e.idcard, + prefix: e.prefix, + firstName: e.firstName, + lastName: e.lastName, + name: `${e.prefix}${e.firstName} ${e.lastName}`, + posNo: e.posNo ?? "-", + position: e.position ?? "-", + positionLevel: e.positionLevel ?? "-", + salary: e.salaries ?? "-", + organization: e.organization ?? "-", + phone: e.phone ?? "-", + email: e.email ?? "-", + })); + + rows.value = list; + }) + .catch((err) => { + console.log(err); + }) + .finally(() => { + hideLoader(); + }); + } +} + +function returnDetail(data: any) { + formData.prefix = data.prefix; + formData.firstname = data.firstName; + formData.lastname = data.lastName; + formData.position = data.position; + formData.phone = data.phone; + formData.email = data.email; +} diff --git a/src/modules/11_discipline/interface/request/director.ts b/src/modules/11_discipline/interface/request/director.ts index 9700953de..de1a4ff4e 100644 --- a/src/modules/11_discipline/interface/request/director.ts +++ b/src/modules/11_discipline/interface/request/director.ts @@ -1,5 +1,5 @@ interface FormData { - personalId:string + personalId: string prefix: string; firstname: string; lastname: string; @@ -8,7 +8,7 @@ interface FormData { email: string; } interface FormDataPost { - personalId:string + personalId: string prefix: string; firstname: string; lastname: string; @@ -21,13 +21,48 @@ interface FormRef { firstname: object | null; lastname: object | null; position: object | null; - phone: object | null; - email: object | null; + // phone: object | null; + // email: object | null; [key: string]: any; } +interface typeOp { + id: string + name: string +} + +interface ResponsePreson { + personId: string; //id อ้างอิง profile + idcard: string; //รหัสบัตรประชาชน + prefix: string; //คำนำหน้า + firstName: string; //ชื่อ + lastName: string; //นามสกุล + posNo: string; //เลขที่ตำแหน่ง + position: string; //ตำแหน่ง + positionLevel: string; //ระดับ + salaries: number; //เงินเดือน + organization: string; //สังกัด + email: string; //อีเมล + phone: string; //เบอร์โทรศัพท์ + } + + interface tableType { + personId: string; + idcard: string; + prefix: string; + firstName: string; + lastName: string; + position: string; + positionLevel: string; + organization: string; + salary: string; + name: string; + } export type { FormData, FormRef, - FormDataPost + FormDataPost, + typeOp, + ResponsePreson, + tableType }; \ No newline at end of file