From 3ebc2714ccf0732029823937d71dadc008be60c9 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Mon, 25 Sep 2023 12:53:42 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=83=E0=B8=AB?= =?UTF-8?q?=E0=B9=89=20file=20=E0=B9=80=E0=B8=9B=E0=B9=87=E0=B8=99?= =?UTF-8?q?=E0=B8=A7=E0=B9=88=E0=B8=B2=E0=B8=87=E0=B9=84=E0=B8=94=E0=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/03_leave/views/AddLeave.vue | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/modules/03_leave/views/AddLeave.vue b/src/modules/03_leave/views/AddLeave.vue index ff8b002..cdf8faf 100644 --- a/src/modules/03_leave/views/AddLeave.vue +++ b/src/modules/03_leave/views/AddLeave.vue @@ -88,20 +88,16 @@ const fileUploadDoc = async (file: any) => { const saveResing = () => { $q.dialog({ - title: "ยืนยันการยื่นข้อมูลแบบสอบถาม", - message: "ต้องการยื่นข้อมูลแบบสอบถามนี้ใช่หรือไม่?", + title: "ยืนยันการยื่นข้อมูลลาออก", + message: "ต้องการยื่นข้อมูลลาออกนี้ใช่หรือไม่?", cancel: { flat: true, color: "negative", }, persistent: true, }) - .onOk(async () => { - if (files.value == undefined) { - fails($q, "กรุณากรอกอัพโหลดเอกสารเพิ่มเติม") - } else { - createFormresign() - } + .onOk(() => { + createFormresign() }) .onCancel(() => {}) .onDismiss(() => {}) @@ -147,15 +143,17 @@ const deleteResting = async (id: string) => { //บันทึกข้อมูล const createFormresign = async () => { const formData = new FormData() - const blob = files.value.slice(0, files.value[0].size) - const newFile = new File(blob, nameFile.value, { - type: files.value[0].type, - }) + + // const blob = files.value.slice(0, files.value[0].size) + // const newFile = new File(blob, nameFile.value, { + // type: files.value[0].type, + // }) + formData.append("Location", tranferOrg.value) formData.append("SendDate", dateToISO(dateCommand.value)) formData.append("ActiveDate", dateToISO(dateLeave.value)) formData.append("Reason", noteReason.value) - formData.append("file", newFile) + formData.append("file", files.value) await http .post(config.API.listResign(), formData) .then((res: any) => {