1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636 |
- <template>
- <view>
- <view class="navbar-tit">{{title}}</view>
- <view class="statisticsChart" style="margin-top: 120rpx;margin-bottom: 0px">
- <view class="statisticsChart-head">
- <h4>充电统计</h4>
- <view class="navbar-screen ">
- <u-button text="月落" size="mini" class="headbotton1" style="border-radius: 10px 0 0 10px;"
- :type="current==1?'primary':'info'" @click="changesub(1)">按天</u-button>
- <u-button text="月落" size="mini" class="headbotton2" style="border-radius: 0 10px 10px 0;"
- :type="current==2?'primary':'info'" @click="changesub(2)">按月</u-button>
- </view>
- </view>
- </view>
- <view class="statisticsData">
- <view class="detailstableHead" style="
- padding-top: 1px;
- ">
- <view id="pieEcharts" style="min-height:250px;margin-top: 20px">
- </view>
- </view>
- <view class="detailstableHead" v-if="indexData&&false">
- <view class="detailsline">
- <view class="details-row details-row-head-1 ">
- <view class="span1">今日收入</view>
- <view class="span2">{{indexData.todayAmount?indexData.todayAmount.toFixed(2):0}}<span>元</span>
- </view>
- </view>
- <view class="details-row details-row-head-2">
- <view class="span1">今日利润</view>
- <view class="span2">{{indexData.todayProfit?indexData.todayProfit.toFixed(2):0}}<span>元</span>
- </view>
- </view>
- <view class="details-row details-row-head-3">
- <view class="span1">今日笔数</view>
- <view class="span2">{{indexData.todayEQNum?indexData.todayEQNum:0}}<span>笔</span></view>
- </view>
- </view>
- <view class="detailsline">
- <view class="details-row details-row-head-1 ">
- <view class="span1">昨日收入</view>
- <view class="span2">
- {{indexData.yesterdayAmount?indexData.yesterdayAmount.toFixed(2):0}}<span>元</span>
- </view>
- </view>
- <view class="details-row details-row-head-2">
- <view class="span1">昨日利润</view>
- <view class="span2">
- {{indexData.yesterdayProfit?indexData.yesterdayProfit.toFixed(2):0}}<span>元</span>
- </view>
- </view>
- <view class="details-row details-row-head-3">
- <view class="span1">昨日笔数</view>
- <view class="span2">{{indexData.yesterdayEQNum?indexData.yesterdayEQNum:0}}<span>笔</span></view>
- </view>
- </view>
- <view class="detailsline—bottom">
- <view class="details-row details-row-head-1">
- <view class="span1">本月收入</view>
- <view class="span2">
- {{indexData.thisMonthAmount?indexData.thisMonthAmount.toFixed(2):0}}<span>元</span>
- </view>
- </view>
- <view class="details-row details-row-head-2">
- <view class="span1">本月利润</view>
- <view class="span2">
- {{indexData.thisMonthProfit?indexData.thisMonthProfit.toFixed(2):0}}<span>元</span>
- </view>
- </view>
- <view class="details-row details-row-head-3">
- <view class="span1">本月笔数</view>
- <view class="span2">{{indexData.thisMonthEQNum?indexData.thisMonthEQNum:0}}<span>笔</span></view>
- </view>
- </view>
- </view>
- </view>
- <u-picker mode="time" v-model="popupShow" @confirm="changedate" :default-time="queryTime" :params="params">
- </u-picker>
- <u-picker mode="time" v-model="popupShow2" @confirm="changedate2" :default-time="queryTime2+'-01'"
- :params="params"></u-picker>
- <u-picker mode="selector" v-model="popupShow3" @confirm="changedate3" :range="stationList" range-key="name"
- :default-selector="[selectstationIndex]"></u-picker>
- <view class="statisticsChart">
- <view class="statisticsChart-head" style="margin-top: 20px;">
- <h4>流水统计</h4>
- <!-- <view class="navbar-screen" >
- {{startTime}}至{{endTime}}
- </view> -->
- <view class="navbar-screen" @click="popupShow = true" v-if="false">
- <span>{{showTime(queryTime)}}</span>
- <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow"></u-icon>
- <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow"></u-icon>
- </view>
- </view>
- <u-calendar v-model="popupShow4" mode="range" @change="changedate4"></u-calendar>
- <view class="details detailstable">
- <p style="text-align: center; margin-bottom: 5px;" @click="popupShow4 = true">
- <img src="@/assets/img/riLine-calendar-todo-line.svg" align="absmiddle"
- style="height:40rpx;width: 40rpx ;">
- {{startTime}}至{{endTime}}
- <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow4"></u-icon>
- <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow4"></u-icon>
- </p>
- <view class="detailsline detailslineHead" v-if="stationFlowList.length>1">
- <view class="details-row ">
- <view class="span1">总收入</view>
- <view class="span2">{{(allMoneySum).toFixed(2)}}<span>元</span></view>
- </view>
- <view class="details-row">
- <view class="span1">总利润<span>(服务费+月卡)</span></view>
- <view class="span2">{{(serviceMoneySum).toFixed(2)}}<span>元</span></view>
- </view>
- </view>
- <view v-if="stationFlowList.length==0"
- style="color: rgba(153, 153, 153, 1);font-size: 28rpx;text-align: center;margin-top: 16rpx;">
- 站点列表为空
- </view>
- <view v-if="stationFlowList.length&&stationFlowList.length>3"
- @click="gotoUrl('pagesFinance/statistics/list')"
- style="color: rgba(153, 153, 153, 1);font-size: 28rpx;text-align: center;margin-top: 16rpx;">
- 查看站点流水统计 <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#b0b8c8" size="28"></u-icon>
- </view>
- <u-collapse :headStyle="{
- color:'#101010',
- fontWeight: 'bold',
- padding:'24rpx 0',
- borderBottom: '1px solid #ededed'
-
- }" v-if="stationFlowList.length&&stationFlowList.length<=3">
- <u-collapse-item @change="changeitem" v-for="(item, index) in stationFlowList" :index="index"
- :key="index">
- <view slot="title" class="u-collapse-title u-line-1" style="width: 100%;">
- {{item.stationName}} <span style="float:right;"><span
- style="font-size: 24rpx;margin-right: 8rpx;font-weight: normal;">总收入</span>{{item.actualMoney.toFixed(2)}}元</span>
- </view>
- <!-- -->
- <view class="detailsline">
- <view class="details-row details-row-1">
- <view class="span1">电费</view>
- <view class="span2">{{item.elecMoney.toFixed(2)}}<span>元</span></view>
- </view>
- <view class="details-row">
- <view class="span1">服务费</view>
- <view class="span2">{{item.serviceMoney.toFixed(2)}}<span>元</span></view>
- </view>
- </view>
- <view class="detailsline">
- <view class="details-row details-row-1">
- <view class="span1">总用电量</view>
- <view class="span2">{{(item.eq/10000).toFixed(1)}}<span>度</span></view>
- </view>
- <view class="details-row">
- <view class="span1">充电枪数量</view>
- <view class="span2">快充{{item.fastNum}}/慢充{{item.slowNum}}</view>
- </view>
- </view>
- <view class="detailsline" v-if="item.fastNum&&item.slowNum">
- <view class="details-row details-row-1">
- <view class="span1">快充枪平均充电量</view>
- <view class="span2" v-if="item.fastNum">
- {{(item.averageFast/10000).toFixed(1)}}<span>度/枪/天</span>
- </view>
- <view class="span2" v-else>0<span>度/枪/天</span></view>
- </view>
- <view class="details-row">
- <view class="span1">慢充枪平均充电量</view>
- <view class="span2" v-if="item.slowNum">
- {{(item.averageSlow/10000).toFixed(1)}}<span>度/枪/天</span>
- </view>
- <view class="span2" v-else>0<span>度/枪/天</span></view>
- </view>
- </view>
- <view class="detailsline" v-if="item.fastNum&&item.slowNum">
- <view class="details-row details-row-1">
- <view class="span1">月卡收益</view>
- <view class="span2">{{(item.cardMoney).toFixed(2)}}<span>元</span></view>
- </view>
- <view class="details-row">
- </view>
- </view>
- <view v-if="item.fastNum&&item.slowNum"
- :style="item.slowDayNum==nowTime?'color: #ffffff;':'border-bottom: 1px solid #ededed;'">
- 查询范围内实际订单天数{{item.slowDayNum}}</view>
- </u-collapse-item>
- </u-collapse>
- </view>
- <view class="statisticsChart-head" style="margin-top: 20px;">
- <h4>站主/桩主收益统计</h4>
- <!-- <view class="navbar-screen" >
- {{startTime}}至{{endTime}}
- </view> -->
- <!-- <view class="navbar-screen" @click="popupShow2 = true"><span>筛选</span>
- <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
- </view> -->
- </view>
- <view class="details" v-if="indexData2&&indexData2.incomeMap">
- <view class="details-row2">
- <p @click="popupShow3 = true">{{selectstationName}}
- <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow3"></u-icon>
- <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow3"></u-icon>
- </p>
- <p @click="popupShow2 = true">
- {{showTime(queryTime2)}}
- <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow2"></u-icon>
- <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow2"></u-icon>
- </p>
- </view>
- <view class="details-row">
- <p>充电总收入</p>
- <span>{{(indexData2.incomeMap.chargingAmount).toFixed(2)}}元</span>
- </view>
- <view class="details-row">
- <p>站主/桩主收入</p>
- <span>{{indexData2.incomeMap.incomeAmount.toFixed(2)}}元</span>
- </view>
- <view class="details-row">
- <p>预估用电度数</p>
- <span>{{(indexData2.incomeMap.electricQuantity/10000).toFixed(1)}}度</span>
- </view>
- <view class="details-row">
- <p>预估电费</p>
- <span>{{indexData2.incomeMap.costAmount.toFixed(2)}}元</span>
- </view>
- <view class="details-row">
- <p>服务费预估收益</p>
- <span>{{indexData2.incomeMap.serviceAmount.toFixed(2)}}元</span>
- </view>
- <view class="details-row">
- <p>月卡收益</p>
- <span>{{indexData2.incomeMap.cardIncomeAmount.toFixed(2)}}元</span>
- </view>
- <view class="details-row">
- <p>预估总利润</p>
- <span>{{(indexData2.incomeMap.serviceAmount+indexData2.incomeMap.cardIncomeAmount).toFixed(2)}}元</span>
- </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";
- //require("@/apis/echarts-5-3.min.js")
- //import * as echarts from "@/apis/echarts-5-3.min.js";
- import {
- daysDistance,
- beforeTimeStamp,
- currentTimeStamp,
- parseUnixTime, newDate
- } from '@/utils'
- export default {
- data() {
- return {
- popupShow3: false,
- params: {
- year: true,
- month: true,
- day: false,
- hour: false,
- minute: false,
- second: false
- },
- headitemby:"",
- isinit: true,
- form: {},
- form2: {},
- selecttype: "",
- selectstationId: "",
- selectdeviceNo: "",
- popupShow2: false,
- popupShow: false,
- popupShow4: false,
- nowTime: 0,
- selectstationId2: "",
- selectstationIndex: 0,
- selectstationName: "",
- info: {},
- title: "",
- showdate: false,
- showdate2: false,
- queryTime: "",
- queryTime2: "",
- indexData: {},
- indexData3: null,
- indexData2: null,
- type_head: '1',
- startDate_head: '',
- changeitemBl: false,
- myChart: null,
- myChartReady: false,
- myChartTime: false,
- subsection: [{
- name: '金额'
- },
- {
- name: '笔数'
- }
- ],
- stationFlowList: [],
- serviceMoneySum: 0,
- allMoneySum: 0,
- 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,
- },
- ],
- endTime: '',
- endTime2: '',
- current: 1,
- background: {
- background: 'none'
- },
- value: '',
- type: 'select',
- show: false,
- border: true,
- step: 0,
- stepname: '',
- startTime: '',
- stepid: 0,
- }
- },
- onShow() {
- if (this.$refs.tabbarMain) {
- this.$refs.tabbarMain.setcount(0);
- }
- },
- onLoad() {
- this.info = this.carhelp.getPersonInfo("merchantUser")
- this.title = this.info.merchantAccountName
- },
- components: {
- Tabbar
- },
- onReady() {
- var date = new Date();
- this.nowTime = 7
- this.queryTime = parseUnixTime(currentTimeStamp(), '{y}-{m}');
- this.queryTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}'),
- this.startDate_head = parseUnixTime(beforeTimeStamp(30), '{y}-{m}-{d}')
- this.startTime = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
- this.endTime = parseUnixTime(beforeTimeStamp(0), '{y}-{m}-{d}')
- //this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
- this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
- this.getStation()
- },
- computed: {
- // startTime(){
- // return this.queryTime+'-1'
- // },
- startTime2() {
- return this.queryTime2 + '-01'
- },
- },
- methods: {
- changeitem(e) {
- if (this.stationFlowList.length > 1 && e.index == this.stationFlowList.length - 1 && e.show) {
- this.changeitemBl = true;
- } else {
- this.changeitemBl = false;
- }
- },
- showTime(name) {
- if (!name) {
- return ''
- }
- return name.replace('-', '年') + '月';
- },
- getStation(bl) {
- API.stationList().then((res) => {
- this.stationList = res.data.stationList
- this.stationList.unshift({
- id: '',
- name: "全部站点"
- })
- this.selectstationName = "全部站点"
- this.stationListSon = res.data.deviceList
- this.getDataHome2()
- this.getData()
- this.getData2()
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- resetBtn() {
- this.nowTime = 7
- this.startTime = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
- this.endTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
- this.selecttype = ""
- this.selectstationId = ""
- this.selectdeviceNo = ""
- this.form = {
- type: this.selecttype,
- stationId: this.selectstationId,
- deviceNo: this.selectdeviceNo,
- };
- this.popupShow = false;
- this.list = [];
- this.getData()
- },
- okbtn() {
- this.popupShow = false;
- this.form = {
- type: this.selecttype,
- stationId: this.selectstationId,
- deviceNo: this.selectdeviceNo,
- };
- this.list = [];
- this.getData()
- },
- resetBtn2() {
- this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
- this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
- this.selectstationId2 = ""
- this.form2 = {
- stationId: this.selectstationId2,
- };
- this.popupShow2 = false;
- this.getData2()
- },
- okbtn2() {
- this.popupShow2 = false;
- this.form2 = {
- stationId: this.selectstationId2,
- };
- this.getData2()
- },
- getDataHome2() {
- var endtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
- API.homeHeadChargingStatistics({
- type: this.type_head,
- startDate: this.startDate_head,
- endDate: endtime
- }).then((res) => {
- this.indexData3 = res.data;
-
- if( this.info.accountType==3){
- //getPie2
- this.getPie2()
- }else{
- //getPie
- this.getPie()
- }
-
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- getDataHome() {
- API.homeHeadStatistics().then((res) => {
- this.indexData = res.data;
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- getData() {
- this.form.startDate = this.startTime,
- this.form.endDate = this.endTime
- API.homeFlowStatistics(this.form).then((res) => {
- this.stationFlowList = res.data.stationFlowList;
- this.nowTime = daysDistance(this.startTime, this.endTime) + 1;
- this.serviceMoneySum = 0;
- this.allMoneySum = 0;
- for (var i in this.stationFlowList) {
- var item = this.stationFlowList[i];
- this.allMoneySum += item.actualMoney
- this.serviceMoneySum += item.serviceMoney
- this.serviceMoneySum += item.cardMoney
- }
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- getData2() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- this.form2.startDate = this.startTime2,
- this.form2.endDate = this.endTime2
- API.homeIncomeStatistics(this.form2).then((res) => {
- this.indexData2 = res.data
- uni.hideLoading()
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- changesub(e) {
- this.current = e
- this.type_head = e;
- if (e == 1) {
- this.startDate_head = parseUnixTime(beforeTimeStamp(30), '{y}-{m}-{d}')
- } else {
- this.startDate_head = parseUnixTime(beforeTimeStamp(365), '{y}-{m}-01')
- }
- // this.getPie()
- this.getDataHome2()
- },
- changedate4(e) {
- this.startTime = e.startDate
- this.endTime = e.endDate
- this.okbtn()
- },
- changedate3(e) {
- var index = e[0];
- var obj = this.stationList[index];
- this.selectstationId2 = obj.id;
- this.selectstationIndex = index;
- this.selectstationName = obj.name;
- this.okbtn2()
- },
- changedate(e) {
- this.queryTime = e.year + '-' + e.month;
- this.startTime = e.year + '-' + e.month + '-01';
-
- if (e.month == '12') {
- this.endTime = (e.year) + "-12-31"
- } else {
- var b = e.year + '/' + (parseInt(e.month) + 1) + '/1';
- var a = beforeTimeStamp(1, b);
- this.endTime = parseUnixTime(a, '{y}-{m}-{d}')
- }
- this.okbtn()
- },
- changedate2(e) {
- this.queryTime2 = e.year + '-' + e.month;
- if (e.month == '12') {
- this.endTime2 = (e.year) + "-12-31"
- } else {
- var b = e.year + '/' + (parseInt(e.month) + 1) + '/1';
- var a = beforeTimeStamp(1, b);
- this.endTime2 = parseUnixTime(a, '{y}-{m}-{d}')
- }
- this.okbtn2()
- },
- getPie2(){
- this.headitemby="";
- var showkey = "";
- var getData = this.indexData3.graphMap;
- //var unit = this.current ? '笔' : '元'
- var colorName = "#333"
- this.showlist1 = ['收入', '利润', '次数','新电途'];
- var sz2 = ['todayAmount', 'todayProfit', 'todayEQNum','todayXDTAmount'];
- // var showlistColor = ['#5872c0', '#9ec97f', '#de6e6a','#f3c96b'];
-
- var showlistColor = ['#5872c0', '#de6e6a','#f3c96b', '#69be8d'];
- if (!this.myChart) {
- this.myChart = echarts.init(document.getElementById('pieEcharts'));
- this.myChart.on("dataZoom", (res) => {
- showkey = "";
- this.headitemby ="";
- });
- }
- this.myChart.clear();
- //
- var timelist = []
- for (var i in getData) {
- if (this.type_head == 1) {
- timelist.push(i.substring(5))
- } else {
- timelist.push(i)
- }
- }
- var list = [];
- for (var j in this.showlist1) {
- var ap = {
- name: this.showlist1[j],
- type: 'line',
- lineStyle:{
- color:showlistColor[j]
- },
- itemStyle:{
- color:showlistColor[j]
- },
-
- // label: {
- // show: true,
- // position: 'top'
- // },
- data: []
- }
- if (this.type_head == 1) {
- ap.symbolSize = 3;
- }
- var bl=true;
- for (var i in getData) {
- //var time=this.queryDate.replace("-","/").replace("-","/")
- //time+' '+i
- var obj = getData[i][sz2[j]];
-
- //'todayAmount', 'todayProfit', 'todayEQNum'
- if (bl&&getData[i].todayAmount == 0 && getData[i].todayProfit == 0 && getData[i].todayEQNum == 0 ) {
- //&& &&getData[i].todayEQNum == 0
- continue;
- }
- bl=false;
- var time = i
- if (this.type_head == 1) {
- // time = i.substring(5)
- } else {
- }
- if(j!=2){
- obj=obj.toFixed(2)
- }
-
- ap.data.push([time, obj]);
- }
- if(bl){
- ap.data=[];
- for (var i in getData) {
- //var time=this.queryDate.replace("-","/").replace("-","/")
- //time+' '+i
- var obj = getData[i][sz2[j]];
- var time = i
- if (this.type_head == 1) {
- time = i.substring(5)
- } else {
-
- }
- if(j!=2){
- obj=obj.toFixed(2)
- }
- ap.data.push([time, obj]);
- }
- }
- list.push(ap)
- }
-
- // 指定图表的配置项和数据
- var option = {
- tooltip: {
- formatter: (value) => {
- //getPie2
- var info = value;
- console.log(value)
- var name = value[0].data[0];
-
- var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
- var now = newDate(name);
- var day = now.getDay();
-
- var week = weeks[day];
-
- var style = "float: right;margin-left: 3px;"
- var text1 = ""
- for (var i in value) {
- var u = "元"
- if (value[i].seriesName == '次数') {
- u = '次'
- }
- text1 += "<p>" + value[i].marker + value[i].seriesName + '<span style="' + style +
- '">' + value[i].data[1] + u + '</span></p>';
- }
-
- if (this.type_head == 1) {
- //time = i.substring(5)
- var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
- var now = newDate(name);
- var day = now.getDay();
- var week = weeks[day];
- return `<p>${name} ${week}</p>` + text1
- } else {
- return `<p>${name}</p>` + text1
- }
-
- },
- trigger: 'axis',
- borderColor: "#F0F0F0",
- borderWidth: 1,
- backgroundColor: "#ffffff",
- textStyle: {
- color: "#333"
- }
- },
- legend: {
- data: this.showlist1,
- textStyle: {
- color: "#333"
- }
- },
- grid: {
- top: '13%',
- left: '3%',
- right: '8%',
- bottom: '18%',
- containLabel: true
- },
- xAxis: {
- //type: 'value',
- type: 'category',
- splitNumber: 4,
- boundaryGap: false,
- axisLabel: {
- formatter: (value) => {
- if(this.headitemby==""){
- this.headitemby=value
- }
- var i = 0
- if (this.type_head == 1) {
- i = 0;
- } else {
- i = 3;
- }
- var showvalue = "";
- var key = value.substring(0,8-i);
-
- if (showkey == ""||value==this.headitemby) {
- showkey = key
-
- showvalue = value
- showvalue = value.substring(5-i)
- } else {
- if (key != showkey) {
- showkey = key
- showvalue = value
- showvalue = value.substring(5-i)
- } else {
- showvalue = value.substring(8-i)
- }
- }
- return showvalue.replace("-",".");
-
- },
- // formatter: (value) => {
- // if(this.headitemby==""){
- // this.headitemby=value
- // }
- // var i = 0
- // if (this.type_head == 1) {
- // i = 3;
- // } else {
- // i = 5;
- // }
- // var showvalue = "";
- // var key = value.substring(0, i);
- // if (showkey == ""||value==this.headitemby) {
- // showkey = key
-
- // showvalue = value
- // } else {
- // if (key != showkey) {
- // showkey = key
- // showvalue = value
- // } else {
- // showvalue = value.substring(i)
- // }
- // }
- // return showvalue.replace("-",".");
- // },
- textStyle: {
- color: "#333"
- }
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#333"
- }
- },
- },
- yAxis: {
-
- //type: 'log',
- // name: '单位('+this.typeN+')',
- axisLabel: {
- textStyle: {
- color: "#333"
- }
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#333"
- }
- },
- },
- series: list
- };
-
- option.dataZoom = [{
- type: 'inside',
- start: 0,
- end: 100
- },
- {
- start: 0,
- end: 100
- }
- ]
- if (this.type_head == 1) {
-
- } else {
- //timelist.push(i)
- }
- console.log(option)
-
- // 使用刚指定的配置项和数据显示图表。
- this.myChart.setOption(option);
- },
- getPie() {
-
- var dataInterval =null;
- if (this.type_head == 1) {
-
- dataInterval= [0,25,50,75,100,
- 125,150,200,250,300,400,500,
- 600,800,1000,1200,1400,1600,1800,
- 2000,2300,2600,2800,
- 3000,3400,3800,4200,
- 4800,5200,5600,6000,6500,7000,7500,8000,9000, 10000,12000,14000, 16000, 20000, 30000,999999];
- }else{
- dataInterval= [0,500,1000,2000,5000, 10000, 20000, 30000, 40000,50000, 60000,70000, 80000,90000, 100000, 120000, 140000, 160000, 180000, 200000, 250000,300000, 400000, 500000,999999];
- }
-
- this.headitemby="";
- var showkey = "";
- var getData = this.indexData3.graphMap;
- //var unit = this.current ? '笔' : '元'
- var colorName = "#333"
-
- this.showlist1 = ['收入', '利润', '次数','新电途'];
- var showlistColor = ['#5872c0', '#de6e6a','#f3c96b', '#69be8d'];
- var zLevel=[1,4,2,3];
- var sz2 = ['todayAmount', 'todayProfit', 'todayEQNum','todayXDTAmount'];
- if (!this.myChart) {
- this.myChart = echarts.init(document.getElementById('pieEcharts'));
- this.myChart.on("dataZoom", (res) => {
- showkey = "";
- this.headitemby ="";
- });
- }
- this.myChart.clear();
- //
- var timelist = []
- for (var i in getData) {
- if (this.type_head == 1) {
- timelist.push(i.substring(5))
- } else {
- timelist.push(i)
- }
- }
- var list = [];
- for (var j in this.showlist1) {
- var ap = {
- name: this.showlist1[j],
- type: 'line',
- lineStyle:{
- color:showlistColor[j]
- },
- itemStyle:{
- color:showlistColor[j]
- },
- z:zLevel[j],
- // label: {
- // show: true,
- // position: 'top'
- // },
- data: []
- }
- if (this.type_head == 1) {
- ap.symbolSize = 3;
- }
- var bl=true;
- for (var i in getData) {
- //var time=this.queryDate.replace("-","/").replace("-","/")
- //time+' '+i
- var obj = getData[i][sz2[j]];
-
- //**********
- if(true){
- const min_v = Math.max(...dataInterval.filter((v) => v <= obj));
- // 2.寻找在数据间隔里大于amount的最小值
- const max_v = Math.min(...dataInterval.filter((v) => v > obj));
- // 3.寻找 min_v 所在的下标
- const index = dataInterval.findIndex((v) => v === min_v);
- // 4.计算该amount在y轴上应该展示的位置
- const y_value = ((obj - min_v) / (max_v - min_v)) * 10 + index * 10;
-
-
- obj = y_value;
-
- }
-
- //**********
- //'todayAmount', 'todayProfit', 'todayEQNum'
- if (bl&&getData[i].todayAmount == 0 && getData[i].todayProfit == 0 &&getData[i].todayEQNum == 0) {
- //&& &&getData[i].todayEQNum == 0
- continue;
- }
-
- bl=false;
- var time = i
- if (this.type_head == 1) {
- //time = i.substring(5)
- } else {
- }
-
- ap.data.push([time, obj]);
- }
-
- if(bl){
- ap.data=[];
- for (var i in getData) {
- //var time=this.queryDate.replace("-","/").replace("-","/")
- //time+' '+i
- var obj = getData[i][sz2[j]];
- var time = i
- if (this.type_head == 1) {
- time = i.substring(5)
- } else {
-
- }
- if(j!=2){
- obj=obj.toFixed(2)
- }
- ap.data.push([time, obj]);
- }
- }
-
- list.push(ap)
- }
- var yshow=0;
- // 指定图表的配置项和数据
- var option = {
- tooltip: {
- formatter: (value) => {
- //getPie
- var name = value[0].data[0];
- var info = getData[name];
-
-
-
- var style = "float: right;margin-left: 3px;"
- var text1 = ""
- for (var i in value) {
- var u = "元"
- var num=info[sz2[value[i].seriesIndex]];
-
- if (value[i].seriesName == '次数') {
- u = '次'
- }else{
- num=num.toFixed(2)
- }
- text1 += "<p>" + value[i].marker + value[i].seriesName + '<span style="' + style +
- '">' + num + u + '</span></p>';
- }
- if (this.type_head == 1) {
- //time = i.substring(5)
- var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
- var now = newDate(name);
- var day = now.getDay();
- var week = weeks[day];
- return `<p>${name} ${week}</p>` + text1
- } else {
- return `<p>${name}</p>` + text1
- }
-
- },
- trigger: 'axis',
- borderColor: "#F0F0F0",
- borderWidth: 1,
- backgroundColor: "#ffffff",
- textStyle: {
- color: "#333"
- }
- },
- legend: {
- data: this.showlist1,
- textStyle: {
- color: "#333"
- }
- },
- grid: {
- top: '13%',
- left: '3%',
- right: '8%',
- bottom: '18%',
- containLabel: true
- },
- xAxis: {
- //type: 'value',
- type: 'category',
- splitNumber: 4,
- boundaryGap: false,
- axisLabel: {
- formatter: (value) => {
- if(this.headitemby==""){
- this.headitemby=value
- }
- var i = 0
- if (this.type_head == 1) {
- i = 0;
- } else {
- i = 3;
- }
- var showvalue = "";
- var key = value.substring(0,8-i);
-
- if (showkey == ""||value==this.headitemby) {
- showkey = key
-
- showvalue = value
- showvalue = value.substring(5-i)
- } else {
- if (key != showkey) {
- showkey = key
- showvalue = value
- showvalue = value.substring(5-i)
- } else {
- showvalue = value.substring(8-i)
- }
- }
- return showvalue.replace("-",".");
- },
- textStyle: {
- color: "#333"
- }
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#333"
- }
- },
- },
- yAxis: {
-
- type: 'value',
- // name: '单位('+this.typeN+')',
- axisLabel: {
- formatter:(v,i)=>{
- //console.log(v,i)
- if(i==0){
- yshow=0
- return 0
- }
- if(yshow!=parseInt(v/10)){
- yshow=parseInt(v/10);
- return dataInterval[parseInt(v/10)]
- }else{
- return ''
- }
-
- },
- textStyle: {
- color: "#333"
- }
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#333"
- }
- },
- },
- series: list
- };
-
- option.dataZoom = [{
- type: 'inside',
- start: 0,
- end: 100
- },
- {
- start: 0,
- end: 100
- }
- ]
- if (this.type_head == 1) {
-
- } else {
- //timelist.push(i)
- }
-
- console.log(option)
- // 使用刚指定的配置项和数据显示图表。
- 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>
- .headbotton1:after {
- border-radius: 15px 0 0 15px;
- }
- .headbotton2:after {
- border-radius: 0 15px 15px 0;
- }
- .detailstable {
- padding: 30rpx 30rpx !important;
- }
- .detailstableHead {
- .span1 {
- font-size: 32rpx !important;
- }
- .details-row-head-1 {}
- .details-row-head-2 {}
- .details-row-head-3 {
- width: 30% !important;
- max-width: 150rpx;
- .span {}
- }
- .span2 {
- font-size: 44rpx !important;
- font-weight: bold;
- width: 100%;
- color: #101010;
- span {
- font-size: 24rpx !important;
- }
- }
- }
- .detailslineHead {
- border-top: 1px solid #ededed;
- ;
- .details-row {
- padding-left: 8rpx !important;
- }
- font-size: 30rpx !important;
- .span1 span {
- font-size: 28rpx;
- }
- }
- .detailstable,
- .detailstableHead {
- font-size: 16px;
- p {
- font-size: 14px;
- }
- .details-row-main {
- border-bottom: 1px solid #ededed;
- padding: 10px 0;
- }
- .detailsline {
- border-bottom: 1px solid #ededed;
- }
- .detailsline,
- .detailsline—bottom {
- display: flex;
- .details-row {
- width: 50%;
- display: flex;
- justify-content: space-between;
- flex-direction: column;
- padding-left: 16rpx;
- margin-bottom: 20rpx;
- .span1 {
- color: rgba(136, 136, 136, 100);
- font-size: 28rpx;
- width: 100%;
- }
- .span2 {
- font-size: 36rpx;
- width: 100%;
- color: #101010;
- span {
- font-size: 24rpx;
- }
- }
- }
- }
- .details-row-1 {
- width: 47%;
- padding-left: 0px !important;
- border-right: 1px solid #ededed;
- }
- }
- .details {
- padding: 20px;
- background-color: #fff;
- border-radius: 8px;
- }
- .details-title {
- margin-bottom: 16px;
- h4 {
- font-weight: normal;
- font-size: 16px;
- position: relative;
- padding-left: 10px;
- &::after {
- content: '';
- position: absolute;
- height: 12px;
- width: 4px;
- background-color: #27B148;
- left: 0;
- top: 5px;
- }
- }
- }
- .details-row {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 15px;
- p {
- color: #37393c;
- font-weight: bold;
- }
- }
- .details-row2 {
- display: flex;
- justify-content: space-between;
- align-items: center;
- // margin-top: 15px;
- p {
- // color: #37393c;
- // font-weight: bold;
- }
- }
- .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: 24px;
- padding-left: 15px;
- padding-top: 10px;
- }
- .statisticsData {
- background-color: #fff;
- margin: 0px 24rpx 24rpx;
- //padding:0px 24rpx 24rpx;
- border-radius: 8px;
- }
- .statisticsDataMain {
- flex-wrap: wrap;
- display: flex;
- }
- .statisticsData-item {
- flex: 1;
- width: 40%;
- .statisticsData-head {
- display: flex;
- align-items: center;
- p {
- color: #637AA2;
- font-size: 12px;
- }
- }
- .statisticsData-main {
- margin-top: 4px;
- font-size: 18px;
- }
- .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>
|