fix filter kpi
This commit is contained in:
parent
8a13dbe06e
commit
2050ac6b9e
2 changed files with 26 additions and 17 deletions
|
|
@ -180,8 +180,13 @@ async function fetchRoundOption(type: string) {
|
||||||
}));
|
}));
|
||||||
if (type === "main") {
|
if (type === "main") {
|
||||||
roundMainOp.value = list;
|
roundMainOp.value = list;
|
||||||
|
if (data.length === 0) {
|
||||||
round.value = "";
|
round.value = "";
|
||||||
|
rows.value = [];
|
||||||
|
} else {
|
||||||
|
round.value = roundMainOp.value[0].id;
|
||||||
await fetchList();
|
await fetchList();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
roundDialgOp.value = list;
|
roundDialgOp.value = list;
|
||||||
formRound.kpiPeriodId = { id: "", name: "", isClosed: false };
|
formRound.kpiPeriodId = { id: "", name: "", isClosed: false };
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ const maxPage = ref<number>(1);
|
||||||
* ดึงข้อมูลรายการขอรับประเมินผลการปฏิบัติราชการระดับบุคคล
|
* ดึงข้อมูลรายการขอรับประเมินผลการปฏิบัติราชการระดับบุคคล
|
||||||
* @param type
|
* @param type
|
||||||
*/
|
*/
|
||||||
async function fetchRoundOption(type: boolean = false) {
|
async function fetchRoundOption() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(
|
.get(
|
||||||
|
|
@ -101,8 +101,9 @@ async function fetchRoundOption(type: boolean = false) {
|
||||||
`?page=${1}&pageSize=${10}&keyword=${""}&year=${store.yearRound}`
|
`?page=${1}&pageSize=${10}&keyword=${""}&year=${store.yearRound}`
|
||||||
)
|
)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = await res.data.result.data;
|
const data = res.data.result.data;
|
||||||
const list = data.map((e: ResRound) => ({
|
const list =
|
||||||
|
data.map((e: ResRound) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
name:
|
name:
|
||||||
e.durationKPI === "OCT"
|
e.durationKPI === "OCT"
|
||||||
|
|
@ -110,12 +111,15 @@ async function fetchRoundOption(type: boolean = false) {
|
||||||
: e.durationKPI === "APR"
|
: e.durationKPI === "APR"
|
||||||
? "รอบที่ 1 เมษายน"
|
? "รอบที่ 1 เมษายน"
|
||||||
: "",
|
: "",
|
||||||
}));
|
})) ?? [];
|
||||||
roundOp.value = list;
|
roundOp.value = list;
|
||||||
if (type) {
|
if (data.length === 0) {
|
||||||
store.formQuery.round = "";
|
store.formQuery.round = "";
|
||||||
}
|
dataListMain.value = [];
|
||||||
|
} else {
|
||||||
|
store.formQuery.round = roundOp.value[0].id;
|
||||||
await fetchList();
|
await fetchList();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -131,7 +135,7 @@ async function fetchList() {
|
||||||
const body = {
|
const body = {
|
||||||
page: store.formQuery.page,
|
page: store.formQuery.page,
|
||||||
pageSize: store.formQuery.pageSize,
|
pageSize: store.formQuery.pageSize,
|
||||||
kpiPeriodId: store.formQuery.round,
|
kpiPeriodId: store.formQuery.round ?? "",
|
||||||
keyword: store.formQuery.keyword,
|
keyword: store.formQuery.keyword,
|
||||||
year: store.yearRound,
|
year: store.yearRound,
|
||||||
status:
|
status:
|
||||||
|
|
@ -226,7 +230,7 @@ onMounted(async () => {
|
||||||
year-picker
|
year-picker
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
(store.formQuery.page = 1), fetchRoundOption(true)
|
(store.formQuery.page = 1), fetchRoundOption()
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<template #year="{ year }">{{ year + 543 }}</template>
|
<template #year="{ year }">{{ year + 543 }}</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue