Bläddra i källkod

运管的更新, 充电统计图增加 充值次数,充值金额 按月,按日
增加 充值送折扣卡活动营销统计

zhengkaixin 1 månad sedan
förälder
incheckning
44f3991d01
3 ändrade filer med 135 tillägg och 51 borttagningar
  1. 5 5
      .env.dev.js
  2. 10 0
      apis/finance.js
  3. 120 46
      pagesFinance/statistics/index.vue

+ 5 - 5
.env.dev.js

@@ -12,14 +12,14 @@ const UNI_APP = {
 	//openId:"oHjCawsxTJkxixR74OVp7aCKahj8",//测试用openId  
 	//openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",
 	openId:"oSruR6exarwenvByKxUp_CvbXg9Q",//老板
-	openId:"oSruR6bebprt9L6EebBQq4KzArYQ",//提现
-	openId:"oSruR6dZcmSM4ATuweZ5fjHGQsiA", //杨所
+	//openId:"oSruR6bebprt9L6EebBQq4KzArYQ",//提现
+	//openId:"oSruR6dZcmSM4ATuweZ5fjHGQsiA", //杨所
 	//openId:"oK9Wr56yEh-TbCvUg3s9LYQSL8tM",
-	//openId:"oSruR6YkhP7QDroLnZGxWis43Kn0",//zkx
-	openId:"oSruR6dsG6wrbiQCwyftfgnp5690",//舒展, 物业
+	openId:"oSruR6YkhP7QDroLnZGxWis43Kn0",//zkx
+	//openId:"oSruR6dsG6wrbiQCwyftfgnp5690",//舒展, 物业
 	//openId:"oK9Wr55J1J1eL6BqI2tW749NTxNU",
 	
-	openId:"oSruR6bq1mtXtMdVy3EWlf6y_7oI",//f++
+	//openId:"oSruR6bq1mtXtMdVy3EWlf6y_7oI",//f++
 	
 	//小鹏管家appid
 	//VUE_APP_WXAPPID:"wx7e70eb62a8459869",

+ 10 - 0
apis/finance.js

@@ -699,6 +699,16 @@ export function queryAccountByStationIdAndType(data) {
 	})
 } 
 
+
+export function markingCardStatistics(data) {
+	 
+	return request({
+		method: 'post',
+	
+		data:data ,
+		url: "/mobile/roleSharing/markingCardStatistics"
+	})
+} 
 export function usageStatistics(data) {
 	 
 	return request({

+ 120 - 46
pagesFinance/statistics/index.vue

@@ -395,21 +395,7 @@
 			</view>
 		</u-popup>
 
-		<view class="statisticsChart chargingpile">
-			<view class="statisticsChart-head" style="margin-top: 40rpx;">
-				<h4>充值送折扣卡活动营销统计</h4>
 
-			</view>
-
-
-			<view class="detailstableHead" style="
-						padding-top: 1px;
-					">
-				<view id="pieEcharts3" style="margin-top: 40rpx">
-
-				</view>
-			</view>
-		</view>
 
 		<view class="statisticsChart chargingpile" v-if="indexData4">
 			<view class="statisticsChart-head" style="margin-top: 40rpx;">
@@ -702,6 +688,26 @@
 			</view>
 
 		</u-popup>
+
+
+
+		<view class="statisticsChart chargingpile">
+			<view class="statisticsChart-head" style="margin-top: 40rpx;">
+				<h4>充值送折扣卡活动营销统计</h4>
+
+			</view>
+
+
+			<view class="detailstableHead" style="
+						padding-top: 1px;
+					">
+				<view id="pieEcharts3" style="margin-top: 40rpx">
+
+				</view>
+			</view>
+		</view>
+
+
 		<view class="statisticsChart">
 
 
@@ -1151,7 +1157,7 @@
 					label: (i - 1) + "-" + i
 				})
 			}
-			console.log(this.byYear)
+
 			this.byYearText = (date.getFullYear() - 1) + "-" + (date.getFullYear())
 			this.byYearStart = parseUnixTime(new Date(), '{y}-01-01')
 
