datepick => test
This commit is contained in:
parent
05234806a4
commit
1a273ccf5f
1 changed files with 6 additions and 8 deletions
|
|
@ -137,6 +137,7 @@ const formQuery = reactive<FormQueryRound>({
|
||||||
keyword: "",
|
keyword: "",
|
||||||
});
|
});
|
||||||
const totalList = ref<number>(1);
|
const totalList = ref<number>(1);
|
||||||
|
const year = ref<number | null>(null);
|
||||||
const formData = reactive<FormRound>({
|
const formData = reactive<FormRound>({
|
||||||
durationKPI: "",
|
durationKPI: "",
|
||||||
year: null,
|
year: null,
|
||||||
|
|
@ -153,7 +154,7 @@ function fetchList() {
|
||||||
http
|
http
|
||||||
.get(
|
.get(
|
||||||
config.API.kpiPeriod +
|
config.API.kpiPeriod +
|
||||||
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&year=${formQuery.year}`
|
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&year=${year.value}`
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data: ResRound[] = res.data.result.data;
|
const data: ResRound[] = res.data.result.data;
|
||||||
|
|
@ -365,8 +366,7 @@ onMounted(() => {
|
||||||
<q-toolbar style="padding: 0px">
|
<q-toolbar style="padding: 0px">
|
||||||
<div class="row q-gutter-sm">
|
<div class="row q-gutter-sm">
|
||||||
<datepicker
|
<datepicker
|
||||||
menu-class-name="modalfix"
|
v-model="year"
|
||||||
v-model="formQuery.year"
|
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
autoApply
|
autoApply
|
||||||
year-picker
|
year-picker
|
||||||
|
|
@ -381,9 +381,7 @@ onMounted(() => {
|
||||||
<q-input
|
<q-input
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
:model-value="
|
:model-value="year === 0 ? 'ทั้งหมด' : Number(year) + 543"
|
||||||
formQuery.year === 0 ? 'ทั้งหมด' : Number(formQuery.year) + 543
|
|
||||||
"
|
|
||||||
:label="`${'ปีงบประมาณ'}`"
|
:label="`${'ปีงบประมาณ'}`"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
|
|
@ -394,11 +392,11 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
</q-icon>
|
</q-icon>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="formQuery.year" v-slot:append>
|
<template v-if="year" v-slot:append>
|
||||||
<q-icon
|
<q-icon
|
||||||
name="cancel"
|
name="cancel"
|
||||||
@click.stop.prevent="
|
@click.stop.prevent="
|
||||||
(formQuery.year = 0), (formQuery.page = 1), fetchList()
|
(year = 0), (formQuery.page = 1), fetchList()
|
||||||
"
|
"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue