แก้ไขโครงสร้าง

This commit is contained in:
Warunee Tamkoo 2024-02-02 14:50:19 +07:00
parent 5465b33de1
commit a0959017c8
6 changed files with 106 additions and 35 deletions

View file

@ -90,26 +90,33 @@ function validateForm() {
/** ฟังชั่น บันทึก */
function onSubmit() {
dialogConfirm($q, () => {
showLoader();
http
.post(config.API.createOrganization, formData)
.then((res) => {
status.value = true;
store.typeOrganizational = "draft";
store.draftId = res.data.result.id;
success($q, "บันทึกข้อมูลสำเร็จ");
// props.fetchActive?.();
})
.catch((err) => {
messageError($q, err);
})
.finally(async () => {
modal.value = await false;
await close();
await hideLoader();
});
});
dialogConfirm(
$q,
() => {
showLoader();
http
.post(config.API.createOrganization, formData)
.then((res) => {
status.value = true;
store.typeOrganizational = "draft";
store.draftId = res.data.result.id;
success($q, "บันทึกข้อมูลสำเร็จ");
// props.fetchActive?.();
})
.catch((err) => {
messageError($q, err);
})
.finally(async () => {
modal.value = await false;
await close();
await hideLoader();
});
},
"ยืนยันการเพิ่มโครงสร้าง",
store.draftId
? "คุณมีแบบร่างอยู่หากคุณกดยืนยันระบบจะทำการลบแบบร่างเดิมและสร้างแบบร่างใหม่ ต้องการยืนยันการเพิ่มโครงสร้างนี้ใช่หรือไม่?"
: "ต้องการยืนยันการเพิ่มโครงสร้างนี้ใช่หรือไม่?"
);
}
function close() {