ปรับการ fetch ข้อมูลรายการประเมิน
This commit is contained in:
parent
77d8dee255
commit
ed7c6e9f07
3 changed files with 180 additions and 93 deletions
|
|
@ -6,8 +6,7 @@ export default {
|
|||
evaluateDirectorMain: () => `${evaluateDirectorMain}`,
|
||||
evaluateDirectorById: (id: string) => `${evaluateDirectorMain}/${id}`,
|
||||
|
||||
evaluationMain: (page: number, pageSize: number, keyword: string) =>
|
||||
`${evaluation}?page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
|
||||
evaluationMain: () => `${evaluation}`,
|
||||
|
||||
evaluateGetDetail: (id: string) => `${evaluation}/check-spec/${id}`,
|
||||
evaluateGetStep: (id: string) => `${evaluation}/check/${id}`,
|
||||
|
|
@ -26,7 +25,7 @@ export default {
|
|||
evaluationApproveDoc1: (id: string) => `${evaluation}/doc1/approve/${id}`,
|
||||
evaluationNext5To6: (id: string) => `${evaluation}/announce/${id}`,
|
||||
evaluationNextFinish: (id: string) => `${evaluation}/wait-check-doc-v2/${id}`,
|
||||
|
||||
|
||||
evaluationHistory: (id: string) => `${evaluation}/step-history/${id}`,
|
||||
|
||||
evaluationDateAnnounce: (id: string) => `${evaluation}/check-date/${id}`,
|
||||
|
|
|
|||
|
|
@ -1,86 +1,91 @@
|
|||
interface DataOption {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
interface DataOptionYear {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
interface DataOptioGroup {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
disable: Boolean;
|
||||
}
|
||||
|
||||
interface DataNumberOption {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface InvestigatefactsDataRowType {
|
||||
id: string;
|
||||
title: string;
|
||||
respondentType: string;
|
||||
offenseDetails: string;
|
||||
investigationDetail: string;
|
||||
dateInvestigate: string;
|
||||
investigationStatusResult: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
interface investigateDisDataRowType {
|
||||
id: string; //id รายการ
|
||||
title: string; //เรื่องร้องเรียน
|
||||
interrogated: string; //ผู้ถูกสอบสวน
|
||||
descMistake: string; //ลักษณะความผิด
|
||||
mistakeLevel: string; //ระดับโทษความผิด
|
||||
mistakeCase: string; //กรณีความผิด
|
||||
investigationDate: Date | null; //วันที่สอบสวน
|
||||
status: string | null; //สถานะ
|
||||
isResultConfirmed: Boolean; //ยืนยันผลเเล้ว/ยังไม่ได้ยืนยันผล
|
||||
}
|
||||
|
||||
interface directorType {
|
||||
id: string;
|
||||
directorId?: string;
|
||||
prefix: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
position: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
total?: number;
|
||||
duty?: string;
|
||||
}
|
||||
interface responseType {
|
||||
id: string;
|
||||
directorId?: string;
|
||||
prefix: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
position: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
total?: number;
|
||||
duty?: string;
|
||||
|
||||
}
|
||||
|
||||
interface FileLists {
|
||||
id: string; //id เอกสาร
|
||||
fileName: string; //ชื่่อเอกสาร
|
||||
pathName: string; //link file
|
||||
}
|
||||
|
||||
export type {
|
||||
DataOption,
|
||||
InvestigatefactsDataRowType,
|
||||
investigateDisDataRowType,
|
||||
directorType,
|
||||
DataNumberOption,
|
||||
responseType,
|
||||
FileLists,
|
||||
DataOptioGroup,
|
||||
DataOptionYear,
|
||||
};
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
interface DataOptionYear {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
interface DataOptioGroup {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
disable: Boolean;
|
||||
}
|
||||
|
||||
interface OptionStatus {
|
||||
val: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
interface DataNumberOption {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface InvestigatefactsDataRowType {
|
||||
id: string;
|
||||
title: string;
|
||||
respondentType: string;
|
||||
offenseDetails: string;
|
||||
investigationDetail: string;
|
||||
dateInvestigate: string;
|
||||
investigationStatusResult: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
interface investigateDisDataRowType {
|
||||
id: string; //id รายการ
|
||||
title: string; //เรื่องร้องเรียน
|
||||
interrogated: string; //ผู้ถูกสอบสวน
|
||||
descMistake: string; //ลักษณะความผิด
|
||||
mistakeLevel: string; //ระดับโทษความผิด
|
||||
mistakeCase: string; //กรณีความผิด
|
||||
investigationDate: Date | null; //วันที่สอบสวน
|
||||
status: string | null; //สถานะ
|
||||
isResultConfirmed: Boolean; //ยืนยันผลเเล้ว/ยังไม่ได้ยืนยันผล
|
||||
}
|
||||
|
||||
interface directorType {
|
||||
id: string;
|
||||
directorId?: string;
|
||||
prefix: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
position: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
total?: number;
|
||||
duty?: string;
|
||||
}
|
||||
interface responseType {
|
||||
id: string;
|
||||
directorId?: string;
|
||||
prefix: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
position: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
total?: number;
|
||||
duty?: string;
|
||||
}
|
||||
|
||||
interface FileLists {
|
||||
id: string; //id เอกสาร
|
||||
fileName: string; //ชื่่อเอกสาร
|
||||
pathName: string; //link file
|
||||
}
|
||||
|
||||
export type {
|
||||
DataOption,
|
||||
InvestigatefactsDataRowType,
|
||||
investigateDisDataRowType,
|
||||
directorType,
|
||||
DataNumberOption,
|
||||
responseType,
|
||||
FileLists,
|
||||
DataOptioGroup,
|
||||
DataOptionYear,
|
||||
OptionStatus,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { onMounted, ref, watch, computed } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { OptionStatus } from "@/modules/12_evaluatePersonal/interface/index/Main";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useEvalutuonStore } from "@/modules/12_evaluatePersonal/store/Evaluate";
|
||||
|
|
@ -90,11 +92,15 @@ function resetFilter() {
|
|||
|
||||
/** function เรียกรายการคำขอประเมิน*/
|
||||
async function fetchEvaluteList() {
|
||||
const body = {
|
||||
page: currentPage.value,
|
||||
pageSize: pageSize.value,
|
||||
keyword: filter.value,
|
||||
status: selectedStatus.value,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.evaluationMain(currentPage.value, pageSize.value, filter.value)
|
||||
)
|
||||
.put(config.API.evaluationMain(), body)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result.data;
|
||||
total.value = res.data.result.total;
|
||||
|
|
@ -103,7 +109,7 @@ async function fetchEvaluteList() {
|
|||
store.fetchData(data);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
// messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -118,6 +124,56 @@ function Detailpage(id: string) {
|
|||
router.push(`/evaluate/detail/${id}`);
|
||||
}
|
||||
|
||||
const selectedStatus = ref<string[]>([
|
||||
"CHECK_SPEC",
|
||||
"PREPARE_DOC_V1",
|
||||
"CHECK_DOC_V1",
|
||||
"WAIT_CHECK_DOC_V1",
|
||||
"ANNOUNCE_WEB",
|
||||
"PREPARE_DOC_V2",
|
||||
"WAIT_CHECK_DOC_V2",
|
||||
"CHECK_DOC_V2",
|
||||
]);
|
||||
const options = ref<OptionStatus[]>([]);
|
||||
const optionsMain = ref<OptionStatus[]>([
|
||||
{ val: "CHECK_SPEC", label: "ตรวจสอบคุณสมบัติด้วยตนเอง" },
|
||||
{ val: "PREPARE_DOC_V1", label: "จัดเตรียมเอกสารเล่ม 1" },
|
||||
{ val: "CHECK_DOC_V1", label: "ตรวจสอบความถูกต้องของเอกสารเล่ม 1" },
|
||||
{ val: "WAIT_CHECK_DOC_V1", label: "รอตรวจสอบคุณสมบัติ" },
|
||||
{ val: "ANNOUNCE_WEB", label: "ประกาศบนเว็บไซต์" },
|
||||
{ val: "PREPARE_DOC_V2", label: "จัดเตรียมเอกสารเล่ม 2" },
|
||||
{ val: "WAIT_CHECK_DOC_V2", label: "รอพิจารณาผลการประเมิน" },
|
||||
{ val: "CHECK_DOC_V2", label: "ตรวจสอบความถูกต้องของเอกสารเล่ม" },
|
||||
{ val: "DONE", label: "เสร็จสิ้น" },
|
||||
]);
|
||||
|
||||
/** ชื่อค่าที่ค้นหาสภานะ*/
|
||||
const label = computed(() => {
|
||||
const filterOption = optionsMain.value.filter((option) =>
|
||||
selectedStatus.value.includes(option.val)
|
||||
);
|
||||
const labelval = filterOption.map((e) => e.label);
|
||||
if (labelval.length !== 0) {
|
||||
return labelval.length <= 2
|
||||
? `${labelval.slice(0, 2).join(", ")}`
|
||||
: `${labelval.slice(0, 2).join(", ")} + ,(${labelval.length - 2})`;
|
||||
} else return "";
|
||||
});
|
||||
|
||||
/**
|
||||
* function ต้นหาข้อมูลของ Option
|
||||
* @param val ค่าที่ต้องการฟิลเตอร์
|
||||
* @param update อัพเดทค่า
|
||||
* @param refData ดาต้าที่ต้องการฟิลเตอร์
|
||||
*/
|
||||
function filterOption(val: any, update: Function) {
|
||||
update(() => {
|
||||
options.value = optionsMain.value.filter(
|
||||
(v: any) => v.label.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/** HookLifecycle */
|
||||
onMounted(async () => {
|
||||
await fetchEvaluteList(); // เรียกข้อมูลรายการปรัเมิน
|
||||
|
|
@ -130,6 +186,33 @@ onMounted(async () => {
|
|||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
||||
<div class="row col-12 q-col-gutter-sm q-mb-sm">
|
||||
<q-select
|
||||
dense
|
||||
outlined
|
||||
multiple
|
||||
v-model="selectedStatus"
|
||||
emit-value
|
||||
map-options
|
||||
:options="options"
|
||||
option-value="val"
|
||||
label="ค้นหาสถานะ"
|
||||
style="width: 28vw"
|
||||
@update:model-value="fetchEvaluteList"
|
||||
use-input
|
||||
@filter="(inputValue:any,doneFn:Function) => filterOption(inputValue, doneFn) "
|
||||
>
|
||||
<template v-slot:selected>
|
||||
<div>
|
||||
{{ label }}
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-space />
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue