เงืนเดือนค่าจ้่าง => แสเดงรายการทั้งหมด

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-04-26 10:48:47 +07:00
parent 40cbf40b6f
commit d04c6f30f5
6 changed files with 56 additions and 19 deletions

View file

@ -22,7 +22,6 @@ import config from "@/app.config";
const posTypeOp = ref<DataOption[]>([]);
const posType = ref<string>("");
const maxPage = ref<number>(1);
const $q = useQuasar();
const {
date2Thai,
@ -147,6 +146,8 @@ const formFilter = reactive({
pageSize: 10,
keyword: "",
});
const maxPage = ref<number>(1);
const totalList = ref<number>(0);
function filterFn() {
formFilter.page = 1;
@ -171,7 +172,7 @@ function getData() {
)
.then((res) => {
const data = res.data.result.data;
const total = res.data.result.total;
totalList.value = res.data.result.total;
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
rows.value = data.map((item: ResponseData) => ({
id: item.id,
@ -271,7 +272,10 @@ onMounted(() => {
<template v-if="posType" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="posType = '';getData()"
@click.stop.prevent="
posType = '';
getData();
"
class="cursor-pointer"
/>
</template>
@ -409,6 +413,7 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ totalList }} รายการ
<q-pagination
v-model="formFilter.page"
active-color="primary"

View file

@ -39,6 +39,7 @@ const formFilter = reactive<FormFilter>({
keyword: "",
});
const maxPage = ref<number>(1);
const totalList = ref<number>(0);
/** ข้อมูล Table*/
const columns = ref<QTableProps["columns"]>([
@ -119,6 +120,7 @@ function fetchListChart() {
)
.then((res) => {
rows.value = res.data.result.data;
totalList.value = res.data.result.total;
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
})
.catch((err) => {
@ -349,6 +351,7 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ totalList }} รายการ
<q-pagination
v-model="formFilter.page"
active-color="primary"