consend form

This commit is contained in:
Kittapath 2023-03-22 00:25:55 +07:00
parent 6fe6aed921
commit 380eb0d10b
17 changed files with 482 additions and 346 deletions

View file

@ -220,6 +220,11 @@
</div>
</q-form>
</q-card>
<q-dialog :model-value="modalConsend" persistent>
<q-card style="min-width: 800px">
<Conference :ok="consendOk" :close="consenClose" />
</q-card>
</q-dialog>
</template>
<script setup lang="ts">
import { ref, onMounted, watch } from 'vue'
@ -230,8 +235,11 @@ import config from '@/app.config'
import type { Address, DataOption, zipCodeOption } from '@/modules/01_exam/interface/index/Main'
import { defaultAddress } from '@/modules/01_exam/interface/index/Main'
import HeaderTop from '@/components/top.vue'
import Conference from '@/modules/01_exam/components/Conference.vue'
import { useExamDataStore } from '@/modules/01_exam/store'
const mixin = useCounterMixin()
const store = useExamDataStore()
const { date2Thai, calAge } = mixin
const edit = ref<boolean>(false)
@ -239,6 +247,7 @@ const addressData = ref<Address>(defaultAddress)
const myform = ref<any>()
const codep = ref<string>('')
const codec = ref<string>('')
const modalConsend = ref<boolean>(false)
const provinceOptions = ref<DataOption[]>([])
const districtOptions = ref<DataOption[]>([])
@ -270,11 +279,17 @@ onMounted(() => {
})
const saveData = async () => {
await myform.value.validate().then(async (success: boolean) => {
if (success) {
} else {
}
})
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 () => {
@ -402,6 +417,16 @@ const fetchSubDistrict = async (id: string, position: string) => {
// })
}
const consenClose = () => {
modalConsend.value = false
}
const consendOk = () => {
modalConsend.value = false
store.consend = true
saveData()
}
const cancelData = () => {}
const getClass = (val: boolean) => {