From 961a548c48a362ef34af32806014d9f49823270f Mon Sep 17 00:00:00 2001 From: AnandaTon <125332905+anandaAiemvong@users.noreply.github.com> Date: Fri, 25 Aug 2023 12:09:22 +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=B9=80=E0=B8=87=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B9=84?= =?UTF-8?q?=E0=B8=82=20questionnair?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/03_leave/views/result.vue | 47 +++++++++++++++++++-------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/src/modules/03_leave/views/result.vue b/src/modules/03_leave/views/result.vue index 413580d..2c4d19b 100644 --- a/src/modules/03_leave/views/result.vue +++ b/src/modules/03_leave/views/result.vue @@ -11,7 +11,7 @@ const route = useRoute() const router = useRouter() const $q = useQuasar() const mixin = useCounterMixin() -const { date2Thai, dateToISO, success, messageError, showLoader, hideLoader } = mixin +const { date2Thai, dateToISO, success, messageError, showLoader, hideLoader, notifyError } = mixin const leaveReason = ref("") const id = ref("") const noteReason = ref("") @@ -105,20 +105,39 @@ const adjust_option = ref([ { label: "อื่น ๆ (ระบุ) ", value: 15 }, ]) const saveForm = () => { - $q.dialog({ - title: "ยืนยันข้อมูลแบบสอบถาม", - message: "ต้องการส่งข้อมูลแบบสอบถามนี้ใช่หรือไม่?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - createResult() + let hasError = false + if ( + reasonWork.value === 0 || + timeThink.value === 0 || + exitFactor.value === 0 || + adjust.value === 0 || + realReason.value.length < 1 || + notExitFactor.value.length < 1 || + haveJob.value === null || + suggestFriends.value === null || + futureWork.value === null || + suggestion.value.length < 1 + ) { + hasError = true + } else { + $q.dialog({ + title: "ยืนยันข้อมูลแบบสอบถาม", + message: "ต้องการส่งข้อมูลแบบสอบถามนี้ใช่หรือไม่?", + cancel: { + flat: true, + color: "negative", + }, + persistent: true, }) - .onCancel(() => {}) - .onDismiss(() => {}) + .onOk(async () => { + createResult() + }) + .onCancel(() => {}) + .onDismiss(() => {}) + } + if (hasError === true) { + notifyError($q, "กรุณากรอกข้อมูลให้ครบ") + } } // const putData = () => {