Ver Fonte

用电统计

wkyy há 1 ano atrás
pai
commit
0d9bb09b86

+ 151 - 116
pages/equipmentDataMonitoring/billingRules.vue

@@ -8,73 +8,74 @@
 					所属收款单位
 				</view>
 				<view class="value">
-					岑河物业公司
+					{{name}}
 				</view>
 			</view>
 			<!-- 规则 -->
 			<view class="rules">
 
 				<view class="content">
-					
-						<view class="title">
-							<view class="title-item">
-								用电分类
-							</view>
-							<view class="title-item">
-								用电时段
-							</view>
-							<view class="title-item">
-								电度电价
-							</view>
+
+					<view class="title">
+						<view class="title-item">
+							用电分类
 						</view>
-						<view class="classify">
-							<view class="classify-title">
-								高峰用电
-							</view>
-							<view class="classify-value">
-								09:00-15:00
-							</view>
-							<view class="classify-value">
-								0.99元/度
-							</view>
+						<view class="title-item">
+							用电时段
 						</view>
-						<view class="classify">
-							<view class="classify-title">
-								谷段用电
-							</view>
-							<view class="classify-value">
-								23:00-07:00
-							</view>
-							<view class="classify-value">
-								0.37元/度
-							</view>
+						<view class="title-item">
+							电度电价
 						</view>
-						<view class="classify classify2">
-							<view class="classify-title">
-								平段用电
-							</view>
-							<view class="classify-value">
-								<p>07:00-09:00</p>
-								<p>15:00-20:00</p>
-								<p>22:00-23:00</p>
-							</view>
-							<view class="classify-value">
-								0.69元/度
-							</view>
+					</view>
+					<view class="classify" v-for="(item,index) in electricPeriodPriceList" :key="index"
+						 :class="item.timeList.length>1 ? 'classify2' : ''">
+						<view class="classify-title">
+							{{item.name}}
 						</view>
-						<view class="classify">
-							<view class="classify-title">
-								尖峰用电
-							</view>
-							<view class="classify-value">
-								20:00-22:00
-							</view>
-							<view class="classify-value">
-								1.18元/度
-							</view>
+						<view class="classify-value">
+							<p v-for="t in item.timeList">{{t.startTime}}-{{t.endTime}}</p>
 						</view>
-						
-						<!-- 	<view class="value" v-for="(item,index) in groupPriceList" :key="index"
+						<view class="classify-value">
+							{{item.price}}元/度
+						</view>
+					</view>
+					<!-- <view class="classify">
+						<view class="classify-title">
+							谷段用电
+						</view>
+						<view class="classify-value">
+							23:00-07:00
+						</view>
+						<view class="classify-value">
+							0.37元/度
+						</view>
+					</view> -->
+					<!-- <view class="classify classify2">
+						<view class="classify-title">
+							平段用电
+						</view>
+						<view class="classify-value">
+							<p>07:00-09:00</p>
+							<p>15:00-20:00</p>
+							<p>22:00-23:00</p>
+						</view>
+						<view class="classify-value">
+							0.69元/度
+						</view>
+					</view> -->
+					<!-- <view class="classify">
+						<view class="classify-title">
+							尖峰用电
+						</view>
+						<view class="classify-value">
+							20:00-22:00
+						</view>
+						<view class="classify-value">
+							1.18元/度
+						</view>
+					</view> -->
+
+					<!-- 	<view class="value" v-for="(item,index) in groupPriceList" :key="index"
 								:class="item.electricPeriodPriceList.length>1 ? '' : 'title3'">
 								{{item.name}}
 							</view>
@@ -94,26 +95,26 @@
 								:class="item.electricPeriodPriceList.length>1 ? '' : 'value4'">
 								<span v-for="e in item.electricPeriodPriceList">{{e.price}}元/度</span>
 							</view> -->
-						
-					</view>
+
 				</view>
-				<!-- 备注 -->
-				<view class="remark" v-if="tenantContract!=null">
-					<view class="title">
-						备注说明:
-					</view>
-					<view class="value">
-						<view class="item">1.计费规则仅展示租赁合同中的计算方式,最终扣费金额以账单中的实际扣费金额为准。
+			</view>
+			<!-- 备注 -->
+			<view class="remark" v-if="tenantContract!=null">
+				<view class="title">
+					备注说明:
+				</view>
+				<view class="value">
+					<view class="item">1.计费规则仅展示租赁合同中的计算方式,最终扣费金额以账单中的实际扣费金额为准。
 
-						</view>
-						<view class="item" v-if="startTime!=null && endTime!=null">
-							2.本次租约有效期:{{startTime}}-{{endTime}}
-						</view>
+					</view>
+					<view class="item" v-if="startTime!=null && endTime!=null">
+						2.本次租约有效期:{{startTime}}-{{endTime}}
 					</view>
 				</view>
 			</view>
 		</view>
-		
+	</view>
+
 	</view>
 </template>
 
@@ -124,11 +125,11 @@
 		beforeTimeStamp,
 		getWeek
 	} from '@/apis/utils'
-	
+
 	export default {
 		data() {
 			return {
-				groupPriceList: [],
+				electricPeriodPriceList: [],
 				queryDate: '',
 				meterId: '',
 				name: '',
@@ -138,7 +139,7 @@
 			}
 		},
 		onLoad(op) {
-			if(op.id) {
+			if (op.id) {
 				this.meterId = op.id;
 				this.queryDate = op.queryDate;
 				this.getBillingRules();
@@ -152,20 +153,50 @@
 				})
 				API_electricityMeter.billingRules({
 					meterId: this.meterId,
-					queryDate: this.queryDate+'-01'
+					queryDate: this.queryDate + '-01'
 				}).then((res) => {
 					uni.hideLoading();
 					this.name = res.data.name;
-					this.groupPriceList = res.data.groupPriceList;
+
 					this.tenantContract = res.data.tenantContract;
-					var startTime = res.data.tenantContract.startTime;
-					var endTime = res.data.tenantContract.endTime;
-					if(startTime != null) {
-						this.startTime = startTime.slice(0,4)+'年'+parseInt(startTime.slice(5,7))+'月'+parseInt(startTime.slice(8))+'日';
+					if (res.data.tenantContract != null) {
+						var startTime = res.data.tenantContract.startTime;
+						var endTime = res.data.tenantContract.endTime;
+						if (startTime != null) {
+							this.startTime = startTime.slice(0, 4) + '年' + parseInt(startTime.slice(5, 7)) + '月'
+							+ parseInt(startTime.slice(8)) + '日';
+						}
+						if (endTime != null) {
+							this.endTime = endTime.slice(0, 4) + '年' + parseInt(endTime.slice(5, 7)) + '月'
+							+ parseInt(endTime.slice(8)) + '日';
+						}
+					}
+
+					var list = res.data.groupPriceList;
+					var list2 = [];
+					var list3 = [
+						{period: '1',name: '尖峰用电',price: 0,timeList:[]},
+						{period: '2',name: '高峰用电',price: 0,timeList:[]},
+						{period: '3',name: '平段用电',price: 0,timeList:[]},
+						{period: '4',name: '谷段用电',price: 0,timeList:[]}
+					];
+					for (var i = 0; i < list.length; i++) {
+						list2 = [...list2, ...list[i].electricPeriodPriceList];
 					}
-					if(endTime != null) {
-						this.endTime = endTime.slice(0,4)+'年'+parseInt(endTime.slice(5,7))+'月'+parseInt(endTime.slice(8))+'日';
+					for (var m = 0; m < list2.length; m++) {
+						for (var n = 0; n < list3.length; n++) {
+							if(list2[m].period == list3[n].period) {
+								list3[n].price = list2[m].price;
+								list3[n].timeList.push({
+									startTime: list2[m].startTime,
+									endTime: list2[m].endTime
+								});
+							}
+						}
 					}
+					this.electricPeriodPriceList = list3;
+					// console.log(this.electricPeriodPriceList)
+					
 				}).catch(error => {
 					uni.showToast({
 						title: error,
@@ -212,50 +243,54 @@
 
 		.content {
 			padding: 24rpx;
-		
-				.title {
-					display: flex;
-					justify-content: space-between;
-					align-items: center;
-					line-height: 96rpx;
-					color: rgba(51, 51, 51, 1);
-					font-size: 32rpx;
-					font-weight: bold;
-					.title-item{
-						width: 33.3%;
-					}
+
+			.title {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				line-height: 96rpx;
+				color: rgba(51, 51, 51, 1);
+				font-size: 32rpx;
+				font-weight: bold;
+
+				.title-item {
+					width: 33.3%;
 				}
+			}
 
-				.classify{
-					display: flex;
-					align-items: center;
-					justify-content: space-between;
-					height: 96rpx;
-					
-					.classify-title,.classify-value{
-						width: 33.3%;
-						color: #666666;
-					}
-					.classify-title{
-						color: #333333;
-						
-					}
-					
+			.classify {
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				height: 96rpx;
+
+				.classify-title,
+				.classify-value {
+					width: 33.3%;
+					color: #666666;
 				}
-				.classify2{
-					height: 144rpx;
-					
+
+				.classify-title {
+					color: #333333;
+
 				}
-			
 
-			
-			
+			}
 
+			.classify2 {
+				height: 200rpx;
 			
+			}
+
+
+
+
+
+
+
+
 
-			
 
-			
 
 		}
 

+ 4 - 4
pages/equipmentDataMonitoring/electricityDetails.vue

@@ -31,7 +31,7 @@
 					</view>
 					<view class="infos-item">
 						<view class="item-title">
-							峰时用电 (1.28元/度)
+							峰时用电 ({{kwhMap.fengPrice}}元/度)
 
 						</view>
 						<view class="item-value">
@@ -41,7 +41,7 @@
 					</view>
 					<view class="infos-item">
 						<view class="item-title">
-							谷时用电 (0.65元/度)
+							谷时用电 ({{kwhMap.guPrice}}元/度)
 
 						</view>
 						<view class="item-value">
@@ -51,7 +51,7 @@
 					</view>
 					<view class="infos-item">
 						<view class="item-title">
-							平时用电 (0.98元/度)
+							平时用电 ({{kwhMap.pingPrice}}元/度)
 
 						</view>
 						<view class="item-value">
@@ -61,7 +61,7 @@
 					</view>
 					<view class="infos-item">
 						<view class="item-title">
-							尖时用电 (1.36元/度)
+							尖时用电 ({{kwhMap.jianPrice}}元/度)
 						</view>
 						<view class="item-value">
 							{{kwhMap.jianKwh}}度 {{kwhMap.jianFee}}元

+ 1 - 1
pages/equipmentDataMonitoring/electricityStatistics.vue

@@ -14,7 +14,7 @@
 				</view>
 			</view>
 			<view class="degree">
-				{{sumQuantity}}<text class="unit">度</text>
+				{{sumQuantity.toFixed(2)}}<text class="unit">度</text>
 			</view>
 			<view class="chat">
 				<view id="lineEcharts" style="min-height:240rpx;">