From 1065ea18165d4e9cb0299c917995da501a23733b Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 17 Jul 2024 13:28:43 +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=B4=E0=B8=AD=E0=B8=94=3D>=20fix=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/13_salary/views/salaryEmployeeLists.vue | 7 +++---- src/modules/13_salary/views/salaryLists.vue | 10 ++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/modules/13_salary/views/salaryEmployeeLists.vue b/src/modules/13_salary/views/salaryEmployeeLists.vue index 1521ab657..54436aa0e 100644 --- a/src/modules/13_salary/views/salaryEmployeeLists.vue +++ b/src/modules/13_salary/views/salaryEmployeeLists.vue @@ -53,7 +53,6 @@ const nextPage = ref(1); /**function เรียกข้อมูลรอบการขึ้นค่าจ้าง*/ function getRound() { - roundOptions.value = []; isDisable.value = false; showLoader(); http @@ -62,11 +61,13 @@ function getRound() { `?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0` ) .then(async (res) => { + roundOptions.value = []; + roundFilter.value = []; const data = res.data.result.data; if (data.length !== 0) { isDisable.value = true; lastPage.value = Math.ceil(res.data.result.total / pageSize.value); - const optionMain = await data.map((x: DataRound) => ({ + roundOptions.value = await data.map((x: DataRound) => ({ id: x.id, revisionId: x.revisionId, shortCode: x.period, @@ -79,9 +80,7 @@ function getRound() { ? "รอบพิเศษ " : "รอบเมษายน ", })); - roundOptions.value.push(...optionMain); - roundFilter.value = await []; roundFilter.value = await (roundOptions.value ? roundOptions.value[0] : ""); diff --git a/src/modules/13_salary/views/salaryLists.vue b/src/modules/13_salary/views/salaryLists.vue index 1da848cc3..768f34958 100644 --- a/src/modules/13_salary/views/salaryLists.vue +++ b/src/modules/13_salary/views/salaryLists.vue @@ -52,7 +52,6 @@ const nextPage = ref(1); /**function เรียกข้อมูลรอบการขึ้นเงินเดือน*/ function getRound() { - roundOptions.value = []; showLoader(); isDisable.value = false; http @@ -61,11 +60,13 @@ function getRound() { `?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0` ) .then(async (res) => { + roundOptions.value = []; + roundFilter.value = []; const data = res.data.result.data; if (data.length !== 0) { isDisable.value = true; lastPage.value = Math.ceil(res.data.result.total / pageSize.value); - const optionMain = await data.map((x: DataRound) => ({ + roundOptions.value = await data.map((x: DataRound) => ({ id: x.id, revisionId: x.revisionId, shortCode: x.period, @@ -78,9 +79,7 @@ function getRound() { ? "รอบพิเศษ " : "รอบเมษายน ", })); - roundOptions.value.push(...optionMain); - roundFilter.value = await []; roundFilter.value = await (roundOptions.value ? roundOptions.value[0] : ""); @@ -348,14 +347,13 @@ onMounted(() => {