Pārlūkot izejas kodu

平台收入 ,智能停电时间

zhengkaixin 1 gadu atpakaļ
vecāks
revīzija
b34f4984e2

+ 29 - 0
apis/pagejs/revenue.js

@@ -0,0 +1,29 @@
+import request from '@/apis/utils/request'
+
+
+export function platformCompanyList(data) {
+	var url='mobile/energyManage/platformCompanyList';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function platformRevenue(data) {
+	var url='mobile/energyManage/platformRevenue';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function platformRevenueTypeList(data) {
+	var url='mobile/energyManage/platformRevenueTypeList';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}

+ 21 - 2
apis/utils/index.js

@@ -107,20 +107,39 @@ export const hourDistanceArr = (date1, date2) => {
 	return [Hour, Fen, s]
 }
 //计算两个时间的相差小时数
-export const hourDistance = (date1, date2) => {
+export const hourDistance = (date1, date2,days) => {
 	if (!date1 || !date2) {
 		return '-';
 	}
 	date1 = Date.parse(date1);
 	date2 = Date.parse(date2);
 	var ms = date2 - date1;
+	var day = parseInt(Math.floor(ms / (24 * 3600 * 1000)));
+	
 	ms = ms < 0 ? 0 : ms;
 	ms = ms / 1000; //s
+	
 	var Hour = parseInt(Math.floor(ms / (60 * 60)));
 	var Fen = parseInt(Math.floor(ms % (60 * 60) / 60));
 	var s = parseInt(Math.floor(ms % (60)));
 	//600000
-	return Hour + '小时' + Fen + '分钟' + s + '秒';
+	var str=""
+	if(days){
+		if(day){
+			str+=(day + '天' )
+		}
+		Hour=Hour%24
+	}
+	if(Hour){
+		str+=(Hour + '小时' )
+	}
+	if(Fen){
+		str+=(Fen + '分钟' )
+	}
+	if(s){
+		str+=(s + '秒' )
+	}
+	return str;
 }
 
 export const parseUnixTime = (time, cFormat) => {

BIN
assets/img/incomeChart1@3x.png


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

@@ -3,7 +3,7 @@ const UNI_APP = {
 	//BASE_URL: 'http://36.134.122.108/railroad-server/',
 
 	BASE_URL: 'https://charging.xiaoxinda.com/electric-manager-api/', //test
-	BASE_URL: 'https://dgj.hbjp.com.cn/electric-manager-api/',
+	//BASE_URL: 'https://dgj.hbjp.com.cn/electric-manager-api/',
 	
 	//BASE_URL:'http://192.168.77.162:8081/electric-manager-api/', //sz
 	

+ 421 - 157
pages/platformRevenueStatistics/platformRevenueStatistics.vue

@@ -1,160 +1,424 @@
-<template>
-	<view>
-		<u-navbar title="平台收入统计" title-color="#101010"></u-navbar>
-		<!-- 标签 -->
-		<view class="tabs">
-			<u-picker v-model="tabShow1" mode="selector" :default-selector="[0]" :range="selector"></u-picker>
-		   <u-picker v-model="tabShow2" mode="time"></u-picker>
-			<view class="tabsItem" @click="tabShow1=!tabShow1" >荆鹏软件园 <u-icon
-					name="arrow-up" v-if="tabShow1" ></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
-			<view class="tabsItem" @click="tabShow2=!tabShow2" >2024-06 <u-icon
-					name="arrow-up" v-if="tabShow2"> 2024-06</u-icon><u-icon v-else  name="arrow-down"></u-icon></view>
-		</view>
-		<!-- 统计 -->
-		<view class="statistics">
-			<view class="statistics-total">
-				<view class="total-title">
-					6月预计收入
-				</view>
-				<view class="total-number">
-					324.75元
-				</view>
-			</view>
+<template>
+	<view>
+		<u-navbar title="平台收入统计" title-color="#101010"></u-navbar>
+
+
+		<!-- 标签 -->
+		<view class="tabs">
+			<u-picker v-model="tabsFrom.show1" :default-selector="[tabsFrom.show1Index]" mode="selector"
+				:range="tabsFrom.selector1" range-key="label" @confirm="selector1confirm"></u-picker>
+			<u-picker-select title="日期选择" v-model="tabsFrom.show2" :defaultTime="tabsFrom.show2Index" :endYear="endYear"
+				:noselect="false" mode="time" :params="params" @confirm="selector2confirm"
+				@reset="selector2reset"></u-picker-select>
+
+			<view class="tabsItem" @click="tabsFrom.show1=!tabsFrom.show1">{{tabsFrom.show1Text}} <u-icon
+					name="arrow-up" v-if="tabsFrom.show1"></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
+			<view class="tabsItem" @click="tabsFrom.show2=!tabsFrom.show2">{{tabsFrom.show2Text}} <u-icon
+					name="arrow-up" v-if="tabsFrom.show2"></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
+		</view>
+		<!-- 统计 -->
+		<view class="statistics">
+			<view class="statistics-total">
+				<view class="total-title">
+					{{monthQuery}}月预计收入
+				</view>
+				<view class="total-number">
+					{{info.totalFee}}元
+				</view>
+			</view>
+
+			<view class="statistics-group">
+				<view  @click="gotoInfo(2)"
+				class="statistics-item">
+					<view class="content">
+						<!-- 收入 -->
+						<view class="income">
+							<view class="income-title">
+								线损电费收入({{info.ratio}}%)
+							</view>
+							<view class="income-number">
+								{{info.lineLossFee}}元
+							</view>
+						</view>
+						<!-- 电量 -->
+						<view class="electric-quantity">
+							<view class="electric-quantity-title">
+								线损电量
+							</view>
+							<view class="electric-quantity-number">
+								{{info.lineLossKwh}}度
+							</view>
+						</view>
+					</view>
+					<view class="icon">
+						<u-icon name="arrow-right" color="#acacac" size="24"></u-icon>
+					</view>
+				</view>
+				<view   @click="gotoInfo(1)" class="statistics-item">
+					<view class="content">
+						<!-- 收入 -->
+						<view class="income">
+							<view class="income-title">
+								分摊电费收入({{info.ratio}}%)
+							</view>
+							<view class="income-number">
+								{{info.sharedFee}}元
+							</view>
+						</view>
+						<!-- 电量 -->
+						<view class="electric-quantity">
+							<view class="electric-quantity-title">
+								分摊电量
+							</view>
+							<view class="electric-quantity-number">
+								{{info.sharedKwh}}度
+							</view>
+						</view>
+					</view>
+					<view class="icon">
+						<u-icon name="arrow-right" color="#acacac" size="24"></u-icon>
+					</view>
+				</view>
+				<view   @click="gotoInfo(3)" class="statistics-item">
+					<view class="content">
+						<!-- 收入 -->
+						<view class="income">
+							<view class="income-title">
+								节约电费收入({{info.ratio}}%)
+							</view>
+							<view class="income-number">
+								{{info.switchFee}}元
+							</view>
+						</view>
+						<!-- 电量 -->
+						<view class="electric-quantity">
+							<view class="electric-quantity-title">
+								节约电量
+							</view>
+							<view class="electric-quantity-number">
+								{{info.switchKwh}}度
+							</view>
+						</view>
+					</view>
+					<view class="icon">
+						<u-icon name="arrow-right" color="#acacac" size="24"></u-icon>
+					</view>
+				</view>
+			</view>
+
+		</view>
+		<!-- 图表 -->
+	
+		<view class="chart">
+			<view id="pieEcharts" >
 			
-			<view class="statistics-group">
-				<view class="statistics-item" v-for="item in 3" >
-					<view class="content">
-						<!-- 收入 -->
-						<view class="income">
-							<view class="income-title">
-								线损电费收入
-							</view>
-							<view class="income-number">
-								108.25元
-							</view>
-						</view>
-						<!-- 电量 -->
-						<view class="electric-quantity">
-							<view class="electric-quantity-title">
-								线损电量
-							</view>
-							<view class="electric-quantity-number">
-								125.33度
-							</view>
-						</view>
-					</view>
-					<view class="icon">
-						<u-icon name="arrow-right" color="#acacac" size="24" ></u-icon>
-					</view>
-				</view>
 			</view>
-			
-		</view>
-		<!-- 图表 -->
-		<view class="chart">
-			<img src="@/assets/img/incomeChart1@3x.png" alt="" />
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				tabShow1:false,
-				tabShow2:false,
-				selector: [1, 2, 3],
-			}
-		},
+		</view>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/pagejs/revenue.js'
+	import * as echarts from "echarts";
+
+	export default {
+		data() {
+			return {
+				tabShow1: false,
+				tabShow2: false,
+				selector: [1, 2, 3],
+				id: "",
+				info: {},
+				list: [],
+				queryDate: "",
+				queryMonth: "",
+				monthQuery: "",
+				params: {
+					year: true,
+					month: true,
+					day: false,
+					hour: false,
+					minute: false,
+					second: false
+				},
+				tabsFrom: {
+					show1: false,
+					show1Index: 0,
+					show2Index: '',
+					show2: false,
+					show1Text: "全部类型",
+					show2Text: "全部时间",
+					selector1: [{
+							label: '全部类型',
+							value: '',
+						},
+						{
+							label: '线上充值',
+							value: '1',
+						},
+						{
+							label: '线下充值',
+							value: '2',
+						},
+					]
+				},
+				endYear: "",
+				myChart: null,
+			}
+		},
+		onLoad(op) {
+			this.endYear = new Date().getFullYear()
+			this.id = op.id
+			var date = new Date()
+			this.queryDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-1"
+			this.queryMonth = date.getFullYear() + "年" + (date.getMonth() + 1) + "月"
+			this.tabsFrom.show2Text = this.queryMonth
+			this.monthQuery = (date.getMonth() + 1)
+			this.getInfo()
+			this.getCompanyList()
+		},
 		methods: {
-			
-		}
-	}
-</script>
-
-<style>
-	page{
-		padding-bottom: 100px;
-		background-color: #fff;
-	}
-</style>
-<style lang="scss" scoped>
-	// 标签
-	.tabs {
-	
-		height: 96rpx;
-		line-height: 96rpx;
-		background-color: #fff;
-		border-top: 1px solid rgba(241, 241, 241, 1);
-		display: flex;
-		justify-content: space-around;
-	
-	}
-
-     // 统计
-	 .statistics{
-		 .statistics-total{
-			 display: flex;
-			 align-items: center;
-			 justify-content: space-between;
-			 padding: 36rpx 32rpx;
-			 background-color: rgba(22,119,255,1);
-			 color: rgba(255,255,255,1);
-			 font-size:40rpx;
-			 font-weight: bold;
-		 }
-		 
-		 .statistics-group{
-			 .statistics-item{
-				 padding: 24rpx 32rpx;
-				 display: flex;
-				 align-items: center;
-				 justify-content: space-between;
-				 border-bottom: 1px solid rgba(245,245,245,1);
-				 
-				 .content{
-					 flex: 0.99;
-					 // 收入
-					 .income{
-						 display: flex;
-						 align-items: center;
-						 justify-content: space-between;
-						 font-size: 32rpx;
-						 font-weight: bold;
-						 .income-title{
-							 color: rgba(51,51,51,1);
-							 
-						 }
-						 .income-number{
-							 color: rgba(22,119,255,1);
-							 
-						 }
-					 }
-					 // 电量
-					 .electric-quantity{
-						 display: flex;
-						 align-items: center;
-						 justify-content: space-between;
-						 font-size: 24rpx;
-						 color: rgba(119,119,119,1);
-						
-					 }
-					 
-				 }
-			 }
-			 
-		 }
-	 }
-
- // 图表
- .chart{
-	 margin-top: 40rpx;
-	 padding: 0 15rpx;
-	 img{
-		 width: 100%;
-		 height: 600rpx;
-	 }
- }
-
-
-</style>
+			gotoInfo(i){
+				var url="/pages/platformRevenueStatistics/saveUtilityIncome?id="+this.id+"&type="+i+"&query="+this.queryDate
+				uni.navigateTo({
+					url:url
+				})
+			},
+			selector2confirm(e) {
+
+				this.tabsFrom.show2Text = e.year + "年" + e.month + "月"
+
+				this.tabsFrom.show2Index = e.year + "-" + e.month
+				this.queryMonth = e.year + "年" + e.month + "月"
+				this.queryDate = e.year + "-" + e.month + "-1"
+
+				this.getInfo()
+			},
+			selector1confirm(e, b) {
+
+				var index = e[0]
+				this.tabsFrom.show1Index = index
+				this.tabsFrom.show1Text = this.tabsFrom.selector1[index].label
+				this.id = this.tabsFrom.selector1[index].value;
+
+				if (!b) {
+					this.getInfo()
+				}
+			},
+			getInfo() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.platformRevenue({
+					companyId: this.id,
+					queryDate: this.queryDate
+				}).then((response) => {
+					uni.hideLoading();
+					var list = response.data.incomeList
+					if (list.length) {
+						this.info = list[0]
+						this.getPle()
+					} else {
+						this.info = {}
+						if (this.myChart) {
+							this.myChart.clear()
+						}
+					}
+
+
+
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			getPle(list) {
+
+				if (!this.myChart) {
+					this.myChart = echarts.init(document.getElementById('pieEcharts'), null, {
+						width: uni.upx2px(700),
+						height: uni.upx2px(480)
+					});
+				}
+				this.myChart.clear();
+
+
+				var option = {
+					tooltip: {
+						trigger: 'item'
+					},
+					grid: {
+							top: 30,
+							left: 20,
+							right: 30,
+							bottom: 20,
+							containLabel: true
+						},
+					series: [{
+					
+						type: 'pie',
+						radius: ['40%', '70%'],
+						avoidLabelOverlap: false,
+						
+						label: {
+							show: true,
+							
+							formatter: '{b}\n\t{c}元'
+						},
+						
+						
+						data: [{
+								value: this.info.lineLossFee,
+								name: '线损电费',
+								itemStyle:{
+									color:"#ef8132"
+								}
+							},
+							{
+								value: this.info.sharedFee,
+								name: '分摊电费',
+								itemStyle:{
+									color:"#99bd3a"
+								}
+							},
+							{
+								value: this.info.switchFee,
+								name: '节约电费',
+								itemStyle:{
+									color:"#53b56b"
+								}
+							}
+						]
+					}]
+				};
+				console.log(option)
+				this.myChart.setOption(option);
+
+
+			},
+			getCompanyList() {
+
+				API.platformCompanyList({
+					//companyId:this.id
+				}).then((response) => {
+					//uni.hideLoading();
+					var list = response.data.companyInfoList;
+					var i = 0;
+					var k = 0
+					this.tabsFrom.selector1 = list.map((item) => {
+
+						if (item.id == this.id) {
+							k = i
+						}
+						i++;
+						return {
+							label: item.name,
+							value: item.id
+						}
+					})
+					this.selector1confirm([k], true)
+
+
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+	page {
+		padding-bottom: 100px;
+		background-color: #fff;
+	}
+</style>
+<style lang="scss" scoped>
+	// 标签
+	.tabs {
+
+		height: 96rpx;
+		line-height: 96rpx;
+		background-color: #fff;
+		border-top: 1px solid rgba(241, 241, 241, 1);
+		display: flex;
+		justify-content: space-around;
+
+	}
+
+	// 统计
+	.statistics {
+		.statistics-total {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding: 36rpx 32rpx;
+			background-color: rgba(22, 119, 255, 1);
+			color: rgba(255, 255, 255, 1);
+			font-size: 40rpx;
+			font-weight: bold;
+		}
+
+		.statistics-group {
+			.statistics-item {
+				padding: 24rpx 32rpx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				border-bottom: 1px solid rgba(245, 245, 245, 1);
+
+				.content {
+					flex: 0.99;
+
+					// 收入
+					.income {
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+						font-size: 32rpx;
+						font-weight: bold;
+
+						.income-title {
+							color: rgba(51, 51, 51, 1);
+
+						}
+
+						.income-number {
+							color: rgba(22, 119, 255, 1);
+
+						}
+					}
+
+					// 电量
+					.electric-quantity {
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+						font-size: 24rpx;
+						color: rgba(119, 119, 119, 1);
+
+					}
+
+				}
+			}
+
+		}
+	}
+
+	// 图表
+	.chart {
+		margin-top: 40rpx;
+		padding: 0 15rpx;
+
+		img {
+			width: 100%;
+			height: 600rpx;
+		}
+	}
+</style>

+ 234 - 59
pages/platformRevenueStatistics/saveUtilityIncome.vue

@@ -1,32 +1,36 @@
 <template>
 	<view>
-		<u-navbar title="节省公用电费收入" title-color="#101010"></u-navbar>
+		<u-navbar :title="typeName+'电费收入'" title-color="#101010"></u-navbar>
 		<!-- 标签 -->
 		<view class="tabs">
-			<u-picker v-model="tabShow1" mode="selector" :default-selector="[0]" :range="selector"></u-picker>
-			<u-picker v-model="tabShow2" mode="time"></u-picker>
-			<view class="tabsItem" @click="tabShow1=!tabShow1">AB栋 <u-icon name="arrow-up"
-					v-if="tabShow1"></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
-			<view class="tabsItem" @click="tabShow2=!tabShow2">2024-06 <u-icon name="arrow-up" v-if="tabShow2">
-					2024-06</u-icon><u-icon v-else name="arrow-down"></u-icon></view>
+			<u-picker v-model="tabsFrom.show1" :default-selector="[tabsFrom.show1Index]" mode="selector"
+				:range="tabsFrom.selector1" range-key="label" @confirm="selector1confirm"></u-picker>
+			<u-picker-select title="日期选择" v-model="tabsFrom.show2" :defaultTime="tabsFrom.show2Index" :endYear="endYear"
+				:noselect="false" mode="time" :params="params" @confirm="selector2confirm"
+				@reset="selector2reset"></u-picker-select>
+		
+			<view class="tabsItem" @click="tabsFrom.show1=!tabsFrom.show1">{{tabsFrom.show1Text}} <u-icon
+					name="arrow-up" v-if="tabsFrom.show1"></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
+			<view class="tabsItem" @click="tabsFrom.show2=!tabsFrom.show2">{{tabsFrom.show2Text}} <u-icon
+					name="arrow-up" v-if="tabsFrom.show2"></u-icon><u-icon v-else name="arrow-down"></u-icon></view>
 		</view>
 		<!-- 统计 -->
 		<view class="statistics">
 			<view class="total-group">
 				<view class="statistics-total1">
 					<view class="total-title">
-						节省电费
+						{{typeName}}电费
 					</view>
 					<view class="total-number">
-						108.25
+						{{info.totalFee}}
 					</view>
 				</view>
 				<view class="statistics-total2">
 					<view class="total-title">
-						节省电量
+						{{typeName}}电量
 					</view>
 					<view class="total-number">
-						125.33
+						{{info.totalFee}}
 					</view>
 				</view>
 			</view>
@@ -35,96 +39,68 @@
 
 
 			<view class="statistics-group">
-				<view class="statistics-item">
+				<view class="statistics-item"  v-for="(item,i) in info.list"  :key="i"
+				 @click="showBtn(item)" >
 					<view class="item-top">
 						<view class="content">
 							<!-- 电费 -->
 							<view class="electricity">
 								<view class="electricity-title">
-									电梯电表节省电费
+									{{item.tenantName}}
 								</view>
 								<view class="electricity-number">
-									108.25
+									{{item.fee}}
 								</view>
 							</view>
 							<!-- 节省度数 -->
 							<view class="electric-quantity">
 								<view class="electric-quantity-title">
-									节省度数
+									{{typeName}}度数
 								</view>
 								<view class="electric-quantity-number">
-									125.33
+									{{item.kwh}}
 								</view>
 							</view>
 						</view>
 
-						<view class="icon" @click="detail=!detail" >
+						<view class="icon"   >
 							
-							<u-icon name="arrow-up" v-if="detail"   color="#acacac" size="24"></u-icon>
+							<u-icon name="arrow-up" v-if="item.show"   color="#acacac" size="24"></u-icon>
 						<u-icon name="arrow-down" v-else color="#acacac" size="24"></u-icon>
 						</view>
 					</view>
 
 
                 <!-- 详情 -->
-					<view class="detail" v-if="detail">
-						<view class="item" v-for="item in 3" >
+					<view class="detail" v-show="item.show">
+						<view class="item" v-for="(it,j) in item.recordList" :key="j" >
 							<!-- 时间段 -->
 							<view class="time-slot">
 								<view class="title">
-									06-30 21:00-24:00
+									{{get(it.createTime,0)}}
 								</view>
 								<view class="value">
-									0.5
+									{{it.fee}}
 								</view>
 							</view>
 							<!-- 总计 -->
 							<view class="total">
 								<view class="total-time">
-									3小时
+									{{get(it.createTime,1)}}
 								</view>
 								<view class="total-degrees">
-									1
+									{{it.kwh}}
 								</view>
 							</view>
 						</view>
 					</view>
 				</view>
+					<u-divider :isnone="info.list.length==0" nonetext="没有找到相关内容"
+					border-color="#CFD2D5">已经到底了</u-divider>
 
-				<view class="statistics-item" v-for="item in 8" >
-					<view class="item-top">
-						<view class="content">
-							<!-- 电费 -->
-							<view class="electricity">
-								<view class="electricity-title">
-									电梯电表节省电费
-								</view>
-								<view class="electricity-number">
-									108.25元
-								</view>
-							</view>
-							<!-- 节省度数 -->
-							<view class="electric-quantity">
-								<view class="electric-quantity-title">
-									节省度数
-								</view>
-								<view class="electric-quantity-number">
-									125.33度
-								</view>
-							</view>
-						</view>
-
-						<view class="icon" @click="detail=!detail" >
-							
-							<u-icon name="arrow-up" v-if="detail"   color="#acacac" size="24"></u-icon>
-						<u-icon name="arrow-down" v-else color="#acacac" size="24"></u-icon>
-						</view>
-					</view>
-
-				</view>
-
+			
 			</view>
-
+	
 		</view>
 
 
@@ -132,6 +108,11 @@
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/revenue.js'
+	import {
+			newDate,hourDistance
+		} from '@/apis/utils'
+		
 	export default {
 		data() {
 			return {
@@ -139,10 +120,201 @@
 				tabShow2: false,
 				detail:true,
 				selector: [1, 2, 3],
+				id: "",
+				companyId: "",
+				info: {
+					list:[]
+				},
+				list: [],
+				queryDate: "",
+				queryMonth: "",
+				monthQuery: "",
+				params: {
+					year: true,
+					month: true,
+					day: false,
+					hour: false,
+					minute: false,
+					second: false
+				},
+				tabsFrom: {
+					show1: false,
+					show1Index: 0,
+					show2Index: '',
+					show2: false,
+					show1Text: "全部",
+					show2Text: "全部时间",
+					selector1: [
+					]
+				},
+				endYear: "",
+				type:0,
+				
+			}
+		},
+		computed:{
+			typeName(){
+				//type 1分摊2线损3停电
+				if(this.type==1){
+					return '分摊'
+				}
+				if(this.type==2){
+					return '线损'
+				}
+				if(this.type==3){
+					return '节约'
+				}
+				return ''
 			}
 		},
+		onLoad(op) {
+			this.endYear = new Date().getFullYear()
+			this.id = op.id
+			this.type = op.type
+			var date =  newDate(op.query)
+			this.queryDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-1"
+			this.queryMonth = date.getFullYear() + "年" + (date.getMonth() + 1) + "月"
+			this.tabsFrom.show2Index =  date.getFullYear() + "-" + (date.getMonth() + 1) 
+			
+			this.tabsFrom.show2Text = this.queryMonth
+			this.monthQuery = (date.getMonth() + 1)
+			//this.getInfo()
+			this.getCompanyList()
+		},
 		methods: {
-
+			showBtn(item){
+				console.log(1)
+				if(item.show==null){
+					item.show=false
+				}
+				
+				
+				item.show=!item.show
+				this.$forceUpdate()
+			},
+			get(time,t){
+				//time="2024-08-01 11:11-2024-08-03 12:21"
+				
+				var str=''
+				try{
+					
+					var sz1=time.substring(0,16)
+					var sz2=time.substring(17)
+					var time1=newDate(sz1)
+					var time2=newDate(sz2)
+					if(time1.getFullYear()!=time2.getFullYear()){
+						if(!t){
+							str='开始时间:'+sz1
+						}else{
+							str='结束时间:'+sz2
+						}
+					}else if(time1.getMonth()!=time2.getMonth()){
+						if(!t){
+							str=sz1+"至"+sz2.substring(5)
+						}else{
+							str=hourDistance(time1,time2,1)
+						}
+					}else {
+						if(!t){
+							str=sz1.substring(5)+"至"+sz2.substring(5)
+						}else{
+							str=hourDistance(time1,time2,1)
+						}
+					}
+					
+				}catch(e){
+					//TODO handle the exception
+					console.log("111111",time)
+					if(!t){
+						str=time
+					}else{
+						str='无'
+					}
+				}
+				
+				return str
+			},
+			selector2confirm(e) {
+			
+				this.tabsFrom.show2Text = e.year + "年" + e.month + "月"
+			
+				this.tabsFrom.show2Index = e.year + "-" + e.month
+				this.queryMonth = e.year + "年" + e.month + "月"
+				this.queryDate = e.year + "-" + e.month + "-1"
+			
+				
+				this.getInfo()
+			},
+			selector1confirm(e, b) {
+			
+				var index = e[0]
+				this.tabsFrom.show1Index = index
+				this.tabsFrom.show1Text = this.tabsFrom.selector1[index].label
+				this.companyId = this.tabsFrom.selector1[index].value;
+			
+				if (!b) {
+					this.getInfo()
+				}
+			},
+			getInfo() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.platformRevenueTypeList({
+					companyId: this.companyId,
+					queryDate: this.queryDate,
+					type:this.type
+				}).then((response) => {
+					uni.hideLoading();
+					var list = response.data.incomeList
+					if (list.length) {
+						this.info = list[0]
+						
+					}else{
+						this.info = {}
+					}
+			
+			
+			
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			getCompanyList() {
+			
+				API.platformCompanyList({
+					parentId:this.id
+				}).then((response) => {
+					//uni.hideLoading();
+					var list = response.data.companyInfoList;
+					
+					if(list.length){
+						this.companyId=list[0].id
+						this.tabsFrom.selector1 = list.map((item) => {
+									
+							return {
+								label: item.name,
+								value: item.id
+							}
+						})
+						
+						this.selector1confirm([0], true)
+						this.getInfo()
+					}
+					
+			
+			
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
 		}
 	}
 </script>
@@ -233,6 +405,7 @@
 
 						.electricity-number {
 							color: rgba(22, 119, 255, 1);
+							white-space: pre;
 
 						}
 					}
@@ -280,7 +453,9 @@
 					align-items: center;
 					justify-content: space-between;
 					.total-time{
-						color: rgba(119,119,119,1);
+						font-size: 32rpx;
+						color: rgba(51,51,51,1);
+						//color: rgba(119,119,119,1);
 						
 					}
 					.total-degrees{

+ 14 - 9
pages/statistics/statistics.vue

@@ -315,16 +315,16 @@
 						</view>
 						<!--  -->
 						<view class="contractListClass"  v-for="(item,i) in platformRevenueList"
-						 v-show="item.type!=1"
-						@click="gotoUrl('/pages/platformRevenueStatistics/platformRevenueStatistics?id='+item.id)"
+						 v-show="item.totalFee!=0"
+						@click="gotoUrl('/pages/platformRevenueStatistics/platformRevenueStatistics?id='+item.companyId)"
 						 :key="i"
 						>
 							<view class="contractListClass1">
-								<view class="class1">{{item.name}}</view>
+								<view class="class1">{{item.companyName}}</view>
 								<view class="class2">{{month}}月预计收入</view>
 							</view>
 							<view  class="contractListClass2">
-								{{item.incomeFee}}
+								{{item.totalFee}}
 								<u-icon name="arrow-right" v-if="0"  style="margin-left: 12rpx;" size="24" color="#838383"></u-icon>
 							</view>
 						</view>
@@ -945,7 +945,8 @@
 					id:"",
 					list:[]
 				},
-				popShow1:false,
+				popShow1:false,
+				userInfo:{},
 			}
 		},
 		onLoad() {
@@ -955,7 +956,9 @@
 			 this.month=date.getMonth() + 1
 			this.endYear = new Date().getFullYear();
 			this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
-			this.datacompanyInfo=this.carhelp.getPersonInfoPlus().companyInfo
+			this.datacompanyInfo=this.carhelp.getPersonInfoPlus().companyInfo
+			this.userInfo=this.carhelp.getPersonInfo()
+			
 			this.getfindByOpenId();
 			this.getCompanyInfoList();
 			
@@ -997,7 +1000,7 @@
 				return num
 			},
 			incomeExpenditureBl(){
-				return this.childInfo.type!=4&&(this.childInfo.styleTemplate==1)
+				return this.childInfo.type!=4&&(this.childInfo.styleTemplate==1)&&!this.userInfo.authorizedMeterEnabled
 			},
 			childListName(){
 				return this.childInfo.name;
@@ -1201,7 +1204,8 @@
 			
 				API_index.findByOpenId({
 					openId: this.carhelp.getOpenId()
-				}).then((response) => {
+				}).then((response) => {
+					
 					if(response.data&&response.data.companyInfo){
 						this.datacompanyInfo=response.data.companyInfo
 						this.companyInfotype = response.data.companyInfo.type;
@@ -1224,6 +1228,7 @@
 						}
 						
 					}
+					this.userInfo=this.carhelp.getPersonInfo()
 					
 					
 				}).catch(error => {
@@ -1837,7 +1842,7 @@
 					queryDate:queryDate
 				}).then((response) => {
 					this.getPlatformRevenueReady=true
-					this.platformRevenueList=response.data.companyInfoList
+					this.platformRevenueList=response.data.incomeList
 				}).catch(error => {
 					uni.showToast({
 						title: error,

+ 52 - 12
pages/timing/autoOff.vue

@@ -127,10 +127,14 @@
 					<view class="time-slot">
 						智能停电条件
 					</view>
-					<view class="type">
-						{{formData.maxPower!=''?formData.maxPower+'kW':'未设置'}}
+					<view class="type" v-if="maxPower">
+						功率阈值:{{maxPower}}kW,持续时间{{closeMinute}}分钟后“自动停电”
+					
 					</view>
+					<view class="type" v-else>
+						未设置
 					
+					</view>
 					
 				</view>
 
@@ -144,8 +148,8 @@
 				<view class="time">
 					
 					<view class="type">
-						1. 智能停电条件:智能停电是功率大于等于阈值持续达到定时间后;<br/>
-						2. 达到智能停电条件后“自动停电”,1分钟后复电源供电;<br/>
+						1. 智能停电条件:智能停电是功率大于等于阈值持续达到定时间后;<br/>
+						2. 达到智能停电条件后“自动停电”,1分钟后复电源供电;<br/>
 						3.“智能停电”结束时,如果处于停电状态将打开电源供电;
 
 					</view>
@@ -324,9 +328,14 @@
 					智能停电条件:功率(kW)
 				</view>
 				<view class="input" style=" padding: 0 24rpx;">
-				  	<u-input type="digit" min="1"
+				  	<u-input type="digit" min="1" placeholderStyle="#777777"
 					 v-model="maxPower" placeholder="填写智能停电条件:功率数值" />
 				</view>
+				<view class="input" style=" padding: 24rpx 24rpx;">
+				  	<u-input type="digit" min="1"  placeholderStyle="#777777"
+					 v-model="closeMinute" placeholder="设置触发条件后多长时间自动断电(分钟)" />
+				</view>
+				
 				<view class="btn-group">
 					<view class="btn cancel" @click="thresholdsPopup=false" >
 						取消
@@ -418,8 +427,10 @@ import {
 					id:"",
 					endTime:"",
 					maxPower:"",
+					closeMinute:"",
 				},
 				progressColor:"#53b56b",
+				closeMinute:"",
 				
 				
 			}
@@ -620,6 +631,7 @@ import {
 						this.endTime=timerSwitch.startTime
 					}
 					this.maxPower=this.formData.maxPower
+					this.closeMinute=this.formData.closeMinute
 					
 				}).catch(error => {
 					uni.showToast({
@@ -629,10 +641,19 @@ import {
 				})
 			},
 			thresholdsPopupApi(){
-				if(this.maxPower!=''){
+				
+				if(this.maxPower!=''&&this.closeMinute!=''){
+					this.maxPower=parseInt(this.maxPower)
+					this.closeMinute=parseInt(this.closeMinute)
+					
 					if(this.maxPower<=0){
 						uni.showToast({
-							title: "请输入大于0的功率阈值(kw)",
+							title: "请输入大于0的功率阈值(kW)",
+							icon: "none"
+						})
+					}else if(this.closeMinute<=0){
+						uni.showToast({
+							title: "请输入大于0的自动断电时间(分钟)",
 							icon: "none"
 						})
 					}else{
@@ -641,10 +662,19 @@ import {
 					}
 				
 				}else{
-					uni.showToast({
-						title: "请填写智能停电条件:功率(kw)",
-						icon: "none"
-					})
+					if(this.maxPower==''){
+						uni.showToast({
+							title: "请填写智能停电条件:功率(kW)",
+							icon: "none"
+						})
+					}
+					if(this.closeMinute==''){
+						uni.showToast({
+							title: "设置触发条件后多长时间自动断电(分钟)",
+							icon: "none"
+						})
+					}
+					
 				}
 			},
 			pickerShow1confirm2(e){
@@ -787,14 +817,24 @@ import {
 				}
 				if(this.formData.switchStatus==3&&this.maxPower==''){
 					uni.showToast({
-						title: "请填写智能停电条件:功率(kw)",
+						title: "请填写智能停电条件:功率(kW)",
+						icon: "none"
+					})
+					return
+				}else if(this.formData.switchStatus==3&&this.closeMinute==''){
+					uni.showToast({
+						title: "设置触发条件后多长时间自动断电(分钟)",
 						icon: "none"
 					})
 					return
 				}else{
 					this.formData.maxPower=this.maxPower;
+					this.formData.closeMinute=this.closeMinute;
+					this.formData.openMinute=1;
 					if(!this.formData.maxPower){
 						this.formData.maxPower=''
+						this.formData.closeMinute='';
+						this.formData.openMinute='';
 					}
 				}