fixbug ==> เพิ่มเรื่องร้องเรียน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-19 11:05:29 +07:00
parent 491651bb79
commit 4a37317deb

View file

@ -220,9 +220,10 @@ async function getActive() {
})
.catch((err) => {
messageError($q, err);
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
} else {
await getOc(formData.activeId);
}
@ -230,6 +231,7 @@ async function getActive() {
/** ดึงข้อมูลหน่วยงานจาก api */
async function getOc(activeId: string) {
showLoader();
await http
.get(config.API.orgByIdSystem(activeId, route.meta.Key as string))
.then(async (res) => {
@ -242,7 +244,9 @@ async function getOc(activeId: string) {
.catch((err) => {
messageError($q, err);
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
/**
@ -257,9 +261,8 @@ function deletePerson(id: string) {
}
/** ช่องทางการร้องเรียน และฟังก์ชั่นการดึงข้อมูลช่องทางการร้องเรียนมาจาก api*/
async function getListChannel() {
await http
function getListChannel() {
http
.get(
config.API.complaintListOp(
mainStore.pathComplaintsChannal(route.name as string)
@ -267,6 +270,9 @@ async function getListChannel() {
)
.then((res) => {
channelOptions.value = res.data.result.data;
})
.catch((err) => {
messageError($q, err);
});
}
@ -377,8 +383,7 @@ watch(props.data, async () => {
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(async () => {
mainStore.rowsAdd = [];
await getActive();
await getListChannel();
await Promise.all([getActive(), getListChannel()]);
});
</script>