แก้ วินัย เพิ่ม api
This commit is contained in:
parent
fc55ffc928
commit
142fc30d8b
13 changed files with 134 additions and 145 deletions
|
|
@ -24,16 +24,16 @@ export default {
|
|||
complaintbyId: (id: string) => `${disciplineMain}/complaint/${id}`,
|
||||
complaintReject: (id: string) => `${disciplineMain}/complaint/reject/${id}`,
|
||||
complaintResume: (id: string) => `${disciplineMain}/complaint/resume/${id}`,
|
||||
complaintList: (page: number, pageSize: number, keyword: string) =>
|
||||
`${disciplineMain}/complaint?page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
|
||||
complaintList: (page: number, pageSize: number, keyword: string,status:string) =>
|
||||
`${disciplineMain}/complaint?page=${page}&pageSize=${pageSize}&keyword=${keyword}&status=${status}`,
|
||||
complaintFileUpload: (id: string) => `${disciplineMain}/complaint/file/${id}`,
|
||||
complaintFileDelete: (id: string, docId: string) =>
|
||||
`${disciplineMain}/complaint/file/${id}/${docId}`,
|
||||
complaintApprove: (id: string) => `${disciplineMain}/complaint/approve/${id}`,
|
||||
|
||||
/** API สืบสวนข้อเท็จจริง*/
|
||||
investigateMain: (page: number, pageSize: number, keyword: string) =>
|
||||
`${investigate}?page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
|
||||
investigateMain: (page: number, pageSize: number, keyword: string,status:string) =>
|
||||
`${investigate}?page=${page}&pageSize=${pageSize}&keyword=${keyword}&status=${status}`,
|
||||
investigateById: (id: string) => `${investigate}/${id}`,
|
||||
|
||||
investigateRelevantUploadFile: (id: string) =>
|
||||
|
|
@ -104,4 +104,6 @@ export default {
|
|||
appealUpLoadFile: (id: string) => `${appeal}/file/${id}`,
|
||||
appealDeleteFile: (id: string, docId: string) =>
|
||||
`${appeal}/file/${id}/${docId}`,
|
||||
|
||||
historyDirectorbyId:(id:string,type:string) => `${disciplineMain}/director/${type}/${id}`
|
||||
};
|
||||
|
|
|
|||
|
|
@ -43,7 +43,8 @@ async function getList() {
|
|||
config.API.complaintList(
|
||||
page.value,
|
||||
rowsPerPage.value,
|
||||
filterKeyword.value
|
||||
filterKeyword.value,
|
||||
statusFilter.value
|
||||
)
|
||||
)
|
||||
//
|
||||
|
|
@ -69,9 +70,6 @@ function filterFn() {
|
|||
getList();
|
||||
}
|
||||
|
||||
function dataUpdate() {
|
||||
console.log(statusFilter.value);
|
||||
}
|
||||
|
||||
function resetFilter() {
|
||||
filterKeyword.value = "";
|
||||
|
|
@ -104,7 +102,7 @@ onMounted(async () => {
|
|||
option-label="name"
|
||||
option-value="id"
|
||||
:options="complainstStore.statusOptions"
|
||||
@update:model-value="dataUpdate"
|
||||
@update:model-value="getList()"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ const data = reactive<FormData>({
|
|||
organizationId: "",
|
||||
persons: [],
|
||||
investigationExtendHistory: [],
|
||||
isDisciplinary:false
|
||||
});
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์มเรื่องร้องเรียน */
|
||||
|
|
@ -162,6 +163,7 @@ function getData() {
|
|||
data.investigationStatusResult = dataList.investigationStatusResult;
|
||||
data.investigationExtendStatus = dataList.investigationExtendStatus;
|
||||
data.investigationDaysExtend = dataList.investigationDaysExtend;
|
||||
data.isDisciplinary = dataList.isDisciplinary;
|
||||
data.investigationExtendHistory =
|
||||
dataList.investigationExtendHistory ?? [];
|
||||
})
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ const formData = reactive<FormData>({
|
|||
organizationId: "",
|
||||
persons: [],
|
||||
investigationExtendHistory: [],
|
||||
isDisciplinary:false
|
||||
});
|
||||
|
||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
||||
|
|
@ -292,7 +293,7 @@ watch(props.data, async () => {
|
|||
|
||||
mainStore.rowsAdd = props.data.persons;
|
||||
mainStore.rowsCheck = mainStore.rowsAdd.filter(
|
||||
(item: any) => item.isSend === "NEW"
|
||||
(item: any) => item.isDisciplinary === false && item.isSend === 'NEW'
|
||||
);
|
||||
|
||||
const dataMap = props.data.directors.map((item: any) => ({
|
||||
|
|
@ -679,7 +680,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div
|
||||
class="col-xs-12 col-sm-4"
|
||||
v-if="route.name === 'disciplineInvestigatefactsEdit'"
|
||||
v-if="route.name === 'disciplineInvestigatefactsEdit' && mainStore.rowsCheck.length >0"
|
||||
>
|
||||
<q-btn
|
||||
class="q-pa-sm"
|
||||
|
|
@ -1200,7 +1201,7 @@ onMounted(async () => {
|
|||
<div class="row col-12">
|
||||
<q-card
|
||||
bordered
|
||||
class="row col-12"
|
||||
class="col-12"
|
||||
style="border: 1px solid #d6dee1"
|
||||
>
|
||||
<div
|
||||
|
|
@ -1211,8 +1212,8 @@ onMounted(async () => {
|
|||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
||||
<div class="col-xs-12 q-pa-sm row">
|
||||
<div class="row col-12 q-col-gutter-md">
|
||||
|
||||
<div class="row col-12 q-col-gutter-sm q-pa-sm">
|
||||
<div class="col-3">
|
||||
<q-select
|
||||
:class="inputEdit(isReadonly)"
|
||||
|
|
@ -1274,24 +1275,24 @@ onMounted(async () => {
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="inputEdit(isReadonly)"
|
||||
outlined
|
||||
ref="resultRef"
|
||||
:readonly="isReadonly"
|
||||
dense
|
||||
borderless
|
||||
v-model="formData.result"
|
||||
hide-bottom-space
|
||||
:label="`${'เหตุผล'}`"
|
||||
type="textarea"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row col-12">
|
||||
<q-input
|
||||
:class="inputEdit(isReadonly)"
|
||||
outlined
|
||||
ref="resultRef"
|
||||
:readonly="isReadonly"
|
||||
dense
|
||||
borderless
|
||||
v-model="formData.result"
|
||||
hide-bottom-space
|
||||
:label="`${'เหตุผล'}`"
|
||||
type="textarea"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ async function getList() {
|
|||
config.API.investigateMain(
|
||||
currentPage.value,
|
||||
rowsPerPage.value,
|
||||
filterKeyword.value
|
||||
filterKeyword.value,
|
||||
statusFilter.value
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
|
|
@ -123,7 +124,7 @@ onMounted(async () => {
|
|||
option-label="name"
|
||||
option-value="id"
|
||||
:options="dataInvestigate.statusOptions"
|
||||
@update:model-value="dataUpdate"
|
||||
@update:model-value="getList()"
|
||||
/>
|
||||
</div>
|
||||
<q-space />
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@ const router = useRouter();
|
|||
const filter = ref<string>(""); //search data table
|
||||
const page = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
|
||||
const status = ref<string>("ALL");
|
||||
async function fetchListDisciplinary() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.disciplineDisciplinary() +
|
||||
`?page=${page.value}&pageSize=${rowsPerPage.value}&keyword=${filter.value}`
|
||||
`?page=${page.value}&pageSize=${rowsPerPage.value}&keyword=${filter.value}&status=${status.value}`
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result.data;
|
||||
|
|
@ -55,6 +55,11 @@ async function updatePagingProp(rowPerpage: number, pageCurrent: number) {
|
|||
await fetchListDisciplinary();
|
||||
}
|
||||
|
||||
function filterStatus(statusReturn: string) {
|
||||
status.value = statusReturn;
|
||||
fetchListDisciplinary()
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
|
|
@ -86,6 +91,7 @@ onMounted(async () => {
|
|||
:fetchListDisciplinary="fetchListDisciplinary"
|
||||
@update:pagination="updatePagingProp"
|
||||
v-model:open-edit="openEdit"
|
||||
:filterStatus="filterStatus"
|
||||
>
|
||||
</Table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
filterStatus: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
nornmalData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
|
|
@ -114,7 +118,7 @@ watch(
|
|||
);
|
||||
|
||||
function dataUpdate() {
|
||||
console.log(statusFilter.value);
|
||||
props.filterStatus(statusFilter.value);
|
||||
}
|
||||
|
||||
function filterFn() {
|
||||
|
|
|
|||
|
|
@ -26,14 +26,14 @@ const page = ref<number>(1);
|
|||
const pageSize = ref<number>(10);
|
||||
const maxPage = ref<number>(1);
|
||||
const filter = ref<string>("");
|
||||
|
||||
const status = ref<string>("ALL");
|
||||
/** function เรียกรายการสรุปผลการพิจารณาทางวินัย*/
|
||||
async function fetchListResult() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.listResult() +
|
||||
`?page=${page.value}&pageSize=${pageSize.value}&keyword=${filter.value}`
|
||||
`?page=${page.value}&pageSize=${pageSize.value}&keyword=${filter.value}&status=${status.value}`
|
||||
)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result.data;
|
||||
|
|
@ -66,6 +66,11 @@ function openEdit(id: string) {
|
|||
router.push(`/discipline-result/${id}`);
|
||||
}
|
||||
|
||||
function filterStatus(statusReturn: string) {
|
||||
status.value = statusReturn;
|
||||
fetchListResult();
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
|
|
@ -97,6 +102,7 @@ onMounted(async () => {
|
|||
:maxPage="maxPage"
|
||||
@update:queryString="updateQueryString"
|
||||
v-model:open-edit="openEdit"
|
||||
:filterStatus="filterStatus"
|
||||
>
|
||||
</Table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
filterStatus: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
nornmalData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
|
|
@ -94,7 +98,7 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
|||
});
|
||||
|
||||
function dataUpdate() {
|
||||
console.log(statusFilter.value);
|
||||
props.filterStatus(statusFilter.value);
|
||||
}
|
||||
|
||||
function updateInput(value: string | number | null) {
|
||||
|
|
|
|||
|
|
@ -9,13 +9,16 @@ import {
|
|||
} from "vue";
|
||||
import { QForm, useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import type { DirectorRowsResponse } from "@/modules/11_discipline/interface/response/director";
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
|
||||
const listCheck = ref<string>("");
|
||||
const listCheck = ref<number>();
|
||||
|
||||
const props = defineProps({
|
||||
modal: Boolean,
|
||||
title: {
|
||||
|
|
@ -23,87 +26,43 @@ const props = defineProps({
|
|||
default: "",
|
||||
},
|
||||
close: Function,
|
||||
type: String,
|
||||
dataList: Object,
|
||||
});
|
||||
const dataList = ref<any>();
|
||||
const listInvestigateDetail = [
|
||||
{
|
||||
id: "1",
|
||||
title: "test1",
|
||||
type: "x1",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
title: "test2",
|
||||
type: "x2",
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
title: "test3",
|
||||
type: "x3",
|
||||
},
|
||||
{
|
||||
id: "4",
|
||||
title: "test4",
|
||||
type: "x4",
|
||||
},
|
||||
{
|
||||
id: "5",
|
||||
title: "test5",
|
||||
type: "x5",
|
||||
},
|
||||
{
|
||||
id: "6",
|
||||
title: "test6",
|
||||
type: "x6",
|
||||
},
|
||||
{
|
||||
id: "7",
|
||||
title: "test7",
|
||||
type: "x7",
|
||||
},
|
||||
];
|
||||
const listInvestigateDetail = ref<any>([]);
|
||||
|
||||
function clickList(id: string, type: string) {
|
||||
const data = [
|
||||
{
|
||||
id: "1",
|
||||
title: "นาย 1",
|
||||
type: "x1",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
title: "นาย 2",
|
||||
type: "x1",
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
title: "นาย 3",
|
||||
type: "x2",
|
||||
},
|
||||
{
|
||||
id: "4",
|
||||
title: "นาย 4",
|
||||
type: "x2",
|
||||
},
|
||||
{
|
||||
id: "5",
|
||||
title: "นาย 5",
|
||||
type: "x3",
|
||||
},
|
||||
{
|
||||
id: "6",
|
||||
title: "นาย 6",
|
||||
type: "x3",
|
||||
},
|
||||
{
|
||||
id: "7",
|
||||
title: "นาย 7",
|
||||
type: "x4",
|
||||
},
|
||||
];
|
||||
dataList.value = data.filter((r) => r.type == type);
|
||||
listCheck.value = id;
|
||||
function clickList(index: number, data: any) {
|
||||
listCheck.value = index;
|
||||
dataList.value = data.map((i: any) => ({
|
||||
commandNo: i.commandNo,
|
||||
duty: i.duty,
|
||||
prefix: i.prefix,
|
||||
firstName: i.firstName,
|
||||
lastName: i.lastName,
|
||||
fullName:`${i.prefix}${i.firstName} ${i.lastName}`
|
||||
}));
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
watch(props, () => {
|
||||
if (props) {
|
||||
const data: DirectorRowsResponse = props.dataList as DirectorRowsResponse;
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.historyDirectorbyId(data.id, props.type as string))
|
||||
.then((res) => {
|
||||
console.log(res.data.result);
|
||||
listInvestigateDetail.value = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -123,26 +82,26 @@ function clickList(id: string, type: string) {
|
|||
<div
|
||||
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
||||
>
|
||||
รายการเรื่องร้องเรียน
|
||||
รายการเรื่องร้องเรียน
|
||||
</div>
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<q-scroll-area
|
||||
style="height: 300px;"
|
||||
class="bg-white rounded-borders q-px-sm row col-12"
|
||||
style="height: 300px"
|
||||
class="bg-white rounded-borders q-px-xs row col-12"
|
||||
>
|
||||
<q-list
|
||||
v-for="(item, index) in listInvestigateDetail"
|
||||
:key="item.id"
|
||||
:key="index"
|
||||
bordered
|
||||
separator
|
||||
>
|
||||
<q-item
|
||||
clickable
|
||||
v-ripple
|
||||
:active="listCheck === item.id"
|
||||
:active="listCheck === index"
|
||||
active-class="my-menu-link"
|
||||
@click="clickList(item.id, item.type)"
|
||||
@click="clickList(index, item.director)"
|
||||
>
|
||||
<q-item-section>{{ item.title }}</q-item-section>
|
||||
</q-item>
|
||||
|
|
@ -165,16 +124,16 @@ function clickList(id: string, type: string) {
|
|||
<div class="col-12"><q-separator /></div>
|
||||
<q-scroll-area
|
||||
style="height: 300px"
|
||||
class="bg-white rounded-borders q-px-sm row col-12"
|
||||
class="bg-white rounded-borders q-px-xs row col-12"
|
||||
>
|
||||
<q-list
|
||||
v-for="(item, index) in dataList"
|
||||
:key="item.id"
|
||||
:key="index"
|
||||
bordered
|
||||
separator
|
||||
>
|
||||
<q-item clickable v-ripple>
|
||||
<q-item-section>{{ item.title }}</q-item-section>
|
||||
<q-item-section>{{ item.fullName }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-scroll-area>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { useDisciplineDirectorDataStore } from "@/modules/11_discipline/store/Di
|
|||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
import DialogTotal from "@/modules/11_discipline/components/6_BasicInformation/Director/DialogInvestigateTotal.vue";
|
||||
import type { DirectorRowsResponse } from "@/modules/11_discipline/interface/response/director";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDisciplineDirectorDataStore();
|
||||
|
|
@ -18,6 +19,8 @@ const maxPage = ref<number>(1);
|
|||
const page = ref<number>(1);
|
||||
const rowsPerPage = ref<number>(10);
|
||||
const modalDetail = ref<boolean>(false);
|
||||
const type = ref<string>('')
|
||||
const dataPopUp = ref<DirectorRowsResponse>()
|
||||
/**
|
||||
* ค้นหาในตาราง
|
||||
*/
|
||||
|
|
@ -111,9 +114,15 @@ function filterFn() {
|
|||
getList();
|
||||
}
|
||||
|
||||
function openDetail(title: string) {
|
||||
titleInvestigate.value = title;
|
||||
function openDetail(data: DirectorRowsResponse, typeChange: string) {
|
||||
if (typeChange == "investigate") {
|
||||
titleInvestigate.value = `รายการสืบสวนข้อเท็จจริงของ ${data.fullName}`;
|
||||
} else if (typeChange == "disciplinary") {
|
||||
titleInvestigate.value = `รายการสอบสวนความผิดทางวินัยของ ${data.fullName}`;
|
||||
}
|
||||
dataPopUp.value = data
|
||||
modalDetail.value = true;
|
||||
type.value = typeChange
|
||||
}
|
||||
|
||||
function closeDetail() {
|
||||
|
|
@ -232,9 +241,7 @@ onMounted(() => {
|
|||
props.row.totalInvestigate > 0
|
||||
"
|
||||
class="text-blue"
|
||||
@click="
|
||||
openDetail(`รายการสืบสวนข้อเท็จจริงของ ${props.row.fullName}`)
|
||||
"
|
||||
@click="openDetail(props.row, 'investigate')"
|
||||
>
|
||||
{{ props.row.totalInvestigate }}
|
||||
</div>
|
||||
|
|
@ -244,11 +251,7 @@ onMounted(() => {
|
|||
props.row.totalDisciplinary > 0
|
||||
"
|
||||
class="text-blue"
|
||||
@click="
|
||||
openDetail(
|
||||
`รายการสอบสวนความผิดทางวินัยของ ${props.row.fullName}`
|
||||
)
|
||||
"
|
||||
@click="openDetail(props.row, 'disciplinary')"
|
||||
>
|
||||
{{ props.row.totalDisciplinary }}
|
||||
</div>
|
||||
|
|
@ -282,5 +285,7 @@ onMounted(() => {
|
|||
:modal="modalDetail"
|
||||
:title="titleInvestigate"
|
||||
:close="closeDetail"
|
||||
:type="type"
|
||||
:data-list="dataPopUp"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ interface FormData {
|
|||
organizationId: string;
|
||||
persons: object | null;
|
||||
investigationExtendHistory: ExtendHistoryObject[];
|
||||
isDisciplinary:boolean
|
||||
}
|
||||
|
||||
interface ExtendHistoryObject {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
interface DirectorRows {
|
||||
id:string
|
||||
prefix:string
|
||||
firstName:string
|
||||
lastName:string
|
||||
id: string
|
||||
prefix: string
|
||||
firstName: string
|
||||
lastName: string
|
||||
position: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
|
|
@ -10,11 +10,11 @@ interface DirectorRows {
|
|||
totalDisciplinary: number
|
||||
}
|
||||
interface DirectorRowsResponse {
|
||||
id:string
|
||||
fullName:string
|
||||
position:string
|
||||
email:string
|
||||
phone:string
|
||||
id: string
|
||||
fullName: string
|
||||
position: string
|
||||
email: string
|
||||
phone: string
|
||||
totalInvestigate: number
|
||||
totalDisciplinary: number
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue