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