Browse Source

运营分析停车场部分

zaijin 3 years ago
parent
commit
d4bc283a99

+ 12 - 2
common/apiurl.js

@@ -22,20 +22,30 @@ export const apiurl = {
 		getParkingLotRevenueDataUrl: '/admin/overview/roadtop',
 		// 获取车流量分析接口
 		getTrafficFlowDataUrl: '/admin/overview/vehicle',
+		// 获取车流量分析(停车场)接口
+		getParkingTrafficFlowDataUrl: '/admin/overview/parkvehicle',
 		// 获取收费员业绩排行接口
 		getTollCollectorPerformanceUrl: '/admin/overview/payeetop',
 		// 获取营收趋势统计接口
 		getRevenueTrendsDataUrl: '/admin/statis/roadamt',
 		// 获取路段分析车流量分析接口
 		getRoadTrafficFlowDataUrl: '/admin/statis/roadvehicle',
-		// 获取欠费分接口
+		// 获取欠费分接口
 		getArrearsDataUrl: '/admin/statis/oweamt',
+		// 获取欠费分析(停车场)接口
+		getParkingArrearsDataUrl: '/admin/statis/oweamtparking',
 		// 获取收入分析接口
 		getIncomeDataUrl: '/admin/income/amt',
+		// 获取收入分析(停车场)接口
+		getParkingIncomeDataUrl: '/admin/income/parkamt',
 		// 获取支付方式占比接口
 		getPaymentWaysDataUrl: '/admin/overview/paysource',
+		// 获取支付方式占比(停车场)接口
+		getParkingPaymentWaysDataUrl: '/admin/overview/parkpaysource',
 		// 获取支付来源分析接口
-		getPaySourceDataUrl: '/admin/overview/payplat'
+		getPaySourceDataUrl: '/admin/overview/payplat',
+		// 获取支付来源分析(停车场)接口
+		getParkingPaySourceDataUrl: '/admin/overview/parkpayplat'
 	},
 	// 统计报表模块接口
 	statisticalReport: {

+ 23 - 1
common/http.api.js

@@ -41,6 +41,11 @@ const install = (Vue, vm) => {
 			.getTrafficFlowDataUrl, {
 				params
 			}),
+		// 获取车流量分析(停车场)
+		getParkingTrafficFlowDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis
+			.getParkingTrafficFlowDataUrl, {
+				params
+			}),
 		// 获取收费员业绩排行
 		getTollCollectorPerformanceApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis
 			.getTollCollectorPerformanceUrl, {
@@ -60,19 +65,36 @@ const install = (Vue, vm) => {
 		getArrearsDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis.getArrearsDataUrl, {
 			params
 		}),
+		// 获取欠费分析(停车场)
+		getParkingArrearsDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis.getParkingArrearsDataUrl, {
+			params
+		}),
 		// 获取收入分析
 		getIncomeDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis.getIncomeDataUrl, {
 			params
 		}),
+		// 获取收入分析(停车场)
+		getParkingIncomeDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis.getParkingIncomeDataUrl, {
+			params
+		}),
 		// 获取支付方式占比分析
 		getPaymentWaysDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis
 			.getPaymentWaysDataUrl, {
 				params
 			}),
