แก้โหลด พ้นราชการ

This commit is contained in:
setthawutttty 2025-07-07 10:38:04 +07:00
parent e497160fd5
commit e539ca977b
3 changed files with 15 additions and 10 deletions

View file

@ -233,9 +233,12 @@ function onSearch() {
);
}
onMounted(async () => {
await getTreeData();
});
watch(
() => modal.value,
async () => {
modal.value && (await getTreeData());
}
);
</script>
<template>
<q-dialog v-model="modal" persistent full-width>

View file

@ -170,8 +170,10 @@ async function fetchlistprofile(id: string) {
linkFile.value = data.file;
//
if (data.profile !== null) {
const listData = data.profile.map((e: any) => ({
const listData =
data.profile &&
data.profile.map((e: any) => ({
id: e.id,
profileId: e.profileId,
order: e.order,
@ -201,18 +203,17 @@ async function fetchlistprofile(id: string) {
child4: e.child4,
child4Id: e.child4Id,
}));
rows.value = listData;
rowsData.value = listData;
}
if (statusReport.value == false) {
await fecthCheck(retireld.value);
} else statusUpload.value = true;
rows.value = listData;
rowsData.value = listData;
hideLoader();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}

View file

@ -182,6 +182,7 @@ async function saveData() {
.put(config.API.detailByidDeceased(profileId.value), dataToSend)
.then(async (res) => {
await getData();
success($q, "เพิ่มข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);