From 07fd157cdf7712b3636ccf9b4b1c2275d2c56efc Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Thu, 31 Aug 2023 10:55:29 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=20api=20delete=20=E0=B8=A5=E0=B8=B2=E0=B8=AD=E0=B8=AD=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/03_leave/views/AddLeave.vue | 46 ++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/modules/03_leave/views/AddLeave.vue b/src/modules/03_leave/views/AddLeave.vue index 9c34976..20d34c7 100644 --- a/src/modules/03_leave/views/AddLeave.vue +++ b/src/modules/03_leave/views/AddLeave.vue @@ -198,7 +198,10 @@ - +
+ + +
@@ -288,6 +291,47 @@ const saveResing = () => { .onCancel(() => {}) .onDismiss(() => {}) } + +const cancelResing = () => { + console.log(id); + + $q.dialog({ + title: "ยืนยันการยกเลิกการลาออก", + message: "ต้องการยื่นข้อมูลยกเลิกการลาออกนี้ใช่หรือไม่?", + cancel: { + flat: true, + color: "negative", + }, + persistent: true, + }) + .onOk(async () => { + if (route.params.id !== undefined) { + id.value = route.params.id.toString() + deleteResting(id.value) + } + + }) + .onCancel(() => {}) + .onDismiss(() => {}) +} + + +const deleteResting = async(id :string) => { + showLoader() + await http + .delete(config.API.resingByid(id)) + .then(() => { + success($q, "ยกเลิกการลาออกขอสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +} + + const createFormresign = async () => { const formData = new FormData() const blob = files.value.slice(0, files.value[0].size)