heyang 1 年之前
父节点
当前提交
3924fc66ae
共有 2 个文件被更改,包括 25 次插入11 次删除
  1. 23 9
      pages/saoCode/scan.vue
  2. 2 2
      pages_safetyExamine/examineManage/examineAddContent.vue

+ 23 - 9
pages/saoCode/scan.vue

@@ -25,6 +25,7 @@
 			if(option.form){
 				this.form=JSON.parse(decodeURIComponent(option.form));
 			}
+			console.log(this.form)
 		},
 		onShow() {
 			this.donghua()
@@ -66,19 +67,32 @@
 				        self.code = newList[1];
 				    }else if(newList[0] == 'type'){
 				        self.type = newList[1];
+				    }else if(newList[0] == 'subId'){
+				        self.subId = newList[1];
 				    }
 				}
-				let joinHazardIds=[];
-				if(this.form.hazardIds){
-					joinHazardIds=this.form.hazardIds.split(',')
-					joinHazardIds.push(self.code)
-					this.form.joinHazardIds=joinHazardIds
+				
+				if(self.type=='10' && self.form.subIds==self.subId){//
+					let joinHazardIds=[];
+					if(this.form.hazardIds){
+						joinHazardIds=this.form.hazardIds.split(',')
+						joinHazardIds.push(self.code)
+						this.form.joinHazardIds=joinHazardIds
+					}else{
+						this.form.joinHazardIds=self.code
+					}
+					uni.redirectTo({
+						url: '/pages_safetyExamine/examineManage/examineAddTow?form='+encodeURIComponent(JSON.stringify(this.form))+'&joinHazardIds='+self.code
+					});
 				}else{
-					this.form.joinHazardIds=self.code
+					uni.showToast({
+						title: '二维码不正确!',
+						icon:"none",
+						mask:true,
+						duration: 2000
+					});
 				}
-				uni.navigateTo({
-					url: '/pages_safetyExamine/examineManage/examineAddTow?form='+encodeURIComponent(JSON.stringify(this.form))+'&joinHazardIds='+self.code
-				});
+				
 			  }
 		}
 	

+ 2 - 2
pages_safetyExamine/examineManage/examineAddContent.vue

@@ -7,7 +7,7 @@
 				<img src="@/pages_safetyExamine/images/icon_aqjc_ss.png"/>
 			</view>
 			<input type="text" v-model="getData.searchValue" placeholder="设备名称/型号" maxlength="50" placeholder-style="color: #CCCCCC;font-size:26rpx;">
-			<img class="scanBtn"  @click="scanBtn" src="@/pages_safetyExamine/images/icon_aqjc_sm.png"/>
+			<!-- <img class="scanBtn"  @click="scanBtn" src="@/pages_safetyExamine/images/icon_aqjc_sm.png"/> -->
 		</view>
 	  </view>
 	<scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
@@ -150,7 +150,7 @@ export default {
 			return
 		}
 
-		uni.navigateTo({
+		uni.redirectTo({
 			url: '/pages_safetyExamine/examineManage/examineAddTow?form='+encodeURIComponent(JSON.stringify(this.form))+'&joinHazardIds='+this.form.joinHazardIds
 		});