浏览代码

Merge branch 'master' of http://47.92.161.104:10080/zkx/jp-housekeep-hall

zkx 1 年之前
父节点
当前提交
c936e9a05e
共有 3 个文件被更改,包括 284 次插入27 次删除
  1. 2 2
      pages/deductionRecord/deductionDetails.vue
  2. 269 19
      pages/timing/autoOff.vue
  3. 13 6
      pages/timing/timing.vue

+ 2 - 2
pages/deductionRecord/deductionDetails.vue

@@ -161,8 +161,8 @@
 							<tr>
 							<tr>
 								<td class="td1">楼层电量</td>
 								<td class="td1">楼层电量</td>
 								<td class="td3" >{{tenantBalanceRecord.extraJson.totalKwh}}度
 								<td class="td3" >{{tenantBalanceRecord.extraJson.totalKwh}}度
-								<span v-if="tenantBalanceRecord.extraJson.lineLoss">(其中线损电量:{{tenantBalanceRecord.extraJson.lineLoss}}度)</span>
-								</td>
+								<!-- <span v-if="tenantBalanceRecord.extraJson.lineLoss&&0">(其中线损电量:{{tenantBalanceRecord.extraJson.lineLoss}}度)</span>
+								 --></td>
 							</tr>
 							</tr>
 							<tr>
 							<tr>
 								<td class="td1">收费电量</td>
 								<td class="td1">收费电量</td>

+ 269 - 19
pages/timing/autoOff.vue

@@ -45,7 +45,7 @@
 			 @click="pickerShow4=true">
 			 @click="pickerShow4=true">
 				<view class="time">
 				<view class="time">
 					 <view class="time-slot" >
 					 <view class="time-slot" >
-						定时供电时间段
+						供电时间段
 						
 						
 					 </view>
 					 </view>
 					<view class="type">
 					<view class="type">
@@ -84,7 +84,7 @@
 				<view class="time">
 				<view class="time">
 					
 					
 					<view class="time-slot" >
 					<view class="time-slot" >
-						定时送电时间
+						电时间
 						
 						
 					</view>
 					</view>
 					
 					
@@ -105,7 +105,7 @@
 				<view class="time">
 				<view class="time">
 					
 					
 					<view class="time-slot"  v-show="switchStatus==0">
 					<view class="time-slot"  v-show="switchStatus==0">
-						定时停电时间
+						停电时间
 					</view>
 					</view>
 					
 					
 					<view class="type">
 					<view class="type">
@@ -144,15 +144,67 @@
 				<view class="time">
 				<view class="time">
 					
 					
 					<view class="type">
 					<view class="type">
-						1.功率达到最大阈值时“自动停电”;<br/>
-						2.关闭自动停电时,如果处于停电状态将“开启供电”;
+						1. 功率达到最大阈值时“自动停电”;<br/>
+						2.“智能停电”结束时,如果处于停电状态将打开电源供电;
+
+					</view>
+				</view>
+			
+				
+			
+			</view>
+			
+			<view class="time-item" v-show="switchStatus==2">
+				<view class="time">
+					
+					<view class="type">
+						在时间段开始时间开启电源供电,时间段结束时间停止供电。
+
 					</view>
 					</view>
 				</view>
 				</view>
 			
 			
 				
 				
 			
 			
+			</view>
+			
+			<view class="time-item2" v-show="startTime||endTime" >
+				<view class="time">
+					
+					<view class="time-slot" >
+											用电设置图示
+											
+					</view>
+				</view>
+				<view class="progressText"  >
+					<view class="progress1" v-if="progress1style.width!='0%'" :style="progress1style" >{{progress1style.text}}</view>
+					<view class="progress2">&nbsp;</view>
+					<view class="progress3" v-if="progress3style.width!='0%'"
+					 :style="progress3style">{{progress3style.text}}</view>
+				</view>
+				
+				<view class="progress" :style="{
+					backgroundColor:progressColor
+				}" >
+					<view class="progress1" :style="progress1style" ></view>
+					<view class="progress2">&nbsp;</view>
+					<view class="progress3" :style="progress3style"></view>
+				</view>
+				<view class="type" style=" color: #777777; margin-top: 16rpx;"  >
+					<view></view>
+					
+				</view>
+				<view class="type"  style=" color: #777777;"  v-if="switchStatus!=3">
+					<view v-if="switchStatus==1||switchStatus==2">设置生效后将在{{gethtml(startTime)}}供电</view>
+					<view v-if="switchStatus==0||switchStatus==2">设置生效后将在{{gethtml(endTime)}}停电</view>
+				</view>
+				<view class="type" style=" color: #777777;" v-else >
+					<view>设置生效后将在{{gethtml(startTime)}}开启“智能停电”</view>
+					<view>设置生效后将在{{gethtml(endTime)}}关闭“智能停电”</view>
+				</view>
+				
 			</view>
 			</view>
 		</view>
 		</view>
