From 1a294be701a09e7aef971d56805ab97a256d5d8d Mon Sep 17 00:00:00 2001 From: waruneeta Date: Fri, 1 Sep 2023 16:18:53 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AD=E0=B8=B1=E0=B8=9E=E0=B9=82=E0=B8=AB?= =?UTF-8?q?=E0=B8=A5=E0=B8=94=E0=B9=84=E0=B8=9F=E0=B8=A5=E0=B9=8C=E0=B8=A3?= =?UTF-8?q?=E0=B8=B1=E0=B8=9A=E0=B9=82=E0=B8=AD=E0=B8=99=20=E0=B9=81?= =?UTF-8?q?=E0=B8=A5=E0=B8=B0=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=20validate=20=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84=E0=B8=B3?= =?UTF-8?q?=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Receive/receiveMain.vue | 418 +++++------------- .../components/RepatriationOrder/step03.vue | 2 +- 2 files changed, 118 insertions(+), 302 deletions(-) diff --git a/src/modules/05_placement/components/Receive/receiveMain.vue b/src/modules/05_placement/components/Receive/receiveMain.vue index f921eecec..d5971fee1 100644 --- a/src/modules/05_placement/components/Receive/receiveMain.vue +++ b/src/modules/05_placement/components/Receive/receiveMain.vue @@ -274,8 +274,21 @@ onMounted(() => { }); const SaveData = async () => { - await addUpload(); - await clickCloseUpload(); + const formData = new FormData(); + formData.append("File", files.value); + showLoader(); + await http + .put(config.API.receiveFile(personalId.value), formData) + .then(() => { + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + await clickCloseUpload(); + hideLoader(); + }); }; const fecthlistRecevice = async () => { @@ -323,33 +336,33 @@ const fecthlistRecevice = async () => { }); }; -const fileUploadDoc = async (val: any) => { - nameFile.value = val[0].name; - fileUpload.value = val; -}; +// const fileUploadDoc = async (val: any) => { +// nameFile.value = val[0].name; +// fileUpload.value = val; +// }; -const addUpload = async () => { - if (fileUpload.value.length > 0) { - const blob = fileUpload.value.slice(0, fileUpload.value[0].size); - const newFile = new File(blob, nameFile.value, { - type: fileUpload.value[0].type, - }); - const formData = new FormData(); - formData.append("", newFile); - showLoader(); - await http - .put(config.API.receiveFile(personalId.value), formData) - .then(() => { - success($q, "บันทึกข้อมูลสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - hideLoader(); - }); - } -}; +// const addUpload = async () => { +// if (fileUpload.value.length > 0) { +// const blob = fileUpload.value.slice(0, fileUpload.value[0].size); +// const newFile = new File(blob, nameFile.value, { +// type: fileUpload.value[0].type, +// }); +// const formData = new FormData(); +// formData.append("", newFile); +// showLoader(); +// await http +// .put(config.API.receiveFile(personalId.value), formData) +// .then(() => { +// success($q, "บันทึกข้อมูลสำเร็จ"); +// }) +// .catch((e) => { +// messageError($q, e); +// }) +// .finally(async () => { +// hideLoader(); +// }); +// } +// }; const resetFilter = () => { filterKeyword.value = ""; @@ -454,64 +467,27 @@ const saveOrder = async () => { เพิ่มข้อมูล - + ส่งไปออกคำสั่งรับโอน - + - +
- + diff --git a/src/modules/05_placement/components/RepatriationOrder/step03.vue b/src/modules/05_placement/components/RepatriationOrder/step03.vue index 4baeab77f..4532181c5 100644 --- a/src/modules/05_placement/components/RepatriationOrder/step03.vue +++ b/src/modules/05_placement/components/RepatriationOrder/step03.vue @@ -86,7 +86,7 @@ const save = () => { const validateForm = () => { return ( fileOrder.value !== null && - fileOrder.value !== null && + fileTailer.value !== null && order.value.trim() !== "" ); };