<template>
|
<div></div>
|
</template>
|
<script>
|
export default {
|
components: {},
|
data() {
|
return {
|
noTaskTip: ''
|
}
|
},
|
computed: {
|
appId() {
|
return this.$route.query.appId
|
}
|
},
|
async created() {
|
const canSignIn = await this.getCanSignIn()
|
if (!canSignIn) {
|
this.$router.replace({ path: '/h5/noTask', query: { tip: this.noTaskTip }})
|
return
|
}
|
const setting = await this.getSignInSetting()
|
|
if (setting === 0) {
|
this.$router.replace({ path: '/h5/face', query: { appId: this.appId } })
|
} else if (setting === 2) {
|
this.$router.replace({ path: '/h5/map', query: { appId: this.appId } })
|
} else {
|
this.$router.replace({ path: '/h5/noTask', query: { tip: this.noTaskTip }})
|
}
|
},
|
mounted() {
|
document.title = '工作人员签到'
|
},
|
methods: {
|
getCanSignIn() {
|
return new Promise((resolve) => {
|
const params = {
|
targetId: '',
|
appraisalPlanId: this.appId
|
}
|
this.$axios.get('/exam/staff/checkin/open', { params }).then(res => {
|
if (res.data.code == 0) {
|
if (!res.data.data) {
|
this.noTaskTip = '当前评价计划未开启签到'
|
}
|
resolve(res.data.data)
|
} else {
|
resolve(false)
|
this.$message.error(res.data.msg)
|
}
|
}, () => {
|
resolve(false)
|
})
|
})
|
},
|
getSignInSetting() {
|
return new Promise((resolve) => {
|
const params = { appraisalPlanId: this.appId }
|
this.$axios.get('/exam/staff/checkin/config', { params }).then(res => {
|
if (res.data.code == 0) {
|
resolve(res.data.data)
|
} else {
|
this.noTaskTip = res.data.msg
|
resolve(null)
|
}
|
}, () => {
|
resolve(null)
|
})
|
})
|
},
|
}
|
}
|
</script>
|