<template>
|
<div></div>
|
</template>
|
<script>
|
export default {
|
components: {},
|
data() {
|
return {
|
noTaskTip: ''
|
}
|
},
|
computed: {
|
appId() {
|
return this.$route.query.appId
|
}
|
},
|
async created() {
|
const canVerify = await this.getCanVerify()
|
if (!canVerify) {
|
this.$router.replace({ path: '/h5/noTask', query: { tip: this.noTaskTip }})
|
return
|
}
|
const getCheckIsSubmit = await this.getCheckIsSubmit()
|
if (getCheckIsSubmit) {
|
this.$router.replace({ path: '/h5/verForm', query: { appId: this.appId }})
|
} else {
|
this.$router.replace({ path: '/h5/face', query: { appId: this.appId }})
|
}
|
},
|
mounted() {
|
document.title = '考点核验'
|
},
|
methods: {
|
getCanVerify() {
|
return new Promise((resolve) => {
|
const params = {
|
applicationId: this.appId
|
}
|
this.$axios.get('/exam/verify-record/can-verify', { params }).then(res => {
|
if (res.data.code == 0) {
|
if (!res.data.data) {
|
this.noTaskTip = '您非此考点核验人员,无法签到,请联系工作人员确认。'
|
}
|
resolve(res.data.data)
|
} else {
|
resolve(false)
|
this.noTaskTip = res.data.msg
|
}
|
}, () => {
|
resolve(false)
|
})
|
})
|
},
|
getCheckIsSubmit() {
|
return new Promise((resolve) => {
|
const params = { applicationId: this.appId }
|
this.$axios.get('/exam/verify-record/get-by-application-id', { params }).then(res => {
|
if (res.data.code == 0) {
|
resolve(res.data.data.isVerified)
|
} else {
|
resolve(false)
|
}
|
}, () => {
|
resolve(false)
|
})
|
})
|
},
|
getCheckinExist() {
|
return new Promise((resolve) => {
|
const params = {
|
targetId: this.appId
|
}
|
this.$axios.get('/exam/staff/checkin/exist', { params }).then(res => {
|
if (res.data.code == 0) {
|
resolve(res.data.data)
|
} else {
|
resolve(false)
|
}
|
}, () => {
|
resolve(false)
|
})
|
})
|
},
|
}
|
}
|
</script>
|