Parcourir la source

调整 ,按时段查询,添加 总度数

zhengkaixin il y a 2 mois
Parent
commit
c81574be66
3 fichiers modifiés avec 88 ajouts et 49 suppressions
  1. 2 1
      package.json
  2. 7 3
      pagesFinance/detailed/index.vue
  3. 79 45
      pagesFinance/statistics/index.vue

+ 2 - 1
package.json

@@ -26,7 +26,8 @@
   "babel-eslint": "^10.0.3",
   "eslint": "^5.16.0",
   "eslint-plugin-vue": "^5.0.0",
-  "node-sass": "^5.0.0",
+
+  "sass": "^1.85",
   "sass-loader": "^11.0.1",
   "vue-template-compiler": "^2.6.10"
  },

+ 7 - 3
pagesFinance/detailed/index.vue

@@ -120,7 +120,7 @@
 				:key="index">
 				<view class="detailed-time" style="background-color:#f3f4f7"    v-if="item.show">
 					<p>{{item.showtime}}</p>
-					<p  v-if="showMap">共收{{showMap.get(item.showtime).num}}笔,{{showMap.get(item.showtime).amount.toFixed(2)}}元</p>
+					<p  v-if="showMap">共收{{showMap.get(item.showtime).num}}笔,{{showMap.get(item.showtime).amount.toFixed(2)}}元;<br/>用电量{{showMap.get(item.showtime).eq.toFixed(2)}}度</p>
 				</view>
 				<view class="detailed-item" style="padding-top: 20rpx;">
 					<p style="   text-align: end;" >
@@ -459,9 +459,11 @@
 							}else{
 								var Amount=item.totalAmount 
 								var num=item.totalNum
+								var eq=item.totalElectricQuantity
 								showMap.set(ktime,{
 									amount:Amount,
-									num:num
+									num:num,
+									eq:eq
 								})
 							
 								
@@ -512,9 +514,11 @@
 							}else{
 								var Amount=item.totalAmount 
 								var num=item.totalNum
+								
 								showMap.set(ktime,{
 									amount:Amount,
-									num:num
+									num:num,
+									
 								})
 							
 								item.show=true;

+ 79 - 45
pagesFinance/statistics/index.vue

@@ -3,7 +3,10 @@
 		<u-select v-model="popupShow8"  
 			 @confirm="byYearConfirm" :default-value="byYearDefaultValue"
 			:list="byYear"></u-select>
-			
+			<u-picker v-model="popupShow9" mode="time" 
+			@confirm="popupShow9confirm" :defaultTime="(popupShow9op==1?form2.startDate:form2.endDate )+':00'"
+			:params="popupShow9params"></u-picker>
+
 		<view class="top-cover">
 			<view>
 				<view class="navbar-tit" :class="{
@@ -742,7 +745,7 @@
 			</view>
 
 			<view class="statisticsChart-head" style="margin-top: 40rpx;">
-				<h4>站主/桩主收益统计</h4>
+				<h4>充电站运营统计</h4>
 				<!-- <view class="navbar-screen" >
 					 {{startTime}}至{{endTime}}
 				 </view> -->
@@ -766,6 +769,17 @@
 						<u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow2"></u-icon>
 					</p>
 				</view>
+				
+				<view class="details-row3">
+					<view class="item" @click="popupShow9 = true,popupShow9op=1" >开始时间 {{form2.startDate}}
+						<u-icon name="arrow-right" color="#b0b8c8" size="32" ></u-icon>
+					</view>
+					<view  class="item" @click="popupShow9 = true,popupShow9op=2" >结束时间 {{form2.endDate}}
+						<u-icon name="arrow-right" color="#b0b8c8" size="32" ></u-icon>
+						
+					</view>
+				</view>
+				
 				<view class="details-row">
 					<p>充电总收入</p>
 					<span>{{(indexData2.incomeMap.chargingAmount).toFixed(2)}}元</span>
@@ -775,15 +789,15 @@
 					<span>{{indexData2.incomeMap.incomeAmount.toFixed(2)}}元</span>
 				</view>
 				<view class="details-row">
-					<p>预估用电度数</p>
+					<p>用电度数</p>
 					<span>{{(indexData2.incomeMap.electricQuantity/10000).toFixed(1)}}度</span>
 				</view>
 				<view class="details-row">
-					<p>预估电费</p>
+					<p>电费</p>
 					<span>{{indexData2.incomeMap.costAmount.toFixed(2)}}元</span>
 				</view>
 				<view class="details-row">
-					<p>服务费预估收益</p>
+					<p>服务费收益</p>
 					<span>{{indexData2.incomeMap.serviceAmount.toFixed(2)}}元</span>
 				</view>
 				<view class="details-row">
@@ -791,7 +805,7 @@
 					<span>{{indexData2.incomeMap.cardIncomeAmount.toFixed(2)}}元</span>
 				</view>
 				<view class="details-row">
-					<p>预估总利润</p>
+					<p>总利润</p>
 					<span>{{(indexData2.incomeMap.serviceAmount+indexData2.incomeMap.cardIncomeAmount).toFixed(2)}}元</span>
 				</view>
 			</view>
@@ -890,6 +904,8 @@
 				popupShow6: false,
 				popupShow7: false,
 				popupShow8: false,
+				popupShow9:false,
+				popupShow9op:1,
 				nowTime: 0,
 				queryHeadTime: "",
 				selectstationId2: "",
@@ -903,7 +919,9 @@
 
 				queryTime: "",
 				queryTime2: "",
-
+				JQquery2:false,
+				
+				
 				indexData: {},
 				indexData3: null,
 				indexData2: null,
@@ -963,6 +981,14 @@
 				background: {
 					background: 'none'
 				},
+				popupShow9params:{
+						year: true,
+										month: true,
+										day: true,
+										hour: true,
+						minute: true,
+										second: false
+				},
 				value: '',
 				type: 'select',
 				show: false,
@@ -1119,7 +1145,11 @@
 			this.startTime = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
 			this.endTime = parseUnixTime(beforeTimeStamp(0), '{y}-{m}-{d}')
 			//this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
-			this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
+			
+			
+			var  nextMonth = new Date(date.getFullYear(), date.getMonth() + 1, 1);
+			
+			this.endTime2 = parseUnixTime(nextMonth, '{y}-{m}-{d}')
 
 
 			this.startTime3 = parseUnixTime(beforeTimeStamp(31), '{y}-{m}-{d}')
@@ -1462,35 +1492,35 @@
 				this.list = [];
 				this.getData()
 			},
