diff --git a/fuintAdmin/src/views/shopowner.vue b/fuintAdmin/src/views/shopowner.vue index 5560155df..033df4f04 100644 --- a/fuintAdmin/src/views/shopowner.vue +++ b/fuintAdmin/src/views/shopowner.vue @@ -148,15 +148,13 @@
油品交易分析
- +
近一周
- 今日 - 昨日 - 近一周 - 近一月 - 近一周 + 近一周 + 近一月 + 近一年
- -
+
员工排行 - +
近一周
- 今日 - 昨日 - 近一周 - 近一月 - 近一周 + 近一周 + 近一月 + 近一年
@@ -226,15 +221,13 @@
数据统计
- +
近一周
- 今日 - 昨日 - 近一周 - 近一月 - 近一周 + 近一周 + 近一月 + 近一年
{ - // console.log('首页数据展示', res) + // console.log('首页数据展示', res.data) + this.dataShows = res.data + this.initChart() }) }, //油站首页数据统计 @@ -409,7 +442,7 @@ export default { "endTime": this.value1[1].split(' ')[0] } getDataCount(data).then(res => { - console.log('首页数据统计', res.data) + // console.log('首页数据统计', res.data) if (res.code == 200) { this.dataCount = res.data this.initChart() @@ -434,7 +467,7 @@ export default { getStoreList() { selectStoreAmount(this.addDateRange({}, this.value2)).then(res => { this.storeList = res.data - // this.initChart() + this.initChart() }) }, // 选择机构信息 @@ -517,13 +550,15 @@ export default { userBalanceList.push(item.userBalance) }) } + const color = ['#FF9655', '#55F3FF', '#0DC291', '#fe8c4a', '#D55F5F']; + // 首页数据统计 const times = this.dataCount.oilData.map(item => item.time); const count = []; for (let i = 0; i < this.dataCount.oilNames.length; i++) { let a = { name: this.dataCount.oilNames[i], - color: '#FF9655', + color: color[i], type: 'bar', tooltip: { valueFormatter: function (value) { @@ -538,11 +573,36 @@ export default { }, barGap: '60%', data: this.dataCount.oilData.map(item => item.money[i]) - // data: oilAmountList } count.push(a) } - console.log('count', count) + + // 首页数据展示 + const showTimes = this.dataShows.oilData.map(item => item.day); + // console.log('showTimes', showTimes) + const showCount = []; + for (let i = 0; i < this.dataShows.oilNames.length; i++) { + let a = { + name: this.dataShows.oilNames[i], + color: color[i], + type: 'bar', + tooltip: { + valueFormatter: function (value) { + return value; + } + }, + barWidth: 13, + itemStyle: { + normal: { + barBorderRadius: [50, 50, 0, 0] + } + }, + barGap: '60%', + data: this.dataShows.oilData.map(item => item.oilPrices[i]) + // data: oilAmountList + } + showCount.push(a) + } const option = { color: [ @@ -678,8 +738,7 @@ export default { } }, legend: { - data: this.dataCount.oilNames, - left:'right' + data: this.dataCount.oilNames }, xAxis: [ { @@ -724,14 +783,13 @@ export default { } }, legend: { - data: ['Evaporation', '油品交易额', '非油品交易额', '会员充值金额', '会员消费金额', '会员余额'], - left:'right' + data: this.dataShows.oilNames }, xAxis: [ { type: 'category', // data: ['中建锦绣广场1站', '中建锦绣广场2站', '中建锦绣广场3站', '中建锦绣广场4站', '中建锦绣广场5站', '中建锦绣广场6站', '中建锦绣广场7站'], - data: storeNameList, + data: showTimes, axisPointer: { type: 'shadow' } @@ -741,105 +799,128 @@ export default { { type: 'value', name: '金额(元)', + // min: 0, + // max: 10000, + // interval: 2000, axisLabel: { formatter: '{value}' } } + // { + // type: 'value', + // name: '', + // min: 0, + // max: 25, + // interval: 5, + // axisLabel: { + // formatter: '{value} ' + // } + // } ], - series: [ - { - name: '油品交易额', - color: '#FF9655', - type: 'bar', - tooltip: { - valueFormatter: function (value) { - return value; - } - }, - barWidth: 13, - itemStyle: { - normal: { - barBorderRadius: [50, 50, 0, 0] - } - }, - barGap: '60%', - data: oilAmountList - }, - { - name: '非油品交易额', - color: '#55F3FF', - type: 'bar', - tooltip: { - valueFormatter: function (value) { - return value; - } - }, - barWidth: 13, - itemStyle: { - normal: { - barBorderRadius: [50, 50, 0, 0] - } - }, - data: noOilAmountList - }, - { - name: '会员充值金额', - color: '#0DC291', - type: 'bar', - tooltip: { - valueFormatter: function (value) { - return value; - } - }, - barWidth: 13, - itemStyle: { - normal: { - barBorderRadius: [50, 50, 0, 0] - } - }, - data: rechargeBalanceList - }, - { - name: '会员消费金额', - color: '#fe8c4a', - type: 'bar', - tooltip: { - valueFormatter: function (value) { - return value; - } - }, - barWidth: 13, - itemStyle: { - normal: { - barBorderRadius: [50, 50, 0, 0] - } - }, - // data: [ - // 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3 - // ] - data: consumeBalanceList - }, - { - name: '会员余额', - color: '#D55F5F', - type: 'bar', - tooltip: { - valueFormatter: function (value) { - return value; - } - }, - barWidth: 13, - itemStyle: { - normal: { - barBorderRadius: [50, 50, 0, 0] - } - }, - // data: [ - // 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3 - // ] - data: userBalanceList - } - ], + // series: [ + // { + // name: '油品交易额', + // color: '#FF9655', + // type: 'bar', + // tooltip: { + // valueFormatter: function (value) { + // return value; + // } + // }, + // barWidth: 13, + // itemStyle: { + // normal: { + // barBorderRadius: [50, 50, 0, 0] + // } + // }, + // barGap: '60%', + // // data: [ + // // 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3 + // // ] + // data: oilAmountList + // }, + // { + // name: '非油品交易额', + // color: '#55F3FF', + // type: 'bar', + // tooltip: { + // valueFormatter: function (value) { + // return value; + // } + // }, + // barWidth: 13, + // itemStyle: { + // normal: { + // barBorderRadius: [50, 50, 0, 0] + // } + // }, + // // data: [ + // // 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3 + // // ] + // data: noOilAmountList + // }, + // { + // name: '会员充值金额', + // color: '#0DC291', + // type: 'bar', + // tooltip: { + // valueFormatter: function (value) { + // return value; + // } + // }, + // barWidth: 13, + // itemStyle: { + // normal: { + // barBorderRadius: [50, 50, 0, 0] + // } + // }, + // // data: [ + // // 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3 + // // ] + // data: rechargeBalanceList + // }, + // { + // name: '会员消费金额', + // color: '#fe8c4a', + // type: 'bar', + // tooltip: { + // valueFormatter: function (value) { + // return value; + // } + // }, + // barWidth: 13, + // itemStyle: { + // normal: { + // barBorderRadius: [50, 50, 0, 0] + // } + // }, + // // data: [ + // // 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3 + // // ] + // data: consumeBalanceList + // }, + // { + // name: '会员余额', + // color: '#D55F5F', + // type: 'bar', + // tooltip: { + // valueFormatter: function (value) { + // return value; + // } + // }, + // barWidth: 13, + // itemStyle: { + // normal: { + // barBorderRadius: [50, 50, 0, 0] + // } + // }, + // // data: [ + // // 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3 + // // ] + // data: userBalanceList + // } + // ], + series: showCount, grid: { left: '3%', right: '3%', @@ -848,7 +929,6 @@ export default { } }; chart.setOption(option) - // console.log('chart',chart) chart1.setOption(option1) chart2.setOption(option2) chart3.setOption(option3)