index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  1. <template>
  2. <view>
  3. <view class="navbar-tit">{{title}}运管中心</view>
  4. <view class="statisticsChart" style="margin-top: 120rpx;margin-bottom: 0px">
  5. <view class="statisticsChart-head">
  6. <h4>充电统计</h4>
  7. <view class="navbar-screen ">
  8. <u-button text="月落" size="mini" class="headbotton1" style="border-radius: 10px 0 0 10px;"
  9. :type="current==1?'primary':'info'" @click="changesub(1)">按天</u-button>
  10. <u-button text="月落" size="mini" class="headbotton2" style="border-radius: 0 10px 10px 0;"
  11. :type="current==2?'primary':'info'" @click="changesub(2)">按月</u-button>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="statisticsData">
  16. <view class="detailstableHead" style="
  17. padding-top: 1px;
  18. ">
  19. <view id="pieEcharts" style="min-height:250px;margin-top: 20px">
  20. </view>
  21. </view>
  22. <view class="detailstableHead" v-if="indexData&&false">
  23. <view class="detailsline">
  24. <view class="details-row details-row-head-1 ">
  25. <view class="span1">今日收入</view>
  26. <view class="span2">{{indexData.todayAmount?indexData.todayAmount.toFixed(2):0}}<span>元</span>
  27. </view>
  28. </view>
  29. <view class="details-row details-row-head-2">
  30. <view class="span1">今日利润</view>
  31. <view class="span2">{{indexData.todayProfit?indexData.todayProfit.toFixed(2):0}}<span>元</span>
  32. </view>
  33. </view>
  34. <view class="details-row details-row-head-3">
  35. <view class="span1">今日笔数</view>
  36. <view class="span2">{{indexData.todayEQNum?indexData.todayEQNum:0}}<span>笔</span></view>
  37. </view>
  38. </view>
  39. <view class="detailsline">
  40. <view class="details-row details-row-head-1 ">
  41. <view class="span1">昨日收入</view>
  42. <view class="span2">
  43. {{indexData.yesterdayAmount?indexData.yesterdayAmount.toFixed(2):0}}<span>元</span></view>
  44. </view>
  45. <view class="details-row details-row-head-2">
  46. <view class="span1">昨日利润</view>
  47. <view class="span2">
  48. {{indexData.yesterdayProfit?indexData.yesterdayProfit.toFixed(2):0}}<span>元</span></view>
  49. </view>
  50. <view class="details-row details-row-head-3">
  51. <view class="span1">昨日笔数</view>
  52. <view class="span2">{{indexData.yesterdayEQNum?indexData.yesterdayEQNum:0}}<span>笔</span></view>
  53. </view>
  54. </view>
  55. <view class="detailsline—bottom">
  56. <view class="details-row details-row-head-1">
  57. <view class="span1">本月收入</view>
  58. <view class="span2">
  59. {{indexData.thisMonthAmount?indexData.thisMonthAmount.toFixed(2):0}}<span>元</span></view>
  60. </view>
  61. <view class="details-row details-row-head-2">
  62. <view class="span1">本月利润</view>
  63. <view class="span2">
  64. {{indexData.thisMonthProfit?indexData.thisMonthProfit.toFixed(2):0}}<span>元</span></view>
  65. </view>
  66. <view class="details-row details-row-head-3">
  67. <view class="span1">本月笔数</view>
  68. <view class="span2">{{indexData.thisMonthEQNum?indexData.thisMonthEQNum:0}}<span>笔</span></view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <u-picker mode="time" v-model="popupShow" @confirm="changedate" :default-time="queryTime" :params="params">
  74. </u-picker>
  75. <u-picker mode="time" v-model="popupShow2" @confirm="changedate2" :default-time="queryTime2+'-1'"
  76. :params="params"></u-picker>
  77. <u-picker mode="selector" v-model="popupShow3" @confirm="changedate3" :range="stationList" range-key="name"
  78. :default-selector="[selectstationIndex]"></u-picker>
  79. <view class="statisticsChart">
  80. <view class="statisticsChart-head" style="margin-top: 20px;">
  81. <h4>流水统计</h4>
  82. <!-- <view class="navbar-screen" >
  83. {{startTime}}至{{endTime}}
  84. </view> -->
  85. <view class="navbar-screen" @click="popupShow = true" v-if="false">
  86. <span>{{showTime(queryTime)}}</span>
  87. <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow"></u-icon>
  88. <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow"></u-icon>
  89. </view>
  90. </view>
  91. <u-calendar v-model="popupShow4" mode="range" @change="changedate4"></u-calendar>
  92. <view class="details detailstable">
  93. <p style="text-align: center; margin-bottom: 5px;" @click="popupShow4 = true">
  94. <img src="@/assets/img/riLine-calendar-todo-line.svg" align="absmiddle"
  95. style="height:40rpx;width: 40rpx ;">
  96. {{startTime}}至{{endTime}}
  97. <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow4"></u-icon>
  98. <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow4"></u-icon>
  99. </p>
  100. <view class="detailsline detailslineHead" v-if="stationFlowList.length>1">
  101. <view class="details-row ">
  102. <view class="span1">总收入</view>
  103. <view class="span2">{{(allMoneySum).toFixed(2)}}<span>元</span></view>
  104. </view>
  105. <view class="details-row">
  106. <view class="span1">总利润<span>(服务费+月卡)</span></view>
  107. <view class="span2">{{(serviceMoneySum).toFixed(2)}}<span>元</span></view>
  108. </view>
  109. </view>
  110. <u-collapse :headStyle="{
  111. color:'#101010',
  112. fontWeight: 'bold',
  113. padding:'24rpx 0',
  114. borderBottom: '1px solid #ededed'
  115. }" v-if="stationFlowList.length">
  116. <u-collapse-item @change="changeitem" v-for="(item, index) in stationFlowList" :index="index"
  117. :key="index">
  118. <view slot="title" class="u-collapse-title u-line-1" style="width: 100%;">
  119. {{item.stationName}} <span style="float:right;"><span
  120. style="font-size: 24rpx;margin-right: 8rpx;font-weight: normal;">总收入</span>{{item.actualMoney.toFixed(2)}}元</span>
  121. </view>
  122. <!-- -->
  123. <view class="detailsline">
  124. <view class="details-row details-row-1">
  125. <view class="span1">电费</view>
  126. <view class="span2">{{item.elecMoney.toFixed(2)}}<span>元</span></view>
  127. </view>
  128. <view class="details-row">
  129. <view class="span1">服务费</view>
  130. <view class="span2">{{item.serviceMoney.toFixed(2)}}<span>元</span></view>
  131. </view>
  132. </view>
  133. <view class="detailsline">
  134. <view class="details-row details-row-1">
  135. <view class="span1">总用电量</view>
  136. <view class="span2">{{(item.eq/10000).toFixed(1)}}<span>度</span></view>
  137. </view>
  138. <view class="details-row">
  139. <view class="span1">充电枪数量</view>
  140. <view class="span2">快充{{item.fastNum}}/慢充{{item.slowNum}}</view>
  141. </view>
  142. </view>
  143. <view class="detailsline" v-if="item.fastNum&&item.slowNum">
  144. <view class="details-row details-row-1">
  145. <view class="span1">快充枪平均充电量</view>
  146. <view class="span2" v-if="item.fastNum">
  147. {{(item.averageFast/10000).toFixed(1)}}<span>度/枪/天</span></view>
  148. <view class="span2" v-else>0<span>度/枪/天</span></view>
  149. </view>
  150. <view class="details-row">
  151. <view class="span1">慢充枪平均充电量</view>
  152. <view class="span2" v-if="item.slowNum">
  153. {{(item.averageSlow/10000).toFixed(1)}}<span>度/枪/天</span></view>
  154. <view class="span2" v-else>0<span>度/枪/天</span></view>
  155. </view>
  156. </view>
  157. <view class="detailsline" v-if="item.fastNum&&item.slowNum">
  158. <view class="details-row details-row-1">
  159. <view class="span1">月卡收益</view>
  160. <view class="span2">{{(item.cardMoney).toFixed(2)}}<span>元</span></view>
  161. </view>
  162. <view class="details-row">
  163. </view>
  164. </view>
  165. <view v-if="item.fastNum&&item.slowNum"
  166. :style="item.slowDayNum==nowTime?'color: #ffffff;':'border-bottom: 1px solid #ededed;'">
  167. 查询范围内实际订单天数{{item.slowDayNum}}</view>
  168. </u-collapse-item>
  169. </u-collapse>
  170. </view>
  171. <view class="statisticsChart-head" style="margin-top: 20px;">
  172. <h4>投资人收益统计</h4>
  173. <!-- <view class="navbar-screen" >
  174. {{startTime}}至{{endTime}}
  175. </view> -->
  176. <!-- <view class="navbar-screen" @click="popupShow2 = true"><span>筛选</span>
  177. <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
  178. </view> -->
  179. </view>
  180. <view class="details" v-if="indexData2&&indexData2.incomeMap">
  181. <view class="details-row2">
  182. <p @click="popupShow3 = true">{{selectstationName}}
  183. <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow3"></u-icon>
  184. <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow3"></u-icon>
  185. </p>
  186. <p @click="popupShow2 = true">
  187. {{showTime(queryTime2)}}
  188. <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow2"></u-icon>
  189. <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow2"></u-icon>
  190. </p>
  191. </view>
  192. <view class="details-row">
  193. <p>投资人收入</p>
  194. <span>{{indexData2.incomeMap.incomeAmount.toFixed(2)}}元</span>
  195. </view>
  196. <view class="details-row">
  197. <p>预估用电度数</p>
  198. <span>{{(indexData2.incomeMap.electricQuantity/10000).toFixed(1)}}度</span>
  199. </view>
  200. <view class="details-row">
  201. <p>预估电费</p>
  202. <span>{{indexData2.incomeMap.costAmount.toFixed(2)}}元</span>
  203. </view>
  204. <view class="details-row">
  205. <p>服务费预估收益</p>
  206. <span>{{indexData2.incomeMap.serviceAmount.toFixed(2)}}元</span>
  207. </view>
  208. <view class="details-row">
  209. <p>月卡收益</p>
  210. <span>{{indexData2.incomeMap.cardIncomeAmount.toFixed(2)}}元</span>
  211. </view>
  212. <view class="details-row">
  213. <p>预估总利润</p>
  214. <span>{{(indexData2.incomeMap.serviceAmount+indexData2.incomeMap.cardIncomeAmount).toFixed(2)}}元</span>
  215. </view>
  216. </view>
  217. </view>
  218. <Tabbar :current="0" ref="tabbarMain"></Tabbar>
  219. <!-- <u-tabbar v-model="current" :list="tabbarList" active-color="#185ac6"></u-tabbar>
  220. -->
  221. </view>
  222. </template>
  223. <script>
  224. import Tabbar from '@/components/TabbarFinance.vue'
  225. import * as API from '@/apis/finance.js'
  226. import * as echarts from "echarts";
  227. //require("@/apis/echarts-5-3.min.js")
  228. //import * as echarts from "@/apis/echarts-5-3.min.js";
  229. import {
  230. daysDistance,
  231. beforeTimeStamp,
  232. currentTimeStamp,
  233. parseUnixTime
  234. } from '@/utils'
  235. export default {
  236. data() {
  237. return {
  238. popupShow3: false,
  239. params: {
  240. year: true,
  241. month: true,
  242. day: false,
  243. hour: false,
  244. minute: false,
  245. second: false
  246. },
  247. isinit: true,
  248. form: {},
  249. form2: {},
  250. selecttype: "",
  251. selectstationId: "",
  252. selectdeviceNo: "",
  253. popupShow2: false,
  254. popupShow: false,
  255. popupShow4: false,
  256. nowTime: 0,
  257. selectstationId2: "",
  258. selectstationIndex: 0,
  259. selectstationName: "",
  260. info: {},
  261. title: "",
  262. showdate: false,
  263. showdate2: false,
  264. queryTime: "",
  265. queryTime2: "",
  266. indexData: {},
  267. indexData3: null,
  268. indexData2: null,
  269. type_head: '1',
  270. startDate_head: '',
  271. changeitemBl: false,
  272. myChart: null,
  273. myChartReady: false,
  274. myChartTime: false,
  275. subsection: [{
  276. name: '金额'
  277. },
  278. {
  279. name: '笔数'
  280. }
  281. ],
  282. stationFlowList: [],
  283. serviceMoneySum: 0,
  284. allMoneySum: 0,
  285. stationList: [],
  286. stationListSon: [],
  287. tabbarList: [{
  288. iconPath: "bar-chart-box-fill",
  289. selectedIconPath: "bar-chart-box-fill",
  290. text: '统计',
  291. count: 0,
  292. isDot: true,
  293. customIcon: true,
  294. },
  295. {
  296. iconPath: "article-fill",
  297. selectedIconPath: "article-fill",
  298. text: '明细',
  299. midButton: true,
  300. customIcon: true,
  301. },
  302. {
  303. iconPath: "account-pin-box-fill",
  304. selectedIconPath: "account-pin-box-fill",
  305. text: '我的',
  306. count: 0,
  307. isDot: false,
  308. customIcon: true,
  309. },
  310. ],
  311. endTime: '',
  312. endTime2: '',
  313. current: 1,
  314. background: {
  315. background: 'none'
  316. },
  317. value: '',
  318. type: 'select',
  319. show: false,
  320. border: true,
  321. step: 0,
  322. stepname: '',
  323. startTime: '',
  324. stepid: 0,
  325. }
  326. },
  327. onShow() {
  328. if (this.$refs.tabbarMain) {
  329. this.$refs.tabbarMain.setcount(0);
  330. }
  331. },
  332. onLoad() {
  333. this.info = this.carhelp.getPersonInfo("merchantUser")
  334. this.title = this.info.merchantAccountName
  335. },
  336. components: {
  337. Tabbar
  338. },
  339. onReady() {
  340. var date = new Date();
  341. this.nowTime = 7
  342. this.queryTime = parseUnixTime(currentTimeStamp(), '{y}-{m}');
  343. this.queryTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}'),
  344. this.startDate_head = parseUnixTime(beforeTimeStamp(30 ), '{y}-{m}-{d}')
  345. this.startTime = parseUnixTime(beforeTimeStamp(7), '{y}-{m}-{d}')
  346. this.endTime = parseUnixTime(beforeTimeStamp(1), '{y}-{m}-{d}')
  347. //this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  348. this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  349. this.getStation()
  350. },
  351. computed: {
  352. // startTime(){
  353. // return this.queryTime+'-1'
  354. // },
  355. startTime2() {
  356. return this.queryTime2 + '-1'
  357. },
  358. },
  359. methods: {
  360. changeitem(e) {
  361. if (this.stationFlowList.length > 1 && e.index == this.stationFlowList.length - 1 && e.show) {
  362. this.changeitemBl = true;
  363. } else {
  364. this.changeitemBl = false;
  365. }
  366. },
  367. showTime(name) {
  368. if (!name) {
  369. return ''
  370. }
  371. return name.replace('-', '年') + '月';
  372. },
  373. getStation(bl) {
  374. API.stationList().then((res) => {
  375. this.stationList = res.data.stationList
  376. this.stationList.unshift({
  377. id: '',
  378. name: "全部站点"
  379. })
  380. this.selectstationName = "全部站点"
  381. this.stationListSon = res.data.deviceList
  382. this.getDataHome2()
  383. this.getData()
  384. this.getData2()
  385. }).catch(error => {
  386. uni.showToast({
  387. title: error
  388. })
  389. })
  390. },
  391. resetBtn() {
  392. this.nowTime = 7
  393. this.startTime = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  394. this.endTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  395. this.selecttype = ""
  396. this.selectstationId = ""
  397. this.selectdeviceNo = ""
  398. this.form = {
  399. type: this.selecttype,
  400. stationId: this.selectstationId,
  401. deviceNo: this.selectdeviceNo,
  402. };
  403. this.popupShow = false;
  404. this.list = [];
  405. this.getData()
  406. },
  407. okbtn() {
  408. this.popupShow = false;
  409. this.form = {
  410. type: this.selecttype,
  411. stationId: this.selectstationId,
  412. deviceNo: this.selectdeviceNo,
  413. };
  414. this.list = [];
  415. this.getData()
  416. },
  417. resetBtn2() {
  418. this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  419. this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  420. this.selectstationId2 = ""
  421. this.form2 = {
  422. stationId: this.selectstationId2,
  423. };
  424. this.popupShow2 = false;
  425. this.getData2()
  426. },
  427. okbtn2() {
  428. this.popupShow2 = false;
  429. this.form2 = {
  430. stationId: this.selectstationId2,
  431. };
  432. this.getData2()
  433. },
  434. getDataHome2() {
  435. var endtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  436. API.homeHeadChargingStatistics({
  437. type: this.type_head,
  438. startDate: this.startDate_head,
  439. endDate: endtime
  440. }).then((res) => {
  441. this.indexData3 = res.data;
  442. this.getPie()
  443. }).catch(error => {
  444. uni.showToast({
  445. title: error
  446. })
  447. })
  448. },
  449. getDataHome() {
  450. API.homeHeadStatistics().then((res) => {
  451. this.indexData = res.data;
  452. }).catch(error => {
  453. uni.showToast({
  454. title: error
  455. })
  456. })
  457. },
  458. getData() {
  459. this.form.startDate = this.startTime,
  460. this.form.endDate = this.endTime
  461. API.homeFlowStatistics(this.form).then((res) => {
  462. this.stationFlowList = res.data.stationFlowList;
  463. this.nowTime = daysDistance(this.startTime, this.endTime) + 1;
  464. this.serviceMoneySum = 0;
  465. this.allMoneySum = 0;
  466. for (var i in this.stationFlowList) {
  467. var item = this.stationFlowList[i];
  468. this.allMoneySum += item.actualMoney
  469. this.serviceMoneySum += item.serviceMoney
  470. this.serviceMoneySum += item.cardMoney
  471. }
  472. }).catch(error => {
  473. uni.showToast({
  474. title: error
  475. })
  476. })
  477. },
  478. getData2() {
  479. uni.showLoading({
  480. title: "加载中",
  481. mask: true,
  482. })
  483. this.form2.startDate = this.startTime2,
  484. this.form2.endDate = this.endTime2
  485. API.homeIncomeStatistics(this.form2).then((res) => {
  486. this.indexData2 = res.data
  487. uni.hideLoading()
  488. }).catch(error => {
  489. uni.showToast({
  490. title: error
  491. })
  492. })
  493. },
  494. changesub(e) {
  495. this.current = e
  496. this.type_head = e;
  497. if (e == 1) {
  498. this.startDate_head = parseUnixTime(beforeTimeStamp(30 ), '{y}-{m}-{d}')
  499. } else {
  500. this.startDate_head = parseUnixTime(beforeTimeStamp(365), '{y}-{m}-01')
  501. }
  502. // this.getPie()
  503. this.getDataHome2()
  504. },
  505. changedate4(e) {
  506. this.startTime = e.startDate
  507. this.endTime = e.endDate
  508. this.okbtn()
  509. },
  510. changedate3(e) {
  511. var index = e[0];
  512. var obj = this.stationList[index];
  513. this.selectstationId2 = obj.id;
  514. this.selectstationIndex = index;
  515. this.selectstationName = obj.name;
  516. this.okbtn2()
  517. },
  518. changedate(e) {
  519. this.queryTime = e.year + '-' + e.month;
  520. this.startTime = e.year + '-' + e.month + '-1';
  521. if (e.month == '12') {
  522. this.endTime = (e.year) + "/12/31"
  523. } else {
  524. var b = e.year + '/' + (parseInt(e.month) + 1) + '/1';
  525. var a = beforeTimeStamp(1, b);
  526. this.endTime = parseUnixTime(a, '{y}-{m}-{d}')
  527. }
  528. this.okbtn()
  529. },
  530. changedate2(e) {
  531. this.queryTime2 = e.year + '-' + e.month;
  532. if (e.month == '12') {
  533. this.endTime2 = (e.year) + "/12/31"
  534. } else {
  535. var b = e.year + '/' + (parseInt(e.month) + 1) + '/1';
  536. var a = beforeTimeStamp(1, b);
  537. this.endTime2 = parseUnixTime(a, '{y}-{m}-{d}')
  538. }
  539. this.okbtn2()
  540. },
  541. getPie() {
  542. var getData = this.indexData3.graphMap;
  543. //var unit = this.current ? '笔' : '元'
  544. var colorName = "#333"
  545. this.showlist1 = ['收入', '利润', '次数'];
  546. var sz2 = ['todayAmount', 'todayProfit', 'todayEQNum'];
  547. if (!this.myChart) {
  548. this.myChart = echarts.init(document.getElementById('pieEcharts'));
  549. this.myChart.on("dataZoom", function(res){
  550. console.log(res)
  551. }); 
  552. }
  553. this.myChart.clear();
  554. var timelist = []
  555. for (var i in getData) {
  556. if (this.type_head == 1) {
  557. timelist.push(i.substring(5))
  558. } else {
  559. timelist.push(i)
  560. }
  561. }
  562. var list = [];
  563. for (var j in this.showlist1) {
  564. var ap = {
  565. name: this.showlist1[j],
  566. type: 'line',
  567. // label: {
  568. // show: true,
  569. // position: 'top'
  570. // },
  571. data: []
  572. }
  573. if (this.type_head == 1) {
  574. // ap.symbol='circle'
  575. ap.symbolSize=3;
  576. }
  577. for (var i in getData) {
  578. //var time=this.queryDate.replace("-","/").replace("-","/")
  579. //time+' '+i
  580. var obj = getData[i][sz2[j]];
  581. //'todayAmount', 'todayProfit', 'todayEQNum'
  582. if(getData[i].todayAmount==0&&getData[i].todayProfit==0&&getData[i].todayEQNum==0){
  583. continue;
  584. }
  585. var time = i
  586. if (this.type_head == 1) {
  587. time = i.substring(5)
  588. } else {
  589. }
  590. ap.data.push([time, obj]);
  591. }
  592. list.push(ap)
  593. }
  594. // 指定图表的配置项和数据
  595. var option = {
  596. tooltip: {
  597. formatter: (value) => {
  598. var info = value;
  599. var name=value[0].data[0];
  600. var style="float: right;margin-left: 3px;"
  601. var text1=""
  602. for(var i in value){
  603. var u="元"
  604. if(value[i].seriesName=='次数'){
  605. u='次'
  606. }
  607. text1+="<p>"+value[i].marker+value[i].seriesName+'<span style="'+style+'">'+value[i].data[1]+u+'</span></p>';
  608. }
  609. return `<p>${name}</p>`+text1
  610. },
  611. trigger: 'axis',
  612. borderColor: "#F0F0F0",
  613. borderWidth: 1,
  614. backgroundColor: "#ffffff",
  615. textStyle: {
  616. color: "#333"
  617. }
  618. },
  619. legend: {
  620. data: this.showlist1,
  621. textStyle: {
  622. color: "#333"
  623. }
  624. },
  625. grid: {
  626. top: '13%',
  627. left: '3%',
  628. right: '8%',
  629. bottom: '16%',
  630. containLabel: true
  631. },
  632. xAxis: {
  633. type: 'category',
  634. splitNumber: 4,
  635. boundaryGap: false,
  636. axisLabel: {
  637. textStyle: {
  638. color: "#333"
  639. }
  640. },
  641. axisLine: {
  642. show: true,
  643. lineStyle: {
  644. color: "#333"
  645. }
  646. },
  647. },
  648. yAxis: {
  649. type: 'value',
  650. // name: '单位('+this.typeN+')',
  651. axisLabel: {
  652. textStyle: {
  653. color: "#333"
  654. }
  655. },
  656. axisLine: {
  657. show: true,
  658. lineStyle: {
  659. color: "#333"
  660. }
  661. },
  662. },
  663. series: list
  664. };
  665. if (this.type_head == 1) {
  666. option.dataZoom = [{
  667. type: 'inside',
  668. start: 0,
  669. end: 100
  670. },
  671. {
  672. start: 0,
  673. end: 100
  674. }
  675. ]
  676. } else {
  677. //timelist.push(i)
  678. }
  679. console.log(option)
  680. // 使用刚指定的配置项和数据显示图表。
  681. this.myChart.setOption(option);
  682. }
  683. }
  684. }
  685. </script>
  686. <style>
  687. page {
  688. background: url(../../assets/img/index_header_bg.png) no-repeat top center #f7f7f7;
  689. background-size: 100%;
  690. }
  691. </style>
  692. <style lang="scss" scoped>
  693. .headbotton1:after {
  694. border-radius: 15px 0 0 15px;
  695. }
  696. .headbotton2:after {
  697. border-radius: 0 15px 15px 0;
  698. }
  699. .detailstable {
  700. padding: 40rpx 30rpx !important;
  701. }
  702. .detailstableHead {
  703. .span1 {
  704. font-size: 32rpx !important;
  705. }
  706. .details-row-head-1 {}
  707. .details-row-head-2 {}
  708. .details-row-head-3 {
  709. width: 30% !important;
  710. max-width: 150rpx;
  711. .span {}
  712. }
  713. .span2 {
  714. font-size: 44rpx !important;
  715. font-weight: bold;
  716. width: 100%;
  717. color: #101010;
  718. span {
  719. font-size: 24rpx !important;
  720. }
  721. }
  722. }
  723. .detailslineHead {
  724. border-top: 1px solid #ededed;
  725. ;
  726. .details-row {
  727. padding-left: 8rpx !important;
  728. }
  729. font-size: 30rpx !important;
  730. .span1 span {
  731. font-size: 28rpx;
  732. }
  733. }
  734. .detailstable,
  735. .detailstableHead {
  736. font-size: 16px;
  737. p {
  738. font-size: 14px;
  739. }
  740. .details-row-main {
  741. border-bottom: 1px solid #ededed;
  742. padding: 10px 0;
  743. }
  744. .detailsline {
  745. border-bottom: 1px solid #ededed;
  746. }
  747. .detailsline,
  748. .detailsline—bottom {
  749. display: flex;
  750. .details-row {
  751. width: 50%;
  752. display: flex;
  753. justify-content: space-between;
  754. flex-direction: column;
  755. padding-left: 16rpx;
  756. margin-bottom: 20rpx;
  757. .span1 {
  758. color: rgba(136, 136, 136, 100);
  759. font-size: 28rpx;
  760. width: 100%;
  761. }
  762. .span2 {
  763. font-size: 36rpx;
  764. width: 100%;
  765. color: #101010;
  766. span {
  767. font-size: 24rpx;
  768. }
  769. }
  770. }
  771. }
  772. .details-row-1 {
  773. width: 47%;
  774. padding-left: 0px !important;
  775. border-right: 1px solid #ededed;
  776. }
  777. }
  778. .details {
  779. padding: 20px;
  780. background-color: #fff;
  781. border-radius: 8px;
  782. }
  783. .details-title {
  784. margin-bottom: 16px;
  785. h4 {
  786. font-weight: normal;
  787. font-size: 16px;
  788. position: relative;
  789. padding-left: 10px;
  790. &::after {
  791. content: '';
  792. position: absolute;
  793. height: 12px;
  794. width: 4px;
  795. background-color: #27B148;
  796. left: 0;
  797. top: 5px;
  798. }
  799. }
  800. }
  801. .details-row {
  802. display: flex;
  803. justify-content: space-between;
  804. align-items: center;
  805. margin-top: 15px;
  806. p {
  807. color: #37393c;
  808. font-weight: bold;
  809. }
  810. }
  811. .details-row2 {
  812. display: flex;
  813. justify-content: space-between;
  814. align-items: center;
  815. // margin-top: 15px;
  816. p {
  817. // color: #37393c;
  818. // font-weight: bold;
  819. }
  820. }
  821. .popup-screen {
  822. padding: 20px;
  823. position: relative;
  824. .screen {
  825. padding-bottom: 30px;
  826. }
  827. .screen-item {
  828. margin-bottom: 20px;
  829. .screen-head {
  830. margin-bottom: 8px;
  831. font-size: 16px;
  832. }
  833. .screen-main {
  834. display: flex;
  835. // display: -webkit-box;
  836. flex-wrap: wrap;
  837. }
  838. .screen-entry {
  839. width: 29%;
  840. padding: 6px 0;
  841. display: flex;
  842. align-items: center;
  843. justify-content: center;
  844. background-color: #F2F5FA;
  845. text-align: center;
  846. margin-bottom: 10px;
  847. border-radius: 3px;
  848. margin-right: 6px;
  849. }
  850. .screen-entry.active {
  851. background-color: #185AC6;
  852. color: #fff;
  853. }
  854. }
  855. .screen-foot {
  856. position: fixed;
  857. left: 0;
  858. right: 0;
  859. bottom: 0;
  860. display: flex;
  861. height: 50px;
  862. border-top: 1px solid #ededed;
  863. .screen-btn-l {
  864. background-color: #fff;
  865. flex: 0.2;
  866. text-align: center;
  867. line-height: 50px;
  868. }
  869. .screen-btn-r {
  870. flex: 0.8;
  871. text-align: center;
  872. line-height: 50px;
  873. background-color: #185AC6;
  874. color: #fff;
  875. }
  876. }
  877. }
  878. .navbar-tit {
  879. color: #fff;
  880. font-size: 24px;
  881. padding-left: 15px;
  882. padding-top: 10px;
  883. }
  884. .statisticsData {
  885. background-color: #fff;
  886. margin: 0px 24rpx 24rpx;
  887. //padding:0px 24rpx 24rpx;
  888. border-radius: 8px;
  889. }
  890. .statisticsDataMain {
  891. flex-wrap: wrap;
  892. display: flex;
  893. }
  894. .statisticsData-item {
  895. flex: 1;
  896. width: 40%;
  897. .statisticsData-head {
  898. display: flex;
  899. align-items: center;
  900. p {
  901. color: #637AA2;
  902. font-size: 12px;
  903. }
  904. }
  905. .statisticsData-main {
  906. margin-top: 4px;
  907. font-size: 18px;
  908. }
  909. .statisticsData-foot {
  910. display: flex;
  911. align-items: center;
  912. margin-top: 16px;
  913. p {
  914. color: #637AA2;
  915. }
  916. h4 {
  917. margin-left: 8px;
  918. }
  919. }
  920. }
  921. .statisticsChart {
  922. margin: 16px;
  923. .statisticsChart-head {
  924. margin-bottom: 5px;
  925. display: flex;
  926. justify-content: space-between;
  927. align-items: center;
  928. h4 {
  929. font-weight: normal;
  930. font-size: 16px;
  931. position: relative;
  932. padding-left: 10px;
  933. &::after {
  934. content: '';
  935. position: absolute;
  936. height: 12px;
  937. width: 4px;
  938. background-color: #4E8DF6;
  939. left: 0;
  940. top: 5px;
  941. }
  942. }
  943. .statisticsChart-time {
  944. display: flex;
  945. align-items: center;
  946. p {
  947. color: #666;
  948. }
  949. }
  950. }
  951. .statisticsChart-main {
  952. background-color: #fff;
  953. padding: 10px 16px 16px 16px;
  954. border-radius: 8px;
  955. }
  956. }
  957. </style>