Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop
# Conflicts: # src/modules/11_discipline/store/InvestigateDisStore.ts
This commit is contained in:
commit
9e8516fc0b
10 changed files with 297 additions and 195 deletions
|
|
@ -2,15 +2,21 @@
|
|||
import { ref, reactive, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import type { FormDetail } from "@/modules/09_leave/interface/response/work";
|
||||
|
||||
/** importStores */
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
|
||||
|
||||
/** useStore */
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader } = mixin;
|
||||
const stores = useWorklistDataStore();
|
||||
const { date2Thai, showLoader, hideLoader, messageError } = mixin;
|
||||
const { convertSatatus } = stores;
|
||||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
|
||||
/** props จาก TableList */
|
||||
const props = defineProps({
|
||||
|
|
@ -22,7 +28,7 @@ const props = defineProps({
|
|||
type: Object,
|
||||
require: true,
|
||||
},
|
||||
colse: {
|
||||
close: {
|
||||
type: Function,
|
||||
require: true,
|
||||
},
|
||||
|
|
@ -63,9 +69,7 @@ async function fetchDetailByid(id: string) {
|
|||
formData.checkInImg = data.checkInImg;
|
||||
formData.checkInLat = data.checkInLat ? data.checkInLat : "";
|
||||
formData.checkInLon = data.checkInLon ? data.checkInLon : "";
|
||||
formData.checkInLocation = data.checkInLocation
|
||||
? data.checkInLocation
|
||||
: "-";
|
||||
formData.checkInLocation = data.checkInPOI ? data.checkInPOI : "-";
|
||||
formData.checkInTime = data.checkInTime ? data.checkInTime : "-";
|
||||
formData.checkOutDate = data.checkOutDate && date2Thai(data.checkOutDate);
|
||||
formData.checkOutImg = data.checkOutImg;
|
||||
|
|
@ -76,27 +80,32 @@ async function fetchDetailByid(id: string) {
|
|||
: "-";
|
||||
formData.checkOutTime = data.checkOutTime ? data.checkOutTime : "-";
|
||||
formData.fullName = data.fullName;
|
||||
formData.checkOutLocation = data.checkOutLocation
|
||||
? data.checkOutLocation
|
||||
: "-";
|
||||
formData.checkOutLocation = data.checkOutPOI ? data.checkOutPOI : "-";
|
||||
formData.checkInDescription = data.checkInDescription
|
||||
? data.checkInDescription
|
||||
: "-";
|
||||
formData.checkOutDescription = data.checkOutDescription
|
||||
? data.checkOutDescription
|
||||
: "-";
|
||||
formData.checkInStatus = data.checkInStatus;
|
||||
formData.checkOutStatus = data.checkOutStatus;
|
||||
formData.checkInStatus = data.checkInStatus
|
||||
? convertSatatus(data.checkInStatus)
|
||||
: "-";
|
||||
formData.checkOutStatus = data.checkOutStatus
|
||||
? convertSatatus(data.checkOutStatus)
|
||||
: "-";
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
closePopup();
|
||||
})
|
||||
.catch((err) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** Function ปิด popup */
|
||||
function colsePopup() {
|
||||
props.colse ? props.colse() : false;
|
||||
function closePopup() {
|
||||
props.close ? props.close() : false;
|
||||
}
|
||||
|
||||
watch(
|
||||
|
|
@ -122,7 +131,7 @@ watch(
|
|||
round
|
||||
dense
|
||||
style="color: #eb0505; background-color: #ffdede"
|
||||
@click="colsePopup"
|
||||
@click="closePopup"
|
||||
/>
|
||||
</q-toolbar>
|
||||
<q-separator />
|
||||
|
|
@ -152,14 +161,26 @@ watch(
|
|||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="col-2">
|
||||
<q-item>
|
||||
<q-item-section>
|
||||
<q-item-label class="text-grey-8">สถานะ</q-item-label>
|
||||
<q-item-label class="text-grey-8"
|
||||
>สถานะเวลาเข้างาน
|
||||
</q-item-label>
|
||||
<q-item-label>{{ formData.checkInStatus }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<q-item>
|
||||
<q-item-section>
|
||||
<q-item-label class="text-grey-8"
|
||||
>สถานะเวลาออก</q-item-label
|
||||
>
|
||||
<q-item-label>{{ formData.checkOutStatus }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
<div class="row q-gutter-md q-pt-md">
|
||||
|
|
|
|||
|
|
@ -143,20 +143,22 @@ async function fetchListTimeRecord() {
|
|||
(e: DataResTime) => ({
|
||||
id: e.id,
|
||||
fullName: e.fullName,
|
||||
checkInDate: e.checkInDate && date2Thai(e.checkInDate),
|
||||
checkInDate: e.checkInDate ? date2Thai(e.checkInDate) : "-",
|
||||
checkInTime: e.checkInTime,
|
||||
checkInLocation: e.checkInLocation,
|
||||
checkInLat: e.checkInLat,
|
||||
checkInLon: e.checkInLon,
|
||||
checkInStatus:
|
||||
e.checkInStatus && workStore.convertSatatus(e.checkInStatus),
|
||||
checkOutDate: e.checkOutDate && date2Thai(e.checkOutDate),
|
||||
checkOutLocation: e.checkOutLocation,
|
||||
checkOutTime: e.checkOutTime,
|
||||
checkOutLat: e.checkOutLat,
|
||||
checkOutLon: e.checkOutLon,
|
||||
checkOutStatus:
|
||||
e.checkOutStatus && workStore.convertSatatus(e.checkOutStatus),
|
||||
checkInStatus: e.checkInStatus
|
||||
? workStore.convertSatatus(e.checkInStatus)
|
||||
: "-",
|
||||
checkOutDate: e.checkOutDate ? date2Thai(e.checkOutDate) : "-",
|
||||
checkOutLocation: e.checkOutLocation ? e.checkOutLocation : "-",
|
||||
checkOutTime: e.checkOutTime ? e.checkOutTime : "-",
|
||||
checkOutLat: e.checkOutLocation ? e.checkOutLat : "",
|
||||
checkOutLon: e.checkOutLocation ? e.checkOutLon : "",
|
||||
checkOutStatus: e.checkOutStatus
|
||||
? workStore.convertSatatus(e.checkOutStatus)
|
||||
: "-",
|
||||
})
|
||||
);
|
||||
rows.value = datalist;
|
||||
|
|
@ -204,6 +206,7 @@ onMounted(async () => {
|
|||
:rowsPerPage="rowsPerPage"
|
||||
:maxPage="maxPage"
|
||||
@update:pagination="updatePaging"
|
||||
:tab="'1'"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -20,7 +21,9 @@ import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
|
|||
/** useStore */
|
||||
const mixin = useCounterMixin();
|
||||
const workStore = useWorklistDataStore();
|
||||
const { date2Thai, dateToISO, showLoader, hideLoader } = mixin;
|
||||
const { date2Thai, dateToISO, showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
|
||||
/** ข้อมูลตาราง*/
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -125,7 +128,7 @@ async function fetchListLogRecord() {
|
|||
rows.value = datalist;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
rows.value = [];
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
@ -162,6 +165,7 @@ onMounted(async () => {
|
|||
:rowsPerPage="rowsPerPage"
|
||||
:maxPage="maxPage"
|
||||
@update:pagination="updatePagingProp"
|
||||
:tab="'2'"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ const props = defineProps({
|
|||
type: Number,
|
||||
require: true,
|
||||
},
|
||||
tab: {
|
||||
type: String,
|
||||
require: true,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:pagination"]);
|
||||
|
|
@ -65,12 +69,14 @@ function updateProp(newPagination: any, page: number) {
|
|||
* @param data ข้อมูลรายละเอียด
|
||||
*/
|
||||
function clickDetail(data: any) {
|
||||
modal.value = true;
|
||||
dataDetail.value = data;
|
||||
if (props.tab === "1") {
|
||||
modal.value = true;
|
||||
dataDetail.value = data;
|
||||
}
|
||||
}
|
||||
|
||||
/** Function ปิด popup */
|
||||
function colseDeyail() {
|
||||
function closeDetail() {
|
||||
modal.value = false;
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +156,7 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
|||
</template>
|
||||
</d-table>
|
||||
|
||||
<DialogDetail :modal="modal" :detail="dataDetail" :colse="colseDeyail" />
|
||||
<DialogDetail :modal="modal" :detail="dataDetail" :close="closeDetail" />
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ export const useWorklistDataStore = defineStore("work", () => {
|
|||
return "สาย";
|
||||
case "ABSENT":
|
||||
return "ขาดราชการ";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -10,6 +10,15 @@ import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.
|
|||
import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง
|
||||
import FormDisciplinary from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue"; // สอบสวนความผิดทางวินัย
|
||||
import type { FormData } from "@/modules/11_discipline/interface/request/disciplinary";
|
||||
import type {
|
||||
FormData as FormDataComplaint,
|
||||
ArrayPerson,
|
||||
ArrayFileList,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
|
||||
import type {
|
||||
FormData as FormInvestigateFact,
|
||||
} from "@/modules/11_discipline/interface/request/investigateFact";
|
||||
|
||||
/**import store*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -25,7 +34,7 @@ const route = useRoute();
|
|||
const id = ref<string>(route.params.id as string);
|
||||
const data = ref<object>();
|
||||
|
||||
/** function fetchData สอบสวนคาวมผิดทางวินัย*/
|
||||
/** function fetchData สอบสวนความผิดทางวินัย*/
|
||||
async function fetchDetailDisciplinary() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -47,7 +56,24 @@ async function fetchDetailInvestigate() {
|
|||
await http
|
||||
.get(config.API.disciplineInvestigateById(id.value))
|
||||
.then((res) => {
|
||||
data.value = res.data.result;
|
||||
const dataList = res.data.result;
|
||||
dataInvestigatefacts.id = dataList.id;
|
||||
dataInvestigatefacts.idComplaint = dataList.idComplaint;
|
||||
dataInvestigatefacts.respondentType = dataList.respondentType;
|
||||
dataInvestigatefacts.persons = dataList.persons;
|
||||
dataInvestigatefacts.investigationDetail = dataList.investigationDetail;
|
||||
dataInvestigatefacts.investigationDetailOther = dataList.investigationDetailOther;
|
||||
dataInvestigatefacts.investigationDateStart = dataList.investigationDateStart;
|
||||
dataInvestigatefacts.investigationDateEnd = dataList.investigationDateEnd;
|
||||
dataInvestigatefacts.investigationDescription = dataList.investigationDescription;
|
||||
dataInvestigatefacts.investigationCauseText = dataList.investigationCauseText;
|
||||
dataInvestigatefacts.status = dataList.status;
|
||||
dataInvestigatefacts.result = dataList.result;
|
||||
dataInvestigatefacts.directors = dataList.director;
|
||||
dataInvestigatefacts.disciplineInvestigateDocs = dataList.disciplineInvestigateDocs;
|
||||
dataInvestigatefacts.disciplineInvestigateRelevantDocs =
|
||||
dataList.disciplineInvestigateRelevantDocs;
|
||||
dataInvestigatefacts.investigationStatusResult = dataList.investigationStatusResult;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -63,7 +89,24 @@ async function fetchDetailComplaints() {
|
|||
await http
|
||||
.get(config.API.disciplineComplaintsById(id.value))
|
||||
.then((res) => {
|
||||
data.value = res.data.result;
|
||||
const dataList = res.data.result;
|
||||
dataComplaints.id = dataList.id;
|
||||
dataComplaints.respondentType = dataList.respondentType;
|
||||
dataComplaints.organizationId = dataList.organizationId;
|
||||
dataComplaints.consideredAgency = dataList.consideredAgency;
|
||||
dataComplaints.title = dataList.title;
|
||||
dataComplaints.description = dataList.description;
|
||||
dataComplaints.dateReceived = dataList.dateReceived;
|
||||
dataComplaints.levelConsideration = dataList.levelConsideration;
|
||||
dataComplaints.dateConsideration = dataList.dateConsideration;
|
||||
dataComplaints.offenseDetails = dataList.offenseDetails;
|
||||
dataComplaints.dateNotification = dataList.dateNotification;
|
||||
dataComplaints.complaintFrom = dataList.complaintFrom;
|
||||
dataComplaints.appellant = dataList.appellant;
|
||||
dataComplaints.status = dataList.status;
|
||||
dataComplaints.persons = dataList.persons;
|
||||
dataComplaints.result = dataList.result;
|
||||
dataComplaints.disciplineComplaintDocs = dataList.disciplineComplaintDocs;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -177,6 +220,78 @@ watch(
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์มเรื่องร้องเรียน */
|
||||
const personObjComplaint = reactive<ArrayPerson>({
|
||||
personId: "",
|
||||
idcard: "",
|
||||
name: "",
|
||||
prefix: "",
|
||||
firstName: "",
|
||||
lastName: "",
|
||||
posNo: "",
|
||||
position: "",
|
||||
positionLevel: "",
|
||||
salary: null,
|
||||
organization: "",
|
||||
});
|
||||
|
||||
const fileListObjComplaint = reactive<ArrayFileList>({
|
||||
id: "",
|
||||
pathName: "",
|
||||
fileName: "",
|
||||
});
|
||||
|
||||
const dataComplaints = reactive<FormDataComplaint>({
|
||||
id: "",
|
||||
respondentType: "",
|
||||
organizationId: "",
|
||||
consideredAgency: "",
|
||||
title: "",
|
||||
description: "",
|
||||
dateReceived: null,
|
||||
dateConsideration: null,
|
||||
offenseDetails: "",
|
||||
levelConsideration: "",
|
||||
dateNotification: null,
|
||||
complaintFrom: "",
|
||||
appellant: "",
|
||||
documentFile: null,
|
||||
status: "",
|
||||
persons: [personObjComplaint],
|
||||
result: "",
|
||||
disciplineComplaintDocs: [fileListObjComplaint],
|
||||
});
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์มสืบสวน */
|
||||
const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
||||
id: "",
|
||||
idComplaint: "",
|
||||
investigationDetail: "",
|
||||
complaint: "",
|
||||
complaintdetail: "",
|
||||
investigationDescription: "",
|
||||
fault: "",
|
||||
investigationDetailOther: "",
|
||||
evidenceFiles: null,
|
||||
fileComplaint: null,
|
||||
clickTime: false,
|
||||
investigationDateStart: null,
|
||||
investigationDateEnd: null,
|
||||
daysExtend: null,
|
||||
investigationStatusResult: "",
|
||||
investigationCauseText: "",
|
||||
complaintStatus: "",
|
||||
result: "",
|
||||
directors: [],
|
||||
disciplineInvestigateDocs: [],
|
||||
disciplineInvestigateRelevantDocs: [],
|
||||
status: "",
|
||||
documentFile: null,
|
||||
respondentType: "",
|
||||
organizationId: "",
|
||||
persons: [],
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
|
|
@ -223,19 +338,20 @@ watch(
|
|||
class="rounded-borders"
|
||||
indicator-color="primary"
|
||||
active-bg-color="teal-1"
|
||||
active-class="text-primary"
|
||||
active-color="primary"
|
||||
active-class="bg-teal-1"
|
||||
>
|
||||
<q-tab name="complaints" label="เรื่องร้องเรียน" />
|
||||
<q-tab name="investigatefacts" label="สืบสวนข้อเท็จจริง" />
|
||||
<q-tab name="complaints" label="เรื่องร้องเรียน (สำเนา)" />
|
||||
<q-tab name="investigatefacts" label="สืบสวนข้อเท็จจริง (สำเนา)" />
|
||||
<q-tab name="disciplinary" label="สอบสวนความผิดทางวินัย" />
|
||||
</q-tabs>
|
||||
<q-separator />
|
||||
<q-tab-panels v-model="store.tabMenu" animated>
|
||||
<q-tab-panel name="complaints">
|
||||
<FormComplaints :on-submit="onSubmit" :data="data" />
|
||||
<FormComplaints :on-submit="onSubmit" :data="dataComplaints" />
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="investigatefacts">
|
||||
<FormInvestigatefacts :on-submit="onSubmit" :data="data" />
|
||||
<FormInvestigatefacts :on-submit="onSubmit" :data="dataInvestigatefacts" />
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="disciplinary">
|
||||
<FormDisciplinary
|
||||
|
|
|
|||
|
|
@ -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,10 +47,10 @@ 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;
|
||||
|
|
@ -90,6 +90,8 @@ export const useInvestigateDisStore = defineStore(
|
|||
return "ความผิดวินัยไม่ร้ายแรง";
|
||||
case "DEADLY":
|
||||
return "ความผิดวินัยร้ายแรง";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
function convertSatatus(val: string) {
|
||||
|
|
@ -306,6 +308,7 @@ export const useInvestigateDisStore = defineStore(
|
|||
optionsTypefault,
|
||||
optionsfaultLevel,
|
||||
fecthDirector,
|
||||
|
||||
visibleColumns,
|
||||
columns,
|
||||
visibleColumnsDirector,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue