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