heyang 1 year ago
parent
commit
b739fe1c1e
3 changed files with 154 additions and 78 deletions
  1. 2 2
      api/request/config.js
  2. 13 18
      pages/manageWorkbench.vue
  3. 139 58
      pages/safetyExamineWorkbench.vue

+ 2 - 2
api/request/config.js

@@ -1,7 +1,7 @@
 const config = {
 	//base_url: 'http://192.168.1.9:8080',//柴
 	// base_url: 'http://192.168.1.7:8080',//刘波
-	base_url: 'http://192.168.1.17:8080',//小飞
+	//base_url: 'http://192.168.1.17:8080',//小飞
 	// base_url: 'http://192.168.1.20:8080',//志伟
     // base_url: 'http://192.168.1.8:8080',//高升
 	// base_url: 'http://192.168.1.29:8080',//何成
@@ -9,7 +9,7 @@ const config = {
 	// base_url: 'https://demo.zjznai.com/xzgd/',
 
 	// base_url: 'https://lab.zjznai.com/labNhSystem/',//43服务器高升测试
-	// base_url: 'https://lab.zjznai.com/labAppTest/',//43服务器线上
+	 base_url: 'https://lab.zjznai.com/labAppTest/',//43服务器线上
     // base_url: 'https://lab.zjznai.com/appTest/',//88服务器线上
 	// base_url: 'https://lab.zjznai.com//labSystem/', //矿大地址
     // base_url: 'https://lab.zjznai.com/labSaasSystem/', //矿大化工

+ 13 - 18
pages/manageWorkbench.vue

@@ -500,25 +500,20 @@ export default {
 		const {data} = await getGentleIdentifier();
 		if(data.code==200){
 			let pageType = null
-		  // 如果是管理员 检查者和整改者 
-		  if(data.data.adminGentle && (data.data.applyGentle || data.data.myApplyGentle) && data.data.rectifyGentle){
-			  pageType=1
-		  }else if(data.data.adminGentle && (data.data.applyGentle || data.data.myApplyGentle) && !data.data.rectifyGentle){
-			  pageType=1
-		  }else if(data.data.adminGentle && !data.data.applyGentle && data.data.rectifyGentle){
-			  pageType=1
-		  }else if(!data.data.adminGentle && (data.data.applyGentle || data.data.myApplyGentle) && data.data.rectifyGentle){
-			  pageType=2
-		  }else if(data.data.adminGentle && !data.data.applyGentle && !data.data.rectifyGentle){
-			  pageType=1
-		  }else if(!data.data.adminGentle && (data.data.applyGentle || data.data.myApplyGentle) && !data.data.rectifyGentle){
-			  pageType=2
-		  }else if(!data.data.adminGentle && !data.data.applyGentle && data.data.rectifyGentle){
-			  pageType=3
-		  }
-		  uni.setStorageSync('gentleIdentifier',pageType)
+		   // 如果是管理员 检查者和整改者 
+		   let list=[];
+			if(data.data.adminGentle){
+				list.push({name:'管理员',pageType:1})
+			}
+			if(data.data.applyGentle){
+				list.push({name:'检查者',pageType:2})
+			}
+			if(data.data.rectifyGentle){
+				list.push({name:'整改者',pageType:3})
+			}
+		  uni.setStorageSync('gentleIdentifier',list)
 		  uni.setStorageSync('gentleIdentifierData',data.data)
-		  if(pageType){
+		  if(list.length>0){
 			  uni.navigateTo({
 			    url: '/pages/safetyExamineWorkbench',
 			  });

+ 139 - 58
pages/safetyExamineWorkbench.vue

@@ -2,6 +2,12 @@
 <template>
   <view class="examine">
 	<scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
+		<view class="tabTitle_identity" v-if="tabTextIdentity.length>1">
+			<view class="tabTitle_identity_li" @tap="tabClickIdentity(item,index)"  :key="index" v-for="(item,index) in tabTextIdentity">
+				<view :class="{on:curTabIdentity==index}" class="tabTitle_identity_text">{{item.name}}</view>
+			    <view :class="{on:curTabIdentity==index}" class="tabTitle_identity_across"></view>
+			</view>
+		</view>
 		<view>
 			<view class="statistics" v-if="pageType==1 || pageType==2">
 					<view class="statistics_li" v-for="(item,index) in  statisticsList" :key="index">
@@ -138,7 +144,7 @@
 						<text>随手拍</text>
 					</view>
 				</viwe>
-				
+
 				<view class="tabTitle_three" v-if="pageType==3">
 					<view class="tabTitle_three_li" @tap="tabClickThree(index)"  :key="index" v-for="(item,index) in tabTextThree">
 						<view :class="{on:curTabThree==index}" class="tabTitle_three_text">{{item.name}}<text>{{item.num}}</text></view>
@@ -196,7 +202,7 @@
 					</view>
 				</view>
 		</view>
-	</scroll-view>	
+	</scroll-view>
 	<!-- <view class="bottom_btn" v-if="pageType==1"  @click="handleClick('','start')">开展检查</view> -->
 	<img class="scan_btn" @click.stop="saoCode" src="@/images/Version3.3.3/icon_xyxc_sm.png"/>
 	<!-- 选择学院-->
@@ -212,17 +218,22 @@
 			</view>
 		</view>
 	</view>
+	<tab-bar></tab-bar>
   </view>
 </template>
 
 <script>
 import { config } from '@/api/request/config.js'
+import { tabBar } from '@/component/tabBar.vue'
 import {checkPlanList,getCheckStatusCount,getManageStatusCount,dataStatistics,checkManageList,checkHazardAppList,checkClapList,getCheckPlanBySubId} from '@/api/index.js'
 export default {
   name: "rectifyList",
+  components: {
+   tabBar
+  },
   data() {
     return {
-	  pageType:uni.getStorageSync('gentleIdentifier'),//人员类型 3整改人 2检查人 1管理员
+	  pageType:1,//人员类型 3整改人 2检查人 1管理员
       //列表请求参数
       getData:{
         pageNum:1,
@@ -243,7 +254,7 @@ export default {
 	    hazardType:'',//1是院校巡查,2是实验室自查
 		rectifyStatus:'',//1已完成 2待整改 3待复核 4 暂无法整改
 	  },
-	 
+
 	  userType:1,//人员类型 3整改人 2检查人 1管理员
 	  statisticsList:[
 		  {name:'本月已检查',value:'0'},
@@ -258,6 +269,8 @@ export default {
 		  {name:'本月已整改',value:'0%'},
 		  {name:'本月复核通过率',value:'0%'},
 	  ],
+	  tabTextIdentity:uni.getStorageSync('gentleIdentifier'),
+	  curTabIdentity:0,
 	  tabText:[{name:'未开始',num:0,},{name:'进行中',num:0}],
 	  curTab:0,
 	  tabTextTow:[{name:'待检查',num:0,},{name:'检查中',num:0,},{name:'待复核',num:0,}],
@@ -282,26 +295,29 @@ export default {
     }
   },
   onLoad() {
-	
+
   },
   onShow() {
-	 
+
   },
   beforeCreate() {
-	   
+
   },
   mounted(){
+	  if(this.tabTextIdentity.length==1){
+	  	this.pageType=uni.getStorageSync('gentleIdentifier')[0].pageType
+	  }
 	  this.myApplyGentle=uni.getStorageSync('gentleIdentifierData').myApplyGentle
 	  this.applyGentle=uni.getStorageSync('gentleIdentifierData').applyGentle
 	  //获取当前日期
 	  this.currentDate=this.getNowFormatDate()
-	  
+
 	  this.getCheckStatusCount();
 	  //this.getManageStatusCount();
 	  this.dataStatistics();
 	  this.checkClapListAllNum();//随手拍待整改总数
-	  
-	  
+
+
 	  if(this.pageType==1){//管理员
 		   this.getList();
 	  }else if(this.pageType==2){//检查者
@@ -312,7 +328,7 @@ export default {
 	  }else if(this.pageType==3){//整改者
 		  this.checkHazardAppList();
 	  }
-	 
+
   },
   methods: {
 	  //滚动事件
@@ -324,9 +340,9 @@ export default {
 			  }else{
 				  setTimeout(function(){
 					  self.getData.pageNum += 1;
-					  self.getList(); 
+					  self.getList();
 				  },1000)
-			  			 
+
 			  }
 		  }else if(this.pageType==2){//检查者
 			  if(self.total2/self.getData2.pageSize<=self.getData2.pageNum){
@@ -334,13 +350,13 @@ export default {
 			  }else{
 				  setTimeout(function(){
 					  self.getData2.pageNum += 1;
-					  
+
 					   if(self.curTabTow==2){//待复核
 						   self.checkHazardAppList()
 					   }else {
 						   self.getList2();
 					   }
-				  },1000)	 
+				  },1000)
 			  }
 		  }else if(this.pageType==3){//整改者
 			  if(self.total3/self.getData3.pageSize<=self.getData3.pageNum){
@@ -354,10 +370,15 @@ export default {
 					 		self.checkClapList()
 					}
 				  },1000)
-			  			 
+
 			  }
 		  }
-	     
+
+	  },
+	  //登录人员身份
+	  tabClickIdentity(item,index) {
+	  	this.curTabIdentity = index;
+		this.pageType=item.pageType;
 	  },
 	  //管理员
 	  tabClick(index) {
@@ -385,8 +406,8 @@ export default {
 		}else if(index==2){//待复核
 			this.getData2.rectifyStatus=3
 			this.checkHazardAppList()
-		} 
-		
+		}
+
 	  },
 	  tabClickThree(index) {//整改者
 	  	this.curTabThree = index;
@@ -401,7 +422,7 @@ export default {
 	  },
 	  handleClick(row,doType){
 		  let self=this;
-		  
+
 		  if(self.pageType==1 && doType=='patrolPlan'){//校院巡查-计划
 			 uni.navigateTo({
 			     url: '/pages_safetyExamine/patrolPlan/patrolPlanList?pageType=1'
@@ -447,9 +468,9 @@ export default {
 			      url: '/pages_safetyExamine/examineManage/examineAdd'
 			  });
 		  }
-		  
+
 	  },
-	  
+
 	  //检查者
 	  handleTowClick(row,doType){
 		  if(doType=='add'){//开始检查
@@ -478,7 +499,7 @@ export default {
 						 url: '/pages_safetyExamine/snapshotManage/snapshotDetail?id='+row.id+'&rectifyStatus='+row.rectifyStatus
 					})
 				}
-				
+
 			}
 	  },
 	  /* 扫一扫*/
@@ -505,8 +526,8 @@ export default {
 						  }
 						  self.checkHazardAppList2(obj);
 						}
-						
-						
+
+
 	  				}else{
 	  					uni.showToast({
 	  						title: '请扫描正确的二维码',
@@ -541,7 +562,7 @@ export default {
 					 url: '/pages_safetyExamine/inforSign'
 				 })
 			}
-			
+
 	  	}
 	  },
 	  //根据实验室id查询隐患
@@ -562,7 +583,7 @@ export default {
 	  				 uni.redirectTo({
 	  					 url: '/pages_safetyExamine/inforSign'
 	  				 })
-	  			}	
+	  			}
 	  	}
 	  },
 	  //选择学院弹窗关闭
@@ -614,7 +635,7 @@ export default {
 				  		{name:'本月复核通过率',value:data.data.passRate},
 				  ]
 			  }
-	  			
+
 	  	  }
 	  },
 	  //获取当前日期函数
@@ -625,7 +646,7 @@ export default {
 	      strDate = date.getDate() // 获取当前日(1-31)
 	    if (month < 10) month = `0${month}` // 如果月份是个位数,在前面补0
 	    if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数,在前面补0
-	   
+
 	    return `${year}-${month}-${strDate}`
 	  },
 	  //是否可以开始检查
@@ -635,16 +656,16 @@ export default {
 	  	    } else {
 	  		   const oDate1 = new Date(date1);
 	  		   const oDate2 = new Date(this.currentDate)
-			   
+
 	  		   if(oDate1.getTime() <= oDate2.getTime()){
 	  			   return true; //可以开始
 	  		   } else {
 	  			   return false; //不能开始
 	  		   }
-	  	    }   
+	  	    }
 	  },
-	  
-	 
+
+
 	  //检查计划各检查状态数据数量
 	  async getCheckStatusCount(){
 	      let self = this;
@@ -664,7 +685,7 @@ export default {
 	  			  this.tabTextTow[2].num=data.data.applyNum;
 	  	  }
 	  },
-	  
+
 	  //管理员
 	  async getList(){
 	      let self = this;
@@ -690,7 +711,7 @@ export default {
 					}else{
 						data.data.records[i].buttonHide=true;
 					}
-							  
+
 				}else if(data.data.records[i].checkType==2){
 					if(!self.myApplyGentle && self.applyGentle){
 						data.data.records[i].buttonHide=false
@@ -701,12 +722,12 @@ export default {
 					}
 				}
 				data.data.records[i].notStarted=self.compareTime(data.data.records[i].cycleStartTime)
-				
+
 			}
 	  		self.dataList2=[...self.dataList2,...data.data.records]
 	  		self.total2=data.data.total;
-			
-			
+
+
 	  	}
 	  },
 	  //待复核列表
@@ -730,7 +751,7 @@ export default {
 		}
 	  	const {data} = await checkHazardAppList(obj);
 	  	if(data.code==200){
-	  		
+
 			if(self.pageType==2){//检查者
 				this.dataList2=[...this.dataList2,...data.data.records]
 				this.total2=data.data.total;
@@ -741,7 +762,7 @@ export default {
 			}
 	  	}
 	  },
-	  
+
 	  //随手拍待整改
 	  async checkClapList(){
 	  	let self = this;
@@ -814,8 +835,8 @@ export default {
 	  		this.tabTextTow[2].num=data.data.total;
 	  	}
 	  },
-	  
-	  
+
+
   }
 }
 </script>
@@ -827,6 +848,7 @@ export default {
 	.info-max-box{
 		flex: 1;
 		overflow: scroll;
+		padding-bottom: 128rpx;
 	}
 	.blue_color{
 		color: #0183FA;
@@ -848,7 +870,7 @@ export default {
 		color: #A2A2A2;
 		border: 1rpx solid #A2A2A2;
 	}
-	
+
 	.statistics{
 		background: #fff;
 		display: flex;
@@ -958,7 +980,65 @@ export default {
 			width: 1rpx;
 			background: #E0E0E0;
 		}
-		
+
+	}
+	/* 检查者 */
+	.tabTitle_identity{
+		width:100%;
+		height: 100rpx;
+		background: #fff;
+		display flex;
+		justify-content: flex-start;
+		align-items: center;
+		position: relative;
+		top: 0;
+		z-index: 100;
+		box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0,0,0,0.16);
+		.tabTitle_identity_li{
+			position: relative;
+			width:162rpx;
+			text-align center;
+			.tabTitle_identity_text{
+				display: inline-block;
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #333333;
+				line-height: 46rpx;
+				position: relative;
+				>text{
+					position:absolute;
+					min-width: 30rpx;
+					min-height: 30rpx;
+					border-radius:54%;
+					background: #E80000;
+					font-size: 18rpx;
+					font-family: PingFang SC-Medium, PingFang SC;
+					font-weight: 400;
+					color: #FFFFFF;
+					text-align: center;
+					line-height: 30rpx;
+					margin-left: 6rpx;
+					padding:2rpx;
+					box-sizing: border-box;
+				}
+				&.on{
+					color:#0183FA;
+				}
+			}
+			.tabTitle_identity_across{
+				width: 50rpx;
+				height: 4rpx;
+				background: #0183FA;
+				border-radius: 2rpx;
+				margin-left 56rpx;
+				display none;
+				&.on{
+					display block;
+				}
+			}
+
+		}
 	}
 	/* 切换按钮 */
 	.tabTitle{
@@ -1016,7 +1096,7 @@ export default {
 					display block;
 				}
 			}
-	
+
 		}
 		.tabTitle_li:nth-of-type(1)::after{
 			content: '';
@@ -1214,9 +1294,10 @@ export default {
 					display block;
 				}
 			}
-	
+
 		}
 	}
+
 	.list_tow{
 		padding: 0 30rpx;
 		box-sizing: border-box;
@@ -1346,7 +1427,7 @@ export default {
 						overflow: hidden;
 						text-overflow:ellipsis;
 						white-space: nowrap;
-						
+
 					}
 				}
 			}
@@ -1519,7 +1600,7 @@ export default {
 			width: 1rpx;
 			background: #E0E0E0;
 		}
-		
+
 	}
 	/* 切换按钮 */
 	.tabTitle_three{
@@ -1577,7 +1658,7 @@ export default {
 					display block;
 				}
 			}
-	
+
 		}
 		.tabTitle_three_li:nth-of-type(1)::after{
 			content: '';
@@ -1717,7 +1798,7 @@ export default {
 						overflow: hidden;
 						text-overflow:ellipsis;
 						white-space: nowrap;
-						
+
 					}
 				}
 			}
@@ -1735,7 +1816,7 @@ export default {
 					font-weight: 400;
 					color: #333333;
 					line-height: 26rpx;
-					
+
 				}
 			}
 			.list_three_li_b2{
@@ -1753,7 +1834,7 @@ export default {
 					display: flex;
 					justify-content: space-between;
 					align-items: center;
-					
+
 					>img{
 						width: 28rpx;
 						height: 30rpx;
@@ -1775,7 +1856,7 @@ export default {
 					line-height: 76rpx;
 				}
 			}
-			
+
 		}
 	}
 	.bottom_btn{
@@ -1792,7 +1873,7 @@ export default {
 		background: #0183FA;
 		border-radius: 20rpx;
 		text-align: center;
-		
+
 	}
 	.scan_btn{
 		position: fixed;
@@ -1841,7 +1922,7 @@ export default {
 				  font-weight: 400;
 				  color: #0183FA;
 				  line-height: 100rpx;
-				  
+
 			  }
 		  }
 		  .shade_n_b{
@@ -1868,7 +1949,7 @@ export default {
 					 width: 24rpx;
 					 height: 16rpx;
 					 margin-right: 14rpx;
-				 } 
+				 }
 			  }
 			  .color_A{
 				  color: #333333;
@@ -1876,8 +1957,8 @@ export default {
 			  .color_B{
 				  color: #0183FA;
 			  }
-			  
-			 
+
+
 		  }
 	  }
 	}