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 }}