-			resetBtn2() {
-				this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
-				this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
-
-
-
-				this.selectstationId2 = ""
-
-				this.form2 = {
-
-					stationId: this.selectstationId2,
-
-				};
-				this.popupShow2 = false;
-
-				this.getData2()
-
-			},
+		
 			okbtn2() {
 				this.popupShow2 = false;
-
-				this.form2 = {
-
-					stationId: this.selectstationId2,
-
-				};
+				if(this.form2){
+					this.form2.stationId=this.selectstationId2
+				}else{
+					this.form2 = {
+						stationId: this.selectstationId2,
+					};
+				}
+				
 
 				this.getData2()
 			},
+			popupShow9confirm(e){
+				this.JQquery2=true
+				console.log(e)
+				
+				var time=`${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`
+				if(this.popupShow9op==1){
+					this.form2.startDate = time
+					
+				}
+				if(this.popupShow9op==2){
+					
+					this.form2.endDate = time
+				}
+				this.okbtn2()
+			},
 			getDataHome2(bl) {
 
 				if(bl){
@@ -1582,9 +1612,13 @@
 					title: "加载中",
 					mask: true,
 				})
-
-				this.form2.startDate = this.startTime2,
-					this.form2.endDate = this.endTime2
+				if(this.JQquery2){
+					
+				}else{
+					this.form2.startDate = this.startTime2+' 00:00',
+					this.form2.endDate = this.endTime2+' 00:00'
+				}
+				
 
 				API.homeIncomeStatistics(this.form2).then((res) => {
 					this.indexData2 = res.data
@@ -1779,17 +1813,12 @@
 				this.okbtn()
 			},
 			changedate2(e) {
-
+				this.JQquery2=false
 				this.queryTime2 = e.year + '-' + e.month;
+				var currentDate=newDate(this.startTime2)
+				var a= new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1);
 
-				if (e.month == '12') {
-					this.endTime2 = (e.year) + "-12-31"
-				} else {
-					var b = e.year + '/' + (parseInt(e.month) + 1) + '/1';
-					var a = beforeTimeStamp(1, b);
-					this.endTime2 = parseUnixTime(a, '{y}-{m}-{d}')
-
-				}
+				this.endTime2 = parseUnixTime(a, '{y}-{m}-{d}')
 
 				this.okbtn2()
 
@@ -3224,7 +3253,12 @@
 			font-weight: bold;
 		}
 	}
-
+	.details-row3{
+		margin: 16rpx 0;
+		.item{
+				margin: 16rpx 0;
+		}
+	}
 	.details-row2 {
 		display: flex;
 		justify-content: space-between;