dedsudiyu 1 day ago
parent
commit
76f655378a

+ 2 - 1
api/request/config.js

@@ -3,6 +3,7 @@ const config = {
 	
 	// base_url: 'http://192.168.1.43/api', //43服务器
 	// base_url: 'http://192.168.1.8/api',//1.8服务器
+	base_url: 'http://192.168.1.88/labSystem',//1.8服务器
 	// base_url: 'http://192.168.1.9:8080',//柴
 	// base_url: 'http://192.168.1.24:8080',//林总
 	// base_url: 'http://192.168.1.7:8080',//刘波
@@ -13,7 +14,7 @@ const config = {
 	// base_url: 'http://192.168.1.29:8080',//何成
 	// base_url: 'https://demo.zjznai.com/xzgd/',
 	// base_url: 'https://lab.zjznai.com/labNhSystem/',//43服务器高升测试
-	base_url: 'https://lab.zjznai.com/labTest/',//1.8外网
+	// base_url: 'https://lab.zjznai.com/labTest/',//1.8外网
 	// base_url: 'https://lab.zjznai.com/labapp/',//43服务器线上
 	// base_url: 'https://lab.zjznai.com/appTest/',//88服务器线上
 	// base_url: 'https://lab.zjznai.com/labSystem/', //矿大地址

+ 8 - 0
pages_safetyEducationExamination/api/index.js

@@ -205,6 +205,14 @@ export const examElLabEduRelationGraduationReport = (data) => {
 		data: { ...data }
   })
 }
+//绑定实验室
+export const examElLabEduRelationBind = (data) => {
+	return apiResquest({
+		url: `/exam/elLabEduRelation/bind`,
+		method: 'POST',
+		data: { ...data }
+	})
+};
 //查询实验室负责人 待审批的列表
 export const examElLabEduRelationAuditList = (data) => {
 	return apiResquest({

File diff suppressed because it is too large
+ 655 - 401
pages_safetyEducationExamination/component/workbench/BindLabModal.vue


+ 23 - 60
pages_safetyEducationExamination/component/workbench/userInfoCard.vue

@@ -100,8 +100,10 @@
 				</view>
 			</view>
 		</view>
-		<BindLabModal 
-			:visible="showBindLabModal" 
+		<BindLabModal
+			:visible="showBindLabModal"
+			:off-type="bindLabOffType"
+			:education-type="userInfo.educationType"
 			@close="showBindLabModal = false"
 			@bind-success="refreshPageData"
 		/>
@@ -135,78 +137,39 @@
 					studyHourRate: '',
 					targetExamName: '',
 				},
-				showBindLabModal:true,
+				showBindLabModal: false,
+				bindLabOffType: true,
 			}
 		},
 		mounted() {
-			this.examElLabEduRelationBindStatus();
+			this.loadUserInfo();
 		},
 		methods: {
-			// 绑定成功后的回调
 			refreshPageData() {
-				// 重新获取用户信息或刷新页面数据
-				this.examElLabEduRelationBindStatus();
+				this.loadUserInfo();
 			},
 			handleExamClick() {
-				// 这里写跳转到考试详情页的逻辑
 				uni.navigateTo({
-					url: '/pages_safetyEducationExamination/screen-exam-detail/screen-exam-detail' // 根据实际路径修改
+					url: '/pages_safetyEducationExamination/views/exam/index',
 				});
 			},
-			// 获取用户信息
-			async examElLabEduRelationBindStatus() {
-				const {
-					data
-				} = await examElLabEduRelationBindStatus({});
+			async loadUserInfo() {
+				const { data } = await examElLabEduRelationBindStatus({});
 				if (data.code == 200) {
-					// 使用 Object.assign 保留默认值,同时更新接口返回的数据
-					// Object.assign(this.userInfo, data.data);
-					this.$set(this,'userInfo',data.data);
+					this.$set(this, 'userInfo', data.data);
+					if (data.data.isPopup) {
+						this.bindLabOffType = false;
+						this.showBindLabModal = true;
+					}
 				}
 			},
-			//关闭弹层
-			shadeButton(type){
-				let self = this;
-				if(type == 1){
-					//提交
-					this.$refs["shadeForm"].validate(valid => {
-						if (valid) {
-							this.$confirm('确认提交?', "提示", {
-								confirmButtonText: "确认",
-								cancelButtonText: "取消",
-								type: "warning"
-							}).then(function() {
-							}).then(() => {
-								self.examElLabEduRelationBind();
-							}).catch(() => {});
-						}
-					})
-				}else if(type == 2){
-					//查看通知
-					this.$set(this,'shadeType',2);
-				}else if(type == 3 || type == 33){
-					if(type == 3){
-						//关闭通知
-						this.$set(this.shadeFormData,'checkType',true);
-						this.$set(this,'shadeType',1);
-					}else if(type == 33){
-						//关闭通知
-						this.$set(this.shadeFormData,'checkType',false);
-						this.$set(this,'shadeType',1);
-					}
-				}else if(type == 4||type == 5){
-					//开启
-					this.$set(this,'shadeFormData',{
-						subId:null,
-						reason:'',
-						isEnter:false,
-						checkType:false,
-						offType:type == 4?true:false,
-					});
-					this.$set(this,'shadeType',1);
-				}else if(type == 6){
-					//关闭
-					this.$set(this,'shadeType',null);
+			shadeButton(type) {
+				if (type == 4) {
+					this.bindLabOffType = true;
+					this.showBindLabModal = true;
+				} else if (type == 5) {
+					this.bindLabOffType = false;
+					this.showBindLabModal = true;
 				}
 			},
 		}

File diff suppressed because it is too large
+ 655 - 401
pages_safetyEducationExamination/views/home/component/BindLabModal.vue


+ 26 - 61
pages_safetyEducationExamination/views/home/component/userInfoCard.vue

@@ -102,8 +102,10 @@
 				</view>
 			</view>
 		</view>
-		<BindLabModal 
-			:visible="showBindLabModal" 
+		<BindLabModal
+			:visible="showBindLabModal"
+			:off-type="bindLabOffType"
+			:education-type="userInfo.educationType"
 			@close="showBindLabModal = false"
 			@bind-success="refreshPageData"
 		/>
@@ -141,83 +143,45 @@
 					studyHourRate: '',
 					targetExamName: '',
 				},
-				showBindLabModal:true,
+				showBindLabModal: false,
+				bindLabOffType: true,
 			}
 		},
 		mounted() {
-			this.examElLabEduRelationBindStatus();
+			this.loadUserInfo();
 		},
 		methods: {
-			// 绑定成功后的回调
 			refreshPageData() {
-				// 重新获取用户信息或刷新页面数据
-				this.examElLabEduRelationBindStatus();
+				this.loadUserInfo();
 			},
 			handleExamClick() {
-				// 这里写跳转到考试详情页的逻辑
 				uni.navigateTo({
-					url: '/pages_safetyEducationExamination/screen-exam-detail/screen-exam-detail' // 根据实际路径修改
+					url: '/pages_safetyEducationExamination/views/exam/index',
 				});
 			},
-			// 获取用户信息
-			async examElLabEduRelationBindStatus() {
-				const {
-					data
-				} = await examElLabEduRelationBindStatus({});
+			async loadUserInfo() {
+				const { data } = await examElLabEduRelationBindStatus({});
 				if (data.code == 200) {
-					// 使用 Object.assign 保留默认值,同时更新接口返回的数据
-					// Object.assign(this.userInfo, data.data);
-					this.$set(this,'userInfo',data.data);
+					this.$set(this, 'userInfo', data.data);
+					if (data.data.isPopup) {
+						this.bindLabOffType = false;
+						this.showBindLabModal = true;
+					}
 				}
 			},
-			//关闭弹层
-			shadeButton(type){
-				let self = this;
-				if(type == 1){
-					//提交
-					this.$refs["shadeForm"].validate(valid => {
-						if (valid) {
-							this.$confirm('确认提交?', "提示", {
-								confirmButtonText: "确认",
-								cancelButtonText: "取消",
-								type: "warning"
-							}).then(function() {
-							}).then(() => {
-								self.examElLabEduRelationBind();
-							}).catch(() => {});
-						}
-					})
-				}else if(type == 2){
-					//查看通知
-					this.$set(this,'shadeType',2);
-				}else if(type == 3 || type == 33){
-					if(type == 3){
-						//关闭通知
-						this.$set(this.shadeFormData,'checkType',true);
-						this.$set(this,'shadeType',1);
-					}else if(type == 33){
-						//关闭通知
-						this.$set(this.shadeFormData,'checkType',false);
-						this.$set(this,'shadeType',1);
-					}
-				}else if(type == 4||type == 5){
-					//开启
-					this.$set(this,'shadeFormData',{
-						subId:null,
-						reason:'',
-						isEnter:false,
-						checkType:false,
-						offType:type == 4?true:false,
-					});
-					this.$set(this,'shadeType',1);
-				}else if(type == 6){
-					//关闭
-					this.$set(this,'shadeType',null);
+			shadeButton(type) {
+				if (type == 4) {
+					this.bindLabOffType = true;
+					this.showBindLabModal = true;
+				} else if (type == 5) {
+					this.bindLabOffType = false;
+					this.showBindLabModal = true;
 				}
 			},
 		}
 	}
-</script>
+
+	</script>
 
 <style lang="stylus" scoped>
 	.safetyEducationExamination-workbench-userInfoCard {
@@ -353,6 +317,7 @@
 					}
 
 					.lab-name {
+						width: 400rpx;
 						font-weight: 500;
 						color: #1857d4;
 						font-size: 28rpx;