fix: popup confirm register
This commit is contained in:
parent
3f46ad30af
commit
d5abc0ae1d
1 changed files with 50 additions and 31 deletions
|
|
@ -95,8 +95,10 @@
|
|||
/>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="q-pt-none">
|
||||
<div class="col-12 q-pa-md">
|
||||
<q-separator />
|
||||
|
||||
<q-card-section>
|
||||
<div class="col-12 q-pa-sm">
|
||||
<div class="q-pt-xs row">
|
||||
<div class="">ชื่อ :</div>
|
||||
<div class="text-black text-bold q-pl-sm">
|
||||
|
|
@ -112,9 +114,14 @@
|
|||
<div class="">ตำแหน่งที่สมัคร :</div>
|
||||
<div class="text-black text-bold q-pl-sm">{{ position }}{{ positionLevel }}</div>
|
||||
</div>
|
||||
<div class="text-red q-mt-md q-px-sm text-cente">
|
||||
***เมื่อส่งใบสมัครแล้วแก้ไขไม่ได้/สมัครใหม่ไม่ได้***
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator />
|
||||
|
||||
<q-card-actions align="center">
|
||||
<div class="col-12 row" align="center">
|
||||
<div class="col-6" align="center">
|
||||
|
|
@ -128,10 +135,9 @@
|
|||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-model="secondDialog" persistent transition-show="scale" transition-hide="scale">
|
||||
<!-- <q-dialog v-model="secondDialog" persistent transition-show="scale" transition-hide="scale">
|
||||
<q-card style="width: 400px">
|
||||
<q-card-section>
|
||||
<!-- <div class="text-h6">เตือน</div> -->
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section>
|
||||
|
|
@ -156,7 +162,7 @@
|
|||
</div>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</q-dialog> -->
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
|
@ -262,7 +268,7 @@ const dialogOpen = () => {
|
|||
dialog.value = true
|
||||
}
|
||||
|
||||
const okModalConfirm = () => {
|
||||
const okModalConfirm = async () => {
|
||||
if (statusEdit.value == true) {
|
||||
modalError($q, 'ไม่สามารถสมัครสอบได้', 'มีข้อมูลที่ยังไม่ถูกบันทึกข้อมูล')
|
||||
} else {
|
||||
|
|
@ -286,17 +292,29 @@ const fetchStatus = async () => {
|
|||
})
|
||||
}
|
||||
|
||||
const saveForm = async () => {
|
||||
loaderPage(true)
|
||||
// ฟังก์ชั่นสำหรับส่งใบสมัคร
|
||||
const sendRegister = async () => {
|
||||
await http
|
||||
.get(config.API.candidateRegister(examId.value, positionId.value))
|
||||
.then(() => {})
|
||||
.then(() => {
|
||||
if (props.stepPayment) {
|
||||
success($q, 'ส่งใบสมัครสำเร็จ')
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
})
|
||||
// .finally(async () => {
|
||||
// // await props.fetchStep()
|
||||
// })
|
||||
|
||||
if (!props.stepPayment) {
|
||||
await http
|
||||
.post(config.API.registerConfirm(examId.value, positionId.value))
|
||||
.then(() => {
|
||||
success($q, 'ส่งใบสมัครสำเร็จ')
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const clickSave = async () => {
|
||||
|
|
@ -364,14 +382,15 @@ const saveData = async () => {
|
|||
contacttel: defaultContact.value.contacttel
|
||||
})
|
||||
.then(async () => {
|
||||
if (!props.stepPayment) {
|
||||
secondDialog.value = true
|
||||
} else {
|
||||
success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ')
|
||||
}
|
||||
await saveForm()
|
||||
await props.fetchStep()
|
||||
// if (!props.stepPayment) {
|
||||
// secondDialog.value = true
|
||||
// } else {
|
||||
// success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ')
|
||||
// }
|
||||
dialog.value = false
|
||||
|
||||
await sendRegister()
|
||||
props.fetchStep()
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
|
|
@ -446,18 +465,18 @@ const saveData = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
async function onSubmit() {
|
||||
try {
|
||||
saveAuto.value = false
|
||||
await saveData()
|
||||
await http.post(config.API.registerConfirm(examId.value, positionId.value))
|
||||
success($q, 'ส่งใบสมัครสำเร็จ')
|
||||
await props.fetchStep()
|
||||
// do something
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
// async function onSubmit() {
|
||||
// try {
|
||||
// saveAuto.value = false
|
||||
// await saveData()
|
||||
// await http.post(config.API.registerConfirm(examId.value, positionId.value))
|
||||
// success($q, 'ส่งใบสมัครสำเร็จ')
|
||||
// await props.fetchStep()
|
||||
// // do something
|
||||
// } catch (error) {
|
||||
// console.error(error)
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue