fix load รักษาการในตำแหน่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-03-26 17:48:04 +07:00
parent d1822542b6
commit d478001f32

View file

@ -48,7 +48,7 @@ async function fetchOrganizationActive() {
nodeTree.value = await fetchTreeActing(""); nodeTree.value = await fetchTreeActing("");
} else { } else {
showLoader(); showLoader();
http await http
.get(config.API.activeOrganization) .get(config.API.activeOrganization)
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
@ -154,9 +154,7 @@ const columns = ref<QTableProps["columns"]>([
]); ]);
const keyword = ref<string>(""); const keyword = ref<string>("");
/** /**function fetch รายชื่อ*/
* function fetch รายช
*/
async function fetchPosMaster() { async function fetchPosMaster() {
await http await http
.post(config.API.orgPosAct + `/search`, { .post(config.API.orgPosAct + `/search`, {
@ -209,9 +207,7 @@ const rowListPerson = ref<ListPerson[]>([]);
const dataListPerson = ref<ListPerson[]>([]); const dataListPerson = ref<ListPerson[]>([]);
const keywordAct = ref<string>(""); const keywordAct = ref<string>("");
/** /** function fetch รายชื่อรักษาการ*/
* function fetch รายชอรกษาการ
*/
async function fetchListAct() { async function fetchListAct() {
await http await http
.get(config.API.orgPosAct + `/${posmasterId.value}`) .get(config.API.orgPosAct + `/${posmasterId.value}`)
@ -267,21 +263,19 @@ function onDelete(id: string) {
}); });
} }
function getWorkFlow() { async function getWorkFlow() {
showLoader(); if (storeActing.isOfficer == null && storeActing.isStaff == null) {
http await http
.get(config.API.workflowKeycloakSystem("SYS_ACTING")) .get(config.API.workflowKeycloakSystem("SYS_ACTING"))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
storeActing.isOfficer = data.isOfficer; storeActing.isOfficer = data.isOfficer;
storeActing.isStaff = data.isStaff; storeActing.isStaff = data.isStaff;
hideLoader(); })
}) .catch((e) => {
.catch((e) => { messageError($q, e);
messageError($q, e); });
hideLoader(); }
})
.finally(() => {});
} }
function onSearchRowPosition() { function onSearchRowPosition() {
@ -300,10 +294,14 @@ function onSearchListPerson() {
); );
} }
onMounted(() => { onMounted(async () => {
fetchOrganizationActive(); try {
if (storeActing.isOfficer == null && storeActing.isStaff == null) { showLoader();
getWorkFlow(); await Promise.all([fetchOrganizationActive(), getWorkFlow()]);
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
} }
}); });
</script> </script>