refactor(qa-prevention):优化培训管理功能和数据处理- 清空 classInfo 数据,避免重复使用
- 修复考试记录按钮显示逻辑 - 优化签到流程,增加已签到提示 - 调整数据查询逻辑,提高数据准确性 - 添加日志输出,便于调试hyx_2025-01-13_xgf2.0
							parent
							
								
									e348a2248f
								
							
						
					
					
						commit
						b425d78223
					
				|  | @ -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) | ||||
|  | @ -135,9 +137,9 @@ | |||
| 							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) | ||||
| 						} | ||||
|  | @ -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,12 +212,11 @@ | |||
| 									uni.$u.toast('您还未完成人脸信息读取,请先完成人脸信息认证!') | ||||
| 								} | ||||
| 								break; | ||||
| 							}; | ||||
| 							} | ||||
| 							case "3": { | ||||
| 								// 考试二维码方式进入 [type: 3 --> 考试二维码方式进入] | ||||
| 								if (store.getters.getVerification === '1') { | ||||
| 									if (classInfo) { | ||||
| 
 | ||||
| 									if (this.classInfo) { | ||||
| 										uni.$u.route({ | ||||
| 											url: '/pages/train_management/face_authentication', | ||||
| 											params: { | ||||
|  | @ -235,7 +236,7 @@ | |||
| 							} | ||||
| 							default: { | ||||
| 								break; | ||||
| 							}; | ||||
| 							} | ||||
| 						} | ||||
| 					} | ||||
| 				}) | ||||
|  |  | |||
|  | @ -31,7 +31,7 @@ | |||
| 								<view> <text class="content_label">任务状态: </text>{{ handleCalcTaskStatus(item.state) }} </view> | ||||
| 								<view class="action-row"> | ||||
| 									<u-button size="mini" type="primary" text="签到信息" :disabled="item.userSignPath === '0'" @click="signInInformation(item.classId)" /> | ||||
| 									<u-button size="mini" type="primary" text="考试记录" :disabled="item.stageexamstate === '1' || item.stageexamstate === '4'" @click="ExamRecord(item)" /> | ||||
| 									<u-button v-if="item.examination === '1'" size="mini" type="primary" text="考试记录" :disabled="item.stageexamstate === '1' || item.stageexamstate === '4'" @click="ExamRecord(item)" /> | ||||
| 								</view> | ||||
| 							</view> | ||||
| 						</view> | ||||
|  | @ -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: { | ||||
|  |  | |||
|  | @ -19,7 +19,8 @@ | |||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| import { getSignInfo } from '@/api' | ||||
| 
 | ||||
| import {getSignInfo} from "../../api"; | ||||
| 
 | ||||
| export default { | ||||
| 	data() { | ||||
|  | @ -93,6 +94,7 @@ export default { | |||
| 			  classId | ||||
| 			}); | ||||
| 			this.signInfo = resData.page.list[0] | ||||
|       console.log(this.signInfo); | ||||
| 		}, | ||||
| 	} | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue