fix(DialogOrgSelect): fetch position

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-05-05 15:56:14 +07:00
parent 44487139ea
commit 7bbd9ae933

View file

@ -318,9 +318,7 @@ async function getDataTable(id: string, level: number = 0) {
messageError($q, err);
})
.finally(() => {
setTimeout(() => {
hideLoader();
}, 1000);
hideLoader();
});
}
@ -403,15 +401,15 @@ async function fetchPosFind(level: number, id: string) {
};
await http
.post(config.API.orgPosFind, body)
.then((res) => {
.then(async (res) => {
const data = res.data.result;
expanded.value = data;
nodeId.value = id;
positionId.value = props?.dataRows?.posmasterId;
seletcId.value = props?.dataRows?.positionId;
datePos.value = props?.dataRows?.reportingDate;
getDataTable(nodeId.value, level);
await getDataTable(nodeId.value, level);
await onClickSelectPos(positionId.value);
})
.catch((e) => {
messageError($q, e);
@ -427,11 +425,6 @@ watch(
if (props?.dataRows?.node !== null && props?.dataRows?.nodeId !== null) {
await fetchPosFind(props?.dataRows?.node, props?.dataRows?.nodeId);
if (positionId.value) {
setTimeout(async () => {
await onClickSelectPos(positionId.value);
}, 200);
}
} else {
expanded.value = [];
}
@ -534,6 +527,7 @@ onMounted(async () => {
await fetchTree();
});
</script>
<template>
<q-dialog v-model="modal" persistent full-width>
<q-card class="no-scroll">
@ -929,6 +923,7 @@ onMounted(async () => {
</q-card>
</q-dialog>
</template>
<style scoped>
.my-list-link {
color: rgb(118, 168, 222);