@@ -1234,7 +1240,7 @@
 				var i = this.byYear.findIndex(item => {
 					return item.value == (value)
 				})
-				console.log(i)
+
 				this.byYearDefaultValue = [i]
 				this.startDate_head = this.byYearStart
 				this.getDataHome2(1)
@@ -1527,7 +1533,7 @@
 			},
 			popupShow9confirm(e) {
 				this.JQquery2 = true
-				console.log(e)
+
 
 				var time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`
 				if (this.popupShow9op == 1) {
@@ -1543,8 +1549,9 @@
 			getDataHome2(bl) {
 
 				if (bl) {
-					uni.showLoading()
+
 				}
+				uni.showLoading()
 
 				var endtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
 				if (this.type_head == 3 && this.startDate_head != new Date().getFullYear() + "-01-01") {
@@ -1627,10 +1634,10 @@
 				})
 			},
 			getData2() {
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
+				// uni.showLoading({
+				// 	title: "加载中",
+				// 	mask: true,
+				// })
 				if (this.JQquery2) {
 
 				} else {
@@ -1642,7 +1649,7 @@
 				API.homeIncomeStatistics(this.form2).then((res) => {
 					this.indexData2 = res.data
 
-					uni.hideLoading()
+					//uni.hideLoading()
 
 				}).catch(error => {
 					uni.showToast({
@@ -1675,10 +1682,10 @@
 			getData3(bl) {
 				this.indexData6 = null
 				if (bl) {
-					uni.showLoading({
-						title: "加载中",
-						mask: true,
-					})
+					// uni.showLoading({
+					// 	title: "加载中",
+					// 	mask: true,
+					// })
 					this.myChartReady = false
 				}
 
@@ -1709,7 +1716,7 @@
 					this.indexData6 = res.data
 					if (bl) {
 						this.myChartReady = true
-						uni.hideLoading()
+						//uni.hideLoading()
 					}
 
 					this.getPie2(this.indexData6)
@@ -1861,33 +1868,73 @@
 				if (!this.myChart3) {
 					this.myChart3 = echarts.init(document.getElementById('pieEcharts3'), null, {
 						width: uni.upx2px(700),
-						height: uni.upx2px(300)
+						height: uni.upx2px(500)
 					});
 				}
 				var salesData = this.indexData7.graphMap;
 
-				for (var i in salesData) {
-					console.log(i, salesData[i])
-				}
+
 
 				const dates = Object.keys(salesData);
 
 				const cardTypes = Object.keys(salesData[dates[0]]);
+				var series = []
+				for (var i in cardTypes) {
+					var item = cardTypes[i]
+					var obj = {
+						name: item,
+						type: 'line',
+
+						data: []
+					}
+					for (var j in dates) {
 
+						var num = salesData[dates[j]][item]
+						obj.data.push(num)
+					}
+					series.push(obj)
+				}
 
-				console.log(dates, cardTypes)
 
 				var data1 = []
 				this.myChart3.clear();
 				var option = {
 					tooltip: {
-						trigger: 'axis'
+						trigger: 'axis',
+						axisPointer: {
+							type: 'shadow'
+						},
+						position: (e) => {
+							var x = e[0]
+							var y = e[1]
+
+							if (this.windowWidth) {
+
+								if (x < this.windowWidth / 2) {
+									return ['30%', '-20%']
+								} else {
+									return ['10%', '-20%']
+								}
+
+
+
+							}
+						},
+						formatter: (params) => {
+							var style = "float: right;margin-left: 20px;"
+							let result = `<div class="font-semibold">${params[0].name}</div>`;
+							params.forEach(item => {
+								result +=
+									`<p>${item.marker}${item.seriesName}: <span style='${style}'>${item.value}张</span></p>`;
+							});
+							return result;
+						}
 					},
 					axisPointer: {
 						type: 'shadow'
 					},
 					grid: {
-						top: 30,
+						top: 80,
 						left: 2,
 						right: 5,
 						bottom: 20,
@@ -1897,12 +1944,15 @@
 					xAxis: {
 						type: 'category',
 
-						data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
+						data: dates
 					},
 					yAxis: {
+
 						type: 'value'
-					}
+					},
+					series: series
 				}
+				console.log(option)
 				this.myChart3.setOption(option);
 
 			},
@@ -2089,7 +2139,7 @@
 				}
 
 				this.myChart2.setOption(option);
-				console.log(option)
+
 			},
 			getBar(type) {
 				var getData = this.indexData3.graphMap;
@@ -2165,7 +2215,7 @@
 							}
 						},
 						formatter: (value) => {
-							//console.log(value)
+
 							var dataIndex = value[0].dataIndex;
 							var name = keyStrN[dataIndex];
 							var style = "float: right;margin-left: 20px;"
@@ -2224,7 +2274,7 @@
 
 
 							return `<p>` + value[0].marker + `${name}</p>` + text1
-							// console.log(value)
+
 						}
 					},
 					legend: {
@@ -2343,9 +2393,11 @@
 				var getData = this.indexData3.graphMap;
 				for (var i in getData) {
 					var item = getData[i]
-					item.todayEQAmount2 = (item.todayEQAmount / 10000)
+					item.todayEQAmount2 = (parseInt(item.todayEQAmount) / 10000)
+
 
 					if (this.type_head == 1) {
+
 						this.showTopobj = item;
 					}
 				}
@@ -2355,7 +2407,9 @@
 				var colorName = "#333"
 
 				// this.showlist1 = ['收入', '利润', '次数','新电途'];
-				var showlistColor = ['#5872c0', '#de6e6a', '#f3c96b', '#69be8d', '#c661b4'];
+				var showlistColor = ['#5872c0', '#de6e6a', '#f3c96b', '#69be8d', '#c661b4', '#009688', '#4CAF50',
+					'#00BCD4', '#2196F3'
+				];
 				// this.showlist1 = ['收入', '利润', '电量', '新电途'];
 				// var sz2 = ['todayAmount', 'todayProfit', 'todayEQAmount2', 'todayXDTAmount'];
 
@@ -2363,12 +2417,18 @@
 				var sz2 = ['todayAmount', 'todayProfit', 'todayEQAmount2', 'todayXDTAmount', 'todayKDAmount',
 					'todayXXAmount'
 				];
+
 				if (this.showMonthlyCard && this.type_head == 2) {
 					var sz2 = ['todayAmountC', 'todayProfitC', 'todayEQAmount2', 'todayXDTAmount', 'todayKDAmount',
 						'todayXXAmount'
 					];
 				}
-
+				if (typebl) {
+					this.showlist1.push('充值人次')
+					this.showlist1.push('充值金额')
+					sz2.push('rechargeNum')
+					sz2.push('rechargeFee')
+				}
 				var zLevel = [20, 40, 10, 30, 9];
 				//var sz2 = ['todayAmount', 'todayProfit', 'todayEQNum','todayXDTAmount'];
 				if (!this.myChart) {
@@ -2509,7 +2569,7 @@
 
 
 
-							var style = "float: right;margin-left: 3px;"
+							var style = "float: right;margin-left: 8px;"
 							var text1 = ""
 							for (var i in value) {
 								var u = "元"
@@ -2518,6 +2578,10 @@
 								if (!num) {
 									num = 0;
 								}
+								if (value[i].seriesName == '充值人次') {
+									u = '次'
+									num = num
+								} else
 								if (value[i].seriesName == '电量') {
 									u = '度'
 									num = num.toFixed(2)
@@ -2555,8 +2619,18 @@
 									if (!num) {
 										num = 0;
 									}
-									num = parseFloat(num)
-									num = num.toFixed(2)
+									if (value[i].seriesName == "充值金额") {
+										u = "万元"
+										num = (num / 10000).toFixed(2)
+									}
+									if (value[i].seriesName == '充值人次') {
+										u = '次'
+										num = num
+									} else {
+										num = parseFloat(num)
+										num = num.toFixed(2)
+									}
+
 								}