From 609a98d2167a19f36832d7fd6d66eefb12184c0d Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 1 Mar 2024 09:33:55 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=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=3D>=20=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B1=E0=B8=9A=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=9B?= =?UTF-8?q?=E0=B8=A5=E0=B8=B5=E0=B9=88=E0=B8=A2=E0=B8=99=E0=B8=A3=E0=B8=AD?= =?UTF-8?q?=E0=B8=9A=E0=B8=82=E0=B8=B6=E0=B9=89=E0=B8=99=E0=B9=80=E0=B8=87?= =?UTF-8?q?=E0=B8=B7=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/13_salary/views/salaryLists.vue | 55 ++++++++++++--------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/src/modules/13_salary/views/salaryLists.vue b/src/modules/13_salary/views/salaryLists.vue index be6e350e8..0f1286e5d 100644 --- a/src/modules/13_salary/views/salaryLists.vue +++ b/src/modules/13_salary/views/salaryLists.vue @@ -58,6 +58,8 @@ async function getRound() { (Number(x.year) + 543), })); + console.log(roundOptions.value); + roundFilter.value = await (roundOptions.value ? roundOptions.value[0] : ""); @@ -127,19 +129,20 @@ function getSnap(code: string) { * @param id revisionId */ async function getAgency(id: string) { - await http - .get(config.API.activeOrganizationRootById(id)) - .then(async (res) => { - const data = res.data.result; - agencyOptions.value = await data.map((x: DataAgency) => ({ - id: x.id, - name: x.orgRootName, + id && + (await http + .get(config.API.activeOrganizationRootById(id)) + .then(async (res) => { + const data = res.data.result; + agencyOptions.value = await data.map((x: DataAgency) => ({ + id: x.id, + name: x.orgRootName, + })); + agencyFilter.value = store.rootId; + }) + .catch((err) => { + messageError($q, err); })); - agencyFilter.value = store.rootId; - }) - .catch((err) => { - messageError($q, err); - }); } /** @@ -147,19 +150,21 @@ async function getAgency(id: string) { * @param id revisionId */ async function getAgencyPosition(id: string) { - await http - .get(config.API.keycloakPositionByid(id)) - .then(async (res) => { - const data = res.data.result; + if (id) { + await http + .get(config.API.keycloakPositionByid(id)) + .then(async (res) => { + const data = res.data.result; - const position = agencyOptions.value?.find( - (e: DataOption) => e.id === data.rootId - ); - agencyFilter.value = position ? position.id : ""; - }) - .catch((err) => { - messageError($q, err); - }); + const position = agencyOptions.value?.find( + (e: DataOption) => e.id === data.rootId + ); + agencyFilter.value = position ? position.id : ""; + }) + .catch((err) => { + messageError($q, err); + }); + } else agencyFilter.value = ""; } /** @@ -214,6 +219,8 @@ async function onChangeRound() { ); store.tabType = "PENDING"; store.roundMainCode = roundFilter.value.shortCode; + } else { + isLoad.value = false; } }