Merge branch 'develop' into devTee
This commit is contained in:
commit
69927cf089
14 changed files with 596 additions and 261 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import env from "../index";
|
||||
const discipline = `${env.API_URI}/discipline/disciplinary`;
|
||||
const investigate = `${env.API_URI}/discipline/investigate`;
|
||||
const discipline2 = `${env.API_URI}/discipline`;
|
||||
|
||||
export default {
|
||||
directorList: (page: number, pageSize: number, keyword: string) =>
|
||||
|
|
@ -14,7 +15,7 @@ export default {
|
|||
/**ลบ ช่องทางการร้องเรียน
|
||||
* @param id type
|
||||
*/
|
||||
complaintListOp:()=>`${discipline}/complaint_Channel`,
|
||||
complaintListOp: () => `${discipline}/complaint_Channel`,
|
||||
complaintChannelbyId: (id: string) => `${discipline}/complaint_Channel/${id}`,
|
||||
complaintAdd: () => `${discipline}/complaint`,
|
||||
complaintbyId: (id: string) => `${discipline}/complaint/${id}`,
|
||||
|
|
@ -47,19 +48,19 @@ export default {
|
|||
|
||||
/** ระบบวินัยเรื่องสอบสวน */
|
||||
disciplineDisciplinary: () => `${discipline}`,
|
||||
disciplineDisciplinaryById: (id: string) =>
|
||||
`${discipline}/${id}`,
|
||||
disciplineInvestigateById: (id: string) =>
|
||||
`${discipline}/investigate/${id}`,
|
||||
disciplineComplaintsById: (id: string) =>
|
||||
`${discipline}/complaint/${id}`,
|
||||
disciplineDisciplinaryById: (id: string) => `${discipline}/${id}`,
|
||||
disciplineInvestigateById: (id: string) => `${discipline}/investigate/${id}`,
|
||||
disciplineComplaintsById: (id: string) => `${discipline}/complaint/${id}`,
|
||||
disciplineDirector: () => `${discipline}/director`,
|
||||
disciplineDoc: (type: string, id: string) =>
|
||||
`${discipline}/${type}/file/${id}`,
|
||||
disciplineByIdDoc: (type: string, id: string, docId: string) =>
|
||||
`${discipline}/${type}/file/${id}/${docId}`,
|
||||
`${discipline}/disciplinary/${type}/file/${id}/${docId}`,
|
||||
disciplinaryReject: (id: string) => `${discipline}/reject/${id}`,
|
||||
disciplinaryResume: (id: string) => `${discipline}/resume/${id}`,
|
||||
disciplinaryApprove: (id: string) => `${discipline}/approve/${id}`,
|
||||
|
||||
disciplinaryReject: (id: string) => `${discipline}/reject/${id}`,
|
||||
disciplinaryResume: (id: string) => `${discipline}/resume/${id}`,
|
||||
disciplinaryApprove: (id: string) => `${discipline}/approve/${id}`,
|
||||
/** รายการผลการพิจารณาทางวินัย*/
|
||||
listResult: () => `${discipline2}/result`,
|
||||
listResultById: (id: string) => `${discipline2}/result/${id}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ const $q = useQuasar(); //ใช้ noti quasar
|
|||
/** ตัวแปร querySting*/
|
||||
const keyword = ref<string>("");
|
||||
const page = ref<number>(1);
|
||||
const rowsPerPage = ref<number>(10);
|
||||
const rowsPerPage = ref<number>(3);
|
||||
const maxPage = ref<number>(1);
|
||||
const filetStatus = ref<string>("ALL");
|
||||
|
||||
|
|
|
|||
|
|
@ -26,33 +26,6 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
|||
const selectDate = ref<Date | null>(new Date());
|
||||
const fiscalYear = ref<string | null>("0");
|
||||
const DataMainOrig = ref<DataRows[]>([]); // ข้อมูลหลักดั้งเดิม
|
||||
// async function fecthList(data: ListData[]) {
|
||||
// let datalist: DataRows[] = data.map((e: ListData) => ({
|
||||
// id: e.id,
|
||||
// fullname: e.fullname,
|
||||
// date: date2Thai(new Date(e.date), false, true),
|
||||
// dateFix: date2Thai(new Date(e.dateFix)),
|
||||
// timeMorning:
|
||||
// e.startTimeMorning == null
|
||||
// ? "-"
|
||||
// : e.startTimeMorning + " - " + e.endTimeMorning,
|
||||
// timeAfternoon:
|
||||
// e.startTimeAfternoon == null
|
||||
// ? "-"
|
||||
// : e.startTimeAfternoon + " - " + e.endTimeAfternoon,
|
||||
// startTimeMorning: e.startTimeMorning,
|
||||
// endTimeMorning: e.endTimeMorning,
|
||||
// startTimeAfternoon: e.startTimeAfternoon,
|
||||
// endTimeAfternoon: e.endTimeAfternoon,
|
||||
// checkIn: e.checkOut,
|
||||
// checkOut: e.checkOut,
|
||||
// status: e.status,
|
||||
// checkInStatus: convertStatus(e.checkInStatus),
|
||||
// checkOutStatus: convertStatus(e.checkOutStatus),
|
||||
// }));
|
||||
// rows.value = datalist;
|
||||
// DataMainOrig.value = datalist;
|
||||
// }
|
||||
const DataMainUpdate = ref<DataRows[]>([]); // ข้อมูลเปลี่ยนแปลง
|
||||
const DataMain = (val: DataRows[]) => (DataMainOrig.value = val);
|
||||
const DataUpdate = (filterYear: string) => {
|
||||
|
|
@ -68,15 +41,16 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
|||
const year = ref<number>(2023);
|
||||
const month = ref<number>(11);
|
||||
const page = ref<number>(1);
|
||||
const total = ref<number>(0);
|
||||
const pageSize = ref<number>(10);
|
||||
const filter = ref<string>(""); //search data table
|
||||
|
||||
const maxPage = ref<number>(0);
|
||||
// Pagination - update rowsPerPage
|
||||
async function updatePagination(newPagination: any) {
|
||||
initialPagination.value = newPagination;
|
||||
// currentPage.value = 1;
|
||||
console.log("updatePagination");
|
||||
}
|
||||
// async function updatePagination(newPagination: any) {
|
||||
// initialPagination.value = newPagination;
|
||||
// // currentPage.value = 1;
|
||||
// console.log("updatePagination");
|
||||
// }
|
||||
|
||||
// Pagination - initial pagination
|
||||
const initialPagination = ref<any>({
|
||||
|
|
@ -86,21 +60,6 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
|||
// rowsPerPage: pageSize,
|
||||
});
|
||||
|
||||
// Pagination - page & change page & get new data
|
||||
// const currentPage = ref<number>(1);
|
||||
// watch(
|
||||
// [() => currentPage.value, () => initialPagination.value.rowsPerPage],
|
||||
// () => {
|
||||
// emit(
|
||||
// "update:change-page",
|
||||
// currentPage.value,
|
||||
// initialPagination.value.rowsPerPage,
|
||||
// true
|
||||
// );
|
||||
// }
|
||||
// );
|
||||
|
||||
// const emit = defineEmits(["update:change-page"]);
|
||||
/**
|
||||
* ฟังก์ชั่น api เปลี่ยนหน้า
|
||||
* @param pageVal page
|
||||
|
|
@ -123,12 +82,16 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
|||
config.API.specialTime() +
|
||||
`?year=${year.value}&month=${month.value}&page=${page.value}&pageSize=${pageSize.value}&keyword=${filter.value}`
|
||||
)
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
.then(async (res) => {
|
||||
let data = res.data.result.data;
|
||||
total.value = res.data.result.total;
|
||||
maxPage.value = await Math.ceil(total.value / pageSize.value);
|
||||
maxPage.value = maxPage.value < 1 ? 1 : maxPage.value;
|
||||
rows.value = [];
|
||||
data.map((e: any) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
fullname: e.fullname,
|
||||
fullname: e.fullName,
|
||||
date: date2Thai(new Date(e.checkDate), false, true),
|
||||
dateFix: date2Thai(new Date(e.createdAt)),
|
||||
timeMorning:
|
||||
|
|
@ -299,7 +262,11 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
|||
optionStatus,
|
||||
fetchData,
|
||||
changePage,
|
||||
initialPagination,
|
||||
updatePagination,
|
||||
total,
|
||||
maxPage,
|
||||
year,
|
||||
page,
|
||||
pageSize,
|
||||
month,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import config from "@/app.config";
|
|||
|
||||
import { useRouter } from "vue-router";
|
||||
import { identity } from "@fullcalendar/core/internal";
|
||||
|
||||
/**ตัวแปรที่ใช้ */
|
||||
const dataSpecialTime = useSpecialTimeStore();
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -20,21 +22,14 @@ const modalUnapprove = ref(false);
|
|||
const modalApprove = ref(false);
|
||||
const detailData = ref<any>();
|
||||
const editCheck = ref<string>("");
|
||||
|
||||
const pagination = ref({
|
||||
// sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const dialogTitle = ref<string>("");
|
||||
const dialogDesc = ref<string>("");
|
||||
const name = ref<string>("");
|
||||
const id = ref<string>("");
|
||||
const reasonNote = ref<string>("");
|
||||
const dateDialog = ref<string>("");
|
||||
const dateFixDialog = ref<string>("");
|
||||
|
||||
/**ฟังก์ชั่นไม่อนุมัติ */
|
||||
const unapprove = async (fullname: string, personId: string) => {
|
||||
id.value = personId;
|
||||
dialogTitle.value = " ไม่อนุมัติการลงเวลาพิเศษของ" + fullname;
|
||||
|
|
@ -42,6 +37,9 @@ const unapprove = async (fullname: string, personId: string) => {
|
|||
modalUnapprove.value = true;
|
||||
// rejectData();
|
||||
};
|
||||
|
||||
/** function Model */
|
||||
//เปิด
|
||||
function openModal(
|
||||
data: any,
|
||||
check: string,
|
||||
|
|
@ -60,6 +58,7 @@ function openModal(
|
|||
}
|
||||
console.log(data);
|
||||
}
|
||||
//ปิด
|
||||
const closeDialog = () => {
|
||||
modalUnapprove.value = false;
|
||||
modalApprove.value = false;
|
||||
|
|
@ -94,63 +93,63 @@ const resetFilter = () => {
|
|||
}
|
||||
};
|
||||
|
||||
// paging
|
||||
const page = ref<number>(1);
|
||||
const pageSize = ref<number>(10);
|
||||
const filter = ref<string>(""); //search data table
|
||||
/**
|
||||
* ฟังก์ชั่น api เปลี่ยนหน้า
|
||||
* @param pageVal page
|
||||
* @param pageSizeVal pagesize
|
||||
*/
|
||||
async function changePage(pageVal: number, pageSizeVal: number) {
|
||||
// page.value = await pageVal;
|
||||
// pageSize.value = await pageSizeVal;
|
||||
// dataSpecialTime.fetchData();
|
||||
console.log("test");
|
||||
}
|
||||
// Pagination - initial pagination
|
||||
const initialPagination = ref<any>({
|
||||
sortBy: null,
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: pageSize, // set ตาม page หลักส่งมา
|
||||
});
|
||||
const emit = defineEmits(["update:change-page"]);
|
||||
// Pagination - page & change page & get new data
|
||||
const currentPage = ref<number>(1);
|
||||
watch(
|
||||
[() => currentPage.value, () => initialPagination.value.rowsPerPage],
|
||||
async () => {
|
||||
dataSpecialTime.page = currentPage.value;
|
||||
await dataSpecialTime.fetchData();
|
||||
// emit(
|
||||
// "update:change-page",
|
||||
// currentPage.value,
|
||||
// initialPagination.value.rowsPerPage,
|
||||
// true
|
||||
// );
|
||||
}
|
||||
);
|
||||
// Pagination - update rowsPerPage
|
||||
async function updatePagination(newPagination: any) {
|
||||
currentPage.value = 1;
|
||||
dataSpecialTime.pageSize = initialPagination.value.rowsPerPage;
|
||||
dataSpecialTime.page = 1; // set current page เป็น 1 เสมอเมื่อเปลี่ยน per row
|
||||
}
|
||||
|
||||
/**Hook */
|
||||
onMounted(async () => {
|
||||
// fecthList([
|
||||
// {
|
||||
// id: "eefa2f4f-c507-4a42-8567-4fadb8dc1f50",
|
||||
// fullname: "นางสาวณัฐกา ชมสิน",
|
||||
// date: "2023-11-01 08:54",
|
||||
// dateFix: "2023-10-30",
|
||||
// startTimeMorning: "08:00",
|
||||
// endTimeMorning: "12:00",
|
||||
// startTimeAfternoon: "08:00",
|
||||
// endTimeAfternoon: "12:00",
|
||||
// status: "PENDING",
|
||||
// checkInStatus: "normal",
|
||||
// checkOutStatus: "late",
|
||||
// checkIn: "08:00",
|
||||
// checkOut: "12.00",
|
||||
// },
|
||||
// {
|
||||
// id: "00000000-0000-0000-0000-000000000000",
|
||||
// fullname: "นางสาวรัชภรณ์ ภักดี",
|
||||
// date: "2023-10-30 08:55",
|
||||
// dateFix: "2023-10-29",
|
||||
// startTimeMorning: "08:00",
|
||||
// endTimeMorning: "12:00",
|
||||
// startTimeAfternoon: null,
|
||||
// endTimeAfternoon: null,
|
||||
// status: "APPROVE",
|
||||
// checkInStatus: "normal",
|
||||
// checkOutStatus: "late",
|
||||
// checkIn: "08:00",
|
||||
// checkOut: "12.00",
|
||||
// },
|
||||
// {
|
||||
// id: "00000000-0000-0000-0000-000000000000",
|
||||
// fullname: "นางสาวภาพรรณ ลออ",
|
||||
// date: "2023-10-31 18:54",
|
||||
// dateFix: "2023-10-30",
|
||||
// startTimeMorning: null,
|
||||
// endTimeMorning: null,
|
||||
// startTimeAfternoon: "13:00",
|
||||
// endTimeAfternoon: "16:30",
|
||||
// status: "REJECT",
|
||||
// checkInStatus: "normal",
|
||||
// checkOutStatus: "late",
|
||||
// checkIn: "08:00",
|
||||
// checkOut: "12.00",
|
||||
// },
|
||||
// ]);
|
||||
dataSpecialTime.fetchData();
|
||||
console.log("test");
|
||||
await dataSpecialTime.fetchData();
|
||||
});
|
||||
|
||||
/** Function Date */
|
||||
const selectedDate = ref<string>("");
|
||||
const dateMonth = ref<any>({
|
||||
month: new Date().getMonth(),
|
||||
year: new Date().getFullYear(),
|
||||
});
|
||||
|
||||
const monthYearThai = (val: any) => {
|
||||
if (val == null) return "";
|
||||
else return monthYear2Thai(val.month, val.year);
|
||||
|
|
@ -244,13 +243,26 @@ const monthYearThai = (val: any) => {
|
|||
row-key="tb-list"
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
:paging="false"
|
||||
dense
|
||||
:pagination="dataSpecialTime.initialPagination"
|
||||
:visible-columns="dataSpecialTime.visibleColumns"
|
||||
:rows-per-page-options="[1, 10, 25, 50, 100]"
|
||||
@update:pagination="dataSpecialTime.updatePagination"
|
||||
:rows-per-page-options="[5, 10, 25, 50, 100]"
|
||||
v-model:pagination="initialPagination"
|
||||
@update:pagination="updatePagination"
|
||||
>
|
||||
<template v-slot:pagination="scope">
|
||||
ทั้งหมด {{ dataSpecialTime.total }} รายการ
|
||||
<q-pagination
|
||||
v-model="currentPage"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
:max="Number(dataSpecialTime.maxPage)"
|
||||
></q-pagination>
|
||||
</template>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
|
|
|
|||
|
|
@ -74,12 +74,6 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const fileListOj = reactive<ArrayFileList>({
|
||||
id: "",
|
||||
pathName: "",
|
||||
fileName: "",
|
||||
});
|
||||
|
||||
const formData = reactive<FormData>({
|
||||
id: "",
|
||||
respondentType: "",
|
||||
|
|
@ -261,20 +255,20 @@ async function fileUploadDoc(documentFile: any) {
|
|||
*/
|
||||
function selectLevel(val: string) {
|
||||
let dayNum = 0;
|
||||
if (val == "3") {
|
||||
if (val == "VERY_URGENT") {
|
||||
dayNum = 15; // ด่วนมาก
|
||||
} else if (val == "1") {
|
||||
} else if (val == "URGENT") {
|
||||
dayNum = 30; // ด่วน
|
||||
} else {
|
||||
dayNum = 45; // ปกติ
|
||||
}
|
||||
// วันแจ้งเตือนล่วงหน้า
|
||||
if (formData.dateConsideration) {
|
||||
const currentDate = new Date(formData.dateConsideration);
|
||||
if (formData.dateReceived) {
|
||||
const currentDate = new Date(formData.dateReceived);
|
||||
const newDate = new Date(
|
||||
currentDate.getTime() + dayNum * 24 * 60 * 60 * 1000
|
||||
);
|
||||
formData.dateNotification = newDate;
|
||||
formData.dateConsideration = newDate;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -410,6 +404,7 @@ function upLoadFileDoc() {
|
|||
|
||||
async function addPerson(data: any) {
|
||||
toggleModal();
|
||||
changeFormData();
|
||||
await complainstStore.fetchComplainstAdd(data);
|
||||
}
|
||||
|
||||
|
|
@ -425,20 +420,24 @@ function deletePerson(id: string) {
|
|||
}
|
||||
|
||||
function removePerson(id: string) {
|
||||
isSave.value = true;
|
||||
changeFormData();
|
||||
const dataRow = complainstStore.rowsAdd;
|
||||
const updatedRows = dataRow.filter((item: any) => item.personId !== id);
|
||||
complainstStore.rowsAdd = updatedRows;
|
||||
}
|
||||
|
||||
function getList() {
|
||||
function getListChannel() {
|
||||
http.get(config.API.complaintListOp()).then((res) => {
|
||||
complaintFromtoptions.value = res.data.result.data;
|
||||
});
|
||||
}
|
||||
|
||||
function changeFormData() {
|
||||
isSave.value = props.data != null ?? true;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getListChannel();
|
||||
getOc();
|
||||
complainstStore.columns = columns.value;
|
||||
complainstStore.visibleColumns = visibleColumns.value;
|
||||
|
|
@ -487,6 +486,7 @@ onMounted(() => {
|
|||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn, 'filterrespondentType'
|
||||
)"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
|
|
@ -522,6 +522,7 @@ onMounted(() => {
|
|||
label="เลือกสำนักงาน"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกสำนักงาน'}`]"
|
||||
lazy-rules
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -548,6 +549,7 @@ onMounted(() => {
|
|||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn, 'filterconsideredAgencytoptions'
|
||||
)"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
|
|
@ -686,6 +688,7 @@ onMounted(() => {
|
|||
label="เรื่องร้องเรียน"
|
||||
type="textarea"
|
||||
rows="5"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -705,6 +708,7 @@ onMounted(() => {
|
|||
label="รายละเอียดเรื่องร้องเรียน"
|
||||
type="textarea"
|
||||
rows="5"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -720,6 +724,7 @@ onMounted(() => {
|
|||
"
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
|
|
@ -784,7 +789,8 @@ onMounted(() => {
|
|||
]"
|
||||
lazy-rules
|
||||
@update:model-value="
|
||||
selectLevel(formData.levelConsideration)
|
||||
selectLevel(formData.levelConsideration);
|
||||
changeFormData();
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -793,9 +799,7 @@ onMounted(() => {
|
|||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="formData.dateConsideration"
|
||||
@update:model-value="
|
||||
selectLevel(formData.levelConsideration)
|
||||
"
|
||||
@update:model-value="changeFormData()"
|
||||
:locale="'th'"
|
||||
:readonly="
|
||||
formData.status !== 'NEW' && formData.status !== ''
|
||||
|
|
@ -866,6 +870,7 @@ onMounted(() => {
|
|||
map-options
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกลักษณะความผิด'}`]"
|
||||
lazy-rules
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -881,6 +886,7 @@ onMounted(() => {
|
|||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
|
|
@ -945,6 +951,7 @@ onMounted(() => {
|
|||
(val) => !!val || `${'กรุณาเลือกรับเรื่องร้องเรียน'}`,
|
||||
]"
|
||||
lazy-rules
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -964,6 +971,7 @@ onMounted(() => {
|
|||
hide-bottom-space
|
||||
type="textarea"
|
||||
rows="5"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
|
|
@ -984,6 +992,7 @@ onMounted(() => {
|
|||
label="ผลการตรวจสอบเรื่องร้องเรียน"
|
||||
type="textarea"
|
||||
rows="5"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1100,7 +1109,7 @@ onMounted(() => {
|
|||
</q-list>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-mt-sm" v-if="fileList.length == 0">
|
||||
<div class="col-12 q-pa-sm" v-if="fileList.length == 0">
|
||||
<q-card class="q-pa-md" bordered> ไม่มีรายการเอกสาร </q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,18 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||
import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง
|
||||
import FormDisciplinary from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue"; // สอบสวนความผิดทางวินัย
|
||||
import FormResult from "@/modules/11_discipline/components/4_Result/Form.vue"; // สอบสวนความผิดทางวินัย
|
||||
import type { FormData } from "@/modules/11_discipline/interface/request/result";
|
||||
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 { useRouter, useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
|
||||
|
|
@ -14,7 +22,7 @@ import DialogSendToCommand from "@/modules/11_discipline/components/4_Result/Dia
|
|||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const store = useDisciplineResultStore();
|
||||
const { dialogConfirm } = mixin;
|
||||
const { dialogConfirm, showLoader, hideLoader, messageError } = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
|
|
@ -61,11 +69,201 @@ function sentIssue() {
|
|||
// );
|
||||
}
|
||||
|
||||
const dataResult = ref<Object[]>([]);
|
||||
/** function เรียกรายละเอียดผลการพิจารณาทางวินัย*/
|
||||
async function fetchDetailResult() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listResultById(id.value))
|
||||
.then((res) => {
|
||||
dataResult.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
const dataDisciplinary = ref<object>([]);
|
||||
/** function เรียกรายละเอียดสอบสวนความผิดทางวินัย*/
|
||||
async function fetchDetailDisciplinary() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.disciplineDisciplinaryById(id.value))
|
||||
.then((res) => {
|
||||
dataDisciplinary.value = res.data.result;
|
||||
// status.value = res.data.result.status;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
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: [],
|
||||
});
|
||||
/** function เรียกรายละเอียดสืบสวนข้อเท็จจริง*/
|
||||
async function fetchDetailInvestigate() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.disciplineInvestigateById(id.value))
|
||||
.then((res) => {
|
||||
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);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
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],
|
||||
});
|
||||
/** function เรียกรายละเอียดเรื่องร้องเรียน*/
|
||||
async function fetchDetailComplaints() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.disciplineComplaintsById(id.value))
|
||||
.then((res) => {
|
||||
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);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
||||
onMounted(async () => {
|
||||
store.tabMenu = "result";
|
||||
await fetchData();
|
||||
await fetchDetailResult();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => store.tabMenu,
|
||||
async () => {
|
||||
const fetchFunction =
|
||||
store.tabMenu === "disciplinary"
|
||||
? fetchDetailDisciplinary
|
||||
: store.tabMenu === "investigatefacts"
|
||||
? fetchDetailInvestigate
|
||||
: store.tabMenu === "complaints"
|
||||
? fetchDetailComplaints
|
||||
: store.tabMenu === "result"
|
||||
? fetchDetailResult
|
||||
: null;
|
||||
|
||||
fetchFunction && (await fetchFunction());
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
|
|
@ -105,16 +303,23 @@ onMounted(async () => {
|
|||
<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 :on-submit="onSubmit" :data="data" />
|
||||
<FormDisciplinary :on-submit="onSubmit" :data="dataDisciplinary" />
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="result">
|
||||
<FormResult :on-submit="onSubmit" :data="data" />
|
||||
<FormResult
|
||||
:on-submit="onSubmit"
|
||||
:data="dataResult"
|
||||
:fetchData="fetchDetailResult"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
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 { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
|
||||
|
||||
|
|
@ -14,7 +17,7 @@ const investigateDis = useInvestigateDisStore();
|
|||
const { fecthDirector } = investigateDis;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, hideLoader, dialogConfirm } = mixin;
|
||||
const { date2Thai, hideLoader, dialogConfirm, success, messageError } = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
|
|
@ -34,16 +37,20 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => "",
|
||||
},
|
||||
fetchData: {
|
||||
type: Function,
|
||||
default: () => "",
|
||||
},
|
||||
});
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
const formData = reactive<FormData>({
|
||||
detail: "",
|
||||
resultDescription: "",
|
||||
});
|
||||
|
||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
||||
const objectdisciplinary: FormRef = {
|
||||
detail: detailRef,
|
||||
resultDescription: detailRef,
|
||||
};
|
||||
|
||||
/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */
|
||||
|
|
@ -74,8 +81,17 @@ function onSubmit() {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
console.log(formData);
|
||||
props.onSubmit();
|
||||
await http
|
||||
.put(config.API.listResultById(id.value), formData)
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(async () => {
|
||||
await props.fetchData();
|
||||
});
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
|
|
@ -83,23 +99,24 @@ function onSubmit() {
|
|||
}
|
||||
|
||||
async function fetchDatadetail() {
|
||||
formData.detail = props.data.detail;
|
||||
formData.resultDescription = props.data.resultDescription;
|
||||
}
|
||||
/**
|
||||
* เช็คข้อมูลจาก props
|
||||
* เมื่อมีข้อมูล
|
||||
* เก็บข้อมูลลง formData
|
||||
*/
|
||||
watch(props.data, async () => {
|
||||
fetchDatadetail();
|
||||
});
|
||||
watch(
|
||||
() => props.data,
|
||||
async () => {
|
||||
await fetchDatadetail();
|
||||
}
|
||||
);
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
onMounted(async () => {
|
||||
await fetchDatadetail();
|
||||
});
|
||||
onMounted(async () => {});
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
|
|
@ -114,7 +131,7 @@ onMounted(async () => {
|
|||
dense
|
||||
outlined
|
||||
ref="detailRef"
|
||||
v-model="formData.detail"
|
||||
v-model="formData.resultDescription"
|
||||
for="#detail"
|
||||
label="สรุปผลการพิจารณา"
|
||||
hide-bottom-space
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import Table from "@/modules/11_discipline/components/4_Result/Table.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
|
||||
|
|
@ -9,16 +12,51 @@ import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
|||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const router = useRouter();
|
||||
const filter = ref<string>(""); //search data table
|
||||
//search data table
|
||||
const mixin = useCounterMixin();
|
||||
const dataInvestigateDis = useDisciplineResultStore();
|
||||
const { showLoader, hideLoader } = mixin;
|
||||
const { fecthList } = dataInvestigateDis;
|
||||
const store = useDisciplineResultStore();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
const { fetchList } = store;
|
||||
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
|
||||
const page = ref<number>(1);
|
||||
const pageSize = ref<number>(5);
|
||||
const maxPage = ref<number>(1);
|
||||
const filter = ref<string>("");
|
||||
|
||||
/** function เรียกรายการผลการพิจารณาทางวินัย*/
|
||||
async function fetchListResult() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.listResult() +
|
||||
`?page=${page.value}&pageSize=${pageSize.value}&keyword=${filter.value}`
|
||||
)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result.data;
|
||||
maxPage.value = Math.ceil(res.data.result.total / pageSize.value);
|
||||
await fetchList(data);
|
||||
console.log(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function updateQueryString(p: number, pS: number, key: string) {
|
||||
page.value = pS === pageSize.value ? p : 1;
|
||||
pageSize.value = pS;
|
||||
filter.value = key;
|
||||
await fetchListResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* ไปหน้าแก้ไข
|
||||
* @param id ไอดีเฉพาะ รายบุคคล
|
||||
|
|
@ -32,43 +70,7 @@ function openEdit(id: string) {
|
|||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
onMounted(async () => {
|
||||
showLoader();
|
||||
fecthList([
|
||||
{
|
||||
id: "001",
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
interrogated: "ศิรินภา คงน้อยี่",
|
||||
fault: "1",
|
||||
penaltyLevel: "7",
|
||||
caseFault: "ทุจริตในหน้าที่",
|
||||
dateInvestigate: "2023-12-01",
|
||||
status: "0",
|
||||
active: "2",
|
||||
},
|
||||
{
|
||||
id: "002",
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
interrogated: "ภัทรานุช คงน้อย",
|
||||
fault: "1",
|
||||
penaltyLevel: "7",
|
||||
caseFault: "ทุจริตในหน้าที่",
|
||||
dateInvestigate: "2023-11-30",
|
||||
status: "0",
|
||||
active: "0",
|
||||
},
|
||||
{
|
||||
id: "003",
|
||||
subject: "กระทำทุจริตเงินกองทุน",
|
||||
interrogated: "ปรมาพร ศรีมี",
|
||||
fault: "2",
|
||||
penaltyLevel: "1",
|
||||
caseFault: "พบการทุจริต",
|
||||
dateInvestigate: "2023-09-14",
|
||||
status: "1",
|
||||
active: "1",
|
||||
},
|
||||
]);
|
||||
await hideLoader();
|
||||
await fetchListResult();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -80,16 +82,19 @@ onMounted(async () => {
|
|||
<div>
|
||||
<Table
|
||||
style="max-height: 80vh"
|
||||
:rows="dataInvestigateDis.rows"
|
||||
:columns="dataInvestigateDis.columns"
|
||||
:filter="filter"
|
||||
:visible-columns="dataInvestigateDis.visibleColumns"
|
||||
:rows="store.rows"
|
||||
:columns="store.columns"
|
||||
:visible-columns="store.visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="dataInvestigateDis.visibleColumns"
|
||||
v-model:inputvisible="store.visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
:page="page"
|
||||
:pageSize="pageSize"
|
||||
:maxPage="maxPage"
|
||||
@update:queryString="updateQueryString"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
|
|
|
|||
|
|
@ -1,17 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import { ref, useAttrs, watch } from "vue";
|
||||
import type { Pagination } from "@/modules/04_registry/interface/index/Main";
|
||||
|
||||
const table = ref<any>(null);
|
||||
const filterRef = ref<any>(null);
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const paging = ref<boolean>(true);
|
||||
const pagination = ref({
|
||||
// sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
|
|
@ -35,19 +29,32 @@ const props = defineProps({
|
|||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
page: {
|
||||
type: Number,
|
||||
},
|
||||
pageSize: {
|
||||
type: Number,
|
||||
},
|
||||
maxPage: {
|
||||
type: Number,
|
||||
},
|
||||
});
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const filter = ref<string>("");
|
||||
const pagination = ref({
|
||||
descending: false,
|
||||
page: props.page,
|
||||
rowsPerPage: props.pageSize,
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
"update:inputfilter",
|
||||
"update:inputvisible",
|
||||
"update:editvisible",
|
||||
"update:queryString",
|
||||
]);
|
||||
|
||||
function paginationLabel(start: string, end: string, total: string) {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
}
|
||||
|
||||
function updateInput(value: string | number | null) {
|
||||
emit("update:inputfilter", value);
|
||||
}
|
||||
|
|
@ -61,6 +68,22 @@ function resetFilter() {
|
|||
emit("update:inputfilter", "");
|
||||
filterRef.value.focus();
|
||||
}
|
||||
|
||||
function filterFn() {
|
||||
updatePaging(
|
||||
currentPage.value,
|
||||
Number(pagination.value.rowsPerPage),
|
||||
filter.value
|
||||
);
|
||||
}
|
||||
|
||||
function updatePaging(p: number, pS: number, key: string) {
|
||||
emit("update:queryString", p, pS, key);
|
||||
}
|
||||
|
||||
watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
||||
filterFn();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -82,9 +105,9 @@ function resetFilter() {
|
|||
<q-input
|
||||
standout
|
||||
dense
|
||||
:model-value="inputfilter"
|
||||
v-model="filter"
|
||||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
@keydown.enter.prevent="filterFn"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
|
|
@ -92,9 +115,9 @@ function resetFilter() {
|
|||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="inputfilter == ''" name="search" />
|
||||
<q-icon v-if="filter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="inputfilter !== ''"
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
|
|
@ -125,8 +148,8 @@ function resetFilter() {
|
|||
virtual-scroll
|
||||
:virtual-scroll-sticky-size-start="48"
|
||||
dense
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
|
|
@ -138,6 +161,17 @@ function resetFilter() {
|
|||
<template #body="props">
|
||||
<slot v-bind="props" name="columns"></slot>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="currentPage"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="Number(props.maxPage)"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</d-table>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
interface FormData {
|
||||
detail: string;
|
||||
resultDescription: string;
|
||||
}
|
||||
|
||||
interface FormRef {
|
||||
detail: object | null;
|
||||
resultDescription: object | null;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
|
|
|
|||
22
src/modules/11_discipline/interface/response/result.ts
Normal file
22
src/modules/11_discipline/interface/response/result.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
interface DataResult {
|
||||
id: string; //id รายการ
|
||||
title: string; //เรื่องที่ร้องเรียน
|
||||
respondentType: string; //ผู้ถูกร้องเรียน
|
||||
offenseDetails: string; //ลักษณะความผิดครั้งแรกจะเป็น
|
||||
disciplinaryFaultLevel: string; //ระดับโทษความผิด
|
||||
disciplinaryCaseFault: string; //กรณีความผิด
|
||||
status: string; //สถานะ
|
||||
createdAt: Date | null; //วันที่ส่งเรื่องสอบสวน
|
||||
}
|
||||
interface DataResultList {
|
||||
id: string; //id รายการ
|
||||
title: string; //เรื่องที่ร้องเรียน
|
||||
respondentType: string | undefined; //ผู้ถูกร้องเรียน
|
||||
offenseDetails: string | undefined; //ลักษณะความผิดครั้งแรกจะเป็น
|
||||
disciplinaryFaultLevel: string; //ระดับโทษความผิด
|
||||
disciplinaryCaseFault: string; //กรณีความผิด
|
||||
status: string | undefined; //สถานะ
|
||||
createdAt: string | null; //วันที่ส่งเรื่องสอบสวน
|
||||
}
|
||||
|
||||
export type { DataResult, DataResultList };
|
||||
42
src/modules/11_discipline/store.ts
Normal file
42
src/modules/11_discipline/store.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { defineStore } from "pinia";
|
||||
|
||||
export const useStoreResultMain = defineStore("resultMain", () => {
|
||||
/** function ผู้ถูกสอบสวน*/
|
||||
function convertRespondentType(val: string) {
|
||||
switch (val) {
|
||||
case "PERSON":
|
||||
return "บุคคล";
|
||||
case "ORGANIZATION":
|
||||
return "หน่วยงาน";
|
||||
case "BANGKOK":
|
||||
return "กรุงเทพมหานคร";
|
||||
}
|
||||
}
|
||||
|
||||
/** function ลักษณะความผิด*/
|
||||
function convertFault(val: string) {
|
||||
switch (val) {
|
||||
case "NOT_SPECIFIED":
|
||||
return "ความผิดวินัยยังไม่ระบุ";
|
||||
case "NOT_DEADLY":
|
||||
return "ความผิดวินัยไม่ร้ายแรง";
|
||||
case "DEADLY":
|
||||
return "ความผิดวินัยร้ายแรง";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
/** function ลักษณะความผิด*/
|
||||
function convertStatus(val: string) {
|
||||
switch (val) {
|
||||
case "NEW":
|
||||
return "กำลังสอบสวน";
|
||||
case "STOP":
|
||||
return "ยุติเรื่อง";
|
||||
case "SEND_DISCIPLINARY":
|
||||
return "ส่งไปสอบสวน";
|
||||
}
|
||||
}
|
||||
return { convertRespondentType, convertFault, convertStatus };
|
||||
});
|
||||
|
|
@ -7,7 +7,7 @@ import type {
|
|||
directorType,
|
||||
responseType,
|
||||
DataOptioGroup,
|
||||
DataNumberOption
|
||||
DataNumberOption,
|
||||
} from "@/modules/11_discipline/interface/index/Main";
|
||||
import type {
|
||||
Persons
|
||||
|
|
@ -36,7 +36,7 @@ export const useInvestigateDisStore = defineStore(
|
|||
{ id: "NOT_SPECIFIED", name: "ยังไม่ระบุ" },
|
||||
{ id: "HAVE_CAUSE", name: "มีมูล" },
|
||||
{ id: "NO_CAUSE", name: "ไม่มีมูล" },
|
||||
]);
|
||||
]);
|
||||
|
||||
const optionsfaultLevel = ref<DataOptioGroup[]>([
|
||||
{ id: "0", name: "ไม่ร้ายแรง", disable: true },
|
||||
|
|
@ -362,7 +362,10 @@ export const useInvestigateDisStore = defineStore(
|
|||
daysExtendOps,
|
||||
|
||||
filterFnOptionsType,
|
||||
causeTextOptions
|
||||
causeTextOptions,
|
||||
|
||||
convertRespondentType,
|
||||
convertFault,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -6,25 +6,43 @@ import type {
|
|||
DataOption,
|
||||
directorType,
|
||||
} from "@/modules/11_discipline/interface/index/Main";
|
||||
import type {
|
||||
DataResult,
|
||||
DataResultList,
|
||||
} from "@/modules/11_discipline/interface/response/result";
|
||||
|
||||
import { useStoreResultMain } from "@/modules/11_discipline/store";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
const mixin = useCounterMixin();
|
||||
const storeMain = useStoreResultMain();
|
||||
const { date2Thai } = mixin;
|
||||
|
||||
export const useDisciplineResultStore = defineStore(
|
||||
"disciplineResultStore",
|
||||
() => {
|
||||
const tabMenu = ref<string>("result");
|
||||
const rows = ref<investigateDisDataRowType[]>([]);
|
||||
const rows = ref<DataResultList[]>([]);
|
||||
const rows2 = ref<directorType[]>([]);
|
||||
const selected = ref<directorType[]>([]);
|
||||
|
||||
async function fecthList(data: investigateDisDataRowType[]) {
|
||||
let datalist: investigateDisDataRowType[] = data.map((e: any) => ({
|
||||
async function fetchList(data: DataResult[]) {
|
||||
const datalist: DataResultList[] = data.map((e: DataResult) => ({
|
||||
id: e.id,
|
||||
subject: e.subject,
|
||||
interrogated: e.interrogated,
|
||||
caseFault: e.caseFault,
|
||||
dateInvestigate: date2Thai(new Date(e.dateInvestigate)),
|
||||
title: e.title,
|
||||
respondentType: e.respondentType
|
||||
? storeMain.convertRespondentType(e.respondentType)
|
||||
: "-",
|
||||
offenseDetails: e.offenseDetails
|
||||
? storeMain.convertFault(e.offenseDetails)
|
||||
: "-",
|
||||
disciplinaryFaultLevel: e.disciplinaryFaultLevel
|
||||
? e.disciplinaryFaultLevel
|
||||
: "-",
|
||||
disciplinaryCaseFault: e.disciplinaryCaseFault
|
||||
? e.disciplinaryCaseFault
|
||||
: "-",
|
||||
status: e.status && storeMain.convertStatus(e.status),
|
||||
createdAt: e.createdAt && date2Thai(e.createdAt),
|
||||
}));
|
||||
rows.value = datalist;
|
||||
}
|
||||
|
|
@ -45,12 +63,12 @@ export const useDisciplineResultStore = defineStore(
|
|||
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"subject",
|
||||
"interrogated",
|
||||
"fault",
|
||||
"penaltyLevel",
|
||||
"caseFault",
|
||||
"dateInvestigate",
|
||||
"title",
|
||||
"respondentType",
|
||||
"offenseDetails",
|
||||
"disciplinaryFaultLevel",
|
||||
"disciplinaryCaseFault",
|
||||
"createdAt",
|
||||
"status",
|
||||
]);
|
||||
|
||||
|
|
@ -65,64 +83,64 @@ export const useDisciplineResultStore = defineStore(
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "subject",
|
||||
name: "title",
|
||||
align: "left",
|
||||
label: "เรื่อง",
|
||||
sortable: true,
|
||||
field: "subject",
|
||||
field: "title",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "interrogated",
|
||||
name: "respondentType",
|
||||
align: "left",
|
||||
label: "ผู้ถูกสืบสวน",
|
||||
sortable: true,
|
||||
field: "interrogated",
|
||||
field: "respondentType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fault",
|
||||
name: "offenseDetails",
|
||||
align: "left",
|
||||
label: "ลักษณะความผิด",
|
||||
sortable: true,
|
||||
field: "fault",
|
||||
field: "offenseDetails",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "penaltyLevel",
|
||||
name: "disciplinaryFaultLevel",
|
||||
align: "left",
|
||||
label: "ระดับโทษความผิด",
|
||||
sortable: true,
|
||||
field: "penaltyLevel",
|
||||
field: "disciplinaryFaultLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "caseFault",
|
||||
name: "disciplinaryCaseFault",
|
||||
align: "left",
|
||||
label: "กรณีความผิด",
|
||||
sortable: true,
|
||||
field: "caseFault",
|
||||
field: "disciplinaryCaseFault",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateInvestigate",
|
||||
name: "createdAt",
|
||||
align: "left",
|
||||
label: "วันที่สอบสวน",
|
||||
sortable: true,
|
||||
field: "dateInvestigate",
|
||||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -213,7 +231,7 @@ export const useDisciplineResultStore = defineStore(
|
|||
]);
|
||||
return {
|
||||
tabMenu,
|
||||
fecthList,
|
||||
fetchList,
|
||||
rows,
|
||||
rows2,
|
||||
fecthDirector,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue