heyang пре 4 месеци
родитељ
комит
c31458e59d

+ 80 - 43
pages_manage/views/laboratory/safetyCardScan.vue

@@ -199,16 +199,15 @@
 				dialogVisible: false,
 				dialogTtile: '',
 				dialogStatus: 0, //0计划 1批次 2实验室
-				batchData: {},
 				batchList: [],
 				queryParams: {
 					page: 1,
 					pageSize: 100,
 					checkCategory: '', //1校院巡查 2学院自查
-					subId:'',
+					subId: '',
 				},
-				checkPlanSetVoList:null,
-				form:{},
+				checkPlanSetVoList: null,
+				form: {},
 
 			}
 		},
@@ -228,7 +227,7 @@
 					newData.labInfoBrandModels[i].showType = true;
 				}
 			}
-			if(newData.levelColor){
+			if (newData.levelColor) {
 				newData.levelColorTow = this.hexToRgb(newData.levelColor, 0.2)
 			}
 			this.$nextTick(() => {
@@ -242,11 +241,11 @@
 
 		},
 		mounted() {
-			
+
 		},
 		methods: {
-			dialogClose(){
-				this.dialogVisible=false;
+			dialogClose() {
+				this.dialogVisible = false;
 			},
 			//十六进制颜色值和RGB格式转换
 			hexToRgb(hex, opacity = 1) {
@@ -259,67 +258,94 @@
 				return `RGB(${red}, ${green}, ${blue},${opacity})`;
 			},
 			batchClick(row) {
-				let self=this;
+				let self = this;
 				if (this.dialogStatus == 0) { //计划点击
-					if (row.checkPlanSetVoList.length ==1) {
+					if (row.checkPlanSetVoList.length == 1) {
 						//如果只有1个检查批次不弹窗
-						this.$set(this, 'batchData', {
-							planId: row.planId,
-							planTitle: row.planTitle,
-							checkCategory: row.checkCategory,
-							checkTypeName: row.checkTypeName,
-							crossCheck: row.crossCheck,
-							checkPlanSetVoList: row.checkPlanSetVoList[0]
-						});
 						let planSetId = row.checkPlanSetVoList[0].planSetId
-						self.checkPlanSetVoList=row.checkPlanSetVoList[0];
+						self.checkPlanSetVoList = row.checkPlanSetVoList[0];
 						self.securityAppCheckManageList(planSetId)
-					} else {
-						this.$set(this, 'batchData', {
-							planId: row.planId,
-							planTitle: row.planTitle,
-							checkCategory: row.checkCategory,
-							checkTypeName: row.checkTypeName,
-							crossCheck: row.crossCheck,
+					} else if (row.checkPlanSetVoList.length == 0) {
+						this.dialogStatus = 0;
+						uni.showToast({
+							title: '该实验室暂无检查计划!',
+							icon: "none",
+							mask: true,
+							duration: 2000
 						});
+						return
+					} else {
 						this.$set(this, 'batchList', row.checkPlanSetVoList);
 						this.dialogStatus = 1;
 						this.dialogTtile = '批次';
 						this.dialogVisible = true;
-						
+
 					}
 				} else if (this.dialogStatus == 1) { //批次点击
-					this.dialogStatus = 2;
-					this.dialogTtile = '实验室';
+					/* this.dialogStatus = 2;
+					this.dialogTtile = '实验室'; */
 					let planSetId = row.planSetId
-					console.log(row)
-					self.checkPlanSetVoList=row;
+					self.checkPlanSetVoList = row;
 					this.securityAppCheckManageList(planSetId)
 				}
 			},
 			//查询计划
 			async securityAppCheckPlanAppTitleList() {
 				console.log(this.newData.subId)
-				this.queryParams.subId=this.newData.subId;
-				this.queryParams.checkStatus=1;
+				this.queryParams.subId = this.newData.subId;
+				this.queryParams.checkStatus = 0;
 				let self = this;
 				const {
 					data
 				} = await securityAppCheckPlanAppTitleList(this.queryParams);
 				if (data.code == 200 && data.data.records[0]) {
+					//循环过滤掉当前计划中批次中已经检查完成的
+					data.data.records.forEach(function(item,index){
+						let list=[];
+						item.checkPlanSetVoList.forEach(function(item2){
+							if (item2.checkSetProgress != 100) {
+								list.push(item2)
+							}
+						})
+						item.checkPlanSetVoList=list
+					})
+					let list2=[]
+					list2 = data.data.records.filter(function(item) {
+					  return item.checkPlanSetVoList.length!=0
+					});
+					data.data.records=list2
+					
 					if (data.data.records.length == 1) { //一个计划
-						let planSetId = data.data.records[0]
-						if (data.data.records[0].checkPlanSetVoList[0]) { //一个批次
-							let planSetId = data.data.records[0].checkPlanSetVoList[0].planSetId
-							self.checkPlanSetVoList=data.data.records[0].checkPlanSetVoList[0];
-							self.securityAppCheckManageList(planSetId)
+						if (data.data.records[0].checkPlanSetVoList.length == 1) { //1个批次
+							let planSetId = data.data.records[0]
+							if (data.data.records[0].checkPlanSetVoList[0]) { //一个批次
+								let planSetId = data.data.records[0].checkPlanSetVoList[0].planSetId
+								self.checkPlanSetVoList = data.data.records[0].checkPlanSetVoList[0];
+								self.securityAppCheckManageList(planSetId)
+							}
+						} else if (data.data.records[0].checkPlanSetVoList.length == 0) {
+							this.dialogStatus = 0;
+							uni.showToast({
+								title: '该实验室暂无检查计划!',
+								icon: "none",
+								mask: true,
+								duration: 2000
+							});
+							return
+						} else { //多个批次
+							this.dialogStatus = 1;
+							this.batchList = data.data.records[0].checkPlanSetVoList;
+							this.dialogVisible = true;
+							this.dialogTtile = '批次';
 						}
+
 					} else { //多个计划
 						this.batchList = data.data.records;
 						this.dialogVisible = true;
 						this.dialogTtile = '计划标题';
 					}
-				}else{
+				} else {
+					this.dialogStatus = 0;
 					uni.showToast({
 						title: '该实验室暂无检查计划!',
 						icon: "none",
@@ -336,17 +362,18 @@
 					page: 1,
 					pageSize: 20,
 					planSetId: planSetId,
-					subId:self.newData.subId,
+					subId: self.newData.subId,
 				}
 				const {
 					data
 				} = await securityAppCheckManageList(obj);
 				if (data.code == 200) {
 					//this.shadeList = data.data.records;
-					if(data.data.records[0]){
+					if (data.data.records[0]) {
 						let manageId = data.data.records[0].manageId;
 						self.securityAppCheckSetOptionList(data.data.records[0]);
-					}else {
+					} else {
+						self.dialogStatus = 0;
 						self.dialogVisible = false;
 						uni.showToast({
 							title: '该实验室暂无检查计划!',
@@ -362,7 +389,7 @@
 			//查询检查项
 			async securityAppCheckSetOptionList(item) {
 				let self = this;
-				let upData=item;
+				let upData = item;
 				let obj = {
 					page: 1,
 					pageSize: 20,
@@ -390,6 +417,16 @@
 									JSON
 									.stringify(infoData))
 						});
+					} else {
+						self.dialogStatus = 0;
+						self.dialogVisible = false;
+						uni.showToast({
+							title: '该实验室暂无检查项!',
+							icon: "none",
+							mask: true,
+							duration: 2000
+						});
+						return
 					}
 				}
 			},

+ 1 - 0
pages_safetyCheck/views/inspectManage/conductInspections.vue

@@ -249,6 +249,7 @@
 					this.$set(this.newData, 'hazardCheckCode2', item.hazardCheckCode2);
 					this.$set(this.newData, 'hazardCheckName2', item.hazardCheckName2);
 					this.$set(this.newData, 'hazardCheckPoint', item.hazardCheckPoint);
+					this.$set(this, 'setOptionId', item.setOptionId);
 					this.$set(this, 'hazardCheckPro', item.hazardCheckPro);
 					this.securityAppCheckPhotoGetCheckNumBySub();
 					this.$set(this, 'checkItemModuleType', false);