เเก้ validate เเล้ว input ลอย

This commit is contained in:
setthawutttty 2023-09-13 17:03:17 +07:00
parent 4936c51a31
commit 477b8e999c
17 changed files with 47 additions and 30 deletions

View file

@ -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);