+		// 获取支付方式占比分析
+		getParkingPaymentWaysDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis
+			.getParkingPaymentWaysDataUrl, {
+				params
+			}),
 		// 获取支付来源
 		getPaySourceDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis.getPaySourceDataUrl, {
 			params
-		})
+		}),
+		// 获取支付来源(停车场)
+		getParkingPaySourceDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis.getParkingPaySourceDataUrl, {
+			params
+		}),
 	};
 	// 统计报表模块
 	let statisticalReportApi = {

+ 23 - 6
pages/dataOverview/operationalAnalysis/components/arrearsAnalysis.vue

@@ -38,7 +38,7 @@
 							}]
 						},
 						legend: {
-							show: false
+							show: true
 						},
 						dataLabel: false,
 						extra: {
@@ -55,7 +55,10 @@
 				chartData: {
 					categories: [],
 					series: [{
-						name: '',
+						name: '路段',
+						data: []
+					}, {
+						name: '停车场',
 						data: []
 					}]
 				}
@@ -68,11 +71,13 @@
 				this.getArrearsData()
 			},
 			getArrearsData() {
+				this.chartData.categories = []
+				this.chartData.series[0].data = []
+				this.chartData.series[1].data = []
 				uni.$u.api.operationalAnalysisApi.getArrearsDataApi({
 					reportType: this.reportType,
 					queryDate: this.queryDate
 				}).then(res => {
-					console.log(res)
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
 							this.chartData.categories = res.data.itemList.map(item => {
@@ -81,9 +86,21 @@
 							this.chartData.series[0].data = res.data.itemList.map(item => {
 								return item.amt
 							})
-						} else {
-							this.chartData.categories = []
-							this.chartData.series[0].data = []
+						}
+					}
+				})
+				uni.$u.api.operationalAnalysisApi.getParkingArrearsDataApi({
+					reportType: this.reportType,
+					queryDate: this.queryDate
+				}).then(res => {
+					if (res.code === 200) {
+						if (res.data.itemList && res.data.itemList.length) {
+							this.chartData.categories = res.data.itemList.map(item => {
+								return item.statisTime
+							})
+							this.chartData.series[1].data = res.data.itemList.map(item => {
+								return item.amt
+							})
 						}
 					}
 				})

+ 43 - 22
pages/dataOverview/operationalAnalysis/components/incomeAnalysis.vue

@@ -15,7 +15,7 @@
 			</view>
 		</view>
 		<view class="revenue-line">
-			<ColumnChart v-if="chartData.series[0].data.length" :chartData="chartData" :title="title" :opts="opts"/>
+			<ColumnChart v-if="chartData.series[0].data.length || chartData.series[1].data.length" :chartData="chartData" :title="title" :opts="opts"/>
 			<view class="empty" v-else>
 				<u-empty></u-empty>
 			</view>
@@ -57,7 +57,7 @@
 							}]
 						},
 						legend: {
-							show: false
+							show: true
 						},
 						dataLabel: false,
 						extra: {
@@ -73,10 +73,14 @@
 			return {
 				chartData: {
 					categories: [],
-					series: [{
-						name: '',
-						data: []
-					}]
+					series: [
+						{
+							name: '路段',
+							data: []
+						}, {
+							name: '停车场',
+							data: []
+						}]
 				},
 				searchContent: {
 					text: '',
@@ -88,37 +92,41 @@
 				queryDate: ''
 			}
 		},
-		created() {
-			this.getDict();
-		},
+		// created() {
+		// 	this.getDict();
+		// },
 		methods: {
 			getData({ reportType, queryDate }) {
 				this.reportType = reportType
 				this.queryDate = queryDate
-				this.getIncomeData()
+				this.getDict();
 			},
 			getDict() {
 				uni.$u.api.getDictApi({  type: 'income_type'}).then(res => {
-					console.log(res)
 					if (res.code === 200) {
-							let list = res.data.map((item => {
-								return {
-									text: item.dictLabel,
-									value: item.dictValue
-								}
-							}))
-							this.dictList = [list]
+						let list = res.data.map((item => {
+							return {
+								text: item.dictLabel,
+								value: item.dictValue
+							}
+						}))
+						this.dictList = [list]
+						if (!this.searchContent.value) {
 							this.searchContent = this.dictList[0][0]
+						}
+						this.getIncomeData()
 					}
 				})
 			},
 			getIncomeData() {
+				this.chartData.categories = []
+				this.chartData.series[0].data = []
+				this.chartData.series[1].data = []
 				uni.$u.api.operationalAnalysisApi.getIncomeDataApi({
 					reportType: this.reportType,
 					queryDate: this.queryDate,
 					incomeType: this.searchContent.value
 				}).then(res => {
-					console.log(res)
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
 							this.chartData.categories = res.data.itemList.map(item => {
@@ -127,9 +135,22 @@
 							this.chartData.series[0].data = res.data.itemList.map(item => {
 								return item.amt
 							})
-						} else {
-							this.chartData.categories = []
-							this.chartData.series[0].data = []
+						}
+					}
+				})
+				uni.$u.api.operationalAnalysisApi.getParkingIncomeDataApi({
+					reportType: this.reportType,
+					queryDate: this.queryDate,
+					incomeType: this.searchContent.value
+				}).then(res => {
+					if (res.code === 200) {
+						if (res.data.itemList && res.data.itemList.length) {
+							this.chartData.categories = res.data.itemList.map(item => {
+								return item.statisTime
+							})
+							this.chartData.series[1].data = res.data.itemList.map(item => {
+								return item.amt
+							})
 						}
 					}
 				})

+ 33 - 3
pages/dataOverview/operationalAnalysis/components/paymentMethod.vue

@@ -1,8 +1,14 @@
 <!-- 支付占比分析分析 -->
 <template>
-	<view class="revenue">
-		<view class="revenue-line">
-			<PieChart v-if="chartData.series[0].data.length" :chartData="chartData" :title="title"/>
+	<view class="revenue-box">
+		<view class="revenue-line revenue">
+			<PieChart v-if="chartData.series[0].data.length" :chartData="chartData" :title="`路段(${title})`"/>
+			<view class="empty" v-else>
+				<u-empty></u-empty>
+			</view>
+		</view>
+		<view class="revenue-line revenue">
+			<PieChart v-if="chartData1.series[0].data.length" :chartData="chartData1" :title="`停车场(${title})`"/>
 			<view class="empty" v-else>
 				<u-empty></u-empty>
 			</view>
@@ -31,6 +37,11 @@
 					series: [{
 						data: []
 					}]
+				},
+				chartData1: {
+					series: [{
+						data: []
+					}]
 				}
 			}
 		},
@@ -69,6 +80,24 @@
 						}
 					}
 				})
+				uni.$u.api.operationalAnalysisApi.getParkingPaymentWaysDataApi({
+					reportType: this.reportType,
+					queryDate: this.queryDate
+				}).then(res => {
+					if (res.code === 200) {
+						if (res.data.itemList && res.data.itemList.length) {
+							let list = res.data.itemList.map(item => {
+								return {
+									name: this.getDictLabel(item.paySource),
+									value: item.amt
+								}
+							})
+							this.chartData1.series[0].data = list
+						} else {
+							this.chartData1.series[0].data = []
+						}
+					}
+				})
 			},
 			getDictLabel(value) {
 				let name
@@ -88,6 +117,7 @@
 	.revenue {
 		background-color: #fff;
 		border-radius: 5px;
+		margin-bottom: 10px;
 		.empty {
 			padding: 15px;
 		}

+ 3 - 4
pages/dataOverview/operationalAnalysis/components/revenueRanking.vue

@@ -19,9 +19,9 @@
 			tableTh: {
 				type: Array,
 				default: () => [
-					{ width: 100, field: '路段编号', key: 'roadNo' },
-					{ width: 100, field: '路段名称', key: 'roadName' },
-					{ width: 100, field: '收益(元)', key: 'amt' }
+					{ field: '路段编号', key: 'roadNo' },
+					{ field: '路段名称', key: 'roadName' },
+					{ field: '收益(元)', key: 'amt' }
 				]
 			}
 		},
@@ -52,7 +52,6 @@
 					reportType: this.reportType,
 					queryDate: this.queryDate
 				}).then(res => {
-					console.log(res)
 					if (res.code === 200) {
 						this.tableData.list = res.rows
 						this.tableData.total = res.total

+ 26 - 7
pages/dataOverview/operationalAnalysis/components/sourceOfPayment.vue

@@ -2,7 +2,7 @@
 <template>
 	<view class="revenue">
 		<view class="revenue-line">
-			<LineChart v-if="chartData.series[0].data.length" :chartData="chartData" :title="title" :opts="opts"/>
+			<LineChart v-if="chartData.series[0].data.length || chartData.series[1].data.length" :chartData="chartData" :title="title" :opts="opts"/>
 			<view class="empty" v-else>
 				<u-empty></u-empty>
 			</view>
@@ -37,7 +37,7 @@
 							}]
 						},
 						legend: {
-							show: false
+							show: true
 						},
 						dataLabel: false,
 						extra: {
@@ -55,7 +55,10 @@
 				chartData: {
 					categories: [],
 					series: [{
-						name: '',
+						name: '路段',
+						data: []
+					}, {
+						name: '停车场',
 						data: []
 					}]
 				},
@@ -80,11 +83,13 @@
 				})
 			},
 			getPaySourceData() {
+				this.chartData.categories = []
+				this.chartData.series[0].data = []
+				this.chartData.series[1].data = []
 				uni.$u.api.operationalAnalysisApi.getPaySourceDataApi({
 					reportType: this.reportType,
 					queryDate: this.queryDate
 				}).then(res => {
-					console.log(res)
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
 							let cateList = []
@@ -95,9 +100,23 @@
 							this.chartData.series[0].data = res.data.itemList.map(item => {
 								return item.amt
 							})
-						} else {
-							this.chartData.categories = []
-							this.chartData.series[0].data = []
+						}
+					}
+				})
+				uni.$u.api.operationalAnalysisApi.getParkingPaySourceDataApi({
+					reportType: this.reportType,
+					queryDate: this.queryDate
+				}).then(res => {
+					if (res.code === 200) {
+						if (res.data.itemList && res.data.itemList.length) {
+							let cateList = []
+							res.data.itemList.forEach(item => {
+								cateList.push(this.getDictLabel(item.payPlatform))
+							})
+							this.chartData.categories = cateList
+							this.chartData.series[1].data = res.data.itemList.map(item => {
+								return item.amt
+							})
 						}
 					}
 				})

+ 21 - 6
pages/dataOverview/operationalAnalysis/components/trafficFlow.vue

@@ -2,7 +2,7 @@
 <template>
 	<view class="revenue">
 		<view class="revenue-line">
-			<LineChart v-if="chartData.series[0].data.length" :chartData="chartData" :title="title" :opts="opts"/>
+			<LineChart v-if="chartData.series[0].data.length || chartData.series[1].data.length" :chartData="chartData" :title="title" :opts="opts"/>
 			<view class="empty" v-else>
 				<u-empty></u-empty>
 			</view>
@@ -38,7 +38,7 @@
 							}]
 						},
 						legend: {
-							show: false
+							show: true
 						},
 						dataLabel: false,
 						extra: {
@@ -55,7 +55,10 @@
 				chartData: {
 					categories: [],
 					series: [{
-						name: '',
+						name: '路段',
+						data: []
+					}, {
+						name: '停车场',
 						data: []
 					}]
 				}
@@ -63,6 +66,9 @@
 		},
 		methods: {
 			getData({ reportType, queryDate }) {
+				this.chartData.categories = []
+				this.chartData.series[0].data = []
+				this.chartData.series[1].data = []
 				uni.$u.api.operationalAnalysisApi.getTrafficFlowDataApi({ reportType, queryDate }).then(res => {
 					if (res.code === 200) {
 						if (res.data.itemList && res.data.itemList.length) {
@@ -72,9 +78,18 @@
 							this.chartData.series[0].data = res.data.itemList.map(item => {
 								return item.vehicleCount
 							})
-						} else {
-							this.chartData.categories = []
-							this.chartData.series[0].data = []
+						}
+					}
+				})
+				uni.$u.api.operationalAnalysisApi.getParkingTrafficFlowDataApi({ reportType, queryDate }).then(res => {
+					if (res.code === 200) {
+						if (res.data.itemList && res.data.itemList.length) {
+							this.chartData.categories = res.data.itemList.map(item => {
+								return item.statisTime
+							})
+							this.chartData.series[1].data = res.data.itemList.map(item => {
+								return item.vehicleCount
+							})
 						}
 					}
 				})

+ 1 - 0
pages/dataOverview/statisticalReport/components/report.scss

@@ -46,6 +46,7 @@
 		&-td {
 			font-size: 12px;
 			color: #434343;
+			word-wrap: break-word;
 		}
 	}