diff --git a/pages/index/index.vue b/pages/index/index.vue
index a0eb1ec..38df129 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -90,7 +90,8 @@
title: '培训管理',
url: '/pages/train_management/index'
}
- ]
+ ],
+ classInfo: null,
}
},
computed: {
@@ -123,6 +124,7 @@
})
},
async fnScan() {
+ this.classInfo = null; // 清空 classInfo
uni.scanCode({
success: async (res) => {
// let obj = JSON.parse(res.result)
@@ -131,29 +133,29 @@
classId,
stageexampaperinputId,
type,
- CORPINFO_ID,
+ CORPINFO_ID,
RELEVANT_UNIT_NAME
} = JSON.parse(res.result);
if (type !== '0') {
- const classInfo = await this.handleGetClassInfoByParams(classId);
+ this.classInfo = await this.handleGetClassInfoByParams(classId);
const resData = await getStudentInfoApi({
- classId: classInfo.classId
+ classId: this.classInfo.classId
})
await this.$store.dispatch('setStudentInfo', resData.studentInfo)
}
switch (type) {
case "0": {
- let info = await setEntryV1({
- userId: this.userInfo.USER_ID,
- corpinfoId: CORPINFO_ID,
- RELEVANT_UNIT_NAME: RELEVANT_UNIT_NAME,
- postMethod: 'application/json'
- })
- if (info.code === 200) {
- uni.$u.toast('入职成功')
- } else {
- uni.$u.toast('入职失败,请联系管理员')
- }
+ let info = await setEntryV1({
+ userId: this.userInfo.USER_ID,
+ corpinfoId: CORPINFO_ID,
+ RELEVANT_UNIT_NAME: RELEVANT_UNIT_NAME,
+ postMethod: 'application/json'
+ })
+ if (info.code === 200) {
+ uni.$u.toast('入职成功')
+ } else {
+ uni.$u.toast('入职失败,请联系管理员')
+ }
break;
}
// case "1": {
@@ -191,8 +193,8 @@
})
}
if (store.getters.getVerification === '1') {
- if (classInfo) {
- if (classInfo.studystate === "3") {
+ if (this.classInfo) {
+ if (this.classInfo.studystate === "3") {
uni.$u.toast("您已经入班签到,无需再次签到!")
return;
}
@@ -210,20 +212,19 @@
uni.$u.toast('您还未完成人脸信息读取,请先完成人脸信息认证!')
}
break;
- };
+ }
case "3": {
// 考试二维码方式进入 [type: 3 --> 考试二维码方式进入]
if (store.getters.getVerification === '1') {
- if (classInfo) {
-
- uni.$u.route({
- url: '/pages/train_management/face_authentication',
- params: {
- type: 'learning_certification',
- stageexampaperinputId,
- classId,
- }
- })
+ if (this.classInfo) {
+ uni.$u.route({
+ url: '/pages/train_management/face_authentication',
+ params: {
+ type: 'learning_certification',
+ stageexampaperinputId,
+ classId,
+ }
+ })
} else {
uni.$u.toast('您未在培训计划内,无法进行考试,请联系教师')
@@ -235,7 +236,7 @@
}
default: {
break;
- };
+ }
}
}
})
diff --git a/pages/train_management/index.vue b/pages/train_management/index.vue
index f16c27f..7d9369f 100644
--- a/pages/train_management/index.vue
+++ b/pages/train_management/index.vue
@@ -31,7 +31,7 @@
任务状态: {{ handleCalcTaskStatus(item.state) }}
-
+
@@ -127,6 +127,10 @@ export default {
if (type === '2') {
// 签到二维码方式进入, [type: 2 --> 签到二维码方式进入]
if (classInfo) {
+ if (classInfo.studystate === "3") {
+ uni.$u.toast("您已经入班签到,无需再次签到!")
+ return;
+ }
uni.$u.route({
url: '/pages/train_management/realname_info_auth',
params: {
diff --git a/pages/train_management/sign_information.vue b/pages/train_management/sign_information.vue
index 6fd2b6d..c4b9aa7 100644
--- a/pages/train_management/sign_information.vue
+++ b/pages/train_management/sign_information.vue
@@ -19,7 +19,8 @@