Browse Source

角色改为多选,页面显示优化

zhengkaixin 4 days ago
parent
commit
6bd6a53e1f

+ 2 - 2
config/.env.dev.js

@@ -16,8 +16,8 @@ const UNI_APP = {
 
 	
 	openId:"123456",
-	//openId:"oSruR6YkhP7QDroLnZGxWis43Kn0",
-	openId:"oSruR6fYa0yzdMsDinzNOlePTotk",
+	//openId:"oSruR6YkhP7QDroLnZGxWis43Kn0",//zkx
+	openId:"oSruR6fYa0yzdMsDinzNOlePTotk",//zq
 	//appid
 	//VUE_APP_WXAPPID:"wxa9f555dc92a1cbfc",
 	VUE_APP_WXAPPID:"wxca33ab204e738ca4",

+ 4 - 4
pages/index/index.vue

@@ -214,7 +214,7 @@
 								getHourDistanceArrNum12:getHourDistanceArr(item.errorReportTime)>12,
 								getHourDistanceArrNum24:getHourDistanceArr(item.errorReportTime)>24,
 							}">
-								{{getHourDistanceArr(item.errorReportTime) }}小时未处理</view>
+								{{getHourDistanceArr(item.errorReportTime) }}小时未处理</view>
 
 						
 
@@ -226,7 +226,7 @@
 					<u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
 				</view>
 
-				<u-divider color="#F44336"  nonetop="0" :isnone="dataerrRecordsTotal==0" nonetext="暂无数据"
+				<u-divider color="#F44336"  :nonetop="0" :isnone="dataerrRecordsTotal==0" nonetext="暂无数据"
 					v-if="dataerrRecordsTotal==0"></u-divider>
 
 
@@ -323,7 +323,7 @@
 
 				</view>
 
-				<u-divider color="#F44336" nonetop="0" :isnone="datainsRecordsTotal==0" nonetext="暂无数据"
+				<u-divider color="#F44336" :nonetop="0" :isnone="datainsRecordsTotal==0" nonetext="暂无数据"
 					v-if="datainsRecordsTotal==0"></u-divider>
 
 
