123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584 |
- <template>
- <view>
- <u-navbar :is-back="false" :border-bottom="false" :background="background">
- <view class="navbar-tit">{{title}}</view>
- </u-navbar>
- <view class="statisticsData" >
- <view class="statisticsData-item">
- <h3 style="font-size: 20px;">{{info.merchantAccountName}}</h3>
- </view>
- <view class="statisticsDataMain">
- <view class="statisticsData-item">
-
- <view class="statisticsData-head" @click="gotoUrl('pagesFinance/detailed/index')">
- <p>今日充电流水</p>
- <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#637AA2" size="36"></u-icon>
-
- </view>
- <view class="statisticsData-main">
- <h2>{{indexData.todayAmount}}元</h2>
- </view>
- <view class="statisticsData-foot">
- <p>昨日流水</p>
- <h4>{{indexData.yesterdayAmount}}元</h4>
- </view>
- </view>
- <view class="statisticsData-item">
- <view >
- <h3> </h3>
- </view>
- <view class="statisticsData-head">
- <p>今日充电笔数</p>
- </view>
- <view class="statisticsData-main">
- <h2>{{indexData.todayEQNum}}</h2>
- </view>
- <view class="statisticsData-foot">
- <p>本月流水</p>
- <h4>{{indexData.thisMonthAmount}}元</h4>
- </view>
- </view>
- </view>
- </view>
- <u-popup v-model="popupShow" mode="top" height="80%">
- <view class="popup-screen">
- <view class="screen">
- <view class="screen-item">
- <view class="screen-head">查询日期</view>
- <view class="screen-main2">
-
- <u-calendar v-model="showdate" mode="range" @change="changedate"></u-calendar>
-
- <u-input :value="startTime?startTime+'至'+endTime:'选择时间筛选'" :type="type" :border="border" @click="showdate = true" />
- <!--
- <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
- --></view>
- </view>
- <view class="screen-item">
- <view class="screen-head">充电桩类型</view>
- <view class="screen-main">
- <view
- :class="{
- active:selecttype==''
- }" @click="selecttype=''"
- class="screen-entry ">全部</view>
- <view
- :class="{
- active:selecttype=='0'
- }" @click="selecttype='0'"
-
- class="screen-entry type1">自行车充电</view>
- <view
- :class="{
- active:selecttype=='2'
- }" @click="selecttype='2'"
- class="screen-entry type3">交流慢充</view>
- <view
- :class="{
- active:selecttype=='1'
- }" @click="selecttype='1'"
- class="screen-entry type2">直流快充</view>
- </view>
- </view>
- <view class="screen-item">
- <view class="screen-head">站点</view>
- <view class="screen-main">
- <view class="screen-entry "
- :class="{
- active:selectstationId==''
- }"
- @click="selectstationId=''"
- >全部</view>
- <view
- v-for="(item,i) in stationList" :key="i"
- :class="{
- active:selectstationId==item.id
- }"
- @click="selectstationId=item.id,selectdeviceNo=''"
- class="screen-entry" >{{item.name}}</view>
-
- </view>
- </view>
- <view
-
- class="screen-item">
- <view class="screen-head">桩号</view>
- <view class="screen-main">
-
- <view class="screen-entry "
- :class="{
- active:selectdeviceNo==''
- }"
- @click="selectdeviceNo=''"
- >全部</view>
- <view
- v-for="(item,i) in stationListSon" :key="i"
- v-show="selectstationId?(selectstationId==item.stationId):true"
- :class="{
- active:selectdeviceNo==item.deviceNo
- }"
-
- @click="selectdeviceNo=item.deviceNo"
- class="screen-entry" >{{item.name}}</view>
- </view>
- </view>
- </view>
- <view class="screen-foot">
- <view class="screen-btn-l"
- @click="resetBtn" >重置</view>
- <view class="screen-btn-r" @click="okbtn" >确定</view>
- </view>
- </view>
- </u-popup>
-
- <view class="statisticsChart">
- <view class="statisticsChart-head">
- <h4 >流水占比</h4>
- <view class="navbar-screen" @click="popupShow = true"><span>筛选</span><u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon></view>
-
-
- </view>
- <view class="statisticsChart-main" >
- <!-- <u-calendar v-model="showdate" mode="range" @change="changedate"></u-calendar>
- -->
- <view class="statisticsChart-time" style="
- text-align: center; margin-bottom: 5px;
- ">
- <p >{{startTime}} 至 {{endTime}} </p>
-
- </view>
- <u-subsection :list="subsection" @change="changesub" :current="current" button-color="#2E7Dff"
- active-color="#fff"></u-subsection>
-
-
-
- <view id="pieEcharts" style="min-height:250px;">
- </view>
- </view>
- </view>
- <Tabbar :current="0" ref="tabbarMain" ></Tabbar>
- <!-- <u-tabbar v-model="current" :list="tabbarList" active-color="#185ac6"></u-tabbar>
- --> </view>
- </template>
- <script>
- import Tabbar from '@/components/TabbarFinance.vue'
- import * as API from '@/apis/finance.js'
-
- import * as echarts from "echarts";
- import {
- beforeTimeStamp,
- currentTimeStamp,
- parseUnixTime
- } from '@/utils'
- export default {
- data() {
- return {
- form:{},
- selecttype:"",
- selectstationId:"",
- selectdeviceNo:"",
-
- popupShow:false,
- info:{},
- title:"",
- showdate: false,
- startTime: "",
- indexData:{},
- endTime: "",
- myChart: null,
- subsection: [{
- name: '金额'
- },
- {
- name: '笔数'
- }
- ],
- stationList:[],
- stationListSon:[],
- tabbarList: [{
- iconPath: "bar-chart-box-fill",
- selectedIconPath: "bar-chart-box-fill",
- text: '统计',
- count: 0,
- isDot: true,
- customIcon: true,
- },
- {
- iconPath: "article-fill",
- selectedIconPath: "article-fill",
- text: '明细',
- midButton: true,
- customIcon: true,
- },
- {
- iconPath: "account-pin-box-fill",
- selectedIconPath: "account-pin-box-fill",
- text: '我的',
- count: 0,
- isDot: false,
- customIcon: true,
- },
- ],
- current: 0,
- background: {
- background: 'none'
- },
- value: '',
- type: 'select',
- show: false,
- border: true,
- }
- },
- onShow(){
- if(this.$refs.tabbarMain){
- this.$refs.tabbarMain.setcount(0);
- }
- },
- onLoad() {
- this.title="收益统计"
- this.info=this.carhelp.getPersonInfo("merchantUser")
-
- },
- components: {
- Tabbar
-
- },
- onReady() {
- this.startTime = parseUnixTime(beforeTimeStamp(7), '{y}-{m}-{d}')
- this.endTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
- this.getData()
- this.getStation()
- },
- methods: {
- getStation(bl) {
-
- API.stationList().then((res) => {
-
- this.stationList = res.data.stationList
- this.stationListSon=res.data.deviceList
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- resetBtn(){
- this.startTime = parseUnixTime(beforeTimeStamp(7), '{y}-{m}-{d}')
- this.endTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
-
-
-
- this.selecttype=""
- this.selectstationId=""
- this.selectdeviceNo=""
- this.pageIndex = 1;
- this.form = {
-
-
- pageIndex: this.pageIndex,
- type:this.selecttype,
- stationId:this.selectstationId,
- deviceNo:this.selectdeviceNo,
- };
- this.popupShow=false;
- this.list = [];
- this.getData()
-
- },
- okbtn(){
- this.popupShow=false;
- this.pageIndex = 1;
-
- this.form = {
-
-
- pageIndex: this.pageIndex,
- type:this.selecttype,
- stationId:this.selectstationId,
- deviceNo:this.selectdeviceNo,
- };
- this.list = [];
- this.getData()
- },
- getData(){
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- //this.form.pageIndex=this.pageIndex
-
- this.form.startDate=this.startTime,
- this.form.endDate=this.endTime
-
- API.spIncomeStatistics(this.form).then((res) => {
-
- this.indexData = res.data
-
- this.getPie()
-
- uni.hideLoading()
-
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- changesub(e){
- console.log(e)
- this.current=e
- this.getPie()
- },
- changedate(e) {
- this.startTime = e.startDate
- this.endTime = e.endDate
-
-
- },
- getPie() {
-
- var list=this.indexData.pieChart;
- var getData=[];
- var unit=this.current?'笔':'元'
- list.forEach(item=>{
- var value=this.current?item.eqNum:item.amount
- getData.push({
- value: value,
- name: item.deviceName
- })
- })
-
- if (!this.myChart) {
- this.myChart = echarts.init(document.getElementById('pieEcharts'));
- }
- // 指定图表的配置项和数据
- var option = {
-
- tooltip: {
- trigger: 'item',
- formatter: '{b} <br/> {c}'+unit,
- position:function(point,params,dom,rect,size){
- return ['10%','0%']
- }
- },
- legend: {
- bottom: '0%',
- left: 'center'
- },
- series: [{
- //name: 'Access From',
- type: 'pie',
- radius: '50%',
- data: getData,
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- },
- itemStyle:{
- normal:{
- color:function(colors){
-
- var list = [
- "#F2BD42",
"#5087EC",
"#68BBC4",
"#58A55C",
"#EE752F",
"#D95040",
- '#fc8251',
- '#5470c6',
- '#91cd77',
- '#ef6567',
- '#f9c956',
- '#75bedc',
- '#fc8251',
- '#5470c6',
- '#91cd77',
- '#ef6567',
- '#f9c956',
- '#75bedc'
- ]
- return list[colors.dataIndex]
- }
- }
- }
- }]
- };
- // 使用刚指定的配置项和数据显示图表。
- this.myChart.setOption(option);
- }
- }
- }
- </script>
- <style>
- page {
- background: url(../../assets/img/index_header_bg.png) no-repeat top center #f7f7f7;
- background-size: 100%;
- }
- </style>
- <style lang="scss" scoped>
- .popup-screen{
- padding: 20px;
- position: relative;
- .screen{
- padding-bottom: 30px;
- }
- .screen-item{
- margin-bottom: 20px;
- .screen-head{
- margin-bottom: 8px;
- font-size: 16px;
- }
- .screen-main{
- display: flex;
- // display: -webkit-box;
- flex-wrap: wrap;
-
- }
- .screen-entry{
- width: 29%;
- padding:6px 0;
- display: flex;
- align-items: center;
- justify-content: center;
-
-
- background-color: #F2F5FA ;
- text-align: center;
- margin-bottom: 10px;
- border-radius: 3px;
-
- margin-right: 6px;
-
- }
- .screen-entry.active{
- background-color: #185AC6;
- color:#fff;
- }
- }
- .screen-foot{
- position: fixed;
- left: 0;
- right: 0;
- bottom: 0;
- display: flex;
- height:50px;
- border-top: 1px solid #ededed;
- .screen-btn-l{
- background-color: #fff;
- flex: 0.2;
- text-align: center;
- line-height: 50px;
- }
- .screen-btn-r{
- flex: 0.8;
- text-align: center;
- line-height: 50px;
- background-color: #185AC6;
- color:#fff;
- }
- }
- }
- .navbar-tit {
- color: #fff;
- font-size: 20px;
- padding-left: 15px;
- }
- .statisticsData {
- background-color: #fff;
- margin: 16px;
- padding: 16px;
- border-radius: 8px;
-
- margin-top: 80px;
- }
- .statisticsDataMain {
-
- display: flex;
-
- }
- .statisticsData-item {
- flex: 1;
- .statisticsData-head {
- display: flex;
- align-items: center;
- p {
- color: #637AA2;
- font-size: 12px;
- }
- }
- .statisticsData-main {
- margin-top: 4px;
- font-size: 20px;
- }
- .statisticsData-foot {
- display: flex;
- align-items: center;
- margin-top: 16px;
- p {
- color: #637AA2;
- }
- h4 {
- margin-left: 8px;
- }
- }
- }
- .statisticsChart {
- margin: 16px;
- .statisticsChart-head {
- margin-bottom: 5px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- h4 {
- font-weight: normal;
- font-size: 16px;
- position: relative;
- padding-left: 10px;
- &::after {
- content: '';
- position: absolute;
- height: 12px;
- width: 4px;
- background-color: #4E8DF6;
- left: 0;
- top: 5px;
- }
- }
- .statisticsChart-time {
- display: flex;
- align-items: center;
- p {
- color: #666;
- }
- }
- }
- .statisticsChart-main {
- background-color: #fff;
- padding:10px 16px 16px 16px;
- border-radius: 8px;
- }
- }
- </style>
|