This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-02 08:16:18 +07:00
parent 0abe2001a9
commit 6130d8bf9e
3 changed files with 16 additions and 19 deletions

View file

@ -298,14 +298,13 @@ async function onSubmit() {
}; };
http http
.put(config.API.noteAdd(props.roundId), body) .put(config.API.noteAdd(props.roundId), body)
.then(() => { .then(async () => {
success($q, "บันทึกข้อมูลสำเร็จ"); await props.close?.();
props.close?.(); await success($q, "บันทึกข้อมูลสำเร็จ");
await showLoader();
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader(); hideLoader();
}); });
} }

View file

@ -80,11 +80,11 @@ async function onSubmit(type: string, id: string) {
if (props.dateCheckReceive === null) { if (props.dateCheckReceive === null) {
formData.append("Date", dateToISO((Datereceive.value as Date) ?? nullii)); formData.append("Date", dateToISO((Datereceive.value as Date) ?? nullii));
formData.append("File", files.value); formData.append("File", files.value);
formData.append("OrgId", OrganazationId.value); // formData.append("OrgId", OrganazationId.value);
} else { } else {
formData.append("Date", dateToISO((Datereturn.value as Date) ?? nullii)); formData.append("Date", dateToISO((Datereturn.value as Date) ?? nullii));
formData.append("File", filesReturn.value); formData.append("File", filesReturn.value);
formData.append("OrgId", OrganazationId2.value); // formData.append("OrgId", OrganazationId2.value);
} }
showLoader(); showLoader();
http http

View file

@ -169,15 +169,14 @@ async function onSubmit() {
borrowDate: receivedate.value, borrowDate: receivedate.value,
insigniaNoteProfileId: insigniaNoteProfileId.value, insigniaNoteProfileId: insigniaNoteProfileId.value,
}) })
.then(() => { .then(async () => {
success($q, "บันทึกข้อมูลสำเร็จ"); await props.closeAndFecth();
clearData(); await clearData();
props.closeAndFecth(); await hideLoader();
await success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader(); hideLoader();
}); });
} else { } else {
@ -187,15 +186,14 @@ async function onSubmit() {
returnOrganizationId: OrganazationId.value, returnOrganizationId: OrganazationId.value,
returnReason: reason.value, returnReason: reason.value,
}) })
.then(() => { .then(async () => {
success($q, "บันทึกข้อมูลสำเร็จ"); await clearData();
clearData(); await hideLoader();
props.closeAndFecth(); await props.closeAndFecth();
await success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader(); hideLoader();
}); });
} }