เเก้ validate เเล้ว input ลอย
This commit is contained in:
parent
4936c51a31
commit
477b8e999c
17 changed files with 47 additions and 30 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue