From ad986efba9417cd9c8ce6622829f4c062d3e4ecd Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 7 Jul 2025 14:03:12 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20Page?= =?UTF-8?q?=20=3D=3D>=20=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A=E0=B9=80?= =?UTF-8?q?=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD?= =?UTF-8?q?=E0=B8=99/=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B8=88=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=87=20>>=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD?= =?UTF-8?q?=E0=B8=99=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94?= =?UTF-8?q?=E0=B8=B7=E0=B8=AD=E0=B8=99=20=E0=B8=82=E0=B8=A3=E0=B8=81.=20(?= =?UTF-8?q?=E0=B8=81=E0=B8=A3=E0=B8=93=E0=B8=B5=E0=B9=80=E0=B8=A5=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B8=82=E0=B8=B1=E0=B9=89=E0=B8=99?= =?UTF-8?q?=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7?= =?UTF-8?q?=E0=B8=AD=E0=B8=99=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=8A?= =?UTF-8?q?=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=AA=E0=B8=B8=E0=B8=94=E0=B8=97?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=A2=20=E0=B8=82=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=AA=E0=B8=B8=E0=B8=94?= =?UTF-8?q?=E0=B8=97=E0=B9=89=E0=B8=B2=E0=B8=A2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../13_salary/components/04_salaryLists/TabMain.vue | 11 +++++++++-- .../components/05_salaryListsEmployee/TabMain.vue | 9 +++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/modules/13_salary/components/04_salaryLists/TabMain.vue b/src/modules/13_salary/components/04_salaryLists/TabMain.vue index a1266e979..b6e40b3fb 100644 --- a/src/modules/13_salary/components/04_salaryLists/TabMain.vue +++ b/src/modules/13_salary/components/04_salaryLists/TabMain.vue @@ -255,9 +255,13 @@ function fetchDataQuota(id: string) { */ async function fetchDataPeriod(id: string) { showLoader(); - rows.value = []; let formData = { - page: formFilter.page.toString(), + page: + formFilter.page !== 1 && + formFilter.page === maxPage.value && + rows.value.length === 0 + ? (formFilter.page - 1).toString() + : formFilter.page.toString(), pageSize: formFilter.pageSize.toString(), keyword: formFilter.keyword.trim(), type: store.tabType, @@ -268,6 +272,7 @@ async function fetchDataPeriod(id: string) { ? "1" : "0", }; + rows.value = []; await http .put(config.API.salaryListPeriodORG(id), formData) @@ -275,6 +280,8 @@ async function fetchDataPeriod(id: string) { rows.value = res.data.result.data; total.value = res.data.result.total; maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize); + console.log("rows.value", rows.value.length); + console.log("maxPage.value", maxPage.value); }) .catch((err) => { messageError($q, err); diff --git a/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue b/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue index 441c724c2..9e808a97f 100644 --- a/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue +++ b/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue @@ -248,9 +248,13 @@ function fetchDataQuota(id: string) { */ async function fetchDataPeriod(id: string) { showLoader(); - rows.value = []; let formData = { - page: formFilter.page.toString(), + page: + formFilter.page !== 1 && + formFilter.page === maxPage.value && + rows.value.length === 0 + ? (formFilter.page - 1).toString() + : formFilter.page.toString(), pageSize: formFilter.pageSize.toString(), keyword: formFilter.keyword, type: store.tabType, @@ -261,6 +265,7 @@ async function fetchDataPeriod(id: string) { ? "1" : "0", }; + rows.value = []; await http .put(config.API.salaryListPeriodORGEmp(id), formData) From 5e7ad2e7f06fb93a9a36069c541dd8eb395301da Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 7 Jul 2025 14:27:41 +0700 Subject: [PATCH 2/3] fix rows.value ==> salary --- src/modules/13_salary/components/04_salaryLists/TabMain.vue | 5 ++--- .../13_salary/components/05_salaryListsEmployee/TabMain.vue | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/13_salary/components/04_salaryLists/TabMain.vue b/src/modules/13_salary/components/04_salaryLists/TabMain.vue index b6e40b3fb..107e41543 100644 --- a/src/modules/13_salary/components/04_salaryLists/TabMain.vue +++ b/src/modules/13_salary/components/04_salaryLists/TabMain.vue @@ -255,11 +255,12 @@ function fetchDataQuota(id: string) { */ async function fetchDataPeriod(id: string) { showLoader(); + let formData = { page: formFilter.page !== 1 && formFilter.page === maxPage.value && - rows.value.length === 0 + rows.value.length === 1 ? (formFilter.page - 1).toString() : formFilter.page.toString(), pageSize: formFilter.pageSize.toString(), @@ -280,8 +281,6 @@ async function fetchDataPeriod(id: string) { rows.value = res.data.result.data; total.value = res.data.result.total; maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize); - console.log("rows.value", rows.value.length); - console.log("maxPage.value", maxPage.value); }) .catch((err) => { messageError($q, err); diff --git a/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue b/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue index 9e808a97f..2ad3dcaa1 100644 --- a/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue +++ b/src/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue @@ -252,7 +252,7 @@ async function fetchDataPeriod(id: string) { page: formFilter.page !== 1 && formFilter.page === maxPage.value && - rows.value.length === 0 + rows.value.length === 1 ? (formFilter.page - 1).toString() : formFilter.page.toString(), pageSize: formFilter.pageSize.toString(), From de0d8365188ea91b7b7b21b6c5f0829d5c3d5494 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 7 Jul 2025 14:43:21 +0700 Subject: [PATCH 3/3] =?UTF-8?q?fix=20page=20=3D=3D=3D=20=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=A5=E0=B8=B9?= =?UTF-8?q?=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=8A=E0=B8=B1?= =?UTF-8?q?=E0=B9=88=E0=B8=A7=E0=B8=84=E0=B8=A3=E0=B8=B2=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/08_registryEmployee/views/Main.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/08_registryEmployee/views/Main.vue b/src/modules/08_registryEmployee/views/Main.vue index 21e25ac6e..0e5775304 100644 --- a/src/modules/08_registryEmployee/views/Main.vue +++ b/src/modules/08_registryEmployee/views/Main.vue @@ -238,6 +238,12 @@ async function fetchList() { function onClickDelete(id: string) { dialogRemove($q, async () => { showLoader(); + queryParams.page = + queryParams.page !== 1 && + queryParams.page === maxPage.value && + rows.value.length === 1 + ? queryParams.page - 1 + : queryParams.page; await http .delete(config.API.registryNew("-employee") + `/${id}`) .then(async () => {