dedsudiyu 3 mesiacov pred
rodič
commit
df5744170d

+ 8 - 0
pages_manage/api/index.js

@@ -251,5 +251,13 @@ export function laboratoryApplyRemoteOpenLock(data) {
 		}
 	})
 }
+//开门5秒后状态查询
+export function applyRemoteOpenLockConfirm(data) {
+	return apiResquest({
+		url: '/laboratory/apply/remoteOpenLock/confirm',
+		method: 'GET',
+		data: data
+	})
+}
 
 

+ 62 - 13
pages_manage/views/accessControl/empowerOpen.vue

@@ -22,9 +22,13 @@
 			<view class="list-tow">
 				<view class="list-tow-li">
 					<view class="list-tow-li-t">被授权人</view>
-					<input class="list-tow-li-b" type="text" @change="authorizedChange()"
+					<view class="list-user-name-box" v-if="addForm.userId">
+						<view>{{addForm.userName}}{{account?'-'+account:''}}</view>
+						<view @click="delUserData()">更改</view>
+					</view>
+					<input class="list-tow-li-b" v-if="!addForm.userId" type="text" @change="authorizedChange()"
 						v-model="getDataTow.searchValue" placeholder="被授权人搜索,最少两个字">
-					<uni-data-picker @change="bindPickerChange" :localdata="dataListTow" ref='picker'>
+					<uni-data-picker @change="bindPickerChange":localdata="dataListTow" ref='picker'>
 					</uni-data-picker>
 				</view>
 				<view class="list-tow-li">
@@ -105,8 +109,8 @@
 				successVisible: false,
 				timer: null,
 				count: '',
-
-
+				//展示用工号
+				account:false,
 			}
 		},
 		onLoad(option) {
@@ -139,6 +143,12 @@
 				var currentdate = year + "-" + month + "-" + strDate;
 				return currentdate;
 			},
