ผูก API สรุปผลการพิจารณา
This commit is contained in:
parent
e0fa2d9632
commit
4dac59a781
11 changed files with 467 additions and 117 deletions
|
|
@ -14,7 +14,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}`,
|
||||
|
|
@ -58,4 +58,8 @@ export default {
|
|||
`${discipline}/disciplinary/${type}/file/${id}`,
|
||||
disciplineByIdDoc: (type: string, id: string, docId: string) =>
|
||||
`${discipline}/disciplinary/${type}/file/${id}/${docId}`,
|
||||
|
||||
/** รายการผลการพิจารณาทางวินัย*/
|
||||
listResult: () => `${discipline}/result`,
|
||||
listResultById: (id: string) => `${discipline}/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");
|
||||
|
||||
|
|
|
|||
|
|
@ -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 { useCounterMixin } from "@/stores/mixin";
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -32,7 +32,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 },
|
||||
|
|
@ -357,7 +357,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