소스 검색

加载中 ,样式

zhengkaixin 1 년 전
부모
커밋
d5c8a83014

+ 12 - 1
apis/pagejs/energyManage.js

@@ -24,6 +24,7 @@ export function deviceCompanyList(data) {
 export function homePageKwh(data) {
 	var url='mobile/employee/homePageKwh';
 	return request({
+		timeout:60*1000,
 		method: 'post',
 		data: data,
 		url: url
@@ -90,8 +91,18 @@ export function homePageManageChildMeter(data) {
 }
 
 
+//能源管理物业子表
+export function incomeExpenditure(data) {
+	var url='mobile/energyManage/incomeExpenditure';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
 export function remoteSwitch(data) {
-	var url='/mobile/energyManage/remoteSwitch';
+	var url='/mobile/ElectricityMeter/remoteSwitch';
 	return request({
 		method: 'post',
 		data: data,

+ 1 - 1
apis/pagejs/index.js

@@ -69,7 +69,7 @@ export function homePage(data) {
 export function findByOpenId(data) {
 	var url='/mobile/employeeUser/findByOpenId';
 	if(data){
-		data.type='5'
+		//data.type="5"
 	}
 	return request({
 		method: 'get',

+ 1 - 1
apis/pagejs/user.js

@@ -59,7 +59,7 @@ export function personalCenter(data) {
 export function findByOpenId(data) {
 	var url = '/mobile/employeeUser/findByOpenId';
 	if(data){
-		data.type='5'
+		//data.type="5"
 	}
 	return requestWhite({
 		method: 'get',

+ 1 - 1
apis/utils/init.js

@@ -68,7 +68,7 @@ var app = {
 		 	url: process.car.BASE_URL + loginurl,
 		 	data: {
 		 		openId:thisopenId,
-				type:'5'
+				//data.type="5"
 		 	},
 		 	header: {
 		 		'Content-Type': 'application/x-www-form-urlencoded',

+ 1 - 1
apis/utils/request.js

@@ -32,7 +32,7 @@ const request = (options) => {
 			url: process.car.BASE_URL + loginurl,
 			data: {
 				openId:openId,
-				type:'5'
+				//data.type="5"
 			},
 			
 			header: {

+ 8 - 6
config/.env.dev.js

@@ -3,22 +3,24 @@ 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
+	//BASE_URL:'http://192.168.77.162:8081/electric-manager-api/', //sz
 	//BASE_URL:'http://192.168.77.222:8086/railroad-server/',
 	
 	NODE_ENV :"dev",
 	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
 	// openId:"1234",//开发人员2
 	// openId:"55555",//测试人员 开发环境
-	// openId:"111111", //sz
+	 openId:"oLowyuNkSxqovYoobKbeHB1nSkm0", //sz
 	//openId:"oK9Wr57rAcNzihDN2PEdptprT0As", 
 	// openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",
-	// openId:"oLowyuOJvTszgk96C0f8j0XfcEXg",//zkx
-	// openId:"oLowyuNkSxqovYoobKbeHB1nSkm0", //sz
+	//openId:"oLowyuOJvTszgk96C0f8j0XfcEXg",//zkx
+	openId:"oLowyuNkSxqovYoobKbeHB1nSkm0", //sz
 	// openId:"oLowyuAJ1Ld0ivnLj4qp1k5Vy_l4", //wang
-	openId:"oLowyuFTU3SzpvU4pGNzWk7NC9y0", //me
+	//openId:"oLowyuFTU3SzpvU4pGNzWk7NC9y0", //me
+	//openId:"oLowyuMMjIkA_bLA4MXzRQ3KJB2E",
+	//openId:"oLowyuHCGgMomNBQEXZSbb5SJxfQ",//杨所
 	
 	//appid
 	VUE_APP_WXAPPID:"wx0b3c41a903053808",

+ 16 - 2
pages/equipmentDataMonitoring/equipmentElectricity.vue

@@ -111,7 +111,7 @@
 				<view class="u-subsection">
 					<u-subsection :list="list"  :current="homePageManageType" @change="sectionChange" font-size="24"></u-subsection>
 				</view>
-				<view class="chat-box" id="barEcharts">
+				<view class="chat-box" id="barEcharts"  v-show="!companyType">
 				
 				</view>
 			</view>
@@ -350,6 +350,7 @@
 					
 				},
 				utabsone:true,
+				companyType:false,
 			}
 		},
 		onReady() {
@@ -360,6 +361,13 @@
 
 			this.getCompanyInfoList();
 		},
+		onLoad() {
+			var getPersonInfoPlus=this.carhelp.getPersonInfoPlus()
+			if(getPersonInfoPlus){
+				this.companyType=getPersonInfoPlus.wuye
+			}
+			
+		},
 		onReachBottom() {
 			if (this.kWhList.length < this.recordsTotal) {
 				this.myLoadmore();
@@ -501,6 +509,8 @@
 				this.merchantChangeApi()
 				
 			},
+			
+			
 			// 设备数据监测
 			getHomePageManageChildMeter(item,bl) {
 				// if(!bl){
@@ -571,7 +581,11 @@
 					// })
 					
 					this.homePageManageObj = response.data;
-					this.getBarCharts()
+					if(!this.companyType){
+						this.getBarCharts()
+						
+					}
+				
 					
 				}).catch(error => {
 					uni.showToast({

+ 1 - 1
pages/login/login.vue

@@ -106,7 +106,7 @@
 					password:this.password,
 					phone:this.phone,
 					openId: this.carhelp.getOpenId(),
-					type:5,
+					//type:2,
 				}).then((response) => {
 					
 					this.loginset(response)

+ 155 - 23
pages/statistics/statistics.vue

@@ -96,7 +96,7 @@
 			</view>
 
 			<!-- 能源管理 -->
-			<view v-show="companyId&&meterList.length" class="statistics statistics-manage">
+			<view v-show="companyId" class="statistics statistics-manage">
 				<view class="title">
 					<view class="icon">
 						<image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
@@ -108,14 +108,58 @@
 						查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
 					</view>
 				</view>
-
+				
+				<view class="content" v-if="!getHomePageManageReady">
+					
+					<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="getHomePageManageReady&&meterList.length == 0">
+					<u-divider :isnone="true"  nonetext="无记录"
+						border-color="#fff"></u-divider>
+				</view>
+				
 				<!-- 图表 -->
-				<view class="chart">
+				<view class="chart" v-show="getHomePageManageReady">
 					<view class="u-subsection">
 						<u-subsection :list="list" :current="homePageManageType" @change="sectionChange"
 							font-size="24"></u-subsection>
+					</view>
+					<view class="incomeExpenditureClass" v-show="incomeExpenditureObj.id">
+						<view class="income1">
+							<view  class="income11">
+								电费支出
+							</view>
+							<view   class="income12">
+								{{incomeExpenditureObj.expenditureFee}}
+							</view>
+						</view>
+						<view class="income1">
+							<view  class="income11">
+								电费收入
+							</view>
+							<view   class="income12">
+								{{incomeExpenditureObj.incomeFee}}
+							</view>
+						</view>
+						<view class="income1">
+							<view  class="income11">
+								收支情况
+							</view>
+							<view   class="income12" :style="incomeExpenditureObj.differenceFee>=0?'color:red':'color:#52b8aa'">
+								{{incomeExpenditureObj.differenceFee}}
+							</view>
+						</view>
+					
 					</view>
-					<view class="chat-box" id="barEcharts">
+					<view class="chat-box" id="barEcharts" v-show="!companyType">
 
 					</view>
 				</view>
@@ -145,7 +189,7 @@
 
 			</view>
 			<!-- 用电量 -->
-			<view class="statistics-e statistics" v-if="!companyId&&kWhList.length != 0">
+			<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>
@@ -156,8 +200,25 @@
 					<view class="check-all" @click="toEquipmentElectricity">
 						查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
 					</view>
-				</view>
-				<view class="content">
+				</view>
+				<view class="content" 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&&kWhList.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 kWhList" :key="index"
@@ -440,7 +501,11 @@
 					
 				},
 				getHomePageManageReady:false,
-				utabsone:true,
+				utabsone:true,
+				companyType:false,
+				incomeExpenditureObj:{},
+				getHomePageKwhshowLoading:false,
+				getHomePageManageshowLoading:false,
 			}
 		},
 		onLoad() {
@@ -450,12 +515,14 @@
 			this.queryDateMonth = year + '-' + month;
 			this.endYear = new Date().getFullYear();
 			this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
-			
+			var getPersonInfoPlus=this.carhelp.getPersonInfoPlus()
+			if(getPersonInfoPlus){
+				this.companyType=getPersonInfoPlus.wuye
+			}
 
 			this.getCompanyInfoList();
 			
 			
-			
 		},
 		onReady() {
 			// this.current=1
@@ -502,6 +569,25 @@
 				})
 				console.log(node,key)
 			},
+			getIncomeExpenditure(){
+				this.incomeExpenditureObj={}
+				API.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"
+					})
+				})
+			},
 			// 设备数据监测
 			getHomePageManageChildMeter(item,bl) {
 				if(!bl){
@@ -723,10 +809,10 @@
 				
 				
 				this.getHomePageManageReady=false
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
+				// uni.showLoading({
+				// 	title: "加载中",
+				// 	mask: true,
+				// })
 				API.homePageManage({
 					queryDate:this.queryDate,
 					companyId: this.companyId,
@@ -735,12 +821,20 @@
 					this.getHomePageManageReady=true
 					this.codes =this.carhelp.getPersonInfo().codes;
 					
-					uni.hideLoading();
+					//uni.hideLoading();
 					this.meterList = response.data.meterList;
 					
 					
-					this.homePageManageObj = response.data;
-					this.getBarCharts()
+					this.homePageManageObj = response.data;
+					if(!this.companyType){
+						this.$nextTick(()=>{
+								this.getBarCharts()
+						})
+						
+					
+						this.getIncomeExpenditure();
+					}
+					
 					
 				}).catch(error => {
 					uni.showToast({
@@ -778,10 +872,11 @@
 				}
 
 				if (!interval) {
-					uni.showLoading({
-						title: "加载中",
-						mask: true,
-					})
+					// uni.showLoading({
+					// 	title: "加载中",
+					// 	mask: true,
+					// })
+					this.getHomePageKwhshowLoading=true;
 				}
 				API.homePageKwh({
 					pageIndex: this.pageIndexp,
@@ -789,7 +884,8 @@
 					companyId: this.companyId
 				}).then((response) => {
 					if (!interval) {
-						uni.hideLoading();
+						//uni.hideLoading();
+						this.getHomePageKwhshowLoading=false;
 					}
 					this.kWhList = response.data.data;
 					this.totalPagep = response.data.totalPage;
@@ -942,7 +1038,43 @@
 	}
 </script>
 
-<style lang="scss" scoped>
+<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{
+			    width: 33.33%;
+			 text-align: center;
+			.income11{
+				padding:12rpx 0;
+				background-color: #1677FF ;
+				color:#fff;
+				font-size: 36rpx;
+				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;
+			}
+			
+		}
+		
+		
+	}
 	page {
 		padding-bottom: 200rpx;
 	}