+			//清空选项
+			delUserData(){
+				this.$set(this.addForm,'userName',null);
+				this.$set(this.addForm,'userId',null);
+				this.$set(this,'account',false);
+			},
 			//被授权人搜索
 			async authorizedChange() {
 				let self = this
@@ -149,8 +159,10 @@
 				if (data.code == 200) {
 					data.data.forEach(function(item) {
 						self.dataListTow.push({
-							text: item.userName,
+							text: item.userName+(item.account?'-'+item.account:''),
 							value: item.userId,
+							userName: item.userName,
+							account: item.account,
 						})
 					})
 					self.$refs.picker.show()
@@ -158,13 +170,14 @@
 			},
 			bindPickerChange: function(e) {
 				let self = this;
-				console.log('picker发送选择改变,携带值为', e.detail.value)
-				let data = e.detail.value;
-				data.forEach(function(item) {
-					self.addForm.userName = item.text
-					self.addForm.userId = item.value
-
-				})
+				for(let i=0;i<self.dataListTow.length;i++){
+					if(e.detail.value[0].value == self.dataListTow[i].value){
+						this.$set(self.addForm,'userName',self.dataListTow[i].userName);
+						this.$set(self.addForm,'userId',self.dataListTow[i].value);
+						this.$set(self,'account',self.dataListTow[i].account?self.dataListTow[i].account:false);
+						return
+					}
+				}
 			},
 			//授权点击
 			authorizedClick(row) {
@@ -198,6 +211,22 @@
 			//授权提交
 			async submitForm() {
 				let self = this;
+				if(!self.addForm.userId){
+						uni.showToast({
+							title: '请选择被授权人',
+							icon: "none",
+							duration: 2000
+						});
+						return
+				}
+				if(!self.addForm.validBeginTime || !self.addForm.validEndTime){
+						uni.showToast({
+							title: '请选择授权时间',
+							icon: "none",
+							duration: 2000
+						});
+						return
+				}
 				let obj={
 					userId:this.addForm.userId,
 					subId: this.addForm.subId,
@@ -339,7 +368,27 @@
 						text-align: left;
 						margin: 24rpx 0;
 					}
-
+					.list-user-name-box{
+						display: flex;
+						width: 690rpx;
+						height: 80rpx;
+						border-radius: 10rpx 10rpx 10rpx 10rpx;
+						border: 1rpx solid #e0e0e0;
+						padding-left: 20rpx;
+						box-sizing: border-box;
+						view{
+							line-height:78rpx;
+						}
+						view:nth-child(1){
+							paddin:0 10rpx;
+							flex:1;
+						}
+						view:nth-child(2){
+							width:100rpx;
+							text-align: center;
+							border-left: 1rpx solid #e0e0e0;
+						}
+					}
 					.list-tow-li-b {
 						width: 690rpx;
 						height: 80rpx;

+ 233 - 109
pages_manage/views/accessControl/remoteOpen.vue

@@ -1,29 +1,35 @@
 <!-- 远程开门 -->
 <template>
 	<view id="empowerOpen">
-		<view class="page-one" v-if="pageType==1">
-			<view class="header">
-				<view class="header-n">
-					<input class="header-l" type="text" @change="subNameChange()" v-model="getData.searchValue" placeholder="实验室名称">
-					<view class="header-r" v-if="getData.searchValue" @click="clearSearch()" >
-						<img src="@/pages/images/clear.png" />
-					</view>
-					
+		<view class="header">
+			<view class="header-n">
+				<input class="header-l" type="text" @change="subNameChange()" v-model="getData.searchValue" placeholder="实验室名称">
+				<view class="header-r" v-if="getData.searchValue" @click="clearSearch()">
+					<img src="@/pages/images/clear.png" />
 				</view>
+
 			</view>
-			<view class="list">
-				<view class="list-li" v-for="(item,index) in dataList">
-					<view class="list-li-l">{{item.subName}}({{item.roomNum}})</view>
-					<view class="list-li-r" @click="openClick(item)">开门</view>
+		</view>
+		<scroll-view scroll-y @scrolltolower="scrollGet" class="list">
+			<!-- <img class="null-img" v-if="!dataList[0]" src="@/pages_manage/images/null-data-1.png"> -->
+			<view class="list-li" v-for="(item,index) in dataList">
+				<view class="list-li-l">{{item.subName}}({{item.roomNum}})</view>
+				<view class="list-li-r" @click="openButton(item)">
+					<view class="null-p"></view>
+					<view>开门</view>
+					<view class="null-p"></view>
 				</view>
 			</view>
-		</view>
+			<view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
+			<view class="get-data-null-p" v-else="getDataType">- 滑动加载更多 -</view>
+		</scroll-view>
 		<view class="success" v-if="successVisible">
 			<view class="null-box" @click="closeTip()"></view>
 			<view class="panel">
-				<img class="panel-t" v-if="authorizeStatus==1" src="@/pages/images/icon_kcxq_cg.png" />
+				<img class="panel-t" v-if="authorizeStatus==1||authorizeStatus==3" src="@/pages/images/icon_kcxq_cg.png" />
 				<img class="panel-t" v-if="authorizeStatus==2" src="@/pages/images/icon_kcxq_sb.png" />
-				<view class="panel-m">{{authorizeStatus==1?'开门成功':'开门失败'}}</view>
+				<view class="panel-m">{{authorizeStatus==1?'开门成功':(authorizeStatus==2?'开门失败':(authorizeStatus==3?'开门中请稍后':''))}}
+				</view>
 				<view class="panel-b">({{count}}S)</view>
 			</view>
 		</view>
@@ -38,6 +44,7 @@
 	import {
 		systemSubjectGetAppSubject,
 		laboratoryApplyRemoteOpenLock,
+		applyRemoteOpenLockConfirm
 	} from '@/pages_manage/api/index.js'
 	export default {
 		components: {
@@ -47,23 +54,26 @@
 			return {
 				pageType: 1,
 				baseUrl: config.base_url,
-				getData: {
-					searchValue: '',
-					adminId: uni.getStorageSync('userId'),
-				},
 				newData: {
 
 				},
-				addForm:{
-					
+				addForm: {
+
 				},
-				dataList:[],
-				authorizeStatus:2,//1成功 2失败
+				dataList: [],
+				authorizeStatus: 2, //1成功 2失败
 				successVisible: false,
 				timer: null,
 				count: '',
-
-
+				total: 0,
+				getData: {
+					page: 1,
+					pageSize: 20,
+					searchValue: '',
+					adminId: uni.getStorageSync('userId'),
+				},
+				getDataType: false,
+				msgId:'',
 			}
 		},
 		onLoad(option) {
@@ -76,23 +86,72 @@
 			this.systemSubjectGetAppSubject();
 		},
 		methods: {
+			openButton(row) {
+				let self = this;
+				uni.showModal({
+					content: '确定对 ' + row.subName + ' 进行远程开门操作?',
+					cancelColor: "#999",
+					confirmColor: "#0183FA",
+					success: function(res) {
+						if (res.confirm) {
+							self.openClick(row);
+						}
+					}
+				});
+			},
 			//开门
-			async openClick(row){
+			async openClick(row) {
 				let self = this;
-				let obj={
-					labId:row.subId,
+				let obj = {
+					labId: row.subId,
 				}
 				const {
 					data
 				} = await laboratoryApplyRemoteOpenLock(obj);
 				if (data.code == 200) {
-					this.$set(this, 'authorizeStatus', 1)
-					this.$set(this, 'successVisible', true)
-					this.getCode();
-				}else{
-					this.$set(this, 'authorizeStatus', 2)
-					this.$set(this, 'successVisible', true)
-					this.getCode();
+					if (data.data[0]) {
+						this.$set(this, 'msgId', data.data[0])
+						this.$set(this, 'authorizeStatus', 3)
+						this.$set(this, 'successVisible', true)
+						this.getMsg();
+					}else{
+						this.$set(this, 'authorizeStatus', 2)
+						this.$set(this, 'successVisible', true)
+						this.getCode();
+					}
+				}
+			},
+			async applyRemoteOpenLockConfirm() {
+				let self = this;
+				let obj = {
+					messageId: this.msgId,
+				}
+				const {
+					data
+				} = await applyRemoteOpenLockConfirm(obj);
+				if (data.code == 200) {
+					if (data.data) {
+						this.$set(this, 'authorizeStatus', 1)
+						this.$set(this, 'successVisible', true)
+						this.getCode();
+					} else {
+						this.$set(this, 'authorizeStatus', 2)
+						this.$set(this, 'successVisible', true)
+						this.getCode();
+					}
+					this.$set(this, 'msgId','')
+				}
+			},
+			//滚动加载事件
+			scrollGet() {
+				let self = this;
+				if (self.total / self.getData.pageSize <= self.getData.page) {
+					this.$set(this, 'getDataType', true);
+				} else {
+					this.getData.page += 1;
+					this.$nextTick(() => {
+						this.systemSubjectGetAppSubject();
+					})
 				}
 			},
 			//获取实验室
@@ -102,28 +161,60 @@
 					data
 				} = await systemSubjectGetAppSubject(this.getData);
 				if (data.code == 200) {
-					this.dataList = data.data;
+					if (self.getData.page == 1) {
+						this.dataList = data.data.records;
+						this.total = data.data.total;
+						if (data.data.total / self.getData.pageSize <= self.getData.page) {
+							this.$set(this, 'getDataType', true);
+						}
+					} else {
+						this.dataList = [...this.dataList, ...data.data.records]
+						this.total = data.data.total;
+						if (data.data.total / self.getData.pageSize <= self.getData.page) {
+							this.$set(this, 'getDataType', true);
+						}
+					}
 				}
 			},
 			//实验室搜索
 			subNameChange() {
+				this.$set(this, 'getDataType', false);
+				this.$set(this, 'dataList', []);
+				this.$set(this, 'total', 0);
+				this.$set(this.getData, 'page', 1);
 				this.systemSubjectGetAppSubject();
 			},
 			//实验室搜索框清除
-			clearSearch(){
-				this.getData.searchValue='';
+			clearSearch() {
+				this.$set(this, 'getDataType', false);
+				this.$set(this, 'dataList', []);
+				this.$set(this, 'total', 0);
+				this.$set(this.getData, 'page', 1);
+				this.$set(this.getData, 'searchValue', '');
 				this.systemSubjectGetAppSubject();
 			},
-			cancelClick(){
-				
-			},
-			submitForm(){
-				this.$set(this,'successVisible',true)
-				this.getCode();
+			//关闭弹框倒计时
+			getMsg() {
+				let self = this;
+				const TIME_COUNT = 5;
+				if (!self.timer) {
+					self.count = TIME_COUNT;
+					self.show = false;
+					self.timer = setInterval(() => {
+						if (self.count > 0 && self.count <= TIME_COUNT) {
+							self.count -= 1;
+						} else {
+							self.successVisible = false;
+							clearInterval(self.timer);
+							self.timer = null;
+							self.applyRemoteOpenLockConfirm();
+						}
+					}, 1000);
+				}
 			},
 			//关闭弹框倒计时
 			getCode() {
-				let self=this;
+				let self = this;
 				const TIME_COUNT = 3;
 				if (!this.timer) {
 					this.count = TIME_COUNT;
@@ -132,7 +223,7 @@
 						if (this.count > 0 && this.count <= TIME_COUNT) {
 							this.count -= 1;
 						} else {
-							self.successVisible=false;
+							self.successVisible = false;
 							clearInterval(this.timer);
 							this.timer = null;
 						}
@@ -148,82 +239,112 @@
 
 <style lang="stylus" scoped>
 	#empowerOpen {
+		height: 100%;
+		display flex;
+		flex-direction column;
 
-		.page-one {
-			.header {
-				width: 749rpx;
-				height: 120rpx;
-				background: #FFFFFF;
-				padding: 20rpx 30rpx;
+		.header {
+			width: 749rpx;
+			height: 120rpx;
+			background: #FFFFFF;
+			padding: 20rpx 30rpx;
+			box-sizing: border-box;
+			border-bottom: 1rpx solid #D8D8D8;
+
+			.header-n {
+				position: relative;
+				width: 690rpx;
+				height: 80rpx;
+				border-radius: 10rpx 10rpx 10rpx 10rpx;
+				border: 1rpx solid #E0E0E0;
+				padding-left: 20rpx;
 				box-sizing: border-box;
-				border-bottom: 1rpx solid #D8D8D8;
-				
-				.header-n{
-					position: relative;
-					width: 690rpx;
+
+				.header-l {
+					width: 590rpx;
 					height: 80rpx;
-					border-radius: 10rpx 10rpx 10rpx 10rpx;
-					border: 1rpx solid #E0E0E0;
-					padding-left: 20rpx;
-					box-sizing: border-box;
-					.header-l {
-						width: 590rpx;
-						height: 80rpx;
-					}
-					.header-r{
-						position: absolute;
-						top: 0rpx;
-						right: 0rpx;
-						width: 68rpx;
-						height: 80rpx;
-						>img{
-							width: 24rpx;
-							height: 24rpx;
-							margin-top: 24rpx;
-							margin-left: 24rpx;
-						}
+				}
+
+				.header-r {
+					position: absolute;
+					top: 0rpx;
+					right: 0rpx;
+					width: 68rpx;
+					height: 80rpx;
+
+					>img {
+						width: 24rpx;
+						height: 24rpx;
+						margin-top: 24rpx;
+						margin-left: 24rpx;
 					}
 				}
-				
 			}
 
-			.list {
-				padding: 0 30rpx;
-				box-sizing: border-box;
-				background: #fff;
+		}
+
+		.list {
+			flex: 1;
+			overflow-y scroll;
+			padding: 0 30rpx;
+			box-sizing: border-box;
+			background: #fff;
+
+			.list-li {
+				// height: 90rpx;
+				display: flex;
+				// justify-content: space-between;
+				// align-items: center;
+				border-bottom: 1rpx solid #D8D8D8;
 
-				.list-li {
-					height: 90rpx;
+				.list-li-l {
+					flex: 1;
+					font-family: PingFang SC, PingFang SC;
+					font-weight: 400;
+					font-size: 30rpx;
+					color: #333333;
+					line-height: 40rpx;
+					padding: 25rpx 25rpx 25rpx 0;
+				}
+
+				.list-li-r {
+					font-family: PingFang SC, PingFang SC;
+					font-weight: 400;
+					font-size: 28rpx;
+					color: #0183FA;
+					line-height: 90rpx;
 					display: flex;
-					justify-content: space-between;
-					align-items: center;
-					border-bottom: 1rpx solid #D8D8D8;
+					flex-direction: column;
+					text-align: right;
+					width: 80rpx;
 
-					.list-li-l {
+					.null-p {
 						flex: 1;
-						font-family: PingFang SC, PingFang SC;
-						font-weight: 400;
-						font-size: 30rpx;
-						color: #333333;
-						line-height: 42rpx;
-					}
-
-					.list-li-r {
-						font-family: PingFang SC, PingFang SC;
-						font-weight: 400;
-						font-size: 28rpx;
-						color: #0183FA;
-						line-height: 39rpx;
 					}
 				}
-				.list-li:last-child{
-					border-bottom: none;
-				}
 			}
 
+			.list-li:last-child {
+				border-bottom: none;
+			}
+		}
+
+		.null-img {
+			display block;
+			width: 276rpx;
+			height: 321rpx;
+			position absolute;
+			top: 200rpx;
+			left: 238rpx;
+		}
+
+		.get-data-null-p {
+			text-align: center;
+			line-height: 100rpx;
+			padding-bottom: 80px;
+			color: #999;
 		}
 
-		
 		.success {
 			height: 100%;
 			width: 100%;
@@ -249,12 +370,14 @@
 				display: flex;
 				flex-direction: column;
 				align-items: center;
-				.panel-t{
+
+				.panel-t {
 					width: 80rpx;
 					height: 80rpx;
 					margin: 40rpx 0 18rpx 0;
 				}
-				.panel-m{
+
+				.panel-m {
 					font-family: PingFang SC, PingFang SC;
 					font-weight: 400;
 					font-size: 30rpx;
@@ -262,7 +385,8 @@
 					line-height: 42rpx;
 					margin-bottom: 8rpx;
 				}
-				.panel-b{
+
+				.panel-b {
 					font-family: PingFang SC, PingFang SC;
 					font-weight: 400;
 					font-size: 30rpx;
@@ -272,4 +396,4 @@
 			}
 		}
 	}
-</style>
+</style>

+ 1 - 1
pages_safetyCheck/views/inspectManage/inspectList.vue

@@ -55,7 +55,7 @@
 					<view class="list-li-b">
 						<view class="list-li-b-t">
 							<img src="@/pages/images/icon_sy_zc@1x.png">
-							{{tabIndexTow==0?(item.roomNum?item.roomNum:'-'):(item.subRoom?item.subRoom:'-')}}房间&{{item.buildName}}
+							{{tabIndexTow==0?(item.roomNum?item.roomNum:'-'):(item.subRoom?item.subRoom:'-')}}房间&{{item.buildName?item.buildName:''}}
 						</view>
 						<view class="list-li-b-b">
 							<view class="list-li-b-b-l">

+ 2 - 2
pages_safetyCheck/views/itemsManage/hiddenDangerRectification.vue

@@ -496,7 +496,7 @@
 					
 					}
 				}else if(self.pageType==2){
-					if(!this.form.rectifyMeasure && status==2){
+					if(!this.form.rectifyMeasure){
 						uni.showToast({
 							title: '请填写隐患整改描述!',
 							icon: "none",
@@ -505,7 +505,7 @@
 						});
 						return
 					}
-					if(!this.form.imgDtoList[0] && status==2){
+					if(!this.form.imgDtoList[0]){
 						uni.showToast({
 							title: '请选择现场照片!',
 							icon: "none",

+ 1 - 1
pages_safetyCheck/views/snapshotManage/laboratorySearch.vue

@@ -31,7 +31,7 @@
 					<view class="list-li-b">
 						<view class="list-li-b-t">
 							<img src="@/pages/images/icon_sy_zc@1x.png">
-							{{(laboratoryStatus==0 || laboratoryStatus==3)?(item.roomNum?item.roomNum:'-'):(item.subRoom?item.subRoom:'-')}}房间&{{item.buildName}}
+							{{(laboratoryStatus==0 || laboratoryStatus==3)?(item.roomNum?item.roomNum:'-'):(item.subRoom?item.subRoom:'-')}}房间&{{item.buildName?item.buildName:''}}
 						</view>
 						<view class="list-li-b-b">
 							<view class="list-li-b-b-l">