fix load ผลการพิจารณาทางวินัย

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-06-24 16:36:23 +07:00
parent d45a2f8412
commit eecd875753
4 changed files with 32 additions and 29 deletions

View file

@ -160,14 +160,16 @@ function confirmDelete(id: string) {
showLoader();
http
.delete(config.API.complaintFileDelete(formData.id, id))
.then(async (res) => {
.then(async () => {
await props.getData();
success($q, `ลบไฟล์สำเร็จ`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
/**
@ -188,7 +190,7 @@ function upLoadFileDoc() {
showLoader();
http
.put(config.API.complaintFileUpload(formData.id), Data)
.then(async (res) => {
.then(async () => {
await props.getData();
countNum.value = 2;
formData.documentFile = null;
@ -198,7 +200,7 @@ function upLoadFileDoc() {
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
.finally(() => {
hideLoader();
});
}
@ -215,7 +217,6 @@ async function addPerson(data: any, type?: string) {
/** ดึงข้อมูล active */
async function getActive() {
if (!formData.activeId) {
showLoader();
await http
.get(config.API.activeOrganization)
.then(async (res) => {
@ -225,16 +226,12 @@ async function getActive() {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
}
/** ดึงข้อมูลหน่วยงานจาก api */
async function getOc(activeId: string) {
showLoader();
await http
.get(config.API.orgByIdSystem(activeId, route.meta.Key as string))
.then(async (res) => {
@ -246,9 +243,6 @@ async function getOc(activeId: string) {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
@ -264,8 +258,8 @@ function deletePerson(id: string) {
}
/** ช่องทางการร้องเรียน และฟังก์ชั่นการดึงข้อมูลช่องทางการร้องเรียนมาจาก api*/
function getListChannel() {
http
async function getListChannel() {
await http
.get(
config.API.complaintListOp(
mainStore.pathComplaintsChannal(route.name as string)
@ -386,7 +380,12 @@ watch(props.data, async () => {
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(async () => {
mainStore.rowsAdd = [];
await Promise.all([getActive(), getListChannel()]);
try {
showLoader();
await Promise.all([getActive(), getListChannel()]);
} finally {
hideLoader();
}
});
</script>

View file

@ -526,10 +526,10 @@ async function saveDuty(id: string, duty: string, resolution: string) {
duty: duty,
commandNo: resolution,
})
.then((res: any) => {
.then(async () => {
await props.getData?.();
success($q, "บันทึกสำเร็จ");
closeEditDirector();
props.getData?.();
})
.catch((e) => {
messageError($q, e);

View file

@ -619,7 +619,7 @@ function emitPerson(data: PersonsArray[]) {
.post(config.API.disciplinaryReport(), {
Id: dataMapId,
})
.then((res) => {
.then(() => {
getActive();
})
.catch((e) => {
@ -648,10 +648,10 @@ async function saveDuty(id: string, duty: string, resolution: string) {
duty: duty,
commandNo: resolution,
})
.then((res: any) => {
.then(async () => {
await props.fetchData();
success($q, "บันทึกสำเร็จ");
closeEditDirector();
props.fetchData();
})
.catch((e) => {
messageError($q, e);

View file

@ -161,17 +161,20 @@ async function selectComplainant(val: string) {
*/
function onSubmit() {
dialogConfirm($q, async () => {
showLoader();
await http
.put(config.API.listResultById(id.value), formData)
.then(() => {
.then(async () => {
await props.fetchData();
isSave.value = false;
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData();
})
.catch((err) => {
messageError($q, err);
})
.finally(async () => {});
.finally(() => {
hideLoader();
});
});
}
@ -194,7 +197,6 @@ function changeFormData() {
/**
* งขอมลจำลองไปย store
*/
function uploadFile() {
/** uploadFile */
const Data = new FormData();
@ -202,7 +204,7 @@ function uploadFile() {
showLoader();
http
.put(config.API.upLoadFileResult(id.value), Data)
.then(async (res) => {
.then(async () => {
await props.fetchData();
countNum.value = 2;
success($q, "อัปโหลดไฟล์สำเร็จ");
@ -229,7 +231,7 @@ function confirmDelete(docid: string) {
showLoader();
http
.delete(config.API.deleteFileResult(id.value, docid))
.then(async (res) => {
.then(async () => {
await props.fetchData();
success($q, `ลบไฟล์สำเร็จ`);
})
@ -294,15 +296,17 @@ function onFaultSubmit() {
offense: JSON.stringify(checkValue.value),
remark: remark.value,
})
.then((res) => {
.then(async () => {
await props.fetchData();
success($q, "ระบุฐานความผิด สำเร็จ");
close();
props.fetchData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
.finally(() => {
hideLoader();
});
});
} else {
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 มาตรา");