From 07dad32620bc442b3f6f975c7d65c7309a55f2c4 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Fri, 6 Oct 2023 15:21:23 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=95=E0=B8=B1=E0=B8=A7=E0=B9=81=E0=B8=9B=E0=B8=A3=E0=B8=A5?= =?UTF-8?q?=E0=B8=87=20store=20=20=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=E0=B9=80=E0=B8=87=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=E0=B9=84=E0=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/01_exam/components/ExamForm.vue | 14 ++++++-------- .../01_exam/components/Form/Information.vue | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/modules/01_exam/components/ExamForm.vue b/src/modules/01_exam/components/ExamForm.vue index dfe1101..fe8e8ad 100644 --- a/src/modules/01_exam/components/ExamForm.vue +++ b/src/modules/01_exam/components/ExamForm.vue @@ -233,15 +233,14 @@ const saveForm = async () => { const clickSave = async () => { saveAuto.value = false - if (defaultInformation.value.profileImg == null || '') { - notifyError($q, 'กรุณาอัพโหลดรูปถ่าย') - } else { - await saveData() - } + await saveData() } const saveData = async () => { - //เช็ครูป + if (defaultInformation.value.profileImg == null || '') { + notifyError($q, 'กรุณาอัพโหลดรูปถ่าย') + return + } await formInformation.value.validate().then(async (suc: boolean) => { if (suc) { await formAddress.value.validate().then(async (suc: boolean) => { @@ -309,8 +308,7 @@ const saveData = async () => { contactfirstname: defaultContact.value.contactfirstname, contactlastname: defaultContact.value.contactlastname, contactrelations: defaultContact.value.contactrelations, - contacttel: defaultContact.value.contacttel, - profileImg: defaultInformation.value.profileImg + contacttel: defaultContact.value.contacttel }) .then(async () => { success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ') diff --git a/src/modules/01_exam/components/Form/Information.vue b/src/modules/01_exam/components/Form/Information.vue index a64dc55..7b38316 100644 --- a/src/modules/01_exam/components/Form/Information.vue +++ b/src/modules/01_exam/components/Form/Information.vue @@ -539,6 +539,7 @@ const fetchImgData = async () => { .then((res) => { const data = res.data.result img.value = data + defaultInformation.value.profileImg = data }) .catch((e) => { // messageError($q, e)