瀏覽代碼

用水量

zhengkaixin 9 月之前
父節點
當前提交
fa42981823

+ 6 - 0
assets/img/mine/iconPark-water-level.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 48 48" width="24" height="24" style="border-color: rgba(187,187,187,1);border-width: 0;border-style: solid" filter="drop-shadow(0px 2px 4px rgba(0,98,52,1))">
+    
+    <g>
+    <rect width="48" height="48" fill="rgba(255,255,255,1)" fill-opacity="0.01" stroke="none"></rect><path fill-rule="evenodd" clip-rule="evenodd" d="M24 44C32.2843 44 39 37.2843 39 29C39 15 24 4 24 4C24 4 9 15 9 29C9 37.2843 15.7157 44 24 44Z" stroke="rgba(255,255,255,1)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" fill="none"></path><path d="M9 29C9 37.2843 15.7157 44 24 44C32.2843 44 39 37.2843 39 29C39 29 30 32 24 29C18 26 9 29 9 29Z" fill="none" stroke="rgba(255,255,255,1)" stroke-width="4" stroke-linejoin="round"></path>
+    </g>
+  </svg>

+ 6 - 0
assets/img/statistics/fa5-bolt-fas.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 320 512" width="16" height="16" style="" filter="none">
+    
+    <g>
+    <path d="M296 160H180.6l42.6-129.8C227.2 15 215.7 0 200 0H56C44 0 33.8 8.9 32.2 20.8l-32 240C-1.7 275.2 9.5 288 24 288h118.7L96.6 482.5c-3.6 15.2 8 29.5 23.3 29.5 8.4 0 16.4-4.4 20.8-12l176-304c9.3-15.9-2.2-36-20.7-36z" fill="rgba(22,119,255,1)"></path>
+    </g>
+  </svg>

+ 6 - 0
assets/img/statistics/fas fa-tint.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 352 512" width="16" height="16" style="" filter="none">
+    
+    <g>
+    <path d="M205.22 22.09c-7.94-28.78-49.44-30.12-58.44 0C100.01 179.85 0 222.72 0 333.91 0 432.35 78.72 512 176 512s176-79.65 176-178.09c0-111.75-99.79-153.34-146.78-311.82zM176 448c-61.75 0-112-50.25-112-112 0-8.84 7.16-16 16-16s16 7.16 16 16c0 44.11 35.89 80 80 80 8.84 0 16 7.16 16 16s-7.16 16-16 16z" fill="rgba(0,185,98,1)"></path>
+    </g>
+  </svg>

+ 7 - 0
pages.json

@@ -480,6 +480,13 @@
         	{
         		"navigationBarTitleText" : ""
         	}
+        },
+        {
+        	"path" : "pages/equipmentDataMonitoring/equipmentElectricityWater",
+        	"style" : 
+        	{
+        		"navigationBarTitleText" : ""
+        	}
         }
       
        

+ 1357 - 0
pages/equipmentDataMonitoring/equipmentElectricityWater.vue

