From ca26dc6b53a531e62b276b3318f7e6cc9318011d Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 13 Mar 2025 17:20:40 +0700 Subject: [PATCH] =?UTF-8?q?fix=20Date=20=E0=B9=80=E0=B8=84=E0=B8=A3?= =?UTF-8?q?=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=87=E0=B8=A3=E0=B8=B2=E0=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/3_result/DialogResults.vue | 9 ++++++--- .../07_insignia/components/5_Borrow/DialogForm.vue | 13 +++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/modules/07_insignia/components/3_result/DialogResults.vue b/src/modules/07_insignia/components/3_result/DialogResults.vue index 5e14a0bdb..928aba2d2 100644 --- a/src/modules/07_insignia/components/3_result/DialogResults.vue +++ b/src/modules/07_insignia/components/3_result/DialogResults.vue @@ -25,6 +25,7 @@ const { showLoader, hideLoader, notifyError, + convertDateToAPI, } = mixin; /** @@ -215,15 +216,17 @@ function onSubmit() { insigniaId: brand.value, // insigniaID number: Advertise.value, issue: issue.value, - dateReceive: receivedate.value, // วันที่ได้รับเครื่องราชฯ + dateReceive: receivedate.value + ? convertDateToAPI(receivedate.value) + : "", // วันที่ได้รับเครื่องราชฯ organizationOrganizationSend: affiliationRequest.value, organizationOrganizationReceive: affiliationReceived.value, - date: announceDate.value, // วันที่กิจนุเบก + date: announceDate.value ? convertDateToAPI(announceDate.value) : "", // วันที่กิจนุเบก volumeNo: volume.value, // เล่ม section: episode.value, //ตอนที่ page: duty.value, //หน้าที่ no: announced.value, - datePayment: invoiceDate.value, //วันที่จ่าย + datePayment: convertDateToAPI(invoiceDate.value), //วันที่จ่าย typePayment: payment.value, // รูปแบบการจ่าย address: addressPayment.value, //ที่อยู่ }; diff --git a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue index ae0b06f5d..14d87a9d3 100644 --- a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue +++ b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue @@ -24,6 +24,7 @@ const { showLoader, hideLoader, notifyError, + convertDateToAPI, } = mixin; /** @@ -136,13 +137,15 @@ async function onSubmit() { if (props.action == "addData") { await http .post(config.API.insigniaManageBorrow(), { - borrowDate: receivedate.value, + borrowDate: receivedate.value + ? convertDateToAPI(receivedate.value) + : "", insigniaNoteProfileId: insigniaNoteProfileId.value, }) .then(async () => { await props.closeAndFecth(); await success($q, "บันทึกข้อมูลสำเร็จ"); - await clearData(); + clearData(); }) .catch((err) => { messageError($q, err); @@ -151,14 +154,16 @@ async function onSubmit() { } else { await http .put(config.API.insigniaManageBorrowReturn(props.profileId), { - returnDate: returndate.value, + returnDate: returndate.value + ? convertDateToAPI(returndate.value) + : "", returnOrganizationId: OrganazationId.value, returnReason: reason.value, }) .then(async () => { await props.closeAndFecth(); - await clearData(); await success($q, "บันทึกข้อมูลสำเร็จ"); + clearData(); }) .catch((err) => { messageError($q, err);