แก้ไขการสอบสวนความผิดทางวินัย
This commit is contained in:
parent
342e848e0c
commit
8587a85133
4 changed files with 104 additions and 170 deletions
|
|
@ -1,8 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, watchEffect, watch, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { directorType } from "@/modules/11_discipline/interface/index/Main";
|
||||
|
|
@ -154,7 +152,7 @@ function Reset() {
|
|||
/** เช็คค่า props.Modal === true */
|
||||
watchEffect(() => {
|
||||
if (props.Modal === true) {
|
||||
selected.value = [];
|
||||
// selected.value = [];
|
||||
props.getList();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,18 +2,10 @@
|
|||
import { ref, onMounted, reactive, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
|
||||
|
||||
import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue";
|
||||
import Dialogbody from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Dialogbody.vue";
|
||||
import Table from "@/modules/11_discipline/components/3_InvestigateDisciplinary/DirectorTable.vue";
|
||||
import UploadFile from "@/modules/11_discipline/components/UploadFile.vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
/**import type*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
FormData,
|
||||
|
|
@ -29,29 +21,35 @@ import type {
|
|||
} from "@/modules/11_discipline/interface/index/Main";
|
||||
import type { DataOptionRes } from "@/modules/11_discipline/interface/response/Main";
|
||||
|
||||
/** import components*/
|
||||
import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue";
|
||||
import Dialogbody from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Dialogbody.vue";
|
||||
import Table from "@/modules/11_discipline/components/3_InvestigateDisciplinary/DirectorTable.vue";
|
||||
import UploadFile from "@/modules/11_discipline/components/UploadFile.vue";
|
||||
|
||||
/** import store*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
|
||||
|
||||
const complainstStore = useComplainstDataStore();
|
||||
const investigateDis = useInvestigateDisStore();
|
||||
// const { fecthDirector } = investigateDis;
|
||||
const { selectComplainantTpye, filterSelector } = complainstStore; // function จาก store complainstStore
|
||||
|
||||
const { filterSelector } = complainstStore; // function จาก store complainstStore
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, dialogConfirm } = mixin;
|
||||
const router = useRouter();
|
||||
const { date2Thai, showLoader, hideLoader, dialogConfirm, messageError } =
|
||||
mixin;
|
||||
|
||||
const route = useRoute();
|
||||
const rows = ref<Director[]>([]);
|
||||
const modal = ref<boolean>(false);
|
||||
const $q = useQuasar();
|
||||
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const type = ref<string>("");
|
||||
const myForm = ref<QForm | null>(null); //form data input
|
||||
const edit = ref<boolean>(false);
|
||||
const dateInvestigate = ref<Date>(new Date());
|
||||
const dateAllegation = ref<Date>(new Date());
|
||||
const dateEvident = ref<Date>(new Date());
|
||||
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const rows = ref<Director[]>([]);
|
||||
const modalPerson = ref<boolean>(false);
|
||||
/** search data table*/
|
||||
const filter = ref<string>("");
|
||||
|
||||
function toggleModal() {
|
||||
modalPerson.value = !modalPerson.value;
|
||||
}
|
||||
|
|
@ -132,6 +130,7 @@ const columnsPerson = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/** formData*/
|
||||
const formData = reactive<FormData>({
|
||||
respondentType: "",
|
||||
organizationId: "",
|
||||
|
|
@ -163,6 +162,10 @@ const formData = reactive<FormData>({
|
|||
// organizationId: "",
|
||||
// consideredAgency: "",
|
||||
});
|
||||
const disciplineDisciplinary_DocSummaryEvidences = ref<FileLists[]>([]);
|
||||
const disciplineDisciplinary_DocRecordAccusers = ref<FileLists[]>([]);
|
||||
const disciplineDisciplinary_DocWitnessess = ref<FileLists[]>([]);
|
||||
const disciplineDisciplinary_DocOthers = ref<FileLists[]>([]);
|
||||
|
||||
/** ตัวแปร ref สำหรับแสดง validate */
|
||||
const respondentTypeRef = ref<Object | null>(null);
|
||||
|
|
@ -179,20 +182,26 @@ const disciplinaryRecordAccuserRef = ref<Object | null>(null);
|
|||
const disciplinaryWitnessesRef = ref<Object | null>(null);
|
||||
const resultRef = ref<Object | null>(null);
|
||||
|
||||
// const typefaultRef = ref<Object | null>(null);
|
||||
// const faultLevelRef = ref<Object | null>(null);
|
||||
// const detailComplaintRef = ref<Object | null>(null);
|
||||
// const whereInvestigateRef = ref<Object | null>(null);
|
||||
// const witnessesRef = ref<Object | null>(null);
|
||||
// const InvestResultsRef = ref<Object | null>(null);
|
||||
// const filesEvidenceRef = ref<Object | null>(null);
|
||||
// const filesRecordAccuserRef = ref<Object | null>(null);
|
||||
// const filesWitnessesRef = ref<Object | null>(null);
|
||||
// const filesEtcRef = ref<Object | null>(null);
|
||||
// const trueDetailRef = ref<Object | null>(null);
|
||||
// const evidenceRef = ref<Object | null>(null);
|
||||
// const recordAccuserRef = ref<Object | null>(null);
|
||||
// const complaintsOptions = ref<any>([]);
|
||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
||||
const objectdisciplinary: DisciplinaryRef = {
|
||||
respondentType: respondentTypeRef,
|
||||
organizationId: organizationIdRef,
|
||||
consideredAgency: consideredAgencyRef,
|
||||
disciplinaryDateAllegation: disciplinaryDateAllegationRef,
|
||||
disciplinaryDateEvident: disciplinaryDateEvidentRef,
|
||||
disciplinaryCaseFault: disciplinaryCaseFaultRef,
|
||||
disciplinaryInvestigateAt: disciplinaryInvestigateAtRef,
|
||||
disciplinaryFaultLevel: disciplinaryFaultLevelRef,
|
||||
disciplinaryRefLaw: disciplinaryRefLawRef,
|
||||
disciplinarySummaryEvidence: disciplinarySummaryEvidenceRef,
|
||||
disciplinaryRecordAccuser: disciplinaryRecordAccuserRef,
|
||||
disciplinaryWitnesses: disciplinaryWitnessesRef,
|
||||
result: resultRef,
|
||||
};
|
||||
|
||||
const initialPagination = ref<any>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
|
|
@ -211,53 +220,12 @@ const props = defineProps({
|
|||
});
|
||||
const emit = defineEmits(["submit:disciplinary"]);
|
||||
|
||||
const initialPagination = ref<any>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
|
||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
||||
const objectdisciplinary: DisciplinaryRef = {
|
||||
respondentType: respondentTypeRef,
|
||||
organizationId: organizationIdRef,
|
||||
consideredAgency: consideredAgencyRef,
|
||||
disciplinaryDateAllegation: disciplinaryDateAllegationRef,
|
||||
disciplinaryDateEvident: disciplinaryDateEvidentRef,
|
||||
disciplinaryCaseFault: disciplinaryCaseFaultRef,
|
||||
disciplinaryInvestigateAt: disciplinaryInvestigateAtRef,
|
||||
disciplinaryFaultLevel: disciplinaryFaultLevelRef,
|
||||
disciplinaryRefLaw: disciplinaryRefLawRef,
|
||||
disciplinarySummaryEvidence: disciplinarySummaryEvidenceRef,
|
||||
disciplinaryRecordAccuser: disciplinaryRecordAccuserRef,
|
||||
disciplinaryWitnesses: disciplinaryWitnessesRef,
|
||||
result: resultRef,
|
||||
// typefault: typefaultRef,
|
||||
// faultLevel: faultLevelRef,
|
||||
// refLaw: refLawRef,
|
||||
// detailComplaint: detailComplaintRef,
|
||||
// whereInvestigate: whereInvestigateRef,
|
||||
// trueDetail: trueDetailRef,
|
||||
// evidence: evidenceRef,
|
||||
// recordAccuser: recordAccuserRef,
|
||||
// witnesses: witnessesRef,
|
||||
// InvestResults: InvestResultsRef,
|
||||
// filesEvidence: filesEvidenceRef,
|
||||
// filesRecordAccuser: filesRecordAccuserRef,
|
||||
// filesWitnesses: filesWitnessesRef,
|
||||
// filesEtc: filesEtcRef,
|
||||
};
|
||||
|
||||
const disciplineDisciplinary_DocSummaryEvidences = ref<FileLists[]>([]);
|
||||
const disciplineDisciplinary_DocRecordAccusers = ref<FileLists[]>([]);
|
||||
const disciplineDisciplinary_DocWitnessess = ref<FileLists[]>([]);
|
||||
const disciplineDisciplinary_DocOthers = ref<FileLists[]>([]);
|
||||
|
||||
/** เปิด dialog */
|
||||
function popup() {
|
||||
modal.value = true;
|
||||
filterKeyword2.value = "";
|
||||
}
|
||||
|
||||
/** ฟังชั่นปิด dialog */
|
||||
function clickClose() {
|
||||
modal.value = false;
|
||||
|
|
@ -281,16 +249,6 @@ function validateForm() {
|
|||
console.log("ไม่ผ่าน ");
|
||||
}
|
||||
}
|
||||
/** search data table*/
|
||||
const filter = ref<string>("");
|
||||
const routeName = router.currentRoute.value.name;
|
||||
|
||||
// async function fileUploadDoc(files: any) {
|
||||
// files.forEach((file: any) => {
|
||||
// fileDocDataUpload.value.push(file);
|
||||
// });
|
||||
// console.log(fileDocDataUpload.value);
|
||||
// }
|
||||
|
||||
/**
|
||||
* ฟังก์ชั่นสำหรับบันทึกข้อมูล ระบบจะแสดง dialog ให้ยืนยันการบันทึก
|
||||
|
|
@ -313,9 +271,9 @@ async function deleteData(id: string) {
|
|||
console.log("delete");
|
||||
}
|
||||
|
||||
/** เรียกข้อมูลรายละเอียด*/
|
||||
async function fetchDatadetail() {
|
||||
if (props.data) {
|
||||
console.log(props.data);
|
||||
formData.respondentType = props.data.respondentType;
|
||||
formData.organizationId = props.data.organizationId;
|
||||
formData.consideredAgency = props.data.consideredAgency;
|
||||
|
|
@ -340,11 +298,8 @@ async function fetchDatadetail() {
|
|||
props.data.disciplineDisciplinary_DocWitnessess;
|
||||
disciplineDisciplinary_DocOthers.value =
|
||||
props.data.disciplineDisciplinary_DocOthers;
|
||||
// formData.InvestResults = props.data.InvestResults;
|
||||
// formData.filesEvidence = props.data.filesEvidence;
|
||||
// formData.filesRecordAccuser = props.data.filesRecordAccuser;
|
||||
// formData.filesWitnesses = props.data.filesWitnesses;
|
||||
// formData.filesEtc = props.data.filesEtc;
|
||||
|
||||
/** MAP รายชื่อกรรมการ หน้าหลัก */
|
||||
let datalistDirector: responseType[] = formData.directors.map(
|
||||
(e: directorType) => ({
|
||||
id: e.id,
|
||||
|
|
@ -353,19 +308,21 @@ async function fetchDatadetail() {
|
|||
prefix: e.prefix,
|
||||
firstName: e.firstName,
|
||||
lastName: e.lastName,
|
||||
position: e.position,
|
||||
email: e.email,
|
||||
phone: e.phone,
|
||||
total: e.total,
|
||||
duty: e.duty,
|
||||
position: e.position ? e.position : "-",
|
||||
email: e.email ? e.email : "-",
|
||||
phone: e.phone ? e.phone : "-",
|
||||
total: e.total ?? "-",
|
||||
duty: e.duty ? e.duty : "-",
|
||||
})
|
||||
);
|
||||
rows.value = datalistDirector;
|
||||
}
|
||||
|
||||
// console.log(formData);
|
||||
}
|
||||
|
||||
/**
|
||||
* function add ผู้ถูกร้องเรียนใน table
|
||||
* @param data รายชื่อ ผู้ถูกร้องเรียน
|
||||
*/
|
||||
async function addPerson(data: Persons[]) {
|
||||
if (!data) {
|
||||
return;
|
||||
|
|
@ -387,6 +344,8 @@ async function addPerson(data: Persons[]) {
|
|||
formData.persons = mergedArray;
|
||||
toggleModal();
|
||||
}
|
||||
|
||||
/** function รับข้อมูลรายชื่อผู้ถูกร้องเรียน*/
|
||||
function handleSave(returnData: any) {
|
||||
addPerson(returnData);
|
||||
}
|
||||
|
|
@ -404,6 +363,7 @@ watch(
|
|||
);
|
||||
|
||||
const organizationOption = ref<DataOption[]>([]);
|
||||
/** function เรียกรายชื่อหน่วยงาน*/
|
||||
async function fetchOrganization() {
|
||||
await http
|
||||
.get(config.API.typeOc())
|
||||
|
|
@ -415,15 +375,17 @@ async function fetchOrganization() {
|
|||
}));
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
/** query string*/
|
||||
const page = ref<number>(1);
|
||||
const rowsPerPage = ref<number>(10);
|
||||
const maxPage = ref<number>(1);
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const listDirector = ref<any>([]);
|
||||
/** function เรียกรายชื่อกรรมการ*/
|
||||
async function fetchDListDirector() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -447,63 +409,52 @@ async function fetchDListDirector() {
|
|||
total: e.total,
|
||||
duty: e.duty,
|
||||
}));
|
||||
listDirector.value = datalistDirector;
|
||||
|
||||
/** หารานชื่อกรรมการที่ไม่ซ้ำ*/
|
||||
listDirector.value = datalistDirector.filter(
|
||||
(i) => !rows.value.some((e) => e.directorId === i.id)
|
||||
);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function อัดเดท Paging กรรมการ
|
||||
* @param rpp ต่อหน้า
|
||||
* @param p หน้า
|
||||
*/
|
||||
async function updatePaging(rpp: number, p: number) {
|
||||
page.value = p;
|
||||
rowsPerPage.value = rpp;
|
||||
}
|
||||
|
||||
/**
|
||||
* function return รายชื่อกรรมการที่เลือก
|
||||
* @param data รายชื่อกรรมการที่เลือก
|
||||
*/
|
||||
async function returnDirector(data: any) {
|
||||
const dataList = data.map((item: any) => item.id);
|
||||
formData.directors.push(dataList);
|
||||
rows.value.push(...data);
|
||||
formData.directors = dataList;
|
||||
rows.value = data;
|
||||
clickClose();
|
||||
}
|
||||
|
||||
async function selectComplainant(val: string) {
|
||||
formData.organizationId = "";
|
||||
formData.consideredAgency = "";
|
||||
if (val === "0") {
|
||||
await fetchListname(); // ถ้าเลือกบุกคลจะเรียก function fetchListname เรียกรายชื่อจากทะเบียน
|
||||
} else if (val === "1") {
|
||||
await fetchOffice(); // ถ้าเลือกหน่วยงานจะเรียก function fetchOffice เรียกโครงสร้างสำนักงาน
|
||||
}
|
||||
// if (val === "0") {
|
||||
// await fetchListname(); // ถ้าเลือกบุกคลจะเรียก function fetchListname เรียกรายชื่อจากทะเบียน
|
||||
// } else if (val === "1") {
|
||||
// await fetchOffice(); // ถ้าเลือกหน่วยงานจะเรียก function fetchOffice เรียกโครงสร้างสำนักงาน
|
||||
// }
|
||||
}
|
||||
|
||||
/** เรียกรายชื่อ */
|
||||
async function fetchListname() {
|
||||
const listName = [
|
||||
{
|
||||
id: "1",
|
||||
name: "นายเอ",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
name: "นายบี",
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
name: "นายชี",
|
||||
},
|
||||
];
|
||||
selectComplainantTpye(listName);
|
||||
}
|
||||
|
||||
/** เรียกโครงสร้างสำนักงาน */
|
||||
async function fetchOffice() {}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
/** Hook */
|
||||
onMounted(async () => {
|
||||
await fetchOrganization();
|
||||
});
|
||||
|
|
@ -571,8 +522,8 @@ onMounted(async () => {
|
|||
lazy-rules
|
||||
/>
|
||||
</div>
|
||||
<!-- <div class="col-xs-12 col-sm-3" id="consideredAgency">
|
||||
<q-select
|
||||
<div class="col-xs-12 col-sm-3" id="consideredAgency">
|
||||
<!-- <q-select
|
||||
ref="consideredAgencyRef"
|
||||
for="selectAgency"
|
||||
dense
|
||||
|
|
@ -599,8 +550,8 @@ onMounted(async () => {
|
|||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div> -->
|
||||
</q-select> -->
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="formData.respondentType !== 'ORGANIZATION'"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ export const useComplainstDataStore = defineStore(
|
|||
const visibleColumns = ref<string[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([]);
|
||||
|
||||
|
||||
function fetchComplainstAdd(data: ArrayPerson[]) {
|
||||
rowsAdd.value = data;
|
||||
}
|
||||
|
|
@ -119,8 +118,7 @@ export const useComplainstDataStore = defineStore(
|
|||
function filterSelector(val: string, update: Function, type: string) {
|
||||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
|
||||
if (type === "filtercomplainantType") {
|
||||
if (type === "filterrespondentType") {
|
||||
complainantoptions.value = complainantoptionsMain.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
|
|
|
|||
|
|
@ -47,29 +47,14 @@ export const useInvestigateDisStore = defineStore(
|
|||
title: e.title,
|
||||
respondentType: convertRespondentType(e.respondentType),
|
||||
offenseDetails: convertFault(e.offenseDetails),
|
||||
disciplinaryFaultLevel: e.disciplinaryFaultLevel,
|
||||
disciplinaryCaseFault: e.disciplinaryCaseFault,
|
||||
status: e.status,
|
||||
createdAt: date2Thai(e.createdAt),
|
||||
disciplinaryFaultLevel: e.disciplinaryFaultLevel ?? "-",
|
||||
disciplinaryCaseFault: e.disciplinaryCaseFault ?? "-",
|
||||
status: e.status ?? "-",
|
||||
createdAt: e.createdAt ? date2Thai(e.createdAt) : "-",
|
||||
}));
|
||||
|
||||
rows.value = datalist;
|
||||
}
|
||||
// async function fecthDirector(data: directorType[]) {
|
||||
// let datalistDirector: responseType[] = data.map((e: directorType) => ({
|
||||
// id: e.id,
|
||||
// name: `${e.prefix}${e.firstName} ${e.lastName}`,
|
||||
// prefix: e.prefix,
|
||||
// firstName: e.firstName,
|
||||
// lastName: e.lastName,
|
||||
// position: e.position,
|
||||
// email: e.email,
|
||||
// phone: e.phone,
|
||||
// }));
|
||||
// rows2.value = datalistDirector;
|
||||
// selected.value = rows2.value;
|
||||
// // console.log(rows2.value);
|
||||
// }
|
||||
|
||||
function convertRespondentType(val: string) {
|
||||
switch (val) {
|
||||
|
|
@ -90,6 +75,8 @@ export const useInvestigateDisStore = defineStore(
|
|||
return "ความผิดวินัยไม่ร้ายแรง";
|
||||
case "DEADLY":
|
||||
return "ความผิดวินัยร้ายแรง";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
function convertSatatus(val: string) {
|
||||
|
|
@ -305,7 +292,7 @@ export const useInvestigateDisStore = defineStore(
|
|||
rows2,
|
||||
optionsTypefault,
|
||||
optionsfaultLevel,
|
||||
// fecthDirector,
|
||||
|
||||
visibleColumns,
|
||||
columns,
|
||||
visibleColumnsDirector,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue