diff --git a/src/modules/07_insignia/components/1_Proposals/addProposals.vue b/src/modules/07_insignia/components/1_Proposals/addProposals.vue index 0375d325a..23ebbdd74 100644 --- a/src/modules/07_insignia/components/1_Proposals/addProposals.vue +++ b/src/modules/07_insignia/components/1_Proposals/addProposals.vue @@ -15,6 +15,7 @@ const { hideLoader, dialogConfirm, success, + dialogMessageNotify } = mixin; const router = useRouter(); const route = useRoute(); @@ -106,22 +107,25 @@ const editData = async (id: string) => { console.log(formData); }; const checkSave = () => { - dialogConfirm($q, () => SaveData()); -}; -const SaveData = async () => { if (myForm.value !== null) { myForm.value.validate().then(async (success) => { if (success) { - if (edit.value) { - await editData(id.value); - } else { - await addData(); - clickBack(); - } + dialogConfirm($q, () => SaveData()); + }else { + dialogMessageNotify($q,"กรุณาเลือกรอบการเสนอขอพระราชทานเครื่องราชฯ") } - }); + }) } }; +const SaveData = async () => { + if (edit.value) { + await editData(id.value); + } else { + await addData(); + clickBack(); + } +}; + const updateDateRange = () => { if (roundInsig.value.value == 1) { dateStart.value = new Date(new Date().getFullYear(), 9, 1); diff --git a/src/modules/07_insignia/components/3_result/DialogForm.vue b/src/modules/07_insignia/components/3_result/DialogForm.vue index e5b50659c..2b847d30c 100644 --- a/src/modules/07_insignia/components/3_result/DialogForm.vue +++ b/src/modules/07_insignia/components/3_result/DialogForm.vue @@ -278,7 +278,7 @@ const searchcardid = () => {
(); +const myForm = ref(null); //form data input const mixin = useCounterMixin(); -const { dialogConfirm } = mixin; +const { dialogConfirm,dialogMessageNotify } = mixin; const router = useRouter(); const routeName = router.currentRoute.value.name; const amount = ref(); @@ -42,8 +42,18 @@ watch(props, () => { }); const clickSave = () => { - dialogConfirm($q, () => props.save(grandCross.value, amount.value)); + if (myForm.value !== null) { + myForm.value.validate().then(async (success) => { + if (success) { + dialogConfirm($q, () => props.save(grandCross.value, amount.value)); + }else { + dialogMessageNotify($q,"กรุณาข้อมูลให้ครบ") + } + }) + } }; + +