clear year sent 0

This commit is contained in:
setthawutttty 2023-12-15 15:08:24 +07:00
parent 0441c29426
commit acc3f1e2c7
2 changed files with 22 additions and 13 deletions

View file

@ -521,7 +521,6 @@ onMounted(async () => {
</div> </div>
<div class="col-4"> <div class="col-4">
<q-input <q-input
:class="getClass(edit)"
:outlined="edit" :outlined="edit"
dense dense
readonly readonly
@ -533,7 +532,6 @@ onMounted(async () => {
</div> </div>
<div class="col-12"> <div class="col-12">
<q-input <q-input
:class="getClass(edit)"
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules

View file

@ -162,7 +162,7 @@ watch(
() => currentPage.value, () => currentPage.value,
() => { () => {
rowsPerPage.value = pagination.value.rowsPerPage; rowsPerPage.value = pagination.value.rowsPerPage;
getData() getData();
} }
); );
@ -171,7 +171,7 @@ watch(
() => { () => {
rowsPerPage.value = pagination.value.rowsPerPage; rowsPerPage.value = pagination.value.rowsPerPage;
currentPage.value = 1; currentPage.value = 1;
getData() getData();
} }
); );
@ -201,7 +201,7 @@ watch(
/** ไปยังหน้าเพิ่มข้อมูล */ /** ไปยังหน้าเพิ่มข้อมูล */
function redirectToPageadd() { function redirectToPageadd() {
dataStore.rowsAdd = [] dataStore.rowsAdd = [];
router.push(`/discipline-appealcomplain/add`); router.push(`/discipline-appealcomplain/add`);
} }
@ -209,7 +209,7 @@ function editPage(id: string) {
router.push(`/discipline-appealcomplain/${id}`); router.push(`/discipline-appealcomplain/${id}`);
} }
function filterFn() { function filterFn() {
getData() getData();
console.log("enter", filterKeyword.value); console.log("enter", filterKeyword.value);
} }
@ -245,7 +245,7 @@ function getData() {
) )
.then((res) => { .then((res) => {
maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value); maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
fetchAppealComplain(res.data.result.data) fetchAppealComplain(res.data.result.data);
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -255,17 +255,20 @@ function getData() {
}); });
} }
function dataUpdate(){ function dataUpdate() {
getData() getData();
} }
function yearAll() {
formData.year = 0;
getData();
}
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */ /** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
onMounted(async () => { onMounted(async () => {
getData() getData();
// await getList(); // await getList();
dataStore.visibleColumns = visibleColumns.value; dataStore.visibleColumns = visibleColumns.value;
dataStore.columns = columns.value; dataStore.columns = columns.value;
}); });
</script> </script>
@ -310,10 +313,18 @@ onMounted(async () => {
dense dense
lazy-rules lazy-rules
outlined outlined
:model-value="Number(formData.year) + 543" :model-value="
formData.year === 0 ? null : Number(formData.year) + 543
"
:label="`${'ปีงบประมาณ'}`" :label="`${'ปีงบประมาณ'}`"
> >
<template v-if="formData.year" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="yearAll"
class="cursor-pointer"
/>
</template>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"