validate กรอกข้อมุลทั่วไป

This commit is contained in:
Kittapath 2023-03-22 12:13:10 +07:00
parent 417f9b5825
commit 1166f82847
4 changed files with 52 additions and 56 deletions

View file

@ -282,27 +282,26 @@ const saveData = async () => {
if (store.consend == true) {
edit.value = false
emit('update:statusEdit', false)
await myform.value.validate().then(async (success: boolean) => {
if (success) {
} else {
}
})
} else {
modalConsend.value = true
}
}
const changeBtn = async () => {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
await myform.value.validate().then(async (success: boolean) => {
if (success) {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
}
} else {
emit('update:statusEdit', false)
}
}
} else {
emit('update:statusEdit', false)
}
})
}
const selectProvince = (e: string, name: string) => {

View file

@ -402,27 +402,26 @@ const saveData = async () => {
if (store.consend == true) {
edit.value = false
emit('update:statusEdit', false)
await myform.value.validate().then(async (success: boolean) => {
if (success) {
} else {
}
})
} else {
modalConsend.value = true
}
}
const changeBtn = async () => {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
await myform.value.validate().then(async (success: boolean) => {
if (success) {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
}
} else {
emit('update:statusEdit', false)
}
}
} else {
emit('update:statusEdit', false)
}
})
}
const selectRadio = (e: boolean, i: any) => {

View file

@ -428,27 +428,26 @@ const saveData = async () => {
if (store.consend == true) {
edit.value = false
emit('update:statusEdit', false)
await myform.value.validate().then(async (success: boolean) => {
if (success) {
} else {
}
})
} else {
modalConsend.value = true
}
}
const changeBtn = async () => {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
await myform.value.validate().then(async (success: boolean) => {
if (success) {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
}
} else {
emit('update:statusEdit', false)
}
}
} else {
emit('update:statusEdit', false)
}
})
}
const fetchProvince = async () => {

View file

@ -277,27 +277,26 @@ const saveData = async () => {
if (store.consend == true) {
edit.value = false
emit('update:statusEdit', false)
await myform.value.validate().then(async (success: boolean) => {
if (success) {
} else {
}
})
} else {
modalConsend.value = true
}
}
const changeBtn = async () => {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
await myform.value.validate().then(async (success: boolean) => {
if (success) {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
}
} else {
emit('update:statusEdit', false)
}
}
} else {
emit('update:statusEdit', false)
}
})
}
const consenClose = () => {