From 4a36e1b4ad64f550b93e1c5771cfe84d90fbc8e1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 22 Feb 2024 11:46:56 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80?= =?UTF-8?q?=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99=20=3D>=20=E0=B8=AD?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=A3=E0=B8=B2=E0=B9=80=E0=B8=87=E0=B8=B4?= =?UTF-8?q?=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99=20?= =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82=20Pagination?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/13_salary/views/salaryRate.vue | 41 +++++++++++++--------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/src/modules/13_salary/views/salaryRate.vue b/src/modules/13_salary/views/salaryRate.vue index 4bfd32b29..1aaa946f0 100644 --- a/src/modules/13_salary/views/salaryRate.vue +++ b/src/modules/13_salary/views/salaryRate.vue @@ -4,7 +4,7 @@ import { useQuasar } from "quasar"; import { useRouter, useRoute } from "vue-router"; import http from "@/plugins/http"; import config from "@/app.config"; -import genReportXLSX from '@/plugins/genreportxlsx' +import genReportXLSX from "@/plugins/genreportxlsx"; /** importType*/ import type { QTableProps } from "quasar"; import type { @@ -132,6 +132,8 @@ async function fetchListSalalyRate() { `?page=${page}&pageSize=${pageSize}&keyword=${keyword}` ) .then((res) => { + totalRow.value = Math.ceil(res.data.result.total / formQuery.pageSize); + rows.value = res.data.result.data; }) .catch((err) => { @@ -178,19 +180,20 @@ function onClickDelete(id: string) { }); } - function clickDownload(){ - showLoader() +function clickDownload() { + showLoader(); http - .get(config.API.salaryReportByid(salaryId.value)) - .then((res)=>{ - const dataList = res.data.result - genReportXLSX(dataList,'อัตราเงินเดือน') - }) - .catch((e)=>{ - messageError($q,e) - }).finally(()=>{ - hideLoader() - }) + .get(config.API.salaryReportByid(salaryId.value)) + .then((res) => { + const dataList = res.data.result; + genReportXLSX(dataList, "อัตราเงินเดือน"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); } onMounted(async () => { await fetchListSalalyRate(); @@ -231,7 +234,13 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => { - +
@@ -260,9 +269,7 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
{{ - (formQuery.page - 1) * formQuery.pageSize + - props.rowIndex + - 1 + (formQuery.page - 1) * formQuery.pageSize + props.rowIndex + 1 }}