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