+		
 		<!-- 重复类型 -->
 		<!-- 重复类型 -->
 		<view class="repeatType" v-if="typeShow">
 		<view class="repeatType" v-if="typeShow">
 
 
@@ -215,7 +267,7 @@
 		<ujpPicker mode="time" jp="2" :default-time="endTime?'2024-1-1 '+endTime+':1':''"  :defaultStartTime="startTime"
 		<ujpPicker mode="time" jp="2" :default-time="endTime?'2024-1-1 '+endTime+':1':''"  :defaultStartTime="startTime"
 		 v-model="pickerShow2" :params="params" @confirm="pickerShow2confirm" ></ujpPicker>
 		 v-model="pickerShow2" :params="params" @confirm="pickerShow2confirm" ></ujpPicker>
 		<!-- 自定义重复 -->
 		<!-- 自定义重复 -->
-	<ujpPicker2   :texts="['开启"智能停电"','停止"智能停电"']"
+		<ujpPicker2   :texts="['开启“智能停电”','停止“智能停电”']"
 		:defaultTime="startTime?'2024-1-1 '+startTime+':1':''"
 		:defaultTime="startTime?'2024-1-1 '+startTime+':1':''"
 		:defaultTime2="endTime?'2024-1-1 '+endTime+':1':''"
 		:defaultTime2="endTime?'2024-1-1 '+endTime+':1':''"
 		
 		
@@ -295,7 +347,11 @@
 	import ujpPicker2 from '@/components/u-picker2.vue'
 	import ujpPicker2 from '@/components/u-picker2.vue'
 	
 	
 	import * as API from '@/apis/pagejs/meterTimer.js'
 	import * as API from '@/apis/pagejs/meterTimer.js'
-
+import {
+		hourDistanceArr,
+		parseUnixTime,
+		newDate
+	} from '@/apis/utils/index.js'
 	export default {
 	export default {
 		components: {
 		components: {
 			ujpPicker,ujpPicker2
 			ujpPicker,ujpPicker2
@@ -321,7 +377,7 @@
 									value:2
 									value:2
 									
 									
 								}, {
 								}, {
-									text: '定时电',
+									text: '定时电',
 									value:1
 									value:1
 								}, {
 								}, {
 									text: '定时停电' ,
 									text: '定时停电' ,
@@ -361,7 +417,10 @@
 					id:"",
 					id:"",
 					endTime:"",
 					endTime:"",
 					maxPower:"",
 					maxPower:"",
-				}
+				},
+				progressColor:"#53b56b",
+				
+				
 			}
 			}
 		},
 		},
 		onLoad(op) {
 		onLoad(op) {
@@ -379,7 +438,139 @@
 				this.getMeterTimerDetails()
 				this.getMeterTimerDetails()
 			}
 			}
 		},
 		},
