API รายการรอบการประเมินผลการปฏิบัติหน้าที่ราชการ
This commit is contained in:
parent
fa7cab32c3
commit
233c577299
4 changed files with 67 additions and 27 deletions
|
|
@ -1,6 +1,20 @@
|
|||
interface DataOption {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type {DataOption};
|
||||
interface ItemsMenu {
|
||||
label: string;
|
||||
value: string;
|
||||
icon: string;
|
||||
color: string;
|
||||
}
|
||||
|
||||
interface NewPagination {
|
||||
descending: boolean;
|
||||
page: number;
|
||||
rowsPerPage: number;
|
||||
sortBy: string;
|
||||
}
|
||||
|
||||
export type { DataOption, ItemsMenu,NewPagination };
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
interface FormCompetency {
|
||||
competencyType: string;
|
||||
competencyName: string;
|
||||
definition: string;
|
||||
level_1: string;
|
||||
level_2: string;
|
||||
level_3: string;
|
||||
level_4: string;
|
||||
level_5: string;
|
||||
evaluation: string;
|
||||
interface FormQueryRound {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
year: number;
|
||||
keyword: string;
|
||||
}
|
||||
|
||||
export type { FormCompetency };
|
||||
interface FormRound {
|
||||
durationKPI: string;
|
||||
startDate: Date | null;
|
||||
endDate: Date | null;
|
||||
}
|
||||
|
||||
export type { FormQueryRound, FormRound };
|
||||
|
|
|
|||
|
|
@ -1 +1,14 @@
|
|||
export type {};
|
||||
interface ResRound {
|
||||
createdAt: Date;
|
||||
createdFullName: string;
|
||||
createdUserId: Date;
|
||||
durationKPI: string;
|
||||
endDate: Date;
|
||||
id: Date;
|
||||
lastUpdateFullName: string;
|
||||
lastUpdateUserId: Date;
|
||||
lastUpdatedAt: Date;
|
||||
startDate: Date;
|
||||
}
|
||||
|
||||
export type { ResRound };
|
||||
|
|
|
|||
|
|
@ -5,6 +5,17 @@ import { useRouter } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type {
|
||||
DataOption,
|
||||
ItemsMenu,
|
||||
NewPagination,
|
||||
} from "@/modules/14_KPI/interface/index/Main";
|
||||
import type {
|
||||
FormQueryRound,
|
||||
FormRound,
|
||||
} from "@/modules/14_KPI/interface/request/Main";
|
||||
import type { ResRound } from "@/modules/14_KPI/interface/response/Main";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/** importStore*/
|
||||
|
|
@ -25,7 +36,7 @@ const {
|
|||
} = useCounterMixin();
|
||||
|
||||
/** หัวตาราง */
|
||||
const rows = ref<any>([]);
|
||||
const rows = ref<ResRound[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "durationKPI",
|
||||
|
|
@ -61,7 +72,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
const visibleColumns = ref<string[]>(["durationKPI", "startDate", "endDate"]);
|
||||
|
||||
const itemMenu = ref<any>([
|
||||
const itemMenu = ref<ItemsMenu[]>([
|
||||
{
|
||||
label: "เปิดรอบ",
|
||||
value: "open",
|
||||
|
|
@ -82,7 +93,7 @@ const itemMenu = ref<any>([
|
|||
},
|
||||
]);
|
||||
|
||||
const roundOp = ref<any>([
|
||||
const roundOp = ref<DataOption[]>([
|
||||
{ id: "APR", name: "รอบเมษายน" },
|
||||
{
|
||||
id: "OCT",
|
||||
|
|
@ -90,7 +101,7 @@ const roundOp = ref<any>([
|
|||
},
|
||||
]);
|
||||
|
||||
const formQuery = reactive({
|
||||
const formQuery = reactive<FormQueryRound>({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
year: new Date().getFullYear(),
|
||||
|
|
@ -98,7 +109,7 @@ const formQuery = reactive({
|
|||
});
|
||||
const totalList = ref<number>(1);
|
||||
|
||||
const formData = reactive({
|
||||
const formData = reactive<FormRound>({
|
||||
durationKPI: "",
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
|
|
@ -112,7 +123,7 @@ function fetchList() {
|
|||
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&year=${formQuery.year}`
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result.data;
|
||||
const data: ResRound[] = res.data.result.data;
|
||||
totalList.value = Math.ceil(res.data.result.total / formQuery.pageSize);
|
||||
rows.value = data;
|
||||
})
|
||||
|
|
@ -203,12 +214,13 @@ function onCloseRounde() {
|
|||
"ต้องการยืนยันการปิดรอบนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
function onDeleteRound(id: string) {
|
||||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.kpiPeriodById(id))
|
||||
.then((res) => {
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
fetchList();
|
||||
})
|
||||
|
|
@ -222,15 +234,15 @@ function onDeleteRound(id: string) {
|
|||
}
|
||||
|
||||
function connvertName(val: string) {
|
||||
const findData = roundOp.value.find((e: any) => e.id === val);
|
||||
return findData.name;
|
||||
const findData = roundOp.value.find((e: DataOption) => e.id === val);
|
||||
return findData?.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* function updatePagination
|
||||
* @param newPagination ข้อมูล Pagination ใหม่
|
||||
*/
|
||||
function updatePagination(newPagination: any) {
|
||||
function updatePagination(newPagination: NewPagination) {
|
||||
formQuery.page = 1;
|
||||
formQuery.pageSize = newPagination.rowsPerPage;
|
||||
}
|
||||
|
|
@ -373,7 +385,7 @@ onMounted(() => {
|
|||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="visibleColumns"
|
||||
:rows-per-page-options="[2, 10, 25, 50, 100]"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
@update:pagination="updatePagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue