heyang hai 1 ano
pai
achega
d9e39a3c12
Modificáronse 1 ficheiros con 124 adicións e 236 borrados
  1. 124 236
      pages/manageWorkbench.vue

+ 124 - 236
pages/manageWorkbench.vue

@@ -1,10 +1,10 @@
 <!-- 管理端工作台 -->
 <template>
   <view class="manage-workbench" :style="{paddingTop:navHeight+'rpx'}">
-	<nav-bar :title="title"></nav-bar>
+    <nav-bar :title="title"></nav-bar>
     <img class="top-big-img" :src="homepageBanner">
     <top-warn></top-warn>
-    <!-- <view class="min-icon-button-box" style="margin-bottom: 0;">
+    <view class="min-icon-button-box" style="margin-bottom: 0;">
       <view @click="goPage('casuallyPat')">
         <img src="@/images/Version2.2/icon_sy_ssp.png">
         <view>随手拍</view>
@@ -37,28 +37,19 @@
         <img src="@/images/Version3.0/icon_sy_aqxx.png">
         <view>安全档案</view>
       </view>
-    </view> -->
+    </view>
     <view class=big-icon-button-box>
-		<!-- 气瓶管理 -->
-		<view class="big-icon-button-box_l" @click="goPage('gasManage')">
-			<!-- <img  class="big-icon-button-box_bg" src="@/images/img_bg_qpgl.png" @click="goPage('gasManage')"> -->
-			<view class="big-icon-button-box_t1">气瓶管理</view>
-			<view class="big-icon-button-box_t2">安全第一   预防为主</view>
-		</view>
-		<view class="big-icon-button-box_r">
-			<!-- 安全报警 -->
-			<img src="@/images/Version2.3/button_1.png" @click="goPage('alarm')">
-			<!-- 应急疏散 -->
-			<img src="@/images/Version2.3/button_2.png" @click="goPage('emergencyEvacuation')">
-		</view>
-      
+      <!-- 安全报警 -->
+      <img src="@/images/Version2.3/button_1.png" @click="goPage('alarm')">
+      <!-- 应急疏散 -->
+      <img src="@/images/Version2.3/button_2.png" @click="goPage('emergencyEvacuation')">
     </view>
     <!-- 分级管控 -->
-    <!-- <view class="grading">
+    <view class="grading">
       <img class="grading_l" src="@/images/icon_sy_fjgk.png"/>
       <view class="grading_c">分级管控</view>
       <view class="grading_r" @click="goPage('grading')">{{gradingCount>0?gradingCount+'项工作待完成':''}}<img src="@/images/icon_wdwg_gd.png"/></view>
-    </view> -->
+    </view>
 
     <view class="for-title-p" @click="goSecurityAlertList" v-if="alarmList[0]">
       <img class="left-img" src="@/images/Version2.2/icon_aqbj.png">
@@ -84,7 +75,7 @@
             <view>{{minItem}}</view>
           </view>
         </view>
-        <view v-if="alarmList.length == index+1" class="button-view" @click="laboratoryInfo(item)">查看详情</view>
+        <view class="button-view" @click="laboratoryInfo(item)">查看详情</view>
       </view>
     </view>
     <view class="for-title-p" v-if="dataList[0]">
@@ -104,14 +95,15 @@
           <img src="@/images/icon_14.png">
           <view>{{item.subAddrrStr}}</view>
         </view>
-		<view class="text-box" v-if="item.sensorFunctionList[0]">
-			<view class="min-box" v-for="(minItem,index2) in item.sensorFunctionList" :key="index2">
-				<view class="min-min-box">
-					<img v-show="minItem.hasWarn" src="@/images/icon_15.png">
-					<view :class="{'colorA':minItem.hasWarn}">{{minItem.funcName}}:{{minItem.formatVal?minItem.formatVal:'-'}}</view>
-				</view>
-			</view>
-		</view>
+
+        <view class="text-box" v-if="item.sensorFunctionList[0]">
+          <view class="min-box" v-for="(minItem,index2) in item.sensorFunctionList" :key="index2">
+            <view class="min-min-box">
+              <img v-show="minItem.hasWarn" src="@/images/icon_15.png">
+              <view :class="{'colorA':minItem.hasWarn}">{{minItem.funcName}}:{{minItem.formatVal?minItem.formatVal:'-'}}</view>
+            </view>
+          </view>
+        </view>
       </view>
     </view>
     <tab-bar></tab-bar>
