Przeglądaj źródła

优化内容显示效果

zhengkaixin 1 rok temu
rodzic
commit
a89bd36948

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

@@ -9,12 +9,12 @@ const UNI_APP = {
 	
 	NODE_ENV :"dev",
 	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
-	 openId:"1239",//开发人员2
+	 openId:"1240",//开发人员2
 	// openId:"55555",//测试人员 开发环境
 	//openId:"oLowyuNkSxqovYoobKbeHB1nSkm0", //sz
 	//openId:"oK9Wr57rAcNzihDN2PEdptprT0As", 
 	// openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",
-	//openId:"oLowyuOJvTszgk96C0f8j0XfcEXg",//zkx
+	openId:"oLowyuOJvTszgk96C0f8j0XfcEXg",//zkx
 	
 	//openId:"oLowyuAJ1Ld0ivnLj4qp1k5Vy_l4", //老板
 	//openId:"oLowyuFTU3SzpvU4pGNzWk7NC9y0", //me

+ 181 - 3
pages/managementList/applicantsList.vue

@@ -43,9 +43,11 @@
 						{{item.statusN}}
 					</view>
 				</view>
-				<view v-if="item.remark" >
+				<view  >
 					<view class="remark"  style="width: 100%;" >
-						<textarea style="background-color: #f5f5f5;height: 100rpx;width: 90%;padding: 20rpx;border-radius: 5px;margin: 20rpx;"   disabled v-model="item.remark"  ></textarea>
+						<textarea style="background-color: #f5f5f5;height: 100rpx;width: 90%;padding: 20rpx;border-radius: 5px;margin: 20rpx;font-size: 28rpx;" v-model="item.vmodelremark"  disabled   >
+							
+						</textarea>
 					</view>
 				</view>
 				
@@ -56,6 +58,53 @@
 		<u-divider :isnone="list.length==0"
 		nonetext="暂无记录" border-color="#CFD2D5">
 			已经到底了</u-divider>
+			
+			<u-popup v-model="show"  mode="bottom">
+				<view class="popup2" >
+					<view class="title">
+						{{userName}}-权限管理
+					</view>
+					<scroll-view scroll-y="true" style="height: 600rpx;" >
+						
+					
+					<u-checkbox-group style="    width: 100%;" @change="checkboxGroupChange">
+					<view class="content">
+						
+						<view class="item" v-for="(item,i) in meterList"  >
+							<view class="item-title">
+								{{item.name}}
+							</view>
+							<view class="item-radio">
+							<!-- 	<label class="radio">
+									<radio value="" /><text></text>
+								</label> -->
+								
+								<u-checkbox 
+											
+												v-model="item.checked" 
+											
+												:name="item.id"
+											></u-checkbox>
+							</view>
+						</view>
+						
+			
+					</view>
+					</u-checkbox-group>
+					<u-divider border-color="#CFD2D5">
+						已经到底了</u-divider>
+					</scroll-view>
+					<view class="popup-bottom">
+						<view class="button cancel" @click="show=false">
+							取消
+						</view>
+						<view class="button save"  @click="submitBtn()" >
+							保存
+						</view>
+					</view>
+					
+				</view>
+			</u-popup>
 		
 		
 	</view>
@@ -72,6 +121,11 @@
 				recordsTotal: 0,
 				list:[],
 				
+				meterList:[],
+				meterListIn:[],
+				userId:"",
+				userName:"",
+				show:false,
 				
 			}
 		},
@@ -86,6 +140,79 @@
 		},
 		
 		methods: {
+			vmodelremark(item){
+				var remark=(item.informationTitle?'申请授权:'+item.informationTitle:'')+
+				
+				(item.remark?'\n申请备注:'+item.remark:'')
+				item.vmodelremark=remark
+			},
+			
+			submitBtn(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var meterIds="";
+				if(this.meterListIn.length){
+					meterIds=this.meterListIn.join()
+				}
+				
+				API.authorizedUserSave({
+					userId:this.userId,
+					meterIds:meterIds,
+				}).then((res) => {
+					//this.userId=id;
+					uni.hideLoading();
+					//this.meterList=res.data.meterList;
+					this.show=false
+					uni.showModal({
+						title:"提示",
+						content:"设置成功",
+						showCancel:false,
+					})
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			checkboxGroupChange(e){
+				console.log(e)
+				this.meterListIn=e
+			},
+			getAuthorizedUserDetails(id) {
+			
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.authorizedUserDetails({
+					userId:id,
+					
+				}).then((res) => {
+					this.userId=id;
+					uni.hideLoading();
+					this.meterList=res.data.meterList;
+					this.show=true
+					this.meterListIn=[]
+					for(var i in this.meterList){
+						var obj=this.meterList[i]
+						if(obj.checked){
+							this.meterListIn.push(obj.id)
+						}
+					}
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			
 			switchBtnApiMethod(node,key){
 				uni.showLoading({
 					title: "加载中",
@@ -96,6 +223,10 @@
 					status:key
 				}).then((res) => {
 					uni.hideLoading();
+					if(key){
+						this.getAuthorizedUserDetails(node.createBy)
+						this.userName=node.createByName
+					}
 					this.getApprovalList(true)
 				}).catch(error => {
 					
@@ -144,6 +275,11 @@
 							...this.list,
 							...res.data.data
 						];
+						
+						for(var i in this.list){
+							var obj=this.list[i]
+							this.vmodelremark(obj)
+						}
 						this.recordsTotal = res.data.recordsTotal;
 					
 					
@@ -279,7 +415,49 @@
   }
  
  
-  
+  // 人员权限管理
+  .popup2{
+  	  padding: 32rpx 0;
+  	  .title{
+  		  color: rgba(16,16,16,1);
+  		  font-size: 36rpx;
+  		  font-weight: bold;
+  		  text-align: center;
+  	  }
+  	  .content{
+  		  width: 100%;
+  		  margin-bottom: 24rpx;
+  		  .item{
+  			  display: flex;
+  			  align-items: center;
+  			  justify-content: space-between;
+  			  padding: 28rpx 30rpx;
+  			  border-bottom: 1px solid rgba(245,245,245,1);
+  		  }
+  	  }
+  	  .popup-bottom{
+  		  display: flex;
+  		  justify-content: space-between;
+  		  padding: 0 32rpx;
+  		  .button{
+  			  width: 328rpx;
+  			  height: 80rpx;
+  			  line-height: 80rpx;
+  			  border-radius: 4px;
+  			  
+  			  font-size: 32rpx;
+  			  text-align: center;
+  		  }
+  		  .cancel{
+  			  background-color: rgba(222,225,228,1);
+  			  color: rgba(51,51,51,1);
+  		  }
+  		  .save{
+  			  background-color: rgba(22,119,255,1);
+  			  color: rgba(255,255,255,1);
+  		  }
+  	  }
+  }
  
  
 

+ 16 - 4
pages/managementList/applyAuthorisation.vue

@@ -5,7 +5,8 @@
 				
 			</u-navbar>
 			<view class="main2">
-				<view class="item" v-for="(item,i) in meterList"  :key="i" >
+				<view class="item" v-for="(item,i) in meterList" 
+				  v-if="item.checked" :key="i" >
 					 <view class="item1">
 						 <view class="item11">{{item.name}}</view>
 						  <view class="item12">电源状态:<span>{{item.switchStatus?'开':'关'}}</span></view>
@@ -29,16 +30,25 @@
 				
 				<view class="item">
 					<view class="title">
-						二维码
+						申请授权
 					</view>
 					<view class="value">
 						{{title}}
 					</view>
 					
+				</view>
+				<view class="item" v-if="information.remark">
+					<view class="title">
+						备注
+					</view>
+					<view class="value">
+						{{information.remark}}
+					</view>
+					
 				</view>
 				<view class="item">
 					<view class="title">
-						<span>*</span>姓名
+						姓名<span>*</span>
 					</view>
 					<view class="value">
 						<input type="text" v-model="name" placeholder="请填写姓名" />
@@ -48,7 +58,7 @@
 				
 				<view class="item">
 					<view class="title">
-						<span>*</span>联系电话
+						联系电话<span>*</span>
 					</view>
 					<view class="value">
 						<input type="text" v-model="phone"  placeholder="请填写手机号码" />
@@ -124,6 +134,7 @@
 				meterList:[],
 				regUser:{},
 				remark:"",
+				information:{},
 			}
 		},
 		onLoad(op) {
@@ -216,6 +227,7 @@
 					openId:this.carhelp.getOpenId(),
 				}).then((res) => {
 					this.title=res.data.information.title
+					this.information=res.data.information;
 					uni.hideLoading();
 					//this.show=true
 					var info=res.data.applicationInfo;

+ 8 - 4
pages/managementList/managementList.vue

@@ -20,6 +20,8 @@
 		
 		</view>
 		
+		<view class="member-list-main">
+			
 		<!-- 列表 -->
 		<view class="member-list">
 			<checkbox-group @change="checkboxChange">
@@ -52,12 +54,12 @@
 			</view>
 			
 			</checkbox-group>
+			
+		</view>
 			<u-divider :isnone="list.length==0"
 			nonetext="暂无记录" border-color="#CFD2D5">
 				已经到底了</u-divider>
 		</view>
-		
-		
 		<view class="bottom">
 			<view class="button qr-code"
 			@click="gotoUrl('/pages/managementList/authorizedQRCode')"
@@ -404,11 +406,13 @@
 			right: 12rpx;
 		}
 	}
-
+.member-list-main{
+	  padding-bottom: 120rpx ;
+}
   // 列表
   .member-list{
 	  background: #fff;
-	   padding-bottom: 120rpx ;
+	 
 	   .item-info{
 	   		   padding: 32rpx 0;
 	   		   margin: 0 32rpx;

+ 1 - 1
pages/timing/timing.vue

@@ -144,7 +144,7 @@
 						text: '供电时间',
 						value: 0,
 					}, {
-						text: '定时电',
+						text: '定时电',
 						value: 1,
 					}, {
 						text: '定时停电',