@@ -404,7 +404,7 @@
 		computed: {
 			isAdmin() {
 				console.log(this.jphelp.getPersonInfo().role)
-				if (this.jphelp.getPersonInfo().role == '1') {
+				if (this.jphelp.getPersonInfo().role.indexOf( '1')!=-1) {
 					return true
 				}
 				return false

+ 3 - 1
pages/inspection/add.vue

@@ -282,7 +282,9 @@
 					mask: true,
 				})
 
-				API.teamMembers().then((res) => {
+				API.teamMembers({
+					userType:1
+				}).then((res) => {
 
 					var arr = res.data.memberList
 

+ 3 - 1
pages/task/addTask.vue

@@ -272,7 +272,9 @@
 					mask: true,
 				})
 
-				API.teamMembers().then((res) => {
+				API.teamMembers({
+					userType:1
+				}).then((res) => {
 
 					var arr = res.data.memberList
 

+ 15 - 12
pages/task/listTask.vue

@@ -90,19 +90,22 @@
 						</view>
 						<view class="value">
 							上报时间 {{item.errorReportTime}} 
-							<span   class="value"  v-if="getHourDistanceArr(item)==0" :class="{
-								getHourDistanceArrNum10:true,
-							
-							}">
-							
-							</span>
-							<span  class="value"  v-else :class="{
-								getHourDistanceArrNum10:true,
-								getHourDistanceArrNum12:getHourDistanceArr(item)>12,
-								getHourDistanceArrNum24:getHourDistanceArr(item)>24,
-							}">
-								(超{{getHourDistanceArr(item) }}小时)
+							<template v-if="item.status==0">
+								<span   class="value"  v-if="getHourDistanceArr(item)==0" :class="{
+									getHourDistanceArrNum10:true,
+								
+								}">
+								
 								</span>
+								<span  class="value"  v-else :class="{
+									getHourDistanceArrNum10:true,
+									getHourDistanceArrNum12:getHourDistanceArr(item)>12,
+									getHourDistanceArrNum24:getHourDistanceArr(item)>24,
+								}">
+									({{getHourDistanceArr(item) }}小时)
+									</span>
+							</template>
+						
 								
 						</view>
 						<view class="value"  v-if="item.status==1">

+ 3 - 1
pages/task/maintenanceTaks.vue

@@ -340,7 +340,9 @@
 					mask: true,
 				})
 
-				API.teamMembers().then((res) => {
+				API.teamMembers({
+					userType:1
+				}).then((res) => {
 
 					var arr = res.data.memberList
 

+ 102 - 90
pages/team/stationMy.vue

@@ -17,10 +17,20 @@
 					{{item.stationNo}}<span class="y">|</span>{{item.name}}
 				</view>
 
-				<view class="v2" :class="{
-					v3:item.inspectionCycle
+				<view class="v2">
+					<view class="v21" :class="{
+					v3:item.inspectionCycle
 				}">
-					{{item.inspectionCycle?'巡检周期:'+item.inspectionCycle+'天':'未设置'}}
+						巡检周期:{{item.inspectionCycle?''+item.inspectionCycle+'天':'未设置'}}
+
+					</view>
+					<view class="v22" :class="{
+					v3:item.inspectionExamine
+				}">
+						异常解决时限:{{item.inspectionExamine?''+item.inspectionErrorLimitDuration+'小时':'未设置'}}
+
+					</view>
+
 				</view>
 
 			</view>
@@ -28,14 +38,14 @@
 		</view>
 		<u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
 
-		<view class="floating-button">
-			
-			
-			<view class="button " @click="gotoTask">
-		
-				关联场站
-			</view>
-		
+		<view class="floating-button">
+
+
+			<view class="button " @click="gotoTask">
+
+				关联场站
+			</view>
+
 		</view>
 
 	</view>
@@ -67,31 +77,31 @@
 			this.getList()
 		},
 		onShow() {
-			
-		},
-		onReachBottom() {
-			if (this.list.length < this.listForm.recordsTotal) {
-				this.myLoadmore();
-			}
+
+		},
+		onReachBottom() {
+			if (this.list.length < this.listForm.recordsTotal) {
+				this.myLoadmore();
+			}
 		},
-		methods: {
-			gotoTask(){
-				uni.navigateTo({
-				  url: '/pages/team/stationAdd?id='+this.id,
-				  events: {
-				    // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
-				    acceptDataFromOpenerPage: (data)=>{
-						console.log(data)
-						this.getList(1)
-				    },
-				 
-				  }
-				 
-				})
-			},
-			myLoadmore() {
-				this.listForm.pageIndex += 1;
-				this.getList()
+		methods: {
+			gotoTask() {
+				uni.navigateTo({
+					url: '/pages/team/stationAdd?id=' + this.id,
+					events: {
+						// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
+						acceptDataFromOpenerPage: (data) => {
+							console.log(data)
+							this.getList(1)
+						},
+
+					}
+
+				})
+			},
+			myLoadmore() {
+				this.listForm.pageIndex += 1;
+				this.getList()
 			},
 			showqueryName(item) {
 				if (this.queryName) {
@@ -116,23 +126,23 @@
 					title: "加载中",
 					mask: true,
 				})
-				this.listForm.id = this.id
-				this.listForm.queryContent=this.queryName 
+				this.listForm.id = this.id
+				this.listForm.queryContent = this.queryName
 				API.teamUserStation(this.listForm).then((res) => {
 
 					var list = this.list
 
-				
-					if (this.listForm.pageIndex == 1) {
-						list = res.data.data;
-					} else {
-						list = [
-							...list,
-							...res.data.data
-						];
-					}
-					this.list =list
-					this.listForm.recordsTotal=res.data.recordsTotal
+
+					if (this.listForm.pageIndex == 1) {
+						list = res.data.data;
+					} else {
+						list = [
+							...list,
+							...res.data.data
+						];
+					}
+					this.list = list
+					this.listForm.recordsTotal = res.data.recordsTotal
 					uni.hideLoading();
 
 				}).catch(error => {
@@ -153,8 +163,8 @@
 <style lang="scss" scoped>
 	.list {
 		padding-top: 20rpx;
-		padding-bottom: 120rpx;
-		
+		padding-bottom: 120rpx;
+
 		.item:not(:last-child) {
 			border-bottom: 2rpx solid rgba(232, 232, 232, 1);
 		}
@@ -162,10 +172,7 @@
 		.item {
 			padding: 24rpx 32rpx;
 			background: #fff;
-		display: flex;
-			    flex-direction: row;
-			    justify-content: space-between;
-align-items: center;
+
 			.vquery {
 				display: flex;
 				align-items: center;
@@ -208,12 +215,17 @@ align-items: center;
 
 			.v2 {
 				color: red;
-				font-size: 24rpx;
-				    white-space: pre;
-			}
-			.v3 {
-				color: rgba(119, 119, 119, 1);
-				font-size: 24rpx;
+				font-size: 24rpx;
+				white-space: pre;
+				display: flex;
+				flex-direction: row;
+				justify-content: space-between;
+				align-items: center;
+			}
+
+			.v3 {
+				color: rgba(119, 119, 119, 1);
+				font-size: 24rpx;
 			}
 
 		}
@@ -239,35 +251,35 @@ align-items: center;
 			border-radius: 16rpx;
 			justify-content: space-between;
 		}
-	}
-	
-	
-	.floating-button {
-		z-index: 999;
-		position: fixed;
-		bottom: 0;
-	
-		width: 100%;
-		display: flex;
-		height: 120rpx;
-	
-		    justify-content: space-around;
-		background-color: rgba(255, 255, 255, 1);
-	
-		.button {
-			margin-top: 24rpx;
-			border-radius: 50px;
-			height: 80rpx;
-			width: 80%;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			padding: 12rpx;
-	
-			background-color: rgba(22, 119, 255, 1);
-			color: rgba(255, 255, 255, 1);
-			font-size: 32rpx;
-		}
-		
+	}
+
+
+	.floating-button {
+		z-index: 999;
+		position: fixed;
+		bottom: 0;
+
+		width: 100%;
+		display: flex;
+		height: 120rpx;
+
+		justify-content: space-around;
+		background-color: rgba(255, 255, 255, 1);
+
+		.button {
+			margin-top: 24rpx;
+			border-radius: 50px;
+			height: 80rpx;
+			width: 80%;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			padding: 12rpx;
+
+			background-color: rgba(22, 119, 255, 1);
+			color: rgba(255, 255, 255, 1);
+			font-size: 32rpx;
+		}
+
 	}
 </style>

+ 47 - 10
pages/team/teamAdd.vue

@@ -58,9 +58,18 @@
 		</view>
 
 
-		<view class="list">
-
-			<u-radio-group v-model="roleId">
+		<view class="list checkboxMain ">
+			
+			<u-checkbox-group >
+						<u-checkbox 
+							 @change="memberListchange"
+							v-model="item.checked" 
+							v-for="(item, index) in codeList" :key="index" 
+							:name="item.value"
+						>{{item.name}}</u-checkbox>
+					</u-checkbox-group>
+					
+			<!-- <u-radio-group v-model="roleId">
 				<view class="radiolist">
 
 					<view class="radioitem" v-for="(item, index) in codeList">
@@ -69,7 +78,7 @@
 						</u-radio>
 					</view>
 				</view>
-			</u-radio-group>
+			</u-radio-group> -->
 		</view>
 
 
@@ -102,7 +111,7 @@
 		onLoad(op) {
 			if(op.id){
 				this.id=op.id
-				this.getInfo()
+				
 			}
 			
 			
@@ -171,7 +180,12 @@
 					this.addInfo.roleId=info.role
 					this.roleId=info.role
 					//this.addInfo.id=info.id
-
+					this.codeList.forEach(item=>{
+						if(this.roleId.indexOf(item.value)!=-1){
+							item.checked=true
+						}
+					})
+					this.$forceUpdate()
 				}).catch(error => {
 
 					uni.hideLoading();
@@ -188,8 +202,13 @@
 
 					var arr = res.data.dataDictionaryList
 
-					this[listName] = arr
-
+					this.codeList= arr
+					this.codeList.forEach(item=>{
+						item.checked=false
+					})
+					if(this.id){
+						this.getInfo()
+					}
 
 				}).catch(error => {
 
@@ -272,6 +291,10 @@
 						// uni.hideLoading();
 					}
 				});
+			},
+			memberListchange(e){
+				console.log(e)
+				this.$forceUpdate()
 			},
 			submit() {
 				if (!this.addInfo.name) {
@@ -286,7 +309,13 @@
 					})
 					return
 				}
-				
+				var sz=[]
+				this.codeList.forEach(item=>{
+					if(item.checked){
+						sz.push(item.value)
+					}
+				})
+				this.roleId=sz.join()
 				if (!this.roleId) {
 					uni.showToast({
 						title: "请选择成员角色"
@@ -464,10 +493,18 @@
 			border-bottom: 2rpx solid rgba(232, 232, 232, 1);
 		}
 	}
+	.checkboxMain{
+		padding: 20rpx;
+	}
 	.rightslot{
 		
 		margin-right: 16rpx;
 		color: red;
 	}
-	   
+	   ::v-deep .u-checkbox{
+		   display: flex;
+	   }
+	  ::v-deep .u-checkbox-group{
+		   display: block;
+	  }
 </style>

+ 4 - 4
pages/team/teamInfo.vue

@@ -48,7 +48,7 @@
 
 				</view>
 				<view class="value">
-					{{roleName}}
+					{{addInfo.roleName}}
 				</view>
 			</view>
 
@@ -196,9 +196,9 @@
 				}).then((res) => {
 
 					this.addInfo=res.data.user
-					this.findByCatalogName({
-						catalogName: '巡检角色'
-					}, "codeList")
+					// this.findByCatalogName({
+					// 	catalogName: '巡检角色'
+					// }, "codeList")
 
 				}).catch(error => {
 

+ 25 - 6
pages/team/teamList.vue

@@ -31,7 +31,10 @@
 				<view class="body">
 					<view class="line1">
 						<view class="title">
-							{{item.name}} <span class="tag"  :class="'role'+item.role">{{item.roleName}}</span> 
+							{{item.name}} 
+							
+							<span class="tag"  v-for="(o,ind) in  item.roleList"
+							 :class="'role'+o.role">{{o.roleName}}</span> 
 		
 						</view>
 						
@@ -154,11 +157,27 @@
 				
 					var list = res.data.memberList
 					
-					list=list.sort((item1,item2)=>{
-						if(item1.role<item2.role){
-							return -1
-						}else {
-							return 1
+					// list=list.sort((item1,item2)=>{
+					// 	if(item1.role<item2.role){
+					// 		return -1
+					// 	}else {
+					// 		return 1
+					// 	}
+						
+					// })
+					list.forEach(item=>{
+						item.roleList=[]
+						if(item.role&&item.roleName){
+							var szA=item.role.split(',')
+							var szB=item.roleName.split(',')
+							for(var i in szA){
+								var key1=szA[i]
+								var key2=szB[i]
+								item.roleList.push({
+									role:key1,
+									roleName:key2
+								})
+							}
 						}