+		computed:{
+			
+			progress1style(){
+				var width=0;
+				var color="red"
+				this.progressColor="#53b56b"
+				var text=""
+				var textColor=""
+				if(this.switchStatus==1||this.switchStatus==2||this.switchStatus==3){
+					
+					var startTime=this.startTime
+					var endTime=this.endTime
+					if(!startTime){
+						startTime="9999"
+					}
+					if(!endTime){
+						endTime="9999"
+					}
+					console.log(startTime,endTime)
+					var num1=parseInt(startTime.replace(":",''))
+					var num2=parseInt(endTime.replace(":",''))
+					
+					
+					var num=parseInt(num1>num2?num2:num1)
+					
+					if(num1>num2){
+						if(this.switchStatus!=1){
+							color=" #53b56b"
+							this.progressColor="red"
+						}
+						textColor=" red"
+						if(this.switchStatus==3){
+							text=`智能停电${endTime}`
+						}else{
+							text=`停电 (${endTime})`
+						}
+					}else{
+						textColor="#53b56b"
+						if(this.switchStatus==3){
+							text=`智能停电${startTime}`
+						}else{
+							text+=`供电 (${startTime})`
+						}
+						 
+					}
+					width=parseInt(num/2400*100)
+					console.log(width)
+				}else{
+					
+					
+				}
+				
+				return {
+					color:textColor,
+						text:text,
+					    width: width+"%",
+						backgroundColor:color
+				}
+			},
+			progress3style(){
+				var width=0;
+				var color="red"
+				var text=""
+				var textColor=""
+				if(this.switchStatus==0||this.switchStatus==2||this.switchStatus==3){
+					
+					var startTime=this.startTime
+					var endTime=this.endTime
+					
+					if(!startTime){
+						startTime="-1"
+					}
+					if(!endTime){
+						endTime="-1"
+					}
+					
+					var num1=parseInt(startTime.replace(":",''))
+					var num2=parseInt(endTime.replace(":",''))
+					
+					if(num1<num2||this.switchStatus==0){
+						textColor=" red"
+						if(this.switchStatus==3){
+							text=`智能停电${endTime}`
+						}else{
+							text=`停电(${endTime})`
+						}
+					}else{
+						if(this.switchStatus!=0){
+							color=" #53b56b"
+						}
+						textColor=" #53b56b"
+						//this.progressColor="red"
+						if(this.switchStatus==3){
+							text=`智能停电${startTime}`
+						}else{
+							text+=`供电(${startTime})`
+						}
+						
+					}
+					var num=parseInt(num1<num2?num2:num1)
+					
+					 width=parseInt((2400-num)/2400*100)
+					
+				}else{
+					
+				}
+				
+			
+				return {
+					color:textColor,
+					text:text,
+					    width: width+"%",
+						backgroundColor:color
+				}
+			}
+		},
 		methods: {
 		methods: {
+			gethtml(item) {
+				var str = parseUnixTime(new Date().getTime(), '{y}-{m}-{d}');
+				var time1 = new Date();
+				var time2 = newDate(str + ' ' + item + ':00');
+				var sz = []
+				if (time1 > time2) {
+					time2.setDate(time2.getDate() + 1)
+					sz = hourDistanceArr(time1, time2)
+				} else {
+			
+					sz = hourDistanceArr(time1, time2)
+				}
+				console.log(sz[0])
+				return (sz[0] ? sz[0] + '小时' : '') + (sz[1] ? sz[1] + '分钟后' : '0分钟后')
+			
+			},
 			showjp2time(time1,time2){
 			showjp2time(time1,time2){
 				
 				
 				if(time1&&time2){
 				if(time1&&time2){
@@ -456,12 +647,20 @@
 				}
 				}
 			},
 			},
 			pickerShow1confirm2(e){
 			pickerShow1confirm2(e){
-				console.log(e)
-				this.startTime=e.hour+":"+e.minute+""
-				
-				this.endTime=e.hour2+":"+e.minute2+""
+				if(e.hour+":"+e.minute+""==e.hour2+":"+e.minute2+""){
+					this.pickerShow3=true
+					uni.showToast({
+						title: "请勿设置相同时间",
+						icon: "none"
+					})
+				}else{
+					this.startTime=e.hour+":"+e.minute+""
+					
+					this.endTime=e.hour2+":"+e.minute2+""
+				}
 				
 				
 			},
 			},
+			
 			pickerShow1confirm(e){
 			pickerShow1confirm(e){
 			
 			
 				
 				
@@ -515,14 +714,14 @@
 					
 					
 					if(this.formData.switchStatus==1){
 					if(this.formData.switchStatus==1){
 						uni.showToast({
 						uni.showToast({
-							title: "请设置定时送电时间",
+							title: "请设置电时间",
 							icon: "none"
 							icon: "none"
 						})
 						})
 						return
 						return
 					}
 					}
 					if(this.formData.switchStatus==2){
 					if(this.formData.switchStatus==2){
 						uni.showToast({
 						uni.showToast({
-							title: "请设置定时供电时间段",
+							title: "请设置供电时间段",
 							icon: "none"
 							icon: "none"
 						})
 						})
 						return
 						return
@@ -543,7 +742,7 @@
 					
 					
 					if(this.formData.switchStatus==0){
 					if(this.formData.switchStatus==0){
 						uni.showToast({
 						uni.showToast({
-							title: "请设置定时停电时间",
+							title: "请设置停电时间",
 							icon: "none"
 							icon: "none"
 						})
 						})
 						return
 						return
@@ -621,9 +820,47 @@
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
+	.progressText{
+		
+		
+		    margin-top: 16rpx;
+			margin-bottom: 2rpx;
+		display: flex;
+		justify-content: space-between;
+		.progress1,.progress3{
+		    white-space: pre;
+			background-color: #fff !important;
+			  
+		}
+		.progress1{
+			
+			text-align: right;
+		}
+		.progress3{
+			text-align: left;
+			min-width: 25%;
+		}
+		
+	}
+	.progress{
+		background-color: #53b56b;
+		color: #53b56b;
+		height: 60rpx;
+		border-radius: 30px;
+		display: flex;
+		justify-content: space-between;
+		.progress1{
+			border-radius: 30px 0 0 30px;	
+		}
+		.progress3{
+			border-radius:0 30px   30px 0;	
+		}
+	}
+	
+	
 	/deep/.u-slot-right {
 	/deep/.u-slot-right {
-		margin-right: 32rpx;
-
+		padding-right: 32rpx;
+		
 		img {
 		img {
 			width: 48rpx;
 			width: 48rpx;
 			height: 48rpx;
 			height: 48rpx;
@@ -632,7 +869,20 @@
 
 
 	.time-group {
 	.time-group {
 		background-color: #fff;
 		background-color: #fff;
-
+		.time-item2 {
+			padding: 24rpx 0;
+			margin: 0 32rpx;
+			.time {
+				.time-slot {
+					color: rgba(16, 16, 16, 1);
+					font-size: 32rpx;
+				}
+			
+				.type {
+					color: rgba(119, 119, 119, 1);
+				}
+			}
+		}
 		.time-item {
 		.time-item {
 
 
 			padding: 24rpx 0;
 			padding: 24rpx 0;

+ 13 - 6
pages/timing/timing.vue

@@ -2,10 +2,13 @@
 	<view>
 	<view>
 		<u-navbar :title="title" title-color="#101010">
 		<u-navbar :title="title" title-color="#101010">
 
 
-			<view slot="right" @click="deleteShow=!deleteShow">
+			<view slot="right" v-if="timerSwitchList.length"
+			 
+			 @click="deleteShow=!deleteShow">
 
 
-				<img v-if="deleteShow==true" src="@/assets/img/arcoDesign-select-all.svg" alt="" />
-				<img v-else src="@/assets/img/riLine-list-settings-line.svg" alt="" />
+				<img v-if="deleteShow==true" src="@/assets/img/arcoDesign-select-all.svg" alt="" /> 
+				<span v-else style="color: red;" >删除</span>
+				<!-- <img  src="@/assets/img/riLine-list-settings-line.svg" alt="" /> -->
 			</view>
 			</view>
 
 
 		</u-navbar>
 		</u-navbar>
@@ -294,10 +297,14 @@
 	.weeklistclassSpan:last-child {
 	.weeklistclassSpan:last-child {
 		display: none;
 		display: none;
 	}
 	}
-
+	/deep/.u-back-wrap{
+		background-color: #fff;
+	}
 	/deep/.u-slot-right {
 	/deep/.u-slot-right {
-		margin-right: 32rpx;
-
+		padding-right: 32rpx;
+		padding-left: 16rpx;
+		line-height: 30px;
+		background-color: #fff;
 		img {
 		img {
 			width: 48rpx;
 			width: 48rpx;
 			height: 48rpx;
 			height: 48rpx;