@@ -121,18 +113,7 @@
 <script>
 import $mqtt from '@/utils/mqtt.min.js';
 import { config } from '@/api/request/config.js'
-import { appReceivePhotoNote,
-		getApprovalCount,
-		subject_class,
-		getSafeWarnList,
-		laboratoryInfo,
-		laboratoryList,
-		getLoginUserInfo,
-		outSubjectPhoto,
-		gradingControl,
-		listData,
-		getDicts,
-		getGentleIdentifier} from '@/api/index.js'
+import { appReceivePhotoNote,getApprovalCount,subject_class,getSafeWarnList,laboratoryInfo,laboratoryList,getLoginUserInfo,outSubjectPhoto,gradingControl,listData} from '@/api/index.js'
 import { tabBar } from '@/component/tabBar.vue'
 import { topWarn } from '@/component/topWarn.vue'
 import { navBar } from '@/component/navbar.vue'
@@ -140,12 +121,13 @@ export default {
   components: {
     tabBar,
     topWarn,
-	navBar
+    navBar
   },
   data() {
     return {
-	  navHeight: uni.getStorageSync('navHeight'),
-	  title:'实验室安全智能监测与控制系统',
+      tenantId:uni.getStorageSync('tenantId'),//0 系统 1化工 2能动
+      navHeight: uni.getStorageSync('navHeight'),
+      title:'实验室安全智能监测与控制系统',
       //随手拍数量
       appReceivePhotoNoteNum:0,
       //准入数量
@@ -170,7 +152,7 @@ export default {
       buttonArray:[],
       gradingCount:0,//分级管控未完成总数
       homepageBanner:uni.getStorageSync('homepageBanner'),
-	  fanList:[],//控制记录触发方式
+      fanList:[],//控制记录触发方式
     }
   },
   created() {
@@ -184,26 +166,24 @@ export default {
     this.getSafeWarnList();
     this.getLoginUserInfo();
     this.getGrading();
-	this.getListData();
-	this.gasBottleSpecificationFun();
-	this.gasBottleLevelFun();
+    this.getListData();
     //监听报警信息
     getApp().watch(this.getSafeWarnList,'mqttAlarmData');
   },
   methods: {
-	  //查询控制记录触发方式
-	  async getListData() {
-		let _this = this;
-		let obj={
-		  pageNum:1,
-		  pageSize:20,
-		  dictType:'trigger_modes'
-		}
-		const {data} = await listData(obj)
-		if (data.code == 200) {
-		   this.fanList=data.rows
-		}
-	  },
+    //查询控制记录触发方式
+    async getListData() {
+      let _this = this;
+      let obj={
+        pageNum:1,
+        pageSize:20,
+        dictType:'trigger_modes'
+      }
+      const {data} = await listData(obj)
+      if (data.code == 200) {
+        this.fanList=data.rows
+      }
+    },
     //暂无提示
     goCheckPage(){
       if(this.userInfo.isadmin){
@@ -272,37 +252,33 @@ export default {
     },
     //获取报警信息详情
     async laboratoryInfo(item){
+      let self=this;
+      const {data} = await laboratoryInfo(item.subDiyVo.id);
+      if(data.code == 200){
+        let obj = data.data[0];
+        obj.subClassVO = item.subDiyVo.subClassVO;
+        obj.name = item.subDiyVo.name;
+        obj.subTypeLable = item.subDiyVo.subTypeLable;
+        obj.deptName = item.subDiyVo.deptName;
+        obj.subAddrrStr = item.subDiyVo.subAddrrStr;
+        //循环判断如果是排风扇的话,启动的时候是人工还是预案还是定时
+        for(let i=0;i<obj.labHardwareVOList.length;i++){
+          if(obj.labHardwareVOList[i].hardwareTypeEnum.hardwareTypeCode == '2'){
+            for(let b=0;b<self.fanList.length;b++){
+              if(self.fanList[b].dictValue==obj.labHardwareVOList[i].triggerModes){
+                obj.labHardwareVOList[i].dictLabel=self.fanList[b].dictLabel
+              }
+            }
+          }
+        }
         uni.navigateTo({
-          url: '/pages/earlyWarningManage/earlyWarningList'
+          url: '/pages_manage/workbench/laboratory/laboratoryInfo?item='+encodeURIComponent(JSON.stringify(obj))+'&deptId='+obj.deptId
         });
-		
-		// let self=this;
-  //     const {data} = await laboratoryInfo(item.subDiyVo.id);
-  //     if(data.code == 200){
-  //       let obj = data.data[0];
-  //       obj.subClassVO = item.subDiyVo.subClassVO;
-  //       obj.name = item.subDiyVo.name;
-  //       obj.subTypeLable = item.subDiyVo.subTypeLable;
-  //       obj.deptName = item.subDiyVo.deptName;
-  //       obj.subAddrrStr = item.subDiyVo.subAddrrStr;
-		// //循环判断如果是排风扇的话,启动的时候是人工还是预案还是定时
-		// for(let i=0;i<obj.labHardwareVOList.length;i++){
-		//  if(obj.labHardwareVOList[i].hardwareTypeEnum.hardwareTypeCode == '2'){
-		//  	for(let b=0;b<self.fanList.length;b++){
-		//  	  if(self.fanList[b].dictValue==obj.labHardwareVOList[i].triggerModes){
-		//  		obj.labHardwareVOList[i].dictLabel=self.fanList[b].dictLabel
-		//  	  }
-		//  	}
-		//  }
-		// }
-  //       uni.navigateTo({
-  //         url: '/pages_manage/workbench/laboratory/laboratoryInfo?item='+encodeURIComponent(JSON.stringify(obj))+'&deptId='+obj.deptId
-  //       });
-  //     }
+      }
     },
     //获取实验室详情
     async laboratoryInfoOne(item){
-		let self=this;
+      let self=this;
       const {data} = await laboratoryInfo(item.id);
       if(data.code == 200){
         let obj = data.data[0];
@@ -312,16 +288,16 @@ export default {
         obj.deptName = item.deptName;
         obj.subAddrrStr = item.subAddrrStr;
         obj.sensorFunctionList = item.sensorFunctionList;
-		//循环判断如果是排风扇的话,启动的时候是人工还是预案还是定时
-		for(let i=0;i<obj.labHardwareVOList.length;i++){
-		 if(obj.labHardwareVOList[i].hardwareTypeEnum.hardwareTypeCode == '2'){
-		 	for(let b=0;b<self.fanList.length;b++){
-		 	  if(self.fanList[b].dictValue==obj.labHardwareVOList[i].triggerModes){
-		 		obj.labHardwareVOList[i].dictLabel=self.fanList[b].dictLabel
-		 	  }
-		 	}
-		  }
-		}
+        //循环判断如果是排风扇的话,启动的时候是人工还是预案还是定时
+        for(let i=0;i<obj.labHardwareVOList.length;i++){
+          if(obj.labHardwareVOList[i].hardwareTypeEnum.hardwareTypeCode == '2'){
+            for(let b=0;b<self.fanList.length;b++){
+              if(self.fanList[b].dictValue==obj.labHardwareVOList[i].triggerModes){
+                obj.labHardwareVOList[i].dictLabel=self.fanList[b].dictLabel
+              }
+            }
+          }
+        }
         uni.navigateTo({
           url: '/pages_manage/workbench/laboratory/laboratoryInfo?item='+encodeURIComponent(JSON.stringify(obj))+'&deptId='+item.deptId
         });
@@ -337,21 +313,18 @@ export default {
       };
       const {data} = await getSafeWarnList(obj);
       if(data.code == 200){
-        this.alarmList = data.data.list;
-        this.securityAlertNum = data.data.count;
-        // if(data.rows[0]){
-        //   this.securityAlertNum = data.rows[0].todayHappenCount;
-        // }else{
-        //   this.securityAlertNum = 0;
-        // }
+        this.alarmList = data.rows;
+        if(data.rows[0]){
+          this.securityAlertNum = data.rows[0].todayHappenCount;
+        }else{
+          this.securityAlertNum = 0;
+        }
       }
     },
     //获取实验室列表
     async laboratoryList(){
       let self = this;
       let obj = {
-		pageNum:1,
-		pageSize:10,
         deptId:this.facultyIndex?this.facultyList[this.facultyIndex].deptId:'',
         subDept:this.subjectIndex?this.subjectList[this.subjectIndex].dictValue:'',
         level:this.levelIndex?this.levelList[this.levelIndex].dictValue:'',
@@ -382,24 +355,24 @@ export default {
           }
         }
         this.dataList = data.data;
-		let list = [];
-		let obj = {
-			type:"lab/function/data",
-			idList:[],
-		}
-		for(let i=0;i<self.dataList.length;i++){
-			let num = 0;
-			for(let o=0;o<obj.idList.length;o++){
-				if(obj.idList[o] == self.dataList[i].id){
-					num++
-				}
-			}
-			if(num == 0){
-				obj.idList.push(self.dataList[i].id)
-			}
-		}
-		list.push({type:"lab/riskPlan/trigger/notice",});
-		getApp().appMqttOn(1,list);
+        let list = [];
+        let obj = {
+          type:"lab/function/data",
+          idList:[],
+        }
+        for(let i=0;i<self.dataList.length;i++){
+          let num = 0;
+          for(let o=0;o<obj.idList.length;o++){
+            if(obj.idList[o] == self.dataList[i].id){
+              num++
+            }
+          }
+          if(num == 0){
+            obj.idList.push(self.dataList[i].id)
+          }
+        }
+        list.push({type:"lab/riskPlan/trigger/notice",});
+        getApp().appMqttOn(1,list);
       }
     },
     //获取输入数量
@@ -426,14 +399,17 @@ export default {
     //去安全警报
     goSecurityAlertList(){
       uni.navigateTo({
-        url: '/pages/earlyWarningManage/earlyWarningList',//安全警报
+        url: '/pages_manage/workbench/securityAlert/securityAlertList',//安全警报
       });
     },
     //页面跳转
     goPage(type){
+      if(this.tenantId==2 && type!='emergencyEvacuation' && type!='alarm'){
+        type='none'
+      }
       if(type=='casuallyPat'){
         uni.navigateTo({
-            url: '/pages_safetyExamine/snapshotManage/snapshotAdd'
+          url: '/pages/casuallyPat',//随手拍
         });
       }else if(type=='receiveCasuallyPat'){//收到随手拍
         uni.navigateTo({
@@ -445,7 +421,10 @@ export default {
         });
 
       }else if(type == 'safetyInspect'){//安全检查
-        this.getGentleIdentifier();
+
+        uni.navigateTo({
+          url: '/pages_manage/workbench/securityCheck/inspectionRecords',//安全检查
+        });
       }
       else if(type == 'alarm'){
         uni.navigateTo({
@@ -461,18 +440,18 @@ export default {
         uni.navigateTo({
           url: '/pages_manage/gradingControl/gradingControl',//分级管控
         });
-      }else if(type == 'gasManage'){//气瓶管理
+      }else if(type == 'gas'){//气瓶管理
         uni.navigateTo({
-          url: '/pages/gasBottle/gasManage/gasManage',
+          url: '/pages_manage/gasManage/gasManage',
         });
       }else if(type == 'none'){
-		  uni.showToast({
-		    title: '暂未开放',
-		    icon:"none",
-		    mask:true,
-		    duration: 2000
-		  });
-	  }
+        uni.showToast({
+          title: '暂未开放',
+          icon:"none",
+          mask:true,
+          duration: 2000
+        });
+      }
     },//获取拍照检查配置
     async outSubjectPhoto(){
       const {data} = await outSubjectPhoto();
@@ -519,57 +498,10 @@ export default {
         }
       }
     },
-    //获取用户身份标识"adminGentle": false,   管理员身份 "rectifyGentle": false,   整改身份"applyGentle": false    检查者身份
-    async getGentleIdentifier(){
-      let self = this;
-      const {data} = await getGentleIdentifier();
-      if(data.code==200){
-        let pageType = null
-        // 如果是管理员 检查者和整改者
-        let list=[];
-        if(data.data.adminGentle){
-          list.push({name:'管理员',pageType:1})
-        }
-        if(data.data.applyGentle ||data.data.myApplyGentle){
-          list.push({name:'检查者',pageType:2})
-        }
-        if(data.data.rectifyGentle){
-          list.push({name:'整改者',pageType:3})
-        }
-        uni.setStorageSync('gentleIdentifier',list)
-        uni.setStorageSync('gentleIdentifierData',data.data)
-        if(list.length>0){
-          uni.navigateTo({
-            url: '/pages/safetyExamineWorkbench',
-          });
-        }else{
-          uni.showToast({
-            title: '没有相关权限',
-            icon:"none",
-            mask:true,
-            duration: 2000
-          });
-        }
-      }
-    },
-	//气瓶规格
-	async gasBottleSpecificationFun(){
-		const {data} = await getDicts('gasBottleSpecification');
-		if(data.code == 200){
-		  uni.setStorageSync('gasBottleSpecification', data.data)
-		}
-	},
-	//气瓶级别 
-	async gasBottleLevelFun(){
-		const {data} = await getDicts('gasBottleLevel');
-		if(data.code == 200){
-		   uni.setStorageSync('gasBottleLevel', data.data)
-		}
-	},
   },
   beforeDestroy(){
-	//断开mqtt连接
-	getApp().offMQTT();
+    //断开mqtt连接
+    getApp().offMQTT();
     //删除报警监听
     getApp().deleteAlarmWatch();
     //删除传感器监听
@@ -612,58 +544,14 @@ export default {
   }
   .big-icon-button-box{
     display flex;
-	justify-content: space-between;
     margin:20rpx;
-	.big-icon-button-box_l{
-		background: url("../images/img_bg_qpgl.png") no-repeat;
-		background-size: 372rpx 260rpx;
-		width:372rpx;
-		height:260rpx;
-		// .big-icon-button-box_bg{
-		// 	width:372rpx;
-		// 	height:260rpx;
-		// }
-		.big-icon-button-box_t1{
-			width: 149rpx;
-			height: 40rpx;
-			background: rgba(225,225,225,0.3);
-			border-radius: 2rpx;
-			font-size: 24rpx;
-			font-family: Microsoft YaHei;
-			font-weight: 400;
-			color: #333333;
-			line-height: 40rpx;
-			text-align: center;
-			margin:94rpx 0 0 181rpx;
-			// position:absolute;
-			// right: 42rpx;
-			// top: 94rpx;
-			
-		}
-		.big-icon-button-box_t2{
-			width: 175rpx;
-			height: 20rpx;
-			font-size: 18rpx;
-			font-family: Microsoft YaHei;
-			font-weight: 400;
-			color: #333333;
-			line-height: 20rpx;
-			margin:20rpx 0 0 181rpx;
-			// position:absolute;
-			// right: 28rpx;
-			// top: 148rpx;
-			
-		}
-	}
-	.big-icon-button-box_r{
-		img{
-		  width:320rpx;
-		  height:120rpx;
-		}
-		>img:nth-of-type(2){
-			margin-top: 20rpx;
-		}
-	}
+    img{
+      width:350rpx;
+      height:150rpx;
+    }
+    img:nth-child(2){
+      margin-left:10rpx;
+    }
   }
   /* 分级管控 */
   .grading{
@@ -814,7 +702,7 @@ export default {
     background #fff
     padding-left:25rpx;
     display flex
-    margin:20rpx 20rpx 0;
+    margin:0 20rpx;
     border-bottom:1rpx solid #e0e0e0;
     .left-img{
       height:34rpx;
@@ -850,13 +738,13 @@ export default {
     margin:0 20rpx;
     border-bottom-left-radius 20rpx
     border-bottom-right-radius 20rpx
-	overflow: hidden;
     .for-box:nth-child(1){
       border-top:none;
     }
     .for-box{
       border-top:4rpx solid #dedede;
       background #fff
+      margin-bottom:20rpx;
       overflow: hidden
       .title-box{
         margin:20rpx 20rpx 0;