แก้ วินัย
This commit is contained in:
parent
743401b19e
commit
3cc4c2ec29
6 changed files with 38 additions and 69 deletions
|
|
@ -31,6 +31,7 @@ function addData(formData: FormDataPost) {
|
|||
position: formData.position,
|
||||
email: formData.email,
|
||||
phone: formData.phone,
|
||||
qualification: formData.qualification,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ watch(props, () => {
|
|||
separator
|
||||
>
|
||||
<q-item clickable v-ripple>
|
||||
<q-item-section>{{ item.fullName }}</q-item-section>
|
||||
<q-item-section>{{ `${item.fullName} (${item.duty})` }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-scroll-area>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const data = reactive<FormData>({
|
|||
position: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
qualification: "",
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
@ -44,6 +45,7 @@ async function fetchData(){
|
|||
data.position = dataApi.position;
|
||||
data.phone = dataApi.phone;
|
||||
data.email = dataApi.email;
|
||||
data.qualification = dataApi.qualification;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -71,6 +73,7 @@ function putData(formData: FormData) {
|
|||
position: formData.position,
|
||||
email: formData.email,
|
||||
phone: formData.phone,
|
||||
qualification: formData.qualification,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
|
|
|
|||
|
|
@ -12,21 +12,19 @@ import type {
|
|||
} 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";
|
||||
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
||||
|
||||
const qualification = ref<string>("");
|
||||
const mainStore = useDisciplineMainStore();
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
const searchRef = ref<any>(null);
|
||||
const rows = ref<tableType[]>([]);
|
||||
const search = ref<string>("");
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, showLoader, dialogMessageNotify, hideLoader } = mixin;
|
||||
/**
|
||||
* รับ props มาจาก page หลัก
|
||||
*/
|
||||
|
||||
/** รับ props มาจาก page หลัก */
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
|
|
@ -37,6 +35,7 @@ const props = defineProps({
|
|||
default: () => "",
|
||||
},
|
||||
});
|
||||
|
||||
const type = ref<string>("idcard");
|
||||
const typeOps = ref<typeOp[]>([
|
||||
{ id: "idcard", name: "เลขประจำตัวประชาชน" },
|
||||
|
|
@ -63,20 +62,7 @@ const formData = reactive<FormData>({
|
|||
position: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
});
|
||||
|
||||
/**
|
||||
* เช็คข้อมูลจาก props
|
||||
* เมื่อมีข้อมูล
|
||||
* เก็บข้อมูลลง formData
|
||||
*/
|
||||
watch(props.data, async () => {
|
||||
formData.prefix = props.data.prefix;
|
||||
formData.firstname = props.data.firstname;
|
||||
formData.lastname = props.data.lastname;
|
||||
formData.position = props.data.position;
|
||||
formData.phone = props.data.phone;
|
||||
formData.email = props.data.email;
|
||||
qualification: "",
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
@ -93,8 +79,6 @@ const formRef: FormRef = {
|
|||
firstname: firstnameRef,
|
||||
lastname: lastnameRef,
|
||||
position: positionRef,
|
||||
// phone: phoneRef,
|
||||
// email: emailRef,
|
||||
};
|
||||
|
||||
const columnsRespondent = ref<QTableProps["columns"]>([
|
||||
|
|
@ -116,15 +100,6 @@ const columnsRespondent = ref<QTableProps["columns"]>([
|
|||
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",
|
||||
|
|
@ -134,15 +109,6 @@ const columnsRespondent = ref<QTableProps["columns"]>([
|
|||
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",
|
||||
|
|
@ -152,24 +118,6 @@ const columnsRespondent = ref<QTableProps["columns"]>([
|
|||
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",
|
||||
|
|
@ -311,8 +259,6 @@ function returnDetail(data: any) {
|
|||
formData.email = data.email;
|
||||
}
|
||||
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
/**
|
||||
* function ดูประวัติแบบย่อย
|
||||
* @param id personId
|
||||
|
|
@ -321,6 +267,7 @@ function onclickViewinfo(id: string) {
|
|||
modalPersonal.value = true;
|
||||
personId.value = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* function อัปเดท modal
|
||||
* @param modal ค่า modal
|
||||
|
|
@ -328,6 +275,21 @@ function onclickViewinfo(id: string) {
|
|||
function updatemodalPersonal(modal: boolean) {
|
||||
modalPersonal.value = modal;
|
||||
}
|
||||
|
||||
/**
|
||||
* เช็คข้อมูลจาก props
|
||||
* เมื่อมีข้อมูล
|
||||
* เก็บข้อมูลลง formData
|
||||
*/
|
||||
watch(props.data, async () => {
|
||||
formData.prefix = props.data.prefix;
|
||||
formData.firstname = props.data.firstname;
|
||||
formData.lastname = props.data.lastname;
|
||||
formData.position = props.data.position;
|
||||
formData.phone = props.data.phone;
|
||||
formData.email = props.data.email;
|
||||
formData.qualification = props.data.qualification;
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<form @submit.prevent.stop="onValidate">
|
||||
|
|
@ -519,11 +481,12 @@ function updatemodalPersonal(modal: boolean) {
|
|||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="inputEdit(isReadonly)"
|
||||
label="คุณวุฒิ"
|
||||
type="textarea"
|
||||
dense
|
||||
outlined
|
||||
v-model="qualification"
|
||||
v-model="formData.qualification"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -489,9 +489,9 @@ onMounted(() => {
|
|||
outlined
|
||||
hide-bottom-space
|
||||
v-model="formData.title"
|
||||
:rules="[(val) => !!val || 'กรุณากรอกเรื่องร้องเรียน']"
|
||||
:rules="[(val) => !!val || 'กรุณากรอกอุทธรณ์/ร้องทุกข์']"
|
||||
lazy-rules
|
||||
label="เรื่องร้องเรียน"
|
||||
label="อุทธรณ์/ร้องทุกข์"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -505,10 +505,10 @@ onMounted(() => {
|
|||
hide-bottom-space
|
||||
v-model="formData.description"
|
||||
:rules="[
|
||||
(val) => !!val || 'กรุณากรอกรายละเอียดเรื่องร้องทุกข์',
|
||||
(val) => !!val || 'กรุณากรอกรายละเอียดอุทธรณ์/ร้องทุกข์',
|
||||
]"
|
||||
lazy-rules
|
||||
label="รายละเอียดเรื่องร้องทุกข์"
|
||||
label="รายละเอียดอุทธรณ์/ร้องทุกข์"
|
||||
type="textarea"
|
||||
rows="5"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ interface FormData {
|
|||
position: string;
|
||||
phone: string;
|
||||
email: string;
|
||||
qualification: string
|
||||
}
|
||||
interface FormDataPost {
|
||||
personalId: string
|
||||
|
|
@ -15,6 +16,7 @@ interface FormDataPost {
|
|||
position: string;
|
||||
phone: string;
|
||||
email: string;
|
||||
qualification: string;
|
||||
}
|
||||
interface FormRef {
|
||||
prefix: object | null;
|
||||
|
|
@ -43,9 +45,9 @@ interface ResponsePreson {
|
|||
organization: string; //สังกัด
|
||||
email: string; //อีเมล
|
||||
phone: string; //เบอร์โทรศัพท์
|
||||
}
|
||||
}
|
||||
|
||||
interface tableType {
|
||||
interface tableType {
|
||||
personId: string;
|
||||
idcard: string;
|
||||
prefix: string;
|
||||
|
|
@ -56,7 +58,7 @@ interface ResponsePreson {
|
|||
organization: string;
|
||||
salary: string;
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
export type {
|
||||
FormData,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue