From 45dca221d8cb377e6bc5f42d605e2a1074989fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Mon, 14 Oct 2024 17:20:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B010.14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fuintAdmin/src/api/allOrder.js | 9 ++ fuintAdmin/src/views/shopowner.vue | 130 ++++++++++++++++++++--------- 2 files changed, 99 insertions(+), 40 deletions(-) diff --git a/fuintAdmin/src/api/allOrder.js b/fuintAdmin/src/api/allOrder.js index 290c5db22..b9fff93ec 100644 --- a/fuintAdmin/src/api/allOrder.js +++ b/fuintAdmin/src/api/allOrder.js @@ -180,3 +180,12 @@ export function getDataShow(query) { }); } +// 油站首页数据展示 +export function getDataCount(query) { + return request({ + url: 'business/allOrderInfo/getDataCount', + method: 'get', + params:query + }); +} + diff --git a/fuintAdmin/src/views/shopowner.vue b/fuintAdmin/src/views/shopowner.vue index cfd17a31c..c27badc89 100644 --- a/fuintAdmin/src/views/shopowner.vue +++ b/fuintAdmin/src/views/shopowner.vue @@ -160,7 +160,7 @@ range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" - @blur="getStoreAmount"> + @blur="getDataAnalysis"> @@ -229,7 +229,7 @@ range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" - @blur="getStoreAmount"> + @blur="getDataCount"> @@ -250,7 +250,7 @@ import {parseTime} from "@/utils/fuint"; import {getBannerListApi} from "@/api/sys/banner"; import {getNotificationlogList} from "@/api/sys/sysNotificationlog"; import {employeeSalesApi} from "@/api/indexStatistics"; -import {getDataBoard, getTotalAmount} from "@/api/allOrder"; +import {getDataAnalysis, getDataBoard, getDataCount, getDataShow, getTotalAmount} from "@/api/allOrder"; export default { props:["accountId"], @@ -297,6 +297,9 @@ export default { hardwareList:[], noticeList:[], employeList:[], + dataAnalysisOilNumberList:[], + dataAnalysisAllList:[], + dataAnalysisIfOilList:[], } }, created() { @@ -317,6 +320,9 @@ export default { this.getHardwareList() this.getNoticeList() this.getEmployeList() + this.getDataAnalysis() + this.getDataShow() + this.getDataCount() }, mounted() { // this.initChart() @@ -341,6 +347,47 @@ export default { }) }, + // 获取数据分析信息 + getDataAnalysis() { + getDataAnalysis().then(res => { + console.log('数据分析的数据',res) + if (res.code == 200) { + for (let i = 0; i < res.data.length; i++) { + if (res.data[i].type == 1) { + this.dataAnalysisOilNumberList.push(res.data[i]) + }else if (res.data[i].type == 2) { + this.dataAnalysisIfOilList.push(res.data[i]) + }else if (res.data[i].type == 3) { + this.dataAnalysisAllList.push(res.data[i]) + } + } + console.log('dataAnalysisOilNumberList',this.dataAnalysisOilNumberList) + console.log('dataAnalysisIfOilList',this.dataAnalysisIfOilList) + console.log('dataAnalysisAllList',this.dataAnalysisAllList) + // this.initChart() + } + }) + }, + //油站首页数据展示 + getDataShow(){ + const data = { + "startTime": this.value1[0].split(' ')[0], + "endTime": this.value1[1].split(' ')[0] + } + getDataShow(data).then(res => { + console.log('首页数据展示',res) + }) + }, + //油站首页数据统计 + getDataCount(){ + const data = { + "startTime": this.value1[0].split(' ')[0], + "endTime": this.value1[1].split(' ')[0] + } + getDataCount(data).then(res => { + console.log('首页数据统计',res) + }) + }, getNoticeList() { getNotificationlogList({pageNo: 1, pageSize: 4}).then(res => { this.noticeList = res.data.records @@ -468,7 +515,7 @@ export default { // // // ], - data: dataList, + data: this.dataAnalysisOilNumberList, emphasis: { itemStyle: { shadowBlur: 10, @@ -494,19 +541,20 @@ export default { name: 'Access From', type: 'pie', radius: '80%', - data: [ - // { value: 28, name: '28%' }, - // { value: 72, name: '72%' }, - { - value: this.countPercentage(Number(this.storeAmount.oilNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.noOilNum)), - name: "油品交易占比" - }, - { - value: this.countPercentage(Number(this.storeAmount.noOilNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.noOilNum)), - name: "非油品交易占比" - }, - - ], + // data: [ + // // { value: 28, name: '28%' }, + // // { value: 72, name: '72%' }, + // { + // value: this.countPercentage(Number(this.storeAmount.oilNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.noOilNum)), + // name: "油品交易占比" + // }, + // { + // value: this.countPercentage(Number(this.storeAmount.noOilNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.noOilNum)), + // name: "非油品交易占比" + // }, + // + // ], + data:this.dataAnalysisIfOilList, emphasis: { itemStyle: { shadowBlur: 10, @@ -533,29 +581,30 @@ export default { name: 'Access From', type: 'pie', radius: [50, '80%'], - data: [ - // { value: 28, name: '会员充值占比' }, - // { value: 72, name: '积分商城交易占比' }, - // { value: 28, name: '油品交易占比' }, - // { value: 72, name: '便利店交易占比' }, - { - value: this.countPercentage(Number(this.storeAmount.userNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)), - name: '会员充值占比' - }, - { - value: this.countPercentage(Number(this.storeAmount.integralNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)), - name: '积分商城交易占比' - }, - { - value: this.countPercentage(Number(this.storeAmount.oilNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)), - name: '油品交易占比' - }, - { - value: this.countPercentage(Number(this.storeAmount.goodNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)), - name: '便利店交易占比' - }, - - ], + // data: [ + // // { value: 28, name: '会员充值占比' }, + // // { value: 72, name: '积分商城交易占比' }, + // // { value: 28, name: '油品交易占比' }, + // // { value: 72, name: '便利店交易占比' }, + // { + // value: this.countPercentage(Number(this.storeAmount.userNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)), + // name: '会员充值占比' + // }, + // { + // value: this.countPercentage(Number(this.storeAmount.integralNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)), + // name: '积分商城交易占比' + // }, + // { + // value: this.countPercentage(Number(this.storeAmount.oilNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)), + // name: '油品交易占比' + // }, + // { + // value: this.countPercentage(Number(this.storeAmount.goodNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.userNum) + Number(this.storeAmount.integralNum) + Number(this.storeAmount.goodNum)), + // name: '便利店交易占比' + // }, + // + // ], + data:this.dataAnalysisAllList, emphasis: { itemStyle: { shadowBlur: 10, @@ -878,6 +927,7 @@ export default { } }; chart.setOption(option) + console.log('chart',chart) chart1.setOption(option1) chart2.setOption(option2) chart3.setOption(option3)