Selaa lähdekoodia

新增 销售排行 统计,优化代理商名字展示

吴洪双 5 vuotta sitten
vanhempi
commit
85d3914aa3

+ 2 - 2
configs/env.js

@@ -9,8 +9,8 @@ let configs = {
 if (process.env.NODE_ENV === 'development') {
 	// 测试环境
 	configs = Object.assign(configs, {
-		baseUrl: 'https://app.sunzee.com.cn/ShenzeeServer',
-		// baseUrl: 'http://127.0.0.1:8090',
+		// baseUrl: 'https://app.sunzee.com.cn/ShenzeeServer',
+		baseUrl: 'http://127.0.0.1:8090',
 	});
 }
 

+ 3 - 1
main.js

@@ -4,6 +4,7 @@ import apis from './configs/http';
 import store from './store';
 import env from '@/configs/env';
 import mainStatistics from '@/pages/Charts/mainStatistics';
+import equipmentStatistics from '@/pages/Charts/equipmentStatistics';
 
 
 
@@ -26,4 +27,5 @@ Object.keys(apis).forEach(key => {
 	Vue.prototype[`$${key}`] = apis[key];
 });
 
-Vue.component('mainStatistics', mainStatistics);
+Vue.component('mainStatistics', mainStatistics);
+Vue.component('equipmentStatistics', equipmentStatistics);

+ 20 - 0
pages.json

@@ -24,6 +24,14 @@
 			}
 		},
 		{
+		    "path" : "pages/User/equipmentSratisticsList",
+		    "style" : {
+				"navigationBarTitleText":"机器排行",
+				// "disableScroll": true,
+				"enablePullDownRefresh": true
+			}
+		},
+		{
 		    "path" : "pages/User/equipmentStatusList",
 		    "style" : {
 				"navigationBarTitleText":"机器状态",
@@ -42,6 +50,12 @@
 			"style": {
 				"navigationBarTitleText": "统计图表"
 			}
+		},
+		{
+			"path": "pages/Charts/equipmentStatistics",
+			"style": {
+				"navigationBarTitleText": "销售排行"
+			}
 		}
     ],
 	"globalStyle": {
@@ -70,6 +84,12 @@
 				"text": "机器销售"
 			},
 			{
+				"pagePath": "pages/User/equipmentSratisticsList",
+				"iconPath": "static/img/equipmentSratisticsList.png",
+				"selectedIconPath": "static/img/equipmentSratisticsListHL.png",
+				"text": "机器排行"
+			},
+			{
 				"pagePath": "pages/User/equipmentStatusList",
 				"iconPath": "static/img/equipment.png",
 				"selectedIconPath": "static/img/equipmentHL.png",

+ 8 - 1
pages/Charts/elseStatistics.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<mainStatistics :equipmentId="equipmentIdData" :adminId="adminIdData" style="padding: 20upx;"></mainStatistics>
+		<mainStatistics :pname="pnameData" :equipmentId="equipmentIdData" :adminId="adminIdData" style="padding: 20upx;"></mainStatistics>
 	</view>
 </template>
 
@@ -13,6 +13,7 @@
 			return {
 				equipmentId: '',
 				adminId: '',
+				pname: '',
 			}
 		},
 		computed: {
@@ -27,10 +28,16 @@
 					return this.adminId;
 				}
 			},
+			pnameData:{
+				get(){
+					return this.pname;
+				}
+			},
 		},
 		onLoad(option){
 			this.equipmentId = option['equipmentId'];
 			this.adminId = option['adminId'];
+			this.pname = option['pname'];
 			console.log("option:",this.equipmentId,this.adminId)
 			// this.mainStatistics.init();
 		},

+ 482 - 0
pages/Charts/equipmentStatistics.vue

@@ -0,0 +1,482 @@
+<template>
+	<view>
+		<view class="head">
+			<view class="company">
+				<font style="color: #F76260;">申泽智能物联</font>
+			</view>
+			<view class="pname">
+				<font class="wenzi" style="color: #F76260;text-align:right">用户:{{pname}}</font>
+			</view>
+		</view>
+		<view class="qiun-columns">
+			<view class="qiun-bg-white qiun-title-bar qiun-common-mt">
+				<view class="qiun-title-dot-light">今日销售情况</view>
+				<view style="text-align: center;position: relative;">
+					<image @click="pre('day')" class="preImg" src="/static/img/leftTriangle.png"></image>
+					<span>{{startDate1}}</span>
+					<image @click="next('day')" class="nextImg" src="/static/img/rightTriangle.png"></image>
+				</view>
+			</view>
+			<view class="qiun-charts" style="background-color: #E5FDC3;">
+				<canvas canvas-id="canvaColumn1" id="canvaColumn1" class="charts" disable-scroll=true @touchstart="touchLine1" @touchmove="moveLine1"
+				 @touchend="touchEndLine1" style="background-color: #E5FDC3;"></canvas>
+			</view>
+		</view>
+		<view class="qiun-columns">
+			<view class="qiun-bg-white qiun-title-bar qiun-common-mt">
+				<view class="qiun-title-dot-light">本周销售情况</view>
+				<view style="text-align: center;position: relative;">
+					<image @click="pre('week')" class="preImg" src="/static/img/leftTriangle.png"></image>
+					<span>{{startDate2}} 至 {{endDate2}}</span>
+					<image @click="next('week')" class="nextImg" src="/static/img/rightTriangle.png"></image>
+				</view>
+			</view>
+			<view class="qiun-charts" style="background-color: #E5FDC3;">
+				<canvas canvas-id="canvaColumn2" id="canvaColumn2" class="charts" disable-scroll=true @touchstart="touchLine2" @touchmove="moveLine2"
+				 @touchend="touchEndLine2" style="background-color: #E5FDC3;"></canvas>
+			</view>
+		</view>
+		<view class="qiun-columns">
+			<view class="qiun-bg-white qiun-title-bar qiun-common-mt">
+				<view class="qiun-title-dot-light">本月销售情况</view>
+				<view style="text-align: center;position: relative;">
+					<image @click="pre('month')" class="preImg" src="/static/img/leftTriangle.png"></image>
+					<span>{{startDate3}} 至 {{endDate3}}</span>
+					<image @click="next('month')" class="nextImg" src="/static/img/rightTriangle.png"></image>
+				</view>
+			</view>
+			<view class="qiun-charts" style="background-color: #E5FDC3;">
+				<canvas canvas-id="canvaColumn3" id="canvaColumn3" class="charts" disable-scroll=true @touchstart="touchLine3" @touchmove="moveLine3"
+				 @touchend="touchEndLine3" style="background-color: #E5FDC3;"></canvas>
+			</view>
+		</view>
+		<view class="qiun-columns">
+			<view class="qiun-bg-white qiun-title-bar qiun-common-mt">
+				<view class="qiun-title-dot-light">本年销售情况</view>
+				<view style="text-align: center;position: relative;">
+					<image @click="pre('year')" class="preImg" src="/static/img/leftTriangle.png"></image>
+					<span>{{startDate4}} 至 {{endDate4}}</span>
+					<image @click="next('year')" class="nextImg" src="/static/img/rightTriangle.png"></image>
+				</view>
+			</view>
+			<view class="qiun-charts" style="background-color: #E5FDC3;">
+				<canvas canvas-id="canvaColumn4" id="canvaColumn4" class="charts" disable-scroll=true @touchstart="touchLine4" @touchmove="moveLine4"
+				 @touchend="touchEndLine4" style="background-color: #E5FDC3;"></canvas>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { mapState, mapActions, mapMutations } from 'vuex';
+	import uCharts from '@/components/u-charts/u-charts.js';
+	import {dateUtils} from '@/common/util.js';
+	
+	var _self;
+	var canvaColumn1=null;
+	var canvaColumn2=null;
+	var canvaColumn3=null;
+	var canvaColumn4=null;
+	export default {
+		name: 'equipmentStatistics',
+		props: {
+			adminId: '',
+		},
+		data() {
+			return {
+				pname:'',
+				cWidth: '',
+				cHeight: '',
+				pixelRatio: 1,
+				startDate1: '',
+				endDate1: '',
+				startDate2: '',
+				endDate2: '',
+				startDate3: '',
+				endDate3: '',
+				startDate4: '',
+				endDate4: '',
+			}
+		},
+		computed: {
+			...mapState(['loginUser']),
+		},
+		onLoad(option){
+			console.log("onLoad");
+			this.adminId = option['adminId'];
+			this.pname = option['pname'];
+			this.init();
+		},
+		mounted() {
+			console.log("mounted");
+			this.init();
+		},
+		methods: {
+			...mapActions('chart', ['getEquipmentStatistics','getMainStatistics','getMachineNum']),
+			async init(){
+				if(this.pname===''){
+					this.pname = uni.getStorageSync("name");
+				}
+				console.log("adminId:" + this.adminId)
+				_self = this;
+				//图表中图
+				this.cWidth = uni.upx2px(600);
+				this.cHeight = uni.upx2px(430);
+
+				await this.initDateRang(new Date(),'day');
+				await this.initDateRang(new Date(),'week');
+				await this.initDateRang(new Date(),'month');
+				await this.initDateRang(new Date(),'year');
+			},
+		
+			initDateRang(day,chartType) {
+				const daystr = dateUtils.formateDate(day, 'yyyy/MM/dd');
+				if(chartType === 'day'){
+					this.startDate1 = dateUtils.formateDate(day, 'yyyy/MM/dd');
+				}
+				if (chartType === 'week') {
+					this.startDate2 = dateUtils.formateDate(dateUtils.getFirstDayOfWeek(day), 'yyyy/MM/dd');
+					this.endDate2 = dateUtils.formateDate(dateUtils.getLastDayOfWeek(day), 'yyyy/MM/dd');
+				}
+				if (chartType === 'month') {
+					this.startDate3 = dateUtils.formateDate(dateUtils.getCurrentMonFirstDate(day), 'yyyy/MM/dd');
+					this.endDate3 = dateUtils.formateDate(dateUtils.getCurrentMonLastDate(day), 'yyyy/MM/dd');
+				}
+				if (chartType === 'year') {
+					this.startDate4 = dateUtils.formateDate(dateUtils.getCurrentYearFirstDate(day), 'yyyy/MM/dd');
+					this.endDate4 = dateUtils.formateDate(dateUtils.getCurrentYearLastDate(day), 'yyyy/MM/dd');
+				}
+				
+				return this.getStatisticsData(chartType);
+			},
+			/**上一个 */
+			pre(chartType) {
+				let day;
+				if (chartType === 'day') { // 日
+					day = new Date(this.startDate1);
+					day.setDate(day.getDate() - 1);
+				}
+				if(chartType === 'week'){ // 周
+					day = new Date(this.startDate2);
+					day.setDate(day.getDate() - 7);
+				}
+				if (chartType === 'month') { // 月
+					day = new Date(this.startDate3);
+					day.setMonth(day.getMonth() - 1);
+				}
+				if (chartType === 'year') { // 年
+					day = new Date(this.startDate4);
+					day.setFullYear(day.getFullYear() - 1);
+				}
+				this.initDateRang(day,chartType);				
+			},
+			/**下一个 */
+			next(chartType) {
+				let day;
+				if (chartType === 'day') { // 日
+					day = new Date(this.startDate1);
+					day.setDate(day.getDate() + 1);
+				}
+				if(chartType === 'week'){ // 周
+					day = new Date(this.startDate2);
+					day.setDate(day.getDate() + 7);
+				}
+				if (chartType === 'month') { // 月
+					day = new Date(this.startDate3);
+					day.setMonth(day.getMonth() + 1);
+				}
+				if (chartType === 'year') { // 年
+					day = new Date(this.startDate4);
+					day.setFullYear(day.getFullYear() + 1);
+				}
+				
+				this.initDateRang(day,chartType);
+			},
+			getStatisticsData(chartType) {
+				const param = {
+					'chartType': chartType
+				};
+				if(chartType=='day'){
+					param['startDate'] = this.startDate1;
+					param['endDate'] = this.startDate1;
+				}
+				if(chartType=='week'){
+					param['startDate'] = this.startDate2;
+					param['endDate'] = this.endDate2;
+				}
+				if(chartType=='month'){
+					param['startDate'] = this.startDate3;
+					param['endDate'] = this.endDate3;
+				}
+				if(chartType=='year'){
+					param['startDate'] = this.startDate4;
+					param['endDate'] = this.endDate4;
+				}
+				if(this.adminId){ // 子组件,则拿传过来的参
+					param['adminId'] = this.adminId;
+				}else if ('admin' !== this.loginUser['username']) { //否则为主页,拿登录用户
+					param['adminId'] = this.loginUser['id'];
+				}
+				if (this.equipmentId) {
+					param['equipmentId'] = this.equipmentId;
+				}
+				
+				return this.getEquipmentStatistics(param)
+					.then(data => {
+							uni.stopPullDownRefresh();
+							if(param['chartType']=='day'){
+								canvaColumn1 = this.initChart('canvaColumn1',data);
+							}
+							if(param['chartType']=='week'){
+								canvaColumn2 = this.initChart('canvaColumn2',data);
+							}
+							if(param['chartType']=='month'){
+								canvaColumn3 = this.initChart('canvaColumn3',data);
+							}
+							if(param['chartType']=='year'){
+								canvaColumn4 = this.initChart('canvaColumn4',data);
+							}
+							
+						}
+					, _ => {
+							uni.stopPullDownRefresh();
+							if(param['chartType']=='day'){
+								canvaColumn1 = this.initChart('canvaColumn1',{categories:['暂无数据'],series:[{name: '销售个数',data:[0]}]});
+							}
+							if(param['chartType']=='week'){
+								canvaColumn2 = this.initChart('canvaColumn2',{categories:['暂无数据'],series:[{name: '销售个数',data:[0]}]});
+							}
+							if(param['chartType']=='month'){
+								canvaColumn3 = this.initChart('canvaColumn3',{categories:['暂无数据'],series:[{name: '销售个数',data:[0]}]});
+							}
+							if(param['chartType']=='year'){
+								canvaColumn4 = this.initChart('canvaColumn4',{categories:['暂无数据'],series:[{name: '销售个数',data:[0]}]});
+							}
+						}
+					);
+			},
+			initChart(canvasId, chartData){
+				return new uCharts({
+					$this: _self,
+					canvasId: canvasId,
+					enableScroll: true,
+					type: 'column',
+					legend: true,
+					fontSize: 11,
+					background: '#E5FDC3',//y轴颜色
+					pixelRatio: 1,
+					animation: true,
+					categories: chartData.categories,
+					series: chartData.series,
+					xAxis: {
+						type: 'grid',
+						gridType: 'dash',
+						itemCount: 4, //x轴单屏显示数据的数量,默认为5个
+						scrollShow: true, //新增是否显示滚动条,默认false
+						scrollAlign: 'left', //滚动条初始位置
+						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF  滚动条颜色底色
+						scrollColor: '#DEE7F7', //默认为 #A6A6A6  滚动条颜色
+						// disableGrid:true,
+					},
+					yAxis: {
+						//disabled:true
+					},
+					dataLabel: true,
+					width: _self.cWidth * _self.pixelRatio,
+					height: _self.cHeight * _self.pixelRatio,
+					extra: {
+						column: {
+							// width: _self.cWidth*_self.pixelRatio*0.45/chartData.categories.length
+							width: 30
+						}
+					}
+				});
+			},
+			touchLine1(e) {
+				if(canvaColumn1){
+					canvaColumn1.scrollStart(e);
+				}
+			},
+			moveLine1(e) {
+				if(canvaColumn1){
+					canvaColumn1.scroll(e);
+				}
+			},
+			touchEndLine1(e) {
+				if(canvaColumn1){
+					canvaColumn1.scrollEnd(e);
+					//下面是toolTip事件,如果滚动后不需要显示,可不填写
+					canvaColumn1.showToolTip(e, {
+						format: function(item, category) {
+							return category + ' ' + item.name + ':' + item.data
+						}
+					});
+				}
+			},
+			touchLine2(e) {
+				if(canvaColumn2){
+					canvaColumn2.scrollStart(e);
+				}
+			},
+			moveLine2(e) {
+				if(canvaColumn2){
+					canvaColumn2.scroll(e);
+				}
+			},
+			touchEndLine2(e) {
+				if(canvaColumn2){
+					canvaColumn2.scrollEnd(e);
+					//下面是toolTip事件,如果滚动后不需要显示,可不填写
+					canvaColumn2.showToolTip(e, {
+						format: function(item, category) {
+							return category + ' ' + item.name + ':' + item.data
+						}
+					});
+				}
+			},
+			touchLine3(e) {
+				if(canvaColumn3){
+					canvaColumn3.scrollStart(e);
+				}
+			},
+			moveLine3(e) {
+				if(canvaColumn3){
+					canvaColumn3.scroll(e);
+				}
+			},
+			touchEndLine3(e) {
+				if(canvaColumn3){
+					canvaColumn3.scrollEnd(e);
+					//下面是toolTip事件,如果滚动后不需要显示,可不填写
+					canvaColumn3.showToolTip(e, {
+						format: function(item, category) {
+							return category + ' ' + item.name + ':' + item.data
+						}
+					});
+				}
+			},
+			touchLine4(e) {
+				if(canvaColumn4){
+					canvaColumn4.scrollStart(e);
+				}
+			},
+			moveLine4(e) {
+				if(canvaColumn4){
+					canvaColumn4.scroll(e);
+				}
+			},
+			touchEndLine4(e) {
+				if(canvaColumn4){
+					canvaColumn4.scrollEnd(e);
+					//下面是toolTip事件,如果滚动后不需要显示,可不填写
+					canvaColumn4.showToolTip(e, {
+						format: function(item, category) {
+							return category + ' ' + item.name + ':' + item.data
+						}
+					});
+				}
+			},
+		}
+	}
+</script>
+<style>
+	page {
+		background: #F2F2F2;
+		width: 750upx;
+		overflow-x: hidden;
+	}
+	.head{
+		display: flex;
+		flex-direction: row;
+	}
+	.company{
+		padding-left: 15upx;
+		width: 48%;
+	}
+	.pname{
+		width: 48%;
+		text-align:right;
+	}
+	.wenzi{
+		padding-right: 0upx;
+		/* text-align:right; */
+		white-space: nowrap;
+		overflow: hidden;
+		/* text-overflow: ellipsis; */
+	}
+	.qiun-padding {
+		padding: 2%;
+		width: 96%;
+	}
+	
+	.qiun-wrap {
+		display: flex;
+		flex-wrap: wrap;
+	}
+	
+	.qiun-rows {
+		display: flex;
+		flex-direction: row !important;
+	}
+	
+	.qiun-columns {
+		display: flex;
+		flex-direction: column !important;
+	}
+	
+	.qiun-common-mt {
+		margin-top: 0upx;
+		height: 170upx;
+	}
+	
+	.qiun-bg-white {
+		background: #FFFFFF;
+	}
+	
+	.qiun-title-bar {
+		width: 100%;
+		/* padding: 10upx 2%; */
+		flex-wrap: nowrap;
+		border-radius: 15upx;
+	}
+	.color{
+		background:#56de9e;
+	}
+	.qiun-title-dot-light {
+		/* border-left: 10upx solid #0ea391; */
+		padding-top: 10upx;
+		border-left: 20upx;
+		padding-left: 20upx;
+		font-family: "宋体";
+		font-size: 50upx;
+		color: #000000;
+	}
+	.qiun-title-dot-light1 {
+		/* border-left: 10upx solid #0ea391; */
+		padding-top: 10upx;
+		border-left: 20upx;
+		padding-left: 20upx;
+		font-family: "宋体";
+		font-size: 30upx;
+		color: #000000;
+	}
+	.qiun-charts {
+		width: 750upx;
+		height: 430upx;
+		background-color: #FFFFFF;
+		margin: auto;
+	}
+	
+	.charts {
+		width: 600upx;
+		height: 430upx;
+		background-color: #FFFFFF;
+		margin: auto;
+	}
+	.preImg {
+		position: absolute;left: 40upx; width: 60upx;height: 60upx;
+	}
+	.nextImg {
+		position: absolute;right: 40upx; width: 60upx;height: 60upx;
+	}
+</style>

+ 1 - 5
pages/Charts/mainStatistics.vue

@@ -209,8 +209,6 @@
 		// 	this.init();
 		// },
 		onShow() {
-			var pname = uni.getStorageSync("name");
-			this.pname = pname;
 			var test = uni.getStorageSync('test');
 			//判断是不是初次登陆
 			if(test == 2){
@@ -219,8 +217,6 @@
 		},
 		mounted() {
 			console.log("mounted");
-			var pname = uni.getStorageSync("name");
-			this.pname = pname;
 			this.init();
 		},
 		methods: {
@@ -709,4 +705,4 @@
 	.nextImg {
 		position: absolute;right: 40upx; width: 27upx;height: 45upx;
 	}
-</style>
+</style>

+ 94 - 0
pages/User/equipmentSratisticsList.vue

@@ -0,0 +1,94 @@
+<template>
+	<view v-if="merchantListSize>1">
+		<uni-collapse :accordion="true">
+			<uni-list>
+				<view  v-for="merchant in merchantList" :key="merchant.id">
+					<uni-list-item :title="getMerchantTitle(merchant)" @click="openEquipmentStatisticsByAdmin(merchant)"/>
+				</view>
+			</uni-list>
+		</uni-collapse>	
+	</view>
+	<view v-else>
+		<equipmentStatistics v-if="merchantList[0].id" :adminId="adminId" style="padding: 20upx;"></equipmentStatistics>
+		<view v-else style="text-align: center;">暂无数据</view>
+	</view>
+</template>
+
+<script>
+    import {mapState,mapActions,mapMutations} from 'vuex'
+	import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
+	import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
+	import uniList from '@/components/uni-list/uni-list.vue'
+	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
+	import {equipmentStatistics} from '@/pages/Charts/equipmentStatistics';
+    export default {
+		components: {
+			uniCollapse,
+			uniCollapseItem,
+			uniList,
+			uniListItem
+		},
+		data() {
+			return {
+				adminId: '',
+				merchantList:[{equipmentList:[]}],
+				extraIcon: {
+					color: '#4cd964',
+					size: '22',
+					type: 'spinner'
+				}
+			}
+		},
+		computed: {
+			...mapState(['loginUser']),
+			adminIdData:{
+				get(){
+					return this.adminId;
+				}
+			},
+			merchantListSize:{
+				get(){
+					console.log('merchantList1',this.merchantList.length)
+					return this.merchantList.length;
+				}
+			}
+		},
+		onShow(state){
+			this.adminId = this.loginUser.id;
+			this.init();
+		},
+		onPullDownRefresh() {
+			this.init();
+		},
+		methods: {
+			...mapActions('chart', ['getEquipmentListByUser']),
+			async init(){
+				await this.getEquipmentListData();
+			},
+			openEquipmentStatisticsByAdmin(merchant){
+				const adminId = merchant.id;
+				const pname = merchant.name;
+				uni.navigateTo({
+					url: '/pages/Charts/equipmentStatistics?adminId=' + adminId+'&pname='+pname,
+				});
+			},
+			getMerchantTitle(merchant){
+				return merchant.name?merchant.name:merchant.username;
+			},
+			getEquipmentListData(){
+				console.log('getEquipmentListData')
+				this.getEquipmentListByUser(this.loginUser)
+				.then(data => {
+					this.merchantList = data;
+					console.log('merchantList2',this.merchantList.length)
+					uni.stopPullDownRefresh();
+				}
+				, _ => void uni.stopPullDownRefresh());
+			}
+		}
+    }
+</script>
+
+<style>
+	
+</style>

+ 8 - 8
pages/User/merchantList.vue

@@ -8,9 +8,9 @@
 						<view v-if="merchant.equipmentList.length>0">
 							<uni-collapse :accordion="true">
 								<uni-list>
-									<uni-list-item title="总销售情况" @click="openByAdmin(merchant.id)"/>
+									<uni-list-item title="总销售情况" @click="openByAdmin(merchant.name,merchant.id)"/>
 									<view  v-for="equipment in merchant.equipmentList" :key="equipment.id">
-										<uni-list-item :title="getEquipmentTitle(equipment)" @click="openByEquipment(equipment.id)"/>
+										<uni-list-item :title="getEquipmentTitle(equipment)" @click="openByEquipment(merchant.name,equipment.id)"/>
 									</view>
 								</uni-list>
 							</uni-collapse>	
@@ -24,9 +24,9 @@
 		<view v-if="merchantList[0].equipmentList.length>1">
 			<uni-collapse :accordion="true">
 				<uni-list>
-					<uni-list-item title="总销售情况" @click="openByAdmin(merchantList[0].id)"/>
+					<uni-list-item title="总销售情况" @click="openByAdmin(merchantList[0].name,merchantList[0].id)"/>
 					<view  v-for="equipment in merchantList[0].equipmentList" :key="equipment.id">
-						<uni-list-item :title="getEquipmentTitle(equipment)" @click="openByEquipment(equipment.id)"/>
+						<uni-list-item :title="getEquipmentTitle(equipment)" @click="openByEquipment(merchantList[0].name,equipment.id)"/>
 					</view>
 				</uni-list>
 			</uni-collapse>	
@@ -70,14 +70,14 @@
 		},
 		methods: {
 			...mapActions('chart', ['getEquipmentListByUser']),
-			openByAdmin(adminId){
+			openByAdmin(pname,adminId){
 				uni.navigateTo({
-					url: '/pages/Charts/elseStatistics?adminId=' + adminId,
+					url: '/pages/Charts/elseStatistics?adminId=' + adminId+'&pname='+pname,
 				});
 			},
-			openByEquipment(equipmentId){
+			openByEquipment(pname,equipmentId){
 				uni.navigateTo({
-					url: '/pages/Charts/elseStatistics?equipmentId=' + equipmentId,
+					url: '/pages/Charts/elseStatistics?equipmentId=' + equipmentId+'&pname='+pname,
 				});
 			},
 			getMerchantTitle(merchant){

BIN
static/img/equipmentSratisticsList.png


BIN
static/img/equipmentSratisticsListHL.png


+ 8 - 1
store/modules/chart.js

@@ -4,8 +4,14 @@ import { redirectToLogin, redirectTo } from '@/common/NavFuncs';
 export default {
 	namespaced: true,
 	actions: {
+		getEquipmentStatistics({ commit },param) {
+			return apis.sz.post('/TOrder/getEquipmentStatistics',param)
+				.then(res => {
+					const { data } = res;
+					return data;
+				});
+		},
 		getStatistics({ commit },param) {
-			// console.log('param1:{}',param);
 			return apis.sz.post('/TOrder/getStatistics',param)
 				.then(res => {
 					const { data } = res;
@@ -20,6 +26,7 @@ export default {
 				});
 		},
 		getEquipmentListByUser({ commit },param) {
+			console.log('getEquipmentListByUser')
 			return apis.sz.post('/TEquipment/getEquipmentListByUser',param)
 				.then(res => {
 					const { data } = res;