เพิ่ม Dialog ดำเนินการสำเร็จ

This commit is contained in:
AnandaTon 2023-09-27 11:30:37 +07:00
parent b15dd6205f
commit 04ce570654

View file

@ -1021,27 +1021,60 @@ const closeKp7Short = () => {
dialogShort.value = false; dialogShort.value = false;
}; };
const helpPost = () => { const helpPost = async () => {
const formData = new FormData();
formData.append("id", profileId.value);
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
const formData = new FormData(); showLoader();
formData.append("id", profileId.value); await http
await http.post(config.API.placemenHelpGov, formData); .post(config.API.placemenHelpGov, formData)
.then(() => {
success($q, "ดำเนินการสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}); });
}; };
const repatriationPost = async () => { const repatriationPost = async () => {
const formData = new FormData();
formData.append("id", profileId.value);
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
const formData = new FormData(); showLoader();
formData.append("id", profileId.value); await http
await http.post(config.API.placemenRepatriation, formData); .post(config.API.placemenRepatriation, formData)
.then(() => {
success($q, "ดำเนินการสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}); });
}; };
const appointPost = async () => { const appointPost = async () => {
const formData = new FormData();
formData.append("id", profileId.value);
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
const formData = new FormData(); showLoader();
formData.append("id", profileId.value); await http
await http.post(config.API.placemenAppointment, formData); .post(config.API.placemenAppointment, formData)
.then(() => {
success($q, "ดำเนินการสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}); });
}; };
@ -1054,34 +1087,78 @@ const appointPost = async () => {
// }; // };
const outPost = async () => { const outPost = async () => {
const formData = new FormData();
formData.append("id", profileId.value);
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
const formData = new FormData(); showLoader();
formData.append("id", profileId.value); await http
await http.post(config.API.retirementOut, formData); .post(config.API.retirementOut, formData)
.then(() => {
success($q, "ดำเนินการสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}); });
}; };
const dischargePost = async () => { const dischargePost = async () => {
const formData = new FormData();
formData.append("id", profileId.value);
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
const formData = new FormData(); showLoader();
formData.append("id", profileId.value); await http
await http.post(config.API.retirementDischarge, formData); .post(config.API.retirementDischarge, formData)
.then(() => {
success($q, "ดำเนินการสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}); });
}; };
const expulsionPost = async () => { const expulsionPost = async () => {
const formData = new FormData();
formData.append("id", profileId.value);
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
const formData = new FormData(); showLoader();
formData.append("id", profileId.value); await http
await http.post(config.API.retirementExpulsion, formData); .post(config.API.retirementExpulsion, formData)
.then(() => {
success($q, "ดำเนินการสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}); });
}; };
const otherPost = async () => { const otherPost = async () => {
const formData = new FormData();
formData.append("id", profileId.value);
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
const formData = new FormData(); showLoader();
formData.append("id", profileId.value); await http
await http.post(config.API.placemenOther, formData); .post(config.API.placemenOther, formData)
.then(() => {
success($q, "ดำเนินการสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}); });
}; };