@@ -0,0 +1,1357 @@
+<template>
+	<view>
+		<view class="navbar-c">
+			<view class="back" @click="backStatistics">
+				<u-icon name="arrow-left" color="#101010" size="36"></u-icon>
+			</view>
+			<view class="title">
+				用水量(度)
+				<image class="img" src="@/assets/img/refresh-line.svg" @click="getList(true)"></image>
+			</view>
+
+		</view>
+		<u-select title="" v-model="tabsFrom.show1" :defaultValue="[current2]"
+		 :list="childList" value-name="id" label-name="name"
+			@confirm="selector1confirm"  >
+		</u-select>
+		
+		<u-picker-select title="日期选择" v-model="tabsFrom.show2" :defaultTime="tabsFrom.show2Index" :endYear="endYear"
+			mode="time" :params="params" :noselect="false" @confirm="selector2confirm" @cancel="selector2cancel"
+			@reset="selector2reset"></u-picker-select>
+		<!-- 标签 -->
+		<view class="tabs-box" >
+			
+			<view class="tabs" :class="'tabs-len-'+merchantList1.length"  v-show="companyList.length>1"
+			 :style="{width: companyList.length>3 ? '' : '100%'}">
+				<u-tabs-one  v-if="utabsone"
+				:list="merchantList1" :is-scroll="false" inactive-color="#999999" active-color="#666666"
+				 :current="current" @change="change"></u-tabs-one>
+			</view>
+			<view class="more" @click="popShow=true" v-if="companyList.length >= 4">
+				<u-icon name="arrow-down" color="#fff" size="40"></u-icon>
+			</view>
+		</view>
+		<!-- 标签弹出层 -->
+		<u-popup v-model="popShow" duration="10" mode="top" :negative-top="88" border-radius="16">
+			<view class="popup-tabs">
+				<view class="tabs">
+					<u-tabs :list="merchantList1" :is-scroll="false" :current="current" @change="change"></u-tabs>
+				</view>
+				<view class="more">
+					<u-icon name="arrow-up" color="#777777" size="40" @click="popShow=false"></u-icon>
+				</view>
+			</view>
+			<view class="tabs-options">
+				<view class="item" v-for="(item, index) in merchantList2" :key="index"
+					@click="merchantChange(item,index)">
+					{{item.name}}
+				</view>
+			</view>
+		</u-popup>
+
+		<view class="electronicMonitoring-title"
+		 @click="titleCk"
+		 v-if="childList&&childList.length>0" >
+			<view>
+				{{childListName}}
+			</view>
+			<view v-show="childList.length>1">
+				<u-icon name="arrow-down" color="#fff"></u-icon>
+			</view>
+		</view>
+
+		<!-- 全部标签 -->
+		<view class="main"    >
+			
+			
+			
+			<view class="item" v-for="(item, index) in kWhList" :key="item.index" 
+			@click="toElectronicMonitoring(item)">
+				<view class="item-content">
+					<view class="equipment">
+						<view class="equipment1 ">
+							{{replaceLastTwoWords(item.name)}}
+						</view>
+						<view class="equipment2">
+							{{item.installationAddressSimple}}
+						</view>
+
+						<view class="state" v-if="!item.online">
+							<view class="dot off-line"></view>
+							<view class="text">离线</view>
+						</view>
+						<view class="state state2" v-else>
+							<view class="dot on-line"></view>
+							<view class="text">在线</view>
+						</view>
+					</view>
+					<view class="electricity">
+						<view class="electricity-item electricity-item-day">
+							<view class="date">
+								今日
+							</view>
+							<view class="number">
+								{{item.thisDayKwh}}
+							</view>
+						</view>
+						<view class="electricity-item">
+							<view class="date">
+								本月
+							</view>
+							<view class="number">
+								{{item.thisMonthKwh}}
+							</view>
+						</view>
+						<view class="electricity-item">
+							<view class="date">
+								上月
+							</view>
+							<view class="number">
+								{{item.lastMonthKwh}}
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="more">
+					<u-icon name="arrow-right" color="#d4d4d4" size="24"></u-icon>
+				</view>
+			</view>
+			
+		</view>
+		<u-divider  :isnone="kWhList.length==0" nonetext="暂无数据" border-color="#CFD2D5">已经到底了</u-divider>
+		
+		
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/pagejs/index.js'
+	import * as API2 from '@/apis/pagejs/energyManage.js'
+	import * as echarts from 'echarts';
+	import {
+		parseUnixTime,
+		beforeTimeStamp,
+		getWeek
+	} from '@/apis/utils'
+	import TreeBody from '@/components/tree/tree-body.vue';
+	
+	import electronicMonitoring from '@/pages/equipmentDataMonitoring/electronicMonitoring.vue'
+	
+	
+	export default {
+		components: {
+		  TreeBody,electronicMonitoring
+		},
+		data() {
+			return {
+				codes:"",
+				getHomePageManageReady:false,
+				getHomePageManageshowLoading:false,
+				companyList: [], // 商户
+				merchantList1: [],
+				merchantList2: [],
+				myLineChart: null, // 图表
+				myBarChart: null,
+				myPieChart: null,
+				homePageManageType: 2,
+				homePageManageObj: {
+					chargeKwh: 0,
+					lostKwh: 0,
+					parkKwh: 0,
+					freeKwh:0,
+					publicKwh:0,
+				},
+				meterList: [],
+				meterListShow:{},
+				queryDate: '',
+				kWhList: [], //设备
+				 
+				companyId: '',
+				popShow: false,
+				current: 0,
+				allKWhList: [],
+				companyKwhList: [],
+				pageIndex: 1,
+				recordsTotal: 0,
+				windowHeight: '',
+				checked:false,
+				list: [{
+						name: '上月',
+						value: "2"
+					},
+					{
+						name: '当月',
+						value: "1"
+					},
+					{
+						name: '今日',
+						value: "4"
+					}, {
+						name: '当年',
+
+						value: "3"
+					}, {
+						name: '合计',
+
+						value: "0"
+					},
+					{
+						name: '指定月份',
+						value: "10"
+					}
+				],
+				endYear: '',
+				params: {
+					year: true,
+					month: true,
+					day: true,
+					hour: false,
+					minute: false,
+					second: false
+				},
+				value: '2',
+				clickType: -1,
+				tabsFrom: {
+					show1: false,
+					show1Index: 0,
+					show2Index: '',
+					show2: false,
+					show1Text: "全部类型",
+					show2Text: "全部时间",
+					
+				},
+				utabsone:true,
+				//companyType:0,
+				incomeExpenditureObj:{},
+				opCompanyId: '',
+				childList:[],
+				companyListMain:[],
+				current2:0,
+				childInfo:{},
+				companyInfo:{}
+			}
+		},
+		onReady() {
+		
+			
+			
+		},
+		computed:{
+			childListName(){
+				return this.childInfo.name;
+			},
+			companyType(){
+				return this.companyInfo.type;
+			}
+		},
+		onLoad(op) {
+			this.endYear = new Date().getFullYear();
+			this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
+			
+			
+			if(op.companyId){
+				this.opCompanyId=op.companyId
+				this.companyId=op.companyId
+				
+			} 
+			else{
+				this.getCompanyInfoList();
+			}
+			this.getList();
+			
+		},
+		onReachBottom() {
+			if (this.kWhList.length < this.recordsTotal) {
+				this.myLoadmore();
+			}
+		},
+	
+		methods: {
+			titleCk() {
+				if(this.childList.length>1){
+					this.tabsFrom.show1 = true
+				}
+				
+			},
+			selector1confirm(e) {
+				//this.getHomePageKwh()
+				
+				console.log(e)
+				this.companyId=e[0].value
+			
+				this.current2=e[0].i
+				
+				this.childInfo=this.childList[this.current2];
+				uni.showLoading()
+				
+				this.merchantChangeApi()
+			},
+			companyIdSet(val,item){
+				
+				this.companyType= 0
+				if(val&&item){
+					this.companyType= item.type
+				}else{
+					if(!val){
+						
+					}else{
+						var bl=false
+						this.companyList.find(item=>{
+							
+							if(item.id==val){
+							
+								this.companyType= item.type;
+							}
+						})
+						
+					}
+				}
+				
+			},
+			switchBtnApiMethod(node,key){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API2.remoteSwitch({
+					meterId:node.id,
+					enabled:key
+				}).then((res) => {
+					uni.hideLoading();
+					node.switchStatus=key
+					
+				}).catch(error => {
+					
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			switchBtnApi(node,key){
+				uni.showModal({
+					confirmColor:`${key?'#3CC51F':'red'}`,
+					confirmText:`${key?'开启':'关闭'}`,
+					content: `确认是否要"${key?'开启':'关闭'}"${this.replaceLastTwoWords(node.name)}`,
+					title: "提示",
+					success:res=> {
+						if(res.confirm){
+							this.switchBtnApiMethod(node,key);
+						}
+					}
+				})
+				console.log(node,key)
+			},
+			refreshList() {
+				// if (this.current != 0) {
+					
+				// } else {
+				// 	this.getCompanyInfoList();
+				// }
+				this.getList(true);
+			},
+			companyChange(item, index) {
+				this.current = index + 1;
+				this.companyId = item.id;
+				//this.companyIdSet(this.companyId)
+				this.getList(true);
+			},
+			
+			getCompanyInfoList() {
+				this.companyKwhList = [];
+
+				API.deviceCompanyList().then((response) => {
+					var list = response.data.companyInfoList;
+					this.companyListMain=response.data.companyInfoList;
+					if(list.length==1&&list[0].childList&&list[0].childList.length){
+						list=list[0].childList
+						
+					}
+					
+					this.companyList = list;
+					
+					var mList1 = [];
+					var mList2 = [];
+					mList1.push({
+						id: '',
+						name: '全部'
+					});
+
+					for (var i = 0; i < list.length; i++) {
+						if (i >= 3) {
+							mList2.push(list[i]);
+						} else {
+							mList1.push(list[i]);
+						}
+
+						
+					}
+
+					this.merchantList1 = mList1;
+					this.merchantList2 = mList2;
+					this.companyId = mList1[0].id;
+					//this.companyIdSet(this.companyId)
+					//this.getList();
+
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			myLoadmore() {
+				this.pageIndex += 1;
+				this.getList();
+			},
+			getList(bl) {
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				if (bl) {
+					this.kWhList = [];
+					this.pageIndex = 1;
+				}
+				var data = {
+					pageIndex: this.pageIndex,
+					pageSize: 20,
+					companyId: this.companyId
+				};
+				API.homePageKwh(data).then((res) => {
+					uni.hideLoading();
+					this.kWhList = [
+						...this.kWhList,
+						...res.data.data
+					];
+					this.recordsTotal = res.data.recordsTotal;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			getHomePageKwh(companyId) {
+				
+				
+			},
+			merchantChange(item, index) {
+				if(this.current==0){
+					this.current=1;
+				}
+				var m = company;
+				var n = this.merchantList1[this.current];
+				this.merchantList1[this.current] = m;
+				this.merchantList2[index] = n;
+				//this.$forceUpdate()
+				this.utabsone=false
+				this.companyId = company.id;
+				
+				this.companyInfo=company
+				
+				
+				if(company.id!=''){
+					this.childList=company.childList;
+					if(this.childList&&this.childList.length){
+						this.companyId = this.childList[0].id;
+						this.childInfo=this.childList[0]
+					}else{
+						this.childList=[]
+						this.companyId =company.id
+						this.childInfo=company
+					}	
+				}else{
+					this.companyId =''	
+				}
+				
+				this.merchantChangeApi()
+				this.popShow = false;
+				
+			},
+			
+			
+			// 设备数据监测
+			getHomePageManageChildMeter(item,bl) {
+				// if(!bl){
+				// 	uni.showLoading({
+				// 		title: "加载中",
+				// 		mask: true,
+				// 	})
+				// }
+				
+				API2.homePageManageChildMeter({
+					parentMeterId:item.id,
+					queryDate:this.queryDate,
+					companyId: this.companyId,
+					type: this.list[this.homePageManageType].value
+				}).then((response) => {
+					// if(!bl){
+					// 	uni.hideLoading();
+					// }
+					// this.meterList = response.data.meterList;
+					// if(!this.meterListShow.id){
+					// 	this.meterListShow.id=1
+					// 	this.recursionList(this.meterList)
+					// }
+					
+					var childMeterList=response.data.childMeterList
+					item.childMeterList=childMeterList
+					 
+					
+					if(!bl){
+						for(var i in childMeterList){
+							var obj=childMeterList[i]
+							this.getHomePageManageChildMeter(obj,true)
+						}
+					}
+					
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			getIncomeExpenditure(){
+				
+				API2.incomeExpenditure({
+					//parentMeterId:item.id,
+					queryDate:this.queryDate,
+					companyId: this.companyId,
+					type: this.list[this.homePageManageType].value
+				}).then((response) => {
+					
+					this.incomeExpenditureObj=response.data
+					this.incomeExpenditureObj.id=1
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			// 设备数据监测
+			
+			// 设备数据监测
+			getHomePageManage(bl) {
+				
+				this.getHomePageManageReady=false
+				if(bl){
+					this.getHomePageManageshowLoading=false
+					
+				}else{
+					uni.showLoading({
+						title: "加载中",
+						mask: true,
+					})
+				}
+				
+				// uni.showLoading({
+				// 	title: "加载中",
+				// 	mask: true,
+				// })
+				this.incomeExpenditureObj={}
+				API2.homePageManage({
+					queryDate:this.queryDate,
+					companyId: this.companyId,
+					type: this.list[this.homePageManageType].value
+				}).then((response) => {
+					//uni.hideLoading();
+					
+					this.getHomePageManageReady=true
+					if(bl){
+						
+						this.getHomePageManageshowLoading=true
+					}else{
+						uni.hideLoading();
+					}
+					
+					 this.utabsone=true;
+					
+					
+					this.codes =this.carhelp.getPersonInfo().codes;
+					
+					this.meterList = response.data.meterList;
+					// this.$nextTick(()=>{
+					// 	this.$refs.mytree.toggle()
+					// })
+					
+					this.homePageManageObj = response.data;
+					if(this.companyType!=4&&this.homePageManageObj.showPark){
+						this.$nextTick(()=>{
+							this.myBarChart=null;
+								this.getBarCharts()
+						})
+						
+						this.getIncomeExpenditure();
+					}
+				
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			sectionChange(index) {
+				this.clickType = this.homePageManageType;
+				this.homePageManageType = index;
+				if (index == 5) {
+					this.tabsFrom.show2 = true;
+					this.params.day = false;
+				} else {
+					this.list[5].name = '指定月份'
+					this.getHomePageManage()
+				}
+				
+				
+			},
+			recursionList(list){
+				if(list){
+					for(var i in list){
+						var obj=list[i]
+					
+						this.meterListShow[obj.id]=false
+						this.recursionList(obj.childMeterList)
+					}
+				}
+			},
+			ifBtnShow(item){
+				return this.meterListShow[item.id]
+			},
+			showBtn(item){
+				var key=this.meterListShow[item.id];
+				
+				this.$set(this.meterListShow,item.id,!key)
+				console.log("showBtn,",key)
+				this.getHomePageManageChildMeter(item);
+				this.$forceUpdate()
+			},
+			selector2reset(e) {
+				console.log(e)
+				this.tabsFrom.show2Text = '全部时间'
+				this.tabsFrom.show2Index = '';
+			
+				if (e.day) {
+					this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
+					
+					this.getHomePageManage();
+				} else {
+				
+					this.homePageManageType = this.clickType;
+					if (this.homePageManageType != 5) {
+						this.list[5].name = '指定月份';
+					}
+					this.getHomePageManage();
+				}
+			},
+			selector2cancel() {
+				if(this.clickType != -1) {
+					
+				}
+				this.homePageManageType = this.clickType;
+			},
+			selector2confirm(e) {
+				this.tabsFrom.show2Text = e.year + "年" + e.month + "月"
+			
+				this.tabsFrom.show2Index = e.year + "-" + e.month
+				if (e.day) {
+					this.tabsFrom.show2Text += e.day + "日"
+					this.tabsFrom.show2Index += '-' + e.day
+			
+					this.queryDateMethod(this.tabsFrom.show2Index, true)
+				} else {
+					this.queryDateMethod(this.tabsFrom.show2Index, false)
+				}
+			},
+			queryDateMethod(queryTime, day) {
+			
+				if (day) {
+					this.queryDate = queryTime;
+					
+				} else {
+			
+					this.queryDate = queryTime + "-01";
+					
+					this.homePageManageType = "5";
+					this.list[5].name = queryTime;
+			
+					this.getHomePageManage();
+				}
+			},
+			getBarCharts() {
+				if (!this.myBarChart) {
+					this.myBarChart = echarts.init(document.getElementById('barEcharts-statistics'),null,{
+						width:uni.upx2px(620),height:uni.upx2px(740)
+					});
+				}
+				this.myBarChart.clear()
+				var data=[
+					
+					
+					{
+						name:"总表电量",
+						key:"parkKwh",
+						color:"#307af6"
+					},
+					{
+						name:"计费电量",
+						key:"chargeKwh",
+						color:"#52b8aa"
+					},
+					{
+						name:"自用电量",
+						key:"freeKwh",
+						color:"#53b56b"
+					},
+					{
+						name:"公用电量",
+						key:"publicKwh",
+						color:"#ef8132"
+					},
+					{
+						name:"电损量",
+						key:"lostKwh",
+						color:"#dc4441"
+					}
+				]
+				var dataName=[]
+				var dataSeries=[]
+				for(var i in data){
+					var it=data[i]
+					dataName.push(it.name)
+					dataSeries.push({})
+				}
+				for(var i in data){
+						var it=data[i]
+						dataSeries[data.length-i-1]={
+							name:it.name,
+							type: 'bar',
+							itemStyle:{
+								color:it.color
+							},
+							data: [
+								
+								this.homePageManageObj[it.key]
+							],
+							coordinateSystem: 'polar',
+							label: {
+								show: true,
+								position: 'start',
+								formatter: '{c}度'
+							}
+						}
+						
+					}
+					
+					
+					
+				
+				
+				
+				
+				var option = {
+					  
+					polar: {
+						  center:['50%','58%'],
+						radius:[25, '80%']
+					},
+					angleAxis: {
+						
+						startAngle: 75,
+						 label: {
+						             rotate: 45, // 旋转标签,使得重叠的概率降低
+						         //    margin: 5    // 设置标签与轴线之间的距离,增加空间
+						         }
+					},
+					 
+					 legend: {
+						itemGap:5,
+						  
+
+					    data: dataName,
+						//orient :'vertical'
+					  },
+					radiusAxis: {
+						type: 'category',
+						data: ['']
+					},
+					tooltip: {},
+					
+					series: dataSeries
+				};
+				console.log(option)
+				this.myBarChart.setOption(option);
+			},
+			merchantChangeApi() {
+			
+				this.popShow=false
+				
+				this.getList(true)
+				
+			},
+			change(index) {
+				this.current = index;
+				this.current2=0;
+				this.childList=[]
+				var company= this.merchantList1[index]
+				if(company.id!=''){
+					this.childList=company.childList;
+					if(this.childList&&this.childList.length){
+						this.companyId = this.childList[0].id;
+						this.childInfo=this.childList[0]
+					}else{
+						this.childList=[]
+						this.companyId =company.id
+						this.childInfo=company
+					}
+					
+					
+				}else{
+					this.companyId =''
+					
+				}
+				this.companyInfo=company;
+				
+				this.merchantChangeApi()
+			},
+			backStatistics() {
+				uni.navigateBack()
+			},
+			toElectronicMonitoring(item) {
+				uni.navigateTo({
+					url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item
+						.name +
+						'&companyId=' + item.companyId
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.incomeExpenditureClass{
+		    display: flex;
+		    justify-content: space-evenly;
+		    width: 100%;
+			padding:32rpx 0;
+			.income1:last-child{
+				.income11,.income12{
+					    border-right: 1px solid #c5c3c3;
+				
+				}
+			}
+		.income1{
+			.income121{
+				font-size: 24rpx;
+					color:#c5c3c3;
+			}
+			    width: 33.33%;
+			 text-align: center;
+			.income11{
+				padding:12rpx 0;
+				background-color: #1677FF ;
+				color:#fff;
+				// font-size: 36rpx;
+				font-size: 32rpx;
+				border-top: 1px solid #c5c3c3;
+				border-left: 1px solid #c5c3c3;
+	
+			}
+			
+			.income12{
+				padding:12rpx 0;
+				border-top: 1px solid #c5c3c3;
+				border-bottom: 1px solid #c5c3c3;
+				border-left: 1px solid #c5c3c3;
+				font-size: 40rpx;
+			}
+			
+		}
+		
+	}
+	
+	
+
+	.back {
+		z-index: 999;
+		width: 200rpx;
+	}
+
+	/deep/.u-drawer-content {
+		margin-top: 88rpx;
+	}
+
+	// /deep/.u-tab-item {
+	// 	width: 25% !important;
+	// 	flex: none !important;
+	// }
+
+	.tabs-box {
+		background-color: #fff;
+		display: flex;
+		align-items: center;
+		
+		padding-right: 32rpx;
+		justify-content: space-between;
+		border-bottom: 1px solid rgba(232, 232, 232, 1);
+
+		.tabs {
+			width: 97%;
+		}
+		.more{
+			padding-right: 12rpx;
+		}
+
+		.icon {
+			margin-left: auto;
+			margin-right: 24rpx;
+		}
+	}
+	.tabs-len-1{
+		
+	}
+	.tabs-len-2{
+		/deep/.u-tab-item {
+			// max-width: 39% !important;
+			// flex: none !important;
+		}
+	}
+	.tabs-len-3{
+		/deep/.u-tab-item {
+			max-width: 39% !important;
+			flex: none !important;
+		}
+	}
+	.tabs-len-4{
+		/deep/.u-tab-item {
+			max-width: 26% !important;
+			flex: none !important;
+		}
+	}
+	/deep/.u-tab-item:first-child {
+		width: 20% !important;
+		flex: none !important;
+	}
+	
+	.popup-tabs {
+		background-color: #fff;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding-right: 32rpx;
+		color: rgba(51, 51, 51, 1);
+		font-size: 32rpx;
+		padding-top: 32rpx;
+
+		.tabs {
+			width: 88%;
+		}
+	}
+
+	.tabs-options {
+		display: flex;
+		padding: 64rpx 32rpx 0;
+		flex-wrap: wrap;
+
+		.item {
+			width: 25%;
+			margin-bottom: 40rpx;
+		}
+	}
+
+	// 用电量合计
+	.total {
+		padding: 24rpx 32rpx;
+		background: linear-gradient(90deg, rgba(49, 110, 207, 1) 2%, rgba(37, 138, 255, 1) 100%);
+
+
+		.company {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+
+			.name {
+				color: rgba(255, 255, 255, 1);
+				font-size: 36rpx;
+				font-weight: bold;
+			}
+
+			.amount {
+				color: #f2f4f6;
+				margin-top: 4rpx;
+			}
+		}
+
+		.infos {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			margin-top: 4rpx;
+			width: 93%;
+
+			.infos-item {
+
+				display: flex;
+				width: 33.3%;
+
+
+				.number {
+					color: rgba(255, 255, 255, 1);
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-left: 8rpx;
+				}
+
+				.time {
+					color: #f2f4f6;
+
+				}
+			}
+		}
+
+	}
+
+
+
+	// 用电量
+	.main {
+		background-color: #fff;
+		padding: 26rpx 32rpx;
+
+		.item:last-of-type {
+			border: none;
+		}
+
+		.item {
+			padding: 16rpx 0;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			border-bottom: 1px solid rgba(245, 245, 245, 1);
+
+			.item-content {
+				width: 93%;
+			}
+
+			.equipment {
+
+				display: flex;
+				align-items: center;
+
+
+				.equipment1 {
+					color: rgba(51, 51, 51, 1);
+					font-size: 32rpx;
+					max-width: 40%;
+					font-weight: bold;
+
+					white-space: nowrap;
+					overflow: hidden;
+					text-overflow: ellipsis;
+				}
+
+				.equipment2 {
+					color: rgba(119, 119, 119, 1);
+					margin-left: 16rpx;
+					max-width: 40%;
+					white-space: nowrap;
+					overflow: hidden;
+					text-overflow: ellipsis;
+
+
+
+
+
+
+				}
+			}
+
+			// 状态
+			.state {
+
+
+				display: flex;
+				align-items: center;
+				color: rgba(255, 123, 0, 1);
+				margin-left: auto;
+
+				.dot {
+					margin-right: 8rpx;
+
+					width: 16rpx;
+					height: 16rpx;
+					background-color: rgba(255, 123, 0, 1);
+					border-radius: 999px;
+					margin-left: auto;
+
+				}
+
+				.off-line {
+
+					background-color: rgba(255, 123, 0, 1);
+
+				}
+
+				.on-line {
+					background-color: rgba(0, 185, 98, 1);
+				}
+			}
+
+			.state2 {
+				color: rgba(0, 185, 98, 1);
+			}
+
+			.electricity {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+
+				margin-top: 8rpx;
+				text-align: center;
+
+				.electricity-item {
+					display: flex;
+					align-items: center;
+					width: 33.3%;
+
+					.number {
+						color: rgba(51, 51, 51, 1);
+
+						font-weight: bold;
+						font-size: 32rpx;
+						margin-left: 8rpx;
+					}
+
+					.date {
+						color: rgba(119, 119, 119, 1);
+
+
+					}
+				}
+
+			}
+		}
+
+	}
+
+	.statistics-manage {
+		border-radius: 8px;
+		background-color: rgba(255, 255, 255, 1);
+		box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
+		margin: 32rpx;
+		padding: 40rpx 0;
+
+		
+
+		.title,
+		.chart,
+		.search,
+		.meter-statistic {
+			padding: 0 32rpx;
+		}
+
+		// 图表
+		.chart {
+			
+
+			/deep/.u-subsection {
+				padding: 2px;
+			}
+
+			/deep/.u-item {
+				padding: 0;
+				font-size: 24rpx
+			}
+
+			.chat-box {
+				//margin-top: 24rpx;
+				width: 100%;
+				//height: 480rpx;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+
+		.search {
+			border-top: 1px solid rgba(242, 242, 242, 1);
+			border-bottom: 1px solid rgba(242, 242, 242, 1);
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding: 40rpx 32rpx;
+
+			.switch {
+				display: flex;
+				align-items: center;
+
+				text {
+					margin-left: 8rpx;
+					color: rgba(51, 51, 51, 1);
+				}
+			}
+
+			.search-box {
+				border-radius: 50px;
+				background-color: rgba(242, 244, 246, 1);
+				color: rgba(136, 136, 136, 1);
+				height: 56rpx;
+				line-height: 56rpx;
+				padding-left: 16rpx;
+				padding-right: 8rpx;
+				flex: 1;
+				margin-left: 28rpx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+
+				uni-input {
+					height: 56rpx;
+					line-height: 56rpx !important;
+					font-size: 28rpx;
+					width: 75%;
+				}
+
+				.icon {
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					width: 64rpx;
+					height: 40rpx;
+					border-radius: 50px;
+					background-color: rgba(22, 119, 255, 1);
+				}
+			}
+		}
+
+	}
+
+	.meter-statistic {
+		margin-top: 32rpx;
+		.meter-statistic-main{
+			display: flex;
+			align-items: center;
+		}
+		.sum {
+			
+			.meter-name {
+				color: rgba(51, 51, 51, 1);
+				font-size: 32rpx;
+				margin-left: 8rpx;
+				font-weight: bold;
+			}
+
+			.icon {
+				margin-right: 8rpx;
+
+				img {
+					width: 40rpx;
+					height: 40rpx;
+					vertical-align: middle;
+				}
+			}
+
+			.meter-state {
+				margin-left: 8rpx;
+				width: 64rpx;
+				height: 36rpx;
+				line-height: 36rpx;
+				border-radius: 4px;
+				background-color: rgba(255, 255, 255, 1);
+				color: rgba(0, 185, 98, 1);
+				font-size: 22rpx;
+				text-align: center;
+				border: 1px solid rgba(0, 185, 98, 1);
+			}
+
+			.meter-state2 {
+				border: 1px solid rgba(255, 123, 0, 1);
+				color: rgba(255, 123, 0, 1);
+			}
+
+			.meter-number {
+				margin-left: auto;
+				color: rgba(51, 51, 51, 1);
+				font-size: 32rpx;
+
+				/deep/.u-icon--right {
+					margin-left: 8rpx;
+				}
+			}
+		}
+
+		.sum2 {
+			padding: 0 32rpx;
+			margin-top: 8rpx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+
+			.title {
+				color: rgba(119, 119, 119, 1);
+			}
+
+			.value {
+				color: rgba(119, 119, 119, 1);
+			}
+		}
+
+		.first-level-list{
+			width: 100%;
+			display: flex;
+			align-items: center;
+		}
+		// 一级表
+		.first-level {
+			padding-left: 32rpx;
+			margin-top: 20rpx;
+
+			.meter-name {
+				font-size: 28rpx
+			}
+		}
+
+		// 二级表
+		.second-level {
+			padding-left: 64rpx;
+			margin-top: 20rpx;
+
+			.meter-name {
+				font-size: 24rpx
+			}
+		}
+
+		.else-switch {
+			padding-left: 144rpx;
+
+			.meter-name {
+				font-size: 24rpx
+			}
+
+			.item {
+				margin-top: 24rpx;
+			}
+		}
+	}
+	.electronicMonitoring-title{
+		display: flex;
+		    align-items: center;
+		padding: 0px 32rpx;
+		    justify-content: space-between;
+			height: 120rpx;
+			font-size: 36rpx;
+background: linear-gradient(88.25deg, rgba(31,85,255,1) 0.65%,rgba(39,171,255,1) 99.34%);
+			
+color:#fff;
+
+
+	}
+</style>

+ 20 - 6
pages/mine/myApps.vue

@@ -76,17 +76,18 @@
 					</view>
 				</view>
 				
-				<view class="item"   v-if="companyInfo.type==2" 
-				@click="gotoUrl('/pages/platformRevenueStatistics/electricityConsumptionAnalysis?isback=1')"
+				<view class="item"   v-if="companyInfo.type==2"
+				@click="gotoUrl('/pages/equipmentDataMonitoring/equipmentElectricityWater')"
 					>
-					<view class="item-icon item-icon8">
-						<image class="img" src="@/assets/img/iconPark-chart-histogram-two.svg" mode=""></image>
+					<view class="item-icon  item-icon7">
+						<image class="img" src="@/assets/img/mine/iconPark-water-level.svg" mode=""></image>
 					</view>
 					<view class="item-name">
-						用电量分析
-
+						设备用水量
+				
 					</view>
 				</view>
+				
 				<view class="item"   v-if="companyInfo.type==2"
 				@click="gotoUrl('/pages/platformRevenueStatistics/platformRevenueStatistics?isback=1')"
 					>
@@ -97,6 +98,19 @@
 						收入统计				
 					</view>
 				</view>
+				
+				<view class="item"   v-if="companyInfo.type==2"
+				@click="gotoUrl('/pages/platformRevenueStatistics/electricityConsumptionAnalysis?isback=1')"
+					>
+					<view class="item-icon item-icon8">
+						<image class="img" src="@/assets/img/iconPark-chart-histogram-two.svg" mode=""></image>
+					</view>
+					<view class="item-name">
+						能耗分析
+				
+					</view>
+				</view>
+				
 			</view>
 		</view>
 		<!-- 租户管理 -->

+ 265 - 13
pages/statistics/statistics.vue

@@ -226,7 +226,7 @@
 						<image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
 					</view>
 					<view class="text">
-						运行电表
+						设备运行情况
 					</view>
 					<view class="check-all" @click="toEquipmentConditionMonitoring">
 						查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
@@ -234,10 +234,23 @@
 				</view>
 
 				<view class="item">
-					
+					<view>
+						<u-circle-progress width="88" borderWidth="12" active-color="#2979ff"  :percent="80">
+								<view class="u-progress-content">
+									<image class="img"  style="width: 32rpx;height: 32rpx;margin-top: 8rpx;"
+									src="@/assets/img/statistics/fa5-bolt-fas.svg"></image>
+								</view>
+							</u-circle-progress>
+					</view>
 					<!-- 累计 -->
-					<view class="total">
-						<view class="total1">
+					<view class="total">
+						
+						<view class="total2">
+							运行电表
+						
+						</view>
+						<view class="total1">
+						
 							<view class="normal">
 								正常 <span style="color:#19be6b;margin: 0 8rpx;">{{alarmsForm.okNum}}</span> 台
 							</view>
@@ -253,7 +266,38 @@
 					</view>
 				</view>
 
-
+				<view class="item">
+					<view>
+						<u-circle-progress width="88" borderWidth="12" active-color="#00B962"  :percent="80">
+								<view class="u-progress-content">
+									<image class="img"  style="width: 32rpx;height: 32rpx;margin-top: 8rpx;"
+									src="@/assets/img/statistics/fas fa-tint.svg"></image>
+								</view>
+							</u-circle-progress>
+					</view>
+					<!-- 累计 -->
+					<view class="total">
+						
+						<view class="total2">
+							运行水表
+						
+						</view>
+						<view class="total1">
+						
+							<view class="normal">
+								正常 <span style="color:#19be6b;margin: 0 8rpx;">{{alarmsForm.okNum}}</span> 台
+							</view>
+							<view class="abnormal">
+								异常 <span style="color:red;margin: 0 8rpx;">{{alarmsForm.errorNum}}</span> 台
+							</view>
+						</view>
+						<view class="total2" v-if="false">
+							本月累计触发告警 <text class="total-number">{{alarmsForm.errorMonthNum}}</text> 次
+				
+				
+						</view>
+					</view>
+				</view>
 
 			</view>
 			
@@ -433,9 +477,13 @@
 					<view class="text">
 						能源管理
 					</view>
-					<!-- <view class="check-all" @click="toEquipmentElectricity">
-						查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
-					</view> -->
+					<view class="check-all switchWater" >
+						
+						<view class="s s1" :class="showAccountantWater?'':'index'"
+						 @click="showAccountantWater=false" >电表</view>
+						 <view class="s s2" :class="showAccountantWater?'index':''"
+						  @click="showAccountantWater=true" >水表</view>
+					</view>
 				</view>
 				<template v-if="anchorpointShow('point-devices')">
 					
@@ -568,6 +616,75 @@
 						</view>
 					
 					</view>
+					
+					<view class="incomeExpenditureClass point-Accountant" v-show="anchorpointShow('point-Accountant-water')" >
+						<view class="incomeRow"  >
+							<view class="isOpenClass" @click="isOpen1=!isOpen1">
+								<view class="isOpenClass1">收支统计</view>
+								<view class="isOpenClass2">
+								<span class="span">{{isOpen1?'收起':'展开'}}</span> 
+								<u-icon name="arrow-up" color="rgb(164 156 156)" v-show="isOpen1" size="24"></u-icon>
+								<u-icon name="arrow-down" color="rgb(164 156 156)"  v-show="!isOpen1" size="24"></u-icon>
+								
+								</view>
+							</view>
+						</view>
+						<view class="incomeRow" v-show="isOpen1" >
+							<view class="income1">
+								<view  class="income11">
+									收入(元)
+								</view>
+								<view   class="income12">
+									{{incomeExpenditureObj.incomeFee}}
+									<span class="income121" v-if="!incomeExpenditureObj.id">加载中...</span>
+								</view>
+							</view>
+							<view class="income1">
+								<view  class="income11">
+									支出(元)
+								</view>
+								<view   class="income12">
+									{{incomeExpenditureObj.expenditureFee}}
+									<span class="income121" v-if="!incomeExpenditureObj.id">加载中...</span>
+								</view>
+							</view>
+							<view class="income1">
+								<view  class="income11">
+									营收(元)
+								</view>
+								<view   class="income12" :style="incomeExpenditureObj.differenceFee>=0?'color:red':'color:#52b8aa'">
+									{{incomeExpenditureObj.differenceFee>0?'+':''}}{{incomeExpenditureObj.differenceFee}}
+									<span class="income121" v-if="!incomeExpenditureObj.id">加载中...</span>
+								</view>
+							</view>
+						</view>
+						<view class="incomeRow" v-show="isOpen1" >
+							
+							<view class="income2">
+								<view  class="income11">
+									节约用水量(立方米)
+								</view>
+								<view   class="income12" :style="incomeExpenditureObj.addMinusKwh>=0?'color:red':'color:#52b8aa'">
+									{{incomeExpenditureObj.addMinusKwh>0?'+':''}}{{incomeExpenditureObj.addMinusKwh}}
+									<span class="income121" v-if="!incomeExpenditureObj.id">加载中...</span>
+								</view>
+							</view>
+							<view class="income1">
+								<view  class="income11">
+									增收电量(度)
+								</view>
+								<view   class="income12">
+									{{incomeExpenditureObj.addKwh}}
+									<span class="income121" v-if="!incomeExpenditureObj.id">加载中...</span>
+								</view>
+							</view>
+							
+						</view>
+						
+					
+					</view>
+					
+					
 					<view  v-show="anchorpointShow('point-Electricityconsumptiontype')" >
 						<view class="incomeRow"   >
 							<view class="isOpenClass point-Electricityconsumptiontype" @click="isOpen2=!isOpen2">
@@ -617,7 +734,7 @@
 				</view>
 				<!-- 电表统计 -->
 				<Tree-Body :meterList="meterList" ref="mytree"
-				class="" v-show="isOpen3"
+				class="" v-show="isOpen3&&anchorpointShow('point-devices')"
 				:showPark="homePageManageObj.showPark"
 				:childInfo="childInfo"
 				 @query="getHomePageManageChildMeter"
@@ -733,7 +850,111 @@
 
 
 			</view>
-
+			
+			<!-- 用电量 -->
+			<view class="statistics-e statistics" v-if="!companyId">
+				<view class="title">
+					<view class="icon">
+						<image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
+					</view>
+					<view class="text">
+						用水量 (立方米)
+					</view>
+					<view class="check-all" @click="toEquipmentElectricity">
+						查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
+					</view>
+				</view>
+				<view class="content"  style="display: flex;justify-content: center;margin: 40px 0;"
+				v-if="getHomePageKwhshowLoading">
+					
+					<div class="uni-toast" style="display: flex;font-size: 60rpx;    color: rgb(192, 196, 204);" >
+						<i class="uni-icon_toast uni-loading"
+					style="
+					    width: 80rpx;
+					    height: 80rpx;
+						
+					"
+					></i><p class="uni-toast__content">  </p>加载中...</div>
+					
+				</view>
+				<view class="content" v-else-if="!getHomePageKwhshowLoading&&kWhListHome.length == 0">
+					<u-divider :isnone="true"  nonetext="无记录"
+						border-color="#fff"></u-divider>
+				</view>
+				
+				<view class="content" v-else >
+					<view class="electricity">
+			
+						<view class="item" v-for="(item, index) in kWhListHome" :key="index"
+							@click="toElectronicMonitoring(item)">
+							<view class="item-content">
+								<view class="equipment">
+									<view class="equipment1 ">
+										{{replaceLastTwoWords(item.name)}}
+									</view>
+			
+									<view class="equipment2">
+										{{item.installationAddressSimple}}
+									</view>
+			
+			
+			
+									<view class="state" v-if="!item.online">
+										<!-- <view class="dot off-line"></view> -->
+										<view class="text">离线</view>
+									</view>
+			
+									<view class="state state2" v-else>
+										<!-- <view class="dot on-line"></view> -->
+										<view class="text">在线</view>
+									</view>
+			
+								</view>
+								<view class="electricity">
+									<view class="electricity-item electricity-item-day">
+			
+										<view class="date">
+											今日
+										</view>
+										<view class="number">
+											{{item.thisDayKwh}}
+										</view>
+									</view>
+									<view class="electricity-item">
+			
+										<view class="date">
+											本月
+										</view>
+										<view class="number">
+											{{item.thisMonthKwh}}
+										</view>
+									</view>
+									<view class="electricity-item">
+			
+										<view class="date">
+											上月
+										</view>
+										<view class="number">
+											{{item.lastMonthKwh}}
+										</view>
+									</view>
+			
+			
+			
+								</view>
+							</view>
+			
+							<view class="more">
+								<u-icon name="arrow-right" color="#d4d4d4" size="24"></u-icon>
+							</view>
+						</view>
+					</view>
+			
+				</view>
+			
+			
+			
+			</view>
 			
 
 
@@ -949,6 +1170,7 @@
 				isOpen1:true,
 				isOpen2:true,
 				isOpen3:true,
+				showAccountantWater:false,
 				anchorpointList:[
 					{
 						key:"point-meteroperation",name:"运行电表"
@@ -965,6 +1187,10 @@
 					},
 					{
 						key:"point-Accountant",name:"收支统计"
+					}
+					,
+					{
+						key:"point-Accountant-water",name:"收支统计"
 					},{
 						key:"point-Electricityconsumptiontype",name:"用电类型"
 					},{
@@ -1076,7 +1302,7 @@
 					
 				}else{
 					if(key=='point-Electricityconsumptiontype'){
-						return this.incomeExpenditureBl&&this.childInfo.sp!=1
+						return this.incomeExpenditureBl&&this.childInfo.sp!=1&&!this.showAccountantWater
 					}
 					
 				}
@@ -1085,12 +1311,16 @@
 					
 					if(key=='point-Accountant'){
 						//console.log("point-Accountantpoint-Accountantpoint-Accountantpoint-Accountant")
-						return this.incomeExpenditureBl
+						return this.incomeExpenditureBl&&!this.showAccountantWater
+					}
+					if(key=='point-Accountant-water'){
+						//console.log("point-Accountantpoint-Accountantpoint-Accountantpoint-Accountant")
+						return this.incomeExpenditureBl&&this.showAccountantWater
 					}
 					if(this.childInfo.sp!=1){
 						
 						if(key=='point-devices'){
-							return true
+							return true&&!this.showAccountantWater
 						}
 					}
 				}
@@ -2415,6 +2645,28 @@
 					font-size: 24rpx;
 				}
 			}
+		}
+		.switchWater{
+			    display: flex;
+				   margin-left: 8px;
+			.s{
+				border: 1px solid rgba(22,132,252,1);
+				
+				color:rgba(22,132,252,1);
+				    padding: 2px 8px;
+				 
+			}
+			.s2{
+				border-radius: 0 4px  4px 0;
+			}
+			.s1{
+				border-radius: 4px 0 0 4px;
+					
+			}
+			.index{
+				background-color:rgba(22,132,252,1);
+				color: #fff;
+			}
 		}
 
 		// 用电量