fix: ระบบพัฒนา เพิ่มปุ่มลบ/ระบบวินัย เพิ่ม ค้นหาขั้นสูง
This commit is contained in:
parent
9c5e958715
commit
852be66d2e
12 changed files with 1182 additions and 75 deletions
|
|
@ -29,15 +29,40 @@ const { fetchList } = dataInvestigateDis;
|
|||
const filter = ref<string>(""); //search data table
|
||||
|
||||
const status = ref<string>("NEW");
|
||||
async function fetchListDisciplinary() {
|
||||
async function fetchListDisciplinary(data?: any) {
|
||||
const body = {
|
||||
page: pagination.value.page,
|
||||
pageSize: pagination.value.rowsPerPage,
|
||||
keyword: filter.value.trim(),
|
||||
status: status.value,
|
||||
...(data && data.respondentType
|
||||
? { respondentType: data.respondentType }
|
||||
: {}),
|
||||
...(data && data.offenseDetails
|
||||
? { offenseDetails: data.offenseDetails }
|
||||
: {}),
|
||||
...(data && data.disciplinaryFaultLevel
|
||||
? { disciplinaryFaultLevel: data.disciplinaryFaultLevel }
|
||||
: {}),
|
||||
...(data && data.disciplinaryCaseFault
|
||||
? { disciplinaryCaseFault: data.disciplinaryCaseFault }
|
||||
: {}),
|
||||
...(data && data.disciplinaryDateStart
|
||||
? { disciplinaryDateStart: data.disciplinaryDateStart }
|
||||
: {}),
|
||||
...(data && data.disciplinaryDateEnd
|
||||
? { disciplinaryDateEnd: data.disciplinaryDateEnd }
|
||||
: {}),
|
||||
...(data && data.dateReceivedStart
|
||||
? { dateReceivedStart: data.dateReceivedStart }
|
||||
: {}),
|
||||
...(data && data.dateReceivedEnd
|
||||
? { dateReceivedEnd: data.dateReceivedEnd }
|
||||
: {}),
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.disciplineDisciplinary() +
|
||||
`?page=${pagination.value.page}&pageSize=${
|
||||
pagination.value.rowsPerPage
|
||||
}&keyword=${filter.value.trim()}&status=${status.value}`
|
||||
)
|
||||
.post(config.API.disciplineDisciplinary(), body)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result.data;
|
||||
totalList.value = Math.ceil(
|
||||
|
|
@ -74,9 +99,9 @@ function filterStatus(statusReturn: string) {
|
|||
getSearch();
|
||||
}
|
||||
|
||||
function getSearch() {
|
||||
function getSearch(data?:any) {
|
||||
pagination.value.page = 1;
|
||||
fetchListDisciplinary();
|
||||
fetchListDisciplinary(data);
|
||||
}
|
||||
|
||||
watch(
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import { ref, useAttrs, watch } from "vue";
|
|||
import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
import DialogSearchAdvanced from "@/modules/11_discipline/components/DialogSearchAdvanced.vue";
|
||||
|
||||
const total = defineModel<number>("total", { required: true });
|
||||
const totalList = defineModel<number>("totalList", { required: true });
|
||||
const pagination = defineModel<any>("pagination", { required: true });
|
||||
|
|
@ -132,7 +134,7 @@ function updatePagination(newPagination: any) {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="q-pb-sm row q-col-gutter-sm">
|
||||
<div class="q-pb-sm row q-col-gutter-sm items-center">
|
||||
<q-select
|
||||
v-model="statusFilter"
|
||||
label="สถานะ"
|
||||
|
|
@ -169,6 +171,7 @@ function updatePagination(newPagination: any) {
|
|||
|
||||
<q-space />
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<DialogSearchAdvanced :get-data="(value:any)=> props.getSearch?.(value)" />
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
|
|
@ -176,13 +179,20 @@ function updatePagination(newPagination: any) {
|
|||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
placeholder="ค้นหาเรื่องร้องเรียน"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
@keydown.enter.prevent="filterFn"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
<q-tooltip
|
||||
transition-show="scale"
|
||||
transition-hide="scale"
|
||||
class="text-body2"
|
||||
>หมายเหตุ: ค้นหาจากเรื่องร้องเรียน
|
||||
ระดับโทษความผิดหรือกรณีความผิด</q-tooltip
|
||||
>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue