index.vue 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060
  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:240px;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>
  44. </view>
  45. </view>
  46. <view class="details-row details-row-head-2">
  47. <view class="span1">昨日利润</view>
  48. <view class="span2">
  49. {{indexData.yesterdayProfit?indexData.yesterdayProfit.toFixed(2):0}}<span>元</span>
  50. </view>
  51. </view>
  52. <view class="details-row details-row-head-3">
  53. <view class="span1">昨日笔数</view>
  54. <view class="span2">{{indexData.yesterdayEQNum?indexData.yesterdayEQNum:0}}<span>笔</span></view>
  55. </view>
  56. </view>
  57. <view class="detailsline—bottom">
  58. <view class="details-row details-row-head-1">
  59. <view class="span1">本月收入</view>
  60. <view class="span2">
  61. {{indexData.thisMonthAmount?indexData.thisMonthAmount.toFixed(2):0}}<span>元</span>
  62. </view>
  63. </view>
  64. <view class="details-row details-row-head-2">
  65. <view class="span1">本月利润</view>
  66. <view class="span2">
  67. {{indexData.thisMonthProfit?indexData.thisMonthProfit.toFixed(2):0}}<span>元</span>
  68. </view>
  69. </view>
  70. <view class="details-row details-row-head-3">
  71. <view class="span1">本月笔数</view>
  72. <view class="span2">{{indexData.thisMonthEQNum?indexData.thisMonthEQNum:0}}<span>笔</span></view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <u-picker mode="time" v-model="popupShow" @confirm="changedate" :default-time="queryTime" :params="params">
  78. </u-picker>
  79. <u-picker mode="time" v-model="popupShow2" @confirm="changedate2" :default-time="queryTime2+'-01'"
  80. :params="params"></u-picker>
  81. <u-picker mode="selector" v-model="popupShow3" @confirm="changedate3" :range="stationList" range-key="name"
  82. :default-selector="[selectstationIndex]"></u-picker>
  83. <view class="statisticsChart chargingpile" v-if="indexData4">
  84. <view class="statisticsChart-head" style="margin-top: 40rpx;">
  85. <h4>充电枪运行情况</h4>
  86. </view>
  87. <view class="details detailstablepile" style="padding: 12px 0 12px 12px ;">
  88. <p>
  89. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="20" height="20" style=" vertical-align: bottom;border-color: rgba(0,0,0,0);border-width: bpx;border-style: undefined" filter="none">
  90. <g>
  91. <path fill="rgba(23.97,90.015,197.88,1)" d="M4 25.333v-20c0-0.736 0.597-1.333 1.333-1.333v0h12c0.736 0 1.333 0.597 1.333 1.333v0 10.667h2.667c1.473 0 2.667 1.194 2.667 2.667v0 5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v0-9.333h-2.667c-0.736 0-1.333-0.597-1.333-1.333v0-4.781l-2.209-2.209 1.885-1.885 6.6 6.6c0.241 0.241 0.391 0.574 0.391 0.941 0 0 0 0.001 0 0.001v-0 12c0 2.209-1.791 4-4 4s-4-1.791-4-4v0-5.333h-2.667v6.667h1.333v2.667h-17.333v-2.667h1.333zM12 14.667v-5.333l-5.333 8h4v5.333l5.333-8h-4z" ></path>
  92. </g>
  93. </svg>
  94. <!-- <img style=" vertical-align: bottom;" src="@/assets/img/riFill-charging-pile-fill.svg"></img>
  95. --> 快(超)充枪<span>共</span>
  96. <span
  97. style="color:#000">{{indexData4.fastGunFaultNum+indexData4.fastGunFreeNum+indexData4.fastGunWorkNum}}</span>
  98. <span>支</span>
  99. </p>
  100. <view class="detailsline">
  101. <view class="details-row details-row-1" @click="indexDate4Ck(1,1)">
  102. <view class="span1"><span class="bot bot1"></span>在用<span
  103. class="bot1span">{{indexData4.fastGunWorkNum}}</span>支
  104. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#b0b8c8" size="28" />
  105. </view>
  106. </view>
  107. <view class="details-row details-row-1" @click="indexDate4Ck(1,0)">
  108. <view class="span1"><span class="bot bot2"></span>空闲<span
  109. class="bot2span">{{indexData4.fastGunFreeNum}}</span>支
  110. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#b0b8c8" size="28" />
  111. </view>
  112. </view>
  113. <view class="details-row details-row-1" @click="indexDate4Ck(1,99)">
  114. <view class="span1"><span class="bot bot3"></span>故障<span
  115. class="bot3span">{{indexData4.fastGunFaultNum}}</span>支
  116. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#b0b8c8" size="28" />
  117. </view>
  118. </view>
  119. </view>
  120. <p style="margin-top: 16rpx;color:#00B962">
  121. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="20" height="20" style=" vertical-align: bottom;border-color: rgba(0,0,0,0);border-width: bpx;border-style: undefined" filter="none">
  122. <g>
  123. <path fill="#00B962" d="M4 25.333v-20c0-0.736 0.597-1.333 1.333-1.333v0h12c0.736 0 1.333 0.597 1.333 1.333v0 10.667h2.667c1.473 0 2.667 1.194 2.667 2.667v0 5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v0-9.333h-2.667c-0.736 0-1.333-0.597-1.333-1.333v0-4.781l-2.209-2.209 1.885-1.885 6.6 6.6c0.241 0.241 0.391 0.574 0.391 0.941 0 0 0 0.001 0 0.001v-0 12c0 2.209-1.791 4-4 4s-4-1.791-4-4v0-5.333h-2.667v6.667h1.333v2.667h-17.333v-2.667h1.333zM12 14.667v-5.333l-5.333 8h4v5.333l5.333-8h-4z" ></path>
  124. </g>
  125. </svg>
  126. 慢充枪<span>共</span>
  127. <span
  128. style="color:#000">{{indexData4.slowGunFaultNum+indexData4.slowGunFreeNum+indexData4.slowGunWorkNum}}</span>
  129. <span>支</span>
  130. </p>
  131. <view class="detailsline—bottom">
  132. <view class="details-row details-row-1" @click="indexDate4Ck(2,1)">
  133. <view class="span1"><span class="bot bot1"></span>在用<span
  134. class="bot1span">{{indexData4.slowGunWorkNum}}</span>支
  135. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#b0b8c8" size="28" />
  136. </view>
  137. </view>
  138. <view class="details-row details-row-1" @click="indexDate4Ck(2,0)">
  139. <view class="span1"><span class="bot bot2"></span>空闲<span
  140. class="bot2span">{{indexData4.slowGunFreeNum}}</span>支
  141. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#b0b8c8" size="28" />
  142. </view>
  143. </view>
  144. <view class="details-row details-row-1" @click="indexDate4Ck(2,99)">
  145. <view class="span1"><span class="bot bot3"></span>故障<span
  146. class="bot3span">{{indexData4.slowGunFaultNum}}</span>支
  147. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#b0b8c8" size="28" />
  148. </view>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. <view class="statisticsChart chargingpile" v-if="indexData4">
  154. <view class="statisticsChart-head" style="margin-top: 20rpx;">
  155. <h4>电单车充电桩运行情况</h4>
  156. </view>
  157. <view class="details detailstablepile" style="padding: 12px 0 12px 12px ;">
  158. <p style="color:#1677FF">
  159. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="20" height="20" style=" vertical-align: bottom;border-color: rgba(0,0,0,0);border-width: bpx;border-style: undefined" filter="none">
  160. <g>
  161. <path fill="#1677FF" d="M4 25.333v-20c0-0.736 0.597-1.333 1.333-1.333v0h12c0.736 0 1.333 0.597 1.333 1.333v0 10.667h2.667c1.473 0 2.667 1.194 2.667 2.667v0 5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v0-9.333h-2.667c-0.736 0-1.333-0.597-1.333-1.333v0-4.781l-2.209-2.209 1.885-1.885 6.6 6.6c0.241 0.241 0.391 0.574 0.391 0.941 0 0 0 0.001 0 0.001v-0 12c0 2.209-1.791 4-4 4s-4-1.791-4-4v0-5.333h-2.667v6.667h1.333v2.667h-17.333v-2.667h1.333zM12 14.667v-5.333l-5.333 8h4v5.333l5.333-8h-4z" ></path>
  162. </g>
  163. </svg>
  164. 电单车充电桩<span>共</span>
  165. <span
  166. style="color:#000">{{indexData4.singleCarOnlineNum+indexData4.singleCarNotOnlineNum}}</span>
  167. <span>台</span>
  168. </p>
  169. <view class="detailsline">
  170. <view class="details-row details-row-1" @click="indexDate5Ck(1,1)">
  171. <view class="span1"><span class="bot bot1"></span>正常<span
  172. class="bot1span">{{indexData4.singleCarOnlineNum}}</span>台
  173. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#b0b8c8" size="28" />
  174. </view>
  175. </view>
  176. <view class="details-row details-row-1" @click="indexDate5Ck(0,99)">
  177. <view class="span1"><span class="bot bot3"></span>故障<span
  178. class="bot3span">{{indexData4.singleCarNotOnlineNum}}</span>台
  179. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#b0b8c8" size="28" />
  180. </view>
  181. </view>
  182. </view>
  183. </view>
  184. </view>
  185. <u-popup v-model="popupShow6" mode="bottom" border-radius="30" >
  186. <view class="indexData5content">
  187. <view class="contentTitle">
  188. 电单车充电桩{{indexData5Obj.type?'正常':'故障'}}明细
  189. </view>
  190. <scroll-view scroll-y="true" style="height: 520rpx;">
  191. <u-collapse style="padding-bottom: 30rpx;" >
  192. <u-collapse-item v-for="(item,index) in indexData5List" class="contentItem" v-show="item.deviceNum" :key="index" >
  193. <svg slot="title" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="20" height="20" style=" vertical-align: bottom;border-color: rgba(0,0,0,0);border-width: bpx;border-style: undefined" filter="none">
  194. <g>
  195. <path fill="#1677FF" d="M4 25.333v-20c0-0.736 0.597-1.333 1.333-1.333v0h12c0.736 0 1.333 0.597 1.333 1.333v0 10.667h2.667c1.473 0 2.667 1.194 2.667 2.667v0 5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v0-9.333h-2.667c-0.736 0-1.333-0.597-1.333-1.333v0-4.781l-2.209-2.209 1.885-1.885 6.6 6.6c0.241 0.241 0.391 0.574 0.391 0.941 0 0 0 0.001 0 0.001v-0 12c0 2.209-1.791 4-4 4s-4-1.791-4-4v0-5.333h-2.667v6.667h1.333v2.667h-17.333v-2.667h1.333zM12 14.667v-5.333l-5.333 8h4v5.333l5.333-8h-4z" ></path>
  196. </g>
  197. </svg>
  198. <view slot="title" class="span1" >
  199. {{item.stationName}}
  200. </view>
  201. <view slot="title" >
  202. <span class="span2 color777">
  203. 共<span class="color333" >{{item.deviceNum}}</span>台
  204. </span>
  205. <span class="span3 color777">
  206. 通道数<span class="color333" >{{item.channelNum}}</span>
  207. </span>
  208. </view>
  209. <view style="padding-bottom: 30rpx;">
  210. <view class="contentBody" v-for="(gun,i) in item.device" :key="i">
  211. <view class="body1">{{gun.deviceName}}</view>
  212. <view class="body2" v-if="indexData5Obj.type">
  213. <view class="body2-0">在用<span class="body2-1">{{gun.useNum}}</span> </view>
  214. <view class="body2-2">| 空闲 {{gun.freeNum}}</view>
  215. </view>
  216. <view class="body3" v-else >故障</view>
  217. </view>
  218. </view>
  219. </u-collapse-item>
  220. </u-collapse>
  221. </scroll-view>
  222. <view class="confrim-btn">
  223. <u-button shape="square" type="primary"
  224. @click="popupShow6 = false;">关闭</u-button>
  225. </view>
  226. </view>
  227. </u-popup>
  228. <u-popup v-model="popupShow5" mode="bottom" border-radius="30" >
  229. <view class="indexData4content">
  230. <view class="contentTitle">
  231. {{indexData4Obj.typeName}}枪{{indexData4Obj.text}}明细
  232. </view>
  233. <scroll-view scroll-y="true" style="height: 520rpx;">
  234. <view style="padding-bottom: 30rpx;">
  235. <view class="contentItem" v-for="(item,index) in indexData4List" v-show="item.queryNum" :key="index" >
  236. <span class="span1">
  237. <img v-show="indexData4Obj.type==1&&item.category!='超充'"
  238. src="@/assets/img/riFill-charging-pile-fill.svg">
  239. <img v-show="indexData4Obj.type==1&&item.category=='超充'"
  240. src="@/assets/img/riFill-charging-pile-fill3.svg">
  241. <img v-show="indexData4Obj.type==2"
  242. src="@/assets/img/riFill-charging-pile-fill2.svg">
  243. </img>
  244. {{item.stationName}}</span>
  245. <span class="span2 color777">
  246. 共<span class="color333" >{{item.gunNum}}</span>支
  247. </span>
  248. <span class="span3 color333">
  249. {{indexData4Obj.text}}<span class="color777" :class="indexData4Obj.value" >{{item.queryNum}}</span>支
  250. </span>
  251. </view>
  252. </view>
  253. </scroll-view>
  254. <view class="confrim-btn">
  255. <u-button shape="square" type="primary"
  256. @click="popupShow5 = false;">关闭</u-button>
  257. </view>
  258. </view>
  259. </u-popup>
  260. <view class="statisticsChart">
  261. <view class="statisticsChart-head" style="margin-top: 40rpx;">
  262. <h4>流水统计</h4>
  263. <!-- <view class="navbar-screen" >
  264. {{startTime}}至{{endTime}}
  265. </view> -->
  266. <view class="navbar-screen" @click="popupShow = true" v-if="false">
  267. <span>{{showTime(queryTime)}}</span>
  268. <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow"></u-icon>
  269. <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow"></u-icon>
  270. </view>
  271. </view>
  272. <u-calendar v-model="popupShow4" mode="range" @change="changedate4"></u-calendar>
  273. <view class="details detailstable">
  274. <p style="text-align: center; margin-bottom: 5px;" @click="popupShow4 = true">
  275. <img src="@/assets/img/riLine-calendar-todo-line.svg" align="absmiddle"
  276. style="height:40rpx;width: 40rpx ;">
  277. {{startTime}}至{{endTime}}
  278. <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow4"></u-icon>
  279. <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow4"></u-icon>
  280. </p>
  281. <view class="detailsline detailslineHead" v-if="stationFlowList.length>1">
  282. <view class="details-row ">
  283. <view class="span1">总收入</view>
  284. <view class="span2">{{(allMoneySum).toFixed(2)}}<span>元</span></view>
  285. </view>
  286. <view class="details-row">
  287. <view class="span1">总利润<span>(服务费+月卡)</span></view>
  288. <view class="span2">{{(serviceMoneySum).toFixed(2)}}<span>元</span></view>
  289. </view>
  290. </view>
  291. <view v-if="stationFlowList.length==0"
  292. style="color: rgba(153, 153, 153, 1);font-size: 28rpx;text-align: center;margin-top: 16rpx;">
  293. 站点列表为空
  294. </view>
  295. <view v-if="stationFlowList.length&&stationFlowList.length>3"
  296. @click="gotoUrl('pagesFinance/statistics/list')"
  297. style="color: rgba(153, 153, 153, 1);font-size: 28rpx;text-align: center;margin-top: 16rpx;">
  298. 查看站点流水统计 <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#b0b8c8" size="28">
  299. </u-icon>
  300. </view>
  301. <u-collapse :headStyle="{
  302. color:'#101010',
  303. fontWeight: 'bold',
  304. padding:'24rpx 0',
  305. borderBottom: '1px solid #ededed'
  306. }" v-if="stationFlowList.length&&stationFlowList.length<=3">
  307. <u-collapse-item @change="changeitem" v-for="(item, index) in stationFlowList" :index="index"
  308. :key="index">
  309. <view slot="title" class="u-collapse-title u-line-1" style="width: 100%;">
  310. {{item.stationName}} <span style="float:right;"><span
  311. style="font-size: 24rpx;margin-right: 8rpx;font-weight: normal;">总收入</span>{{item.actualMoney.toFixed(2)}}元</span>
  312. </view>
  313. <!-- -->
  314. <view class="detailsline">
  315. <view class="details-row details-row-1">
  316. <view class="span1">电费</view>
  317. <view class="span2">{{item.elecMoney.toFixed(2)}}<span>元</span></view>
  318. </view>
  319. <view class="details-row">
  320. <view class="span1">服务费</view>
  321. <view class="span2">{{item.serviceMoney.toFixed(2)}}<span>元</span></view>
  322. </view>
  323. </view>
  324. <view class="detailsline">
  325. <view class="details-row details-row-1">
  326. <view class="span1">总用电量</view>
  327. <view class="span2">{{(item.eq/10000).toFixed(1)}}<span>度</span></view>
  328. </view>
  329. <view class="details-row">
  330. <view class="span1">充电枪数量</view>
  331. <view class="span2">快充{{item.fastNum}}/慢充{{item.slowNum}}</view>
  332. </view>
  333. </view>
  334. <view class="detailsline" v-if="item.fastNum&&item.slowNum">
  335. <view class="details-row details-row-1">
  336. <view class="span1">快充枪平均充电量</view>
  337. <view class="span2" v-if="item.fastNum">
  338. {{(item.averageFast/10000).toFixed(1)}}<span>度/枪/天</span>
  339. </view>
  340. <view class="span2" v-else>0<span>度/枪/天</span></view>
  341. </view>
  342. <view class="details-row">
  343. <view class="span1">慢充枪平均充电量</view>
  344. <view class="span2" v-if="item.slowNum">
  345. {{(item.averageSlow/10000).toFixed(1)}}<span>度/枪/天</span>
  346. </view>
  347. <view class="span2" v-else>0<span>度/枪/天</span></view>
  348. </view>
  349. </view>
  350. <view class="detailsline" v-if="item.fastNum&&item.slowNum">
  351. <view class="details-row details-row-1">
  352. <view class="span1">月卡收益</view>
  353. <view class="span2">{{(item.cardMoney).toFixed(2)}}<span>元</span></view>
  354. </view>
  355. <view class="details-row">
  356. </view>
  357. </view>
  358. <view v-if="item.fastNum&&item.slowNum"
  359. :style="item.slowDayNum==nowTime?'color: #ffffff;':'border-bottom: 1px solid #ededed;'">
  360. 查询范围内实际订单天数{{item.slowDayNum}}</view>
  361. </u-collapse-item>
  362. </u-collapse>
  363. </view>
  364. <view class="statisticsChart-head" style="margin-top: 40rpx;">
  365. <h4>站主/桩主收益统计</h4>
  366. <!-- <view class="navbar-screen" >
  367. {{startTime}}至{{endTime}}
  368. </view> -->
  369. <!-- <view class="navbar-screen" @click="popupShow2 = true"><span>筛选</span>
  370. <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
  371. </view> -->
  372. </view>
  373. <view class="details" v-if="indexData2&&indexData2.incomeMap">
  374. <view class="details-row2">
  375. <p @click="popupShow3 = true">{{selectstationName}}
  376. <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow3"></u-icon>
  377. <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow3"></u-icon>
  378. </p>
  379. <p @click="popupShow2 = true">
  380. {{showTime(queryTime2)}}
  381. <u-icon name="arrow-down" color="#b0b8c8" size="32" v-show="!popupShow2"></u-icon>
  382. <u-icon name="arrow-up" color="#b0b8c8" size="32" v-show="popupShow2"></u-icon>
  383. </p>
  384. </view>
  385. <view class="details-row">
  386. <p>充电总收入</p>
  387. <span>{{(indexData2.incomeMap.chargingAmount).toFixed(2)}}元</span>
  388. </view>
  389. <view class="details-row">
  390. <p>站主/桩主收入</p>
  391. <span>{{indexData2.incomeMap.incomeAmount.toFixed(2)}}元</span>
  392. </view>
  393. <view class="details-row">
  394. <p>预估用电度数</p>
  395. <span>{{(indexData2.incomeMap.electricQuantity/10000).toFixed(1)}}度</span>
  396. </view>
  397. <view class="details-row">
  398. <p>预估电费</p>
  399. <span>{{indexData2.incomeMap.costAmount.toFixed(2)}}元</span>
  400. </view>
  401. <view class="details-row">
  402. <p>服务费预估收益</p>
  403. <span>{{indexData2.incomeMap.serviceAmount.toFixed(2)}}元</span>
  404. </view>
  405. <view class="details-row">
  406. <p>月卡收益</p>
  407. <span>{{indexData2.incomeMap.cardIncomeAmount.toFixed(2)}}元</span>
  408. </view>
  409. <view class="details-row">
  410. <p>预估总利润</p>
  411. <span>{{(indexData2.incomeMap.serviceAmount+indexData2.incomeMap.cardIncomeAmount).toFixed(2)}}元</span>
  412. </view>
  413. </view>
  414. </view>
  415. <Tabbar :current="0" ref="tabbarMain"></Tabbar>
  416. <!-- <u-tabbar v-model="current" :list="tabbarList" active-color="#185ac6"></u-tabbar>
  417. -->
  418. </view>
  419. </template>
  420. <script>
  421. import Tabbar from '@/components/TabbarFinance.vue'
  422. import * as API from '@/apis/finance.js'
  423. import * as echarts from "echarts";
  424. //require("@/apis/echarts-5-3.min.js")
  425. //import * as echarts from "@/apis/echarts-5-3.min.js";
  426. import {
  427. daysDistance,
  428. beforeTimeStamp,
  429. currentTimeStamp,
  430. parseUnixTime,
  431. newDate
  432. } from '@/utils'
  433. export default {
  434. data() {
  435. return {
  436. popupShow3: false,
  437. params: {
  438. year: true,
  439. month: true,
  440. day: false,
  441. hour: false,
  442. minute: false,
  443. second: false
  444. },
  445. indexData4List:[],
  446. indexData4Obj:{},
  447. indexData5List:[],
  448. indexData5Obj:{},
  449. headitemby: "",
  450. isinit: true,
  451. form: {},
  452. form2: {},
  453. selecttype: "",
  454. selectstationId: "",
  455. selectdeviceNo: "",
  456. popupShow2: false,
  457. popupShow: false,
  458. popupShow4: false,
  459. popupShow5: false,
  460. popupShow6: false,
  461. nowTime: 0,
  462. selectstationId2: "",
  463. selectstationIndex: 0,
  464. selectstationName: "",
  465. info: {},
  466. title: "",
  467. showdate: false,
  468. showdate2: false,
  469. queryTime: "",
  470. queryTime2: "",
  471. indexData: {},
  472. indexData3: null,
  473. indexData2: null,
  474. indexData4: null,
  475. type_head: '1',
  476. startDate_head: '',
  477. changeitemBl: false,
  478. myChart: null,
  479. myChartReady: false,
  480. myChartTime: false,
  481. subsection: [{
  482. name: '金额'
  483. },
  484. {
  485. name: '笔数'
  486. }
  487. ],
  488. stationFlowList: [],
  489. serviceMoneySum: 0,
  490. allMoneySum: 0,
  491. stationList: [],
  492. stationListSon: [],
  493. tabbarList: [{
  494. iconPath: "bar-chart-box-fill",
  495. selectedIconPath: "bar-chart-box-fill",
  496. text: '统计',
  497. count: 0,
  498. isDot: true,
  499. customIcon: true,
  500. },
  501. {
  502. iconPath: "article-fill",
  503. selectedIconPath: "article-fill",
  504. text: '明细',
  505. midButton: true,
  506. customIcon: true,
  507. },
  508. {
  509. iconPath: "account-pin-box-fill",
  510. selectedIconPath: "account-pin-box-fill",
  511. text: '我的',
  512. count: 0,
  513. isDot: false,
  514. customIcon: true,
  515. },
  516. ],
  517. endTime: '',
  518. endTime2: '',
  519. current: 1,
  520. background: {
  521. background: 'none'
  522. },
  523. value: '',
  524. type: 'select',
  525. show: false,
  526. border: true,
  527. step: 0,
  528. stepname: '',
  529. startTime: '',
  530. stepid: 0,
  531. }
  532. },
  533. onShow() {
  534. if (this.$refs.tabbarMain) {
  535. this.$refs.tabbarMain.setcount(0);
  536. }
  537. API.homeChargingGunStatus().then((res) => {
  538. this.indexData4 = res.data;
  539. }).catch(error => {
  540. uni.showToast({
  541. title: error
  542. })
  543. })
  544. },
  545. onLoad() {
  546. this.info = this.carhelp.getPersonInfo()
  547. this.title = this.info.merchantAccountName
  548. },
  549. components: {
  550. Tabbar
  551. },
  552. onReady() {
  553. var date = new Date();
  554. this.nowTime = 7
  555. this.queryTime = parseUnixTime(currentTimeStamp(), '{y}-{m}');
  556. this.queryTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}'),
  557. this.startDate_head = parseUnixTime(beforeTimeStamp(30), '{y}-{m}-{d}')
  558. this.startTime = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  559. this.endTime = parseUnixTime(beforeTimeStamp(0), '{y}-{m}-{d}')
  560. //this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  561. this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  562. this.getStation()
  563. },
  564. computed: {
  565. // startTime(){
  566. // return this.queryTime+'-1'
  567. // },
  568. startTime2() {
  569. return this.queryTime2 + '-01'
  570. },
  571. },
  572. methods: {
  573. indexDate5Ck(t,status) {
  574. //单车充电
  575. API.homeChargingGunStatus().then((res) => {
  576. this.indexData4 = res.data;
  577. }).catch(error => {
  578. uni.showToast({
  579. title: error
  580. })
  581. })
  582. this.indexData5Obj.type=t
  583. API.homeChargingSingleCarStatusDetail({
  584. status:status
  585. }).then((res) => {
  586. this.popupShow6=true;
  587. this.indexData5List = res.data.stationList;
  588. for(var i in this.indexData5List){
  589. var item=this.indexData5List[i];
  590. if(item.deviceNum){
  591. this.popupShow6 = true
  592. break
  593. }
  594. this.popupShow6 = false;
  595. }
  596. if(!this.popupShow6 ){
  597. uni.showToast({
  598. title:"电单车充电桩"+(t?"正常":"故障")+"0支"
  599. })
  600. }
  601. }).catch(error => {
  602. uni.showToast({
  603. title: error
  604. })
  605. })
  606. },
  607. indexDate4Ck(c, t) {
  608. //汽车充电
  609. API.homeChargingGunStatus().then((res) => {
  610. this.indexData4 = res.data;
  611. }).catch(error => {
  612. uni.showToast({
  613. title: error
  614. })
  615. })
  616. this.indexData4Obj.type=c
  617. if(c==1){
  618. this.indexData4Obj.typeName="快(超)充"
  619. }
  620. if(c==2){
  621. this.indexData4Obj.typeName="慢充"
  622. }
  623. if(t==1){
  624. this.indexData4Obj.text="在用"
  625. this.indexData4Obj.value="bot1span"
  626. }
  627. if(t==0){
  628. this.indexData4Obj.text="空闲"
  629. this.indexData4Obj.value="bot2span"
  630. }
  631. if(t==99){
  632. this.indexData4Obj.text="故障"
  633. this.indexData4Obj.value="bot3span"
  634. }
  635. API.homeChargingGunStatusDetail({
  636. type:c,
  637. status:t
  638. }).then((res) => {
  639. this.indexData4List = res.data.stationList;
  640. for(var i in this.indexData4List){
  641. var item=this.indexData4List[i];
  642. if(item.queryNum){
  643. this.popupShow5 = true
  644. break
  645. }
  646. this.popupShow5 = false;
  647. }
  648. if(!this.popupShow5 ){
  649. uni.showToast({
  650. title:this.indexData4Obj.typeName+"枪"+ this.indexData4Obj.text+"0支"
  651. })
  652. }
  653. }).catch(error => {
  654. uni.showToast({
  655. title: error
  656. })
  657. })
  658. },
  659. changeitem(e) {
  660. if (this.stationFlowList.length > 1 && e.index == this.stationFlowList.length - 1 && e.show) {
  661. this.changeitemBl = true;
  662. } else {
  663. this.changeitemBl = false;
  664. }
  665. },
  666. showTime(name) {
  667. if (!name) {
  668. return ''
  669. }
  670. return name.replace('-', '年') + '月';
  671. },
  672. getStation(bl) {
  673. API.stationList().then((res) => {
  674. this.stationList = res.data.stationList
  675. this.stationList.unshift({
  676. id: '',
  677. name: "全部站点"
  678. })
  679. this.selectstationName = "全部站点"
  680. this.stationListSon = res.data.deviceList
  681. this.getDataHome2()
  682. this.getData()
  683. this.getData2()
  684. }).catch(error => {
  685. uni.showToast({
  686. title: error
  687. })
  688. })
  689. },
  690. resetBtn() {
  691. this.nowTime = 7
  692. this.startTime = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  693. this.endTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  694. this.selecttype = ""
  695. this.selectstationId = ""
  696. this.selectdeviceNo = ""
  697. this.form = {
  698. type: this.selecttype,
  699. stationId: this.selectstationId,
  700. deviceNo: this.selectdeviceNo,
  701. };
  702. this.popupShow = false;
  703. this.list = [];
  704. this.getData()
  705. },
  706. okbtn() {
  707. this.popupShow = false;
  708. this.form = {
  709. type: this.selecttype,
  710. stationId: this.selectstationId,
  711. deviceNo: this.selectdeviceNo,
  712. };
  713. this.list = [];
  714. this.getData()
  715. },
  716. resetBtn2() {
  717. this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  718. this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  719. this.selectstationId2 = ""
  720. this.form2 = {
  721. stationId: this.selectstationId2,
  722. };
  723. this.popupShow2 = false;
  724. this.getData2()
  725. },
  726. okbtn2() {
  727. this.popupShow2 = false;
  728. this.form2 = {
  729. stationId: this.selectstationId2,
  730. };
  731. this.getData2()
  732. },
  733. getDataHome2() {
  734. var endtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  735. API.homeHeadChargingStatistics({
  736. type: this.type_head,
  737. startDate: this.startDate_head,
  738. endDate: endtime
  739. }).then((res) => {
  740. this.indexData3 = res.data;
  741. uni.hideLoading()
  742. // if( this.info.accountType==3){
  743. // //getPie2
  744. // this.getPie2()
  745. // }else{
  746. // //getPie
  747. // this.getPie()
  748. // }
  749. this.getPie(this.info.accountType)
  750. }).catch(error => {
  751. uni.showToast({
  752. title: error
  753. })
  754. })
  755. },
  756. // getDataHome() {
  757. // API.homeHeadStatistics().then((res) => {
  758. // this.indexData = res.data;
  759. // }).catch(error => {
  760. // uni.showToast({
  761. // title: error
  762. // })
  763. // })
  764. // },
  765. getData() {
  766. this.form.startDate = this.startTime,
  767. this.form.endDate = this.endTime
  768. API.homeFlowStatistics(this.form).then((res) => {
  769. this.stationFlowList = res.data.stationFlowList;
  770. this.nowTime = daysDistance(this.startTime, this.endTime) + 1;
  771. this.serviceMoneySum = 0;
  772. this.allMoneySum = 0;
  773. for (var i in this.stationFlowList) {
  774. var item = this.stationFlowList[i];
  775. this.allMoneySum += item.actualMoney
  776. this.serviceMoneySum += item.serviceMoney
  777. this.serviceMoneySum += item.cardMoney
  778. }
  779. }).catch(error => {
  780. uni.showToast({
  781. title: error
  782. })
  783. })
  784. },
  785. getData2() {
  786. uni.showLoading({
  787. title: "加载中",
  788. mask: true,
  789. })
  790. this.form2.startDate = this.startTime2,
  791. this.form2.endDate = this.endTime2
  792. API.homeIncomeStatistics(this.form2).then((res) => {
  793. this.indexData2 = res.data
  794. uni.hideLoading()
  795. }).catch(error => {
  796. uni.showToast({
  797. title: error
  798. })
  799. })
  800. },
  801. changesub(e) {
  802. this.current = e
  803. this.type_head = e;
  804. uni.showLoading({
  805. title: "加载中",
  806. mask: true,
  807. })
  808. if (e == 1) {
  809. this.startDate_head = parseUnixTime(beforeTimeStamp(30), '{y}-{m}-{d}')
  810. } else {
  811. this.startDate_head = parseUnixTime(beforeTimeStamp(365), '{y}-{m}-01')
  812. }
  813. // this.getPie()
  814. this.getDataHome2()
  815. },
  816. changedate4(e) {
  817. this.startTime = e.startDate
  818. this.endTime = e.endDate
  819. this.okbtn()
  820. },
  821. changedate3(e) {
  822. var index = e[0];
  823. var obj = this.stationList[index];
  824. this.selectstationId2 = obj.id;
  825. this.selectstationIndex = index;
  826. this.selectstationName = obj.name;
  827. this.okbtn2()
  828. },
  829. changedate(e) {
  830. this.queryTime = e.year + '-' + e.month;
  831. this.startTime = e.year + '-' + e.month + '-01';
  832. if (e.month == '12') {
  833. this.endTime = (e.year) + "-12-31"
  834. } else {
  835. var b = e.year + '/' + (parseInt(e.month) + 1) + '/1';
  836. var a = beforeTimeStamp(1, b);
  837. this.endTime = parseUnixTime(a, '{y}-{m}-{d}')
  838. }
  839. this.okbtn()
  840. },
  841. changedate2(e) {
  842. this.queryTime2 = e.year + '-' + e.month;
  843. if (e.month == '12') {
  844. this.endTime2 = (e.year) + "-12-31"
  845. } else {
  846. var b = e.year + '/' + (parseInt(e.month) + 1) + '/1';
  847. var a = beforeTimeStamp(1, b);
  848. this.endTime2 = parseUnixTime(a, '{y}-{m}-{d}')
  849. }
  850. this.okbtn2()
  851. },
  852. getPie(type) {
  853. //true 正常版本 false 个人版本
  854. var typebl = !(this.info.accountType == 3);
  855. var dataInterval = null;
  856. if (typebl) {
  857. if (this.type_head == 1) {
  858. dataInterval = [0, 25, 50, 75, 100,
  859. 125, 150, 200, 250, 300, 400, 500,
  860. 600, 800, 1000, 1200, 1400, 1600, 1800,
  861. 2000, 2300, 2600, 2800,
  862. 3000, 3400, 3800, 4200,
  863. 4800, 5200, 5600, 6000, 6500, 7000, 7500, 8000, 9000, 10000, 12000, 14000, 16000, 20000,
  864. 30000, 999999
  865. ];
  866. } else {
  867. dataInterval = [0, 500, 1000, 2000, 5000, 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000,
  868. 90000, 100000, 120000, 140000, 160000, 180000, 200000, 250000, 300000, 400000, 500000,
  869. 999999
  870. ];
  871. }
  872. }
  873. this.headitemby = "";
  874. var showkey = "";
  875. var getData = this.indexData3.graphMap;
  876. for (var i in getData) {
  877. var item = getData[i]
  878. item.todayEQAmount2 = (item.todayEQAmount / 10000)
  879. }
  880. this.indexData3.graphMap = getData
  881. //var unit = this.current ? '笔' : '元'
  882. var colorName = "#333"
  883. // this.showlist1 = ['收入', '利润', '次数','新电途'];
  884. var showlistColor = ['#5872c0', '#de6e6a', '#f3c96b', '#69be8d', '#c661b4'];
  885. // this.showlist1 = ['收入', '利润', '电量', '新电途'];
  886. // var sz2 = ['todayAmount', 'todayProfit', 'todayEQAmount2', 'todayXDTAmount'];
  887. this.showlist1 = ['收入', '利润', '电量', '新电途', '快电'];
  888. var sz2 = ['todayAmount', 'todayProfit', 'todayEQAmount2', 'todayXDTAmount','todayKDAmount'];
  889. var zLevel = [20, 40, 10, 30,9];
  890. //var sz2 = ['todayAmount', 'todayProfit', 'todayEQNum','todayXDTAmount'];
  891. if (!this.myChart) {
  892. this.myChart = echarts.init(document.getElementById('pieEcharts'));
  893. this.myChart.on("dataZoom", (res) => {
  894. showkey = "";
  895. this.headitemby = "";
  896. });
  897. }
  898. this.myChart.clear();
  899. //
  900. var timelist = []
  901. for (var i in getData) {
  902. if (this.type_head == 1) {
  903. timelist.push(i.substring(5))
  904. } else {
  905. timelist.push(i)
  906. }
  907. }
  908. var list = [];
  909. for (var j in this.showlist1) {
  910. var ap = {
  911. name: this.showlist1[j],
  912. type: 'line',
  913. lineStyle: {
  914. color: showlistColor[j]
  915. },
  916. itemStyle: {
  917. color: showlistColor[j]
  918. },
  919. z: zLevel[j],
  920. // label: {
  921. // show: true,
  922. // position: 'top'
  923. // },
  924. data: []
  925. }
  926. if (this.type_head == 1) {
  927. ap.symbolSize = 3;
  928. }
  929. var bl = true;
  930. for (var i in getData) {
  931. //var time=this.queryDate.replace("-","/").replace("-","/")
  932. //time+' '+i
  933. var obj = getData[i][sz2[j]];
  934. //**********
  935. if (typebl) {
  936. const min_v = Math.max(...dataInterval.filter((v) => v <= obj));
  937. // 2.寻找在数据间隔里大于amount的最小值
  938. const max_v = Math.min(...dataInterval.filter((v) => v > obj));
  939. // 3.寻找 min_v 所在的下标
  940. const index = dataInterval.findIndex((v) => v === min_v);
  941. // 4.计算该amount在y轴上应该展示的位置
  942. const y_value = ((obj - min_v) / (max_v - min_v)) * 10 + index * 10;
  943. obj = y_value;
  944. }
  945. //**********
  946. //'todayAmount', 'todayProfit', 'todayEQNum'
  947. // if (bl&&getData[i].todayAmount == 0 && getData[i].todayProfit == 0 &&getData[i].todayEQNum == 0) {
  948. // //&& &&getData[i].todayEQNum == 0
  949. // continue;
  950. // }
  951. bl = false;
  952. var time = i
  953. if (this.type_head == 1) {
  954. //time = i.substring(5)
  955. } else {
  956. }
  957. ap.data.push([time, obj]);
  958. }
  959. if (bl) {
  960. ap.data = [];
  961. for (var i in getData) {
  962. //var time=this.queryDate.replace("-","/").replace("-","/")
  963. //time+' '+i
  964. var obj = getData[i][sz2[j]];
  965. var time = i
  966. if (this.type_head == 1) {
  967. time = i.substring(5)
  968. } else {
  969. }
  970. // if(j!=2){
  971. // obj=obj.toFixed(2)
  972. // }
  973. ap.data.push([time, obj]);
  974. }
  975. }
  976. list.push(ap)
  977. }
  978. var yshow = 0;
  979. // 指定图表的配置项和数据
  980. var option = {
  981. tooltip: {
  982. formatter: (value) => {
  983. //getPie
  984. var name = value[0].data[0];
  985. var info = getData[name];
  986. var style = "float: right;margin-left: 3px;"
  987. var text1 = ""
  988. for (var i in value) {
  989. var u = "元"
  990. var num = info[sz2[value[i].seriesIndex]];
  991. if(!num){
  992. num=0;
  993. }
  994. if (value[i].seriesName == '电量') {
  995. u = '度'
  996. num = num.toFixed(2)
  997. } else if (value[i].seriesName == '次数') {
  998. u = '次'
  999. } else {
  1000. num = num.toFixed(2)
  1001. }
  1002. text1 += "<p>" + value[i].marker + value[i].seriesName + '<span style="' + style +
  1003. '">' + num + u + '</span></p>';
  1004. if (this.type_head == 2) {
  1005. console.log(i,this.queryTime2)
  1006. if (value[i].seriesName == "收入") {
  1007. if(name!=this.queryTime2){
  1008. if(info.yoyNum!=0){
  1009. text1 += "<p>" + value[i].marker + "收入同比"+(info.yoyNum<0?'减少':'增长') + '<span style="' + style +
  1010. '">' + (info.yoyNum<0?info.yoyNum*-1:info.yoyNum) + '%' + '</span></p>';
  1011. }else{
  1012. text1 += "<p>" + value[i].marker + "收入同比"+ '<span style="' + style +
  1013. '">' +'无数据' + '</span></p>';
  1014. }
  1015. if(info.qoqNum!=0){
  1016. text1 += "<p>" + value[i].marker + "收入环比" +(info.qoqNum<0?'减少':'增长') + '<span style="' + style +
  1017. '">' + (info.qoqNum<0?info.qoqNum*-1:info.qoqNum) + '%' + '</span></p>';
  1018. }else{
  1019. text1 += "<p>" + value[i].marker + "收入环比"+ '<span style="' + style +
  1020. '">' +'无数据' + '</span></p>';
  1021. }
  1022. }
  1023. }
  1024. }
  1025. if(i==value.length-1){
  1026. text1 += "<p><span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:#FF3D00;'></span>新增购买月卡"+ '<span style="' + style +
  1027. '">' +info.cardBuyNum + '张</span></p>';
  1028. }
  1029. }
  1030. if (this.type_head == 1) {
  1031. //time = i.substring(5)
  1032. var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
  1033. var now = newDate(name);
  1034. var day = now.getDay();
  1035. var week = weeks[day];
  1036. return `<p>${name} ${week}</p>` + text1
  1037. } else {
  1038. return `<p>${name}</p>` + text1
  1039. }
  1040. },
  1041. trigger: 'axis',
  1042. borderColor: "#F0F0F0",
  1043. borderWidth: 1,
  1044. backgroundColor: "#ffffff",
  1045. textStyle: {
  1046. color: "#333"
  1047. }
  1048. },
  1049. legend: {
  1050. itemGap :1,
  1051. data: this.showlist1,
  1052. textStyle: {
  1053. color: "#333"
  1054. }
  1055. },
  1056. grid: {
  1057. top: '16%',
  1058. left: '3%',
  1059. right: '8%',
  1060. bottom: '8%',
  1061. containLabel: true
  1062. },
  1063. xAxis: {
  1064. //type: 'value',
  1065. type: 'category',
  1066. splitNumber: 4,
  1067. boundaryGap: false,
  1068. axisLabel: {
  1069. formatter: (value) => {
  1070. if (this.headitemby == "") {
  1071. this.headitemby = value
  1072. }
  1073. var i = 0
  1074. if (this.type_head == 1) {
  1075. i = 0;
  1076. } else {
  1077. i = 3;
  1078. }
  1079. var showvalue = "";
  1080. var key = value.substring(0, 8 - i);
  1081. if (showkey == "" || value == this.headitemby) {
  1082. showkey = key
  1083. showvalue = value
  1084. showvalue = value.substring(5 - i)
  1085. } else {
  1086. if (key != showkey) {
  1087. showkey = key
  1088. showvalue = value
  1089. showvalue = value.substring(5 - i)
  1090. } else {
  1091. showvalue = value.substring(8 - i)
  1092. }
  1093. }
  1094. return showvalue.replace("-", ".");
  1095. },
  1096. textStyle: {
  1097. color: "#333"
  1098. }
  1099. },
  1100. axisLine: {
  1101. show: true,
  1102. lineStyle: {
  1103. color: "#333"
  1104. }
  1105. },
  1106. },
  1107. yAxis: {
  1108. type: 'value',
  1109. // name: '单位('+this.typeN+')',
  1110. axisLabel: {
  1111. formatter: (v, i) => {
  1112. //console.log(v,i)
  1113. if (dataInterval == null) {
  1114. return v
  1115. }
  1116. if (i == 0) {
  1117. yshow = 0
  1118. return 0
  1119. }
  1120. if (yshow != parseInt(v / 10)) {
  1121. yshow = parseInt(v / 10);
  1122. return dataInterval[parseInt(v / 10)]
  1123. } else {
  1124. return ''
  1125. }
  1126. },
  1127. textStyle: {
  1128. color: "#333"
  1129. }
  1130. },
  1131. axisLine: {
  1132. show: true,
  1133. lineStyle: {
  1134. color: "#333"
  1135. }
  1136. },
  1137. },
  1138. series: list
  1139. };
  1140. // option.dataZoom = [{
  1141. // type: 'inside',
  1142. // start: 0,
  1143. // end: 100
  1144. // },
  1145. // {
  1146. // start: 0,
  1147. // end: 100
  1148. // }
  1149. // ]
  1150. if (this.type_head == 1) {
  1151. } else {
  1152. //timelist.push(i)
  1153. }
  1154. //console.log(option)
  1155. // 使用刚指定的配置项和数据显示图表。
  1156. this.myChart.setOption(option);
  1157. }
  1158. }
  1159. }
  1160. </script>
  1161. <style>
  1162. page {
  1163. background: url(../../assets/img/index_header_bg.png) no-repeat top center #f7f7f7;
  1164. background-size: 100%;
  1165. }
  1166. </style>
  1167. <style lang="scss" scoped>
  1168. .indexData5content {
  1169. padding: 40rpx 20rpx;
  1170. .contentTitle{
  1171. color:#333333;
  1172. font-size: 40rpx;
  1173. text-align: center;
  1174. font-weight: bold;
  1175. margin-bottom: 8px;
  1176. }
  1177. .contentBody{
  1178. color: #777777 ;
  1179. font-size: 28rpx;
  1180. display: flex;
  1181. justify-content: space-between;
  1182. flex-direction: row;
  1183. padding: 0 16rpx;
  1184. margin-bottom: 16rpx;
  1185. .body1{
  1186. color:#333333;
  1187. margin-left: 20rpx;
  1188. }
  1189. .body2{
  1190. display: flex;
  1191. .body2-0{
  1192. width: 110rpx;
  1193. }
  1194. .body2-1{
  1195. padding: 0 8rpx;
  1196. color: #00B962;
  1197. }
  1198. .body2-2{
  1199. width: 120rpx;
  1200. }
  1201. }
  1202. .body3{
  1203. padding: 0 8rpx;
  1204. color:#FF3D00 ;
  1205. }
  1206. }
  1207. .contentItem{
  1208. border-bottom: 1px solid #ededed;
  1209. // margin: 16rpx;
  1210. // padding:12rpx;
  1211. img,svg{
  1212. vertical-align: bottom;
  1213. height: 44rpx;
  1214. //margin-right: 8rpx;
  1215. }
  1216. .span1{
  1217. text-align: left;
  1218. font-weight: bold;
  1219. font-size: 36rpx;
  1220. width: 310rpx;
  1221. overflow: hidden;
  1222. text-overflow: ellipsis;
  1223. white-space: nowrap;
  1224. }
  1225. .color777{
  1226. color: #777777;
  1227. }
  1228. .color333{
  1229. color: #333333;
  1230. }
  1231. .span2{
  1232. border-right: 1px solid #ededed;
  1233. width: 120rpx;
  1234. padding: 0 8rpx;
  1235. span{
  1236. padding: 0 8rpx;
  1237. }
  1238. }
  1239. .span3{
  1240. padding: 0 0 0 12rpx;
  1241. span{
  1242. padding: 0 8rpx;
  1243. }
  1244. width: 154rpx;
  1245. .bot1span {
  1246. color: #00B962;
  1247. }
  1248. .bot2span {
  1249. color: #AAAAAA;
  1250. }
  1251. .bot3span {
  1252. color: #FF3D00;
  1253. }
  1254. }
  1255. }
  1256. }
  1257. .indexData4content {
  1258. padding: 40rpx 20rpx;
  1259. .contentTitle{
  1260. color:#333333;
  1261. font-size: 40rpx;
  1262. text-align: center;
  1263. font-weight: bold;
  1264. margin-bottom: 8px;
  1265. }
  1266. .contentItem{
  1267. border-bottom: 1px solid #ededed;
  1268. display: flex;
  1269. justify-content: space-between;
  1270. flex-direction: row;
  1271. margin: 16rpx;
  1272. padding:12rpx;
  1273. .span1{
  1274. img{
  1275. vertical-align: bottom;
  1276. height: 44rpx;
  1277. margin-right: 8rpx;
  1278. }
  1279. font-weight: bold;
  1280. font-size: 36rpx;
  1281. width: 400rpx;
  1282. overflow: hidden;
  1283. text-overflow: ellipsis;
  1284. white-space: nowrap;
  1285. }
  1286. .color777{
  1287. color: #777777;
  1288. }
  1289. .color333{
  1290. color: #333333;
  1291. }
  1292. .span2{
  1293. border-right: 1px solid #ededed;
  1294. width: 120rpx;
  1295. padding: 0 16rpx;
  1296. span{
  1297. padding: 0 8rpx;
  1298. }
  1299. }
  1300. .span3{
  1301. padding: 0 0 0 16rpx;
  1302. span{
  1303. padding: 0 8rpx;
  1304. }
  1305. width: 154rpx;
  1306. color: #333;
  1307. .bot1span {
  1308. color: #00B962;
  1309. }
  1310. .bot2span {
  1311. color: #AAAAAA;
  1312. }
  1313. .bot3span {
  1314. color: #FF3D00;
  1315. }
  1316. }
  1317. }
  1318. }
  1319. .chargingpile {
  1320. img {
  1321. vertical-align: bottom;
  1322. height: 44rpx;
  1323. margin-right: 8rpx;
  1324. }
  1325. p {
  1326. color: #185AC6;
  1327. font-size: 36rpx;
  1328. font-weight: bold;
  1329. span {
  1330. color: #777777;
  1331. margin-left: 8rpx;
  1332. font-size: 32rpx;
  1333. font-weight: normal;
  1334. }
  1335. }
  1336. .detailstablepile {
  1337. .details-row-main {
  1338. border-bottom: 1px solid #ededed;
  1339. padding: 10px 0;
  1340. }
  1341. span {
  1342. margin: 0 8rpx;
  1343. }
  1344. .bot {
  1345. display: inline-block;
  1346. width: 24rpx;
  1347. height: 24rpx;
  1348. margin-left: 4rpx;
  1349. border-radius: 999px;
  1350. }
  1351. .bot1 {
  1352. background-color: #00B962;
  1353. }
  1354. .bot2 {
  1355. //margin-left: 16rpx;
  1356. background-color: #AAAAAA;
  1357. }
  1358. .bot3 {
  1359. //margin-left: 16rpx;
  1360. background-color: #FF3D00;
  1361. }
  1362. .bot1span {
  1363. color: #00B962;
  1364. }
  1365. .bot2span {
  1366. color: #AAAAAA;
  1367. }
  1368. .bot3span {
  1369. color: #FF3D00;
  1370. }
  1371. .detailsline {
  1372. border-bottom: 1px solid #ededed;
  1373. }
  1374. .detailsline,
  1375. .detailsline—bottom {
  1376. display: flex;
  1377. .details-row {
  1378. width: 33%;
  1379. // display: flex;
  1380. // justify-content: space-between;
  1381. // flex-direction: column;
  1382. padding-left: 16rpx;
  1383. margin-bottom: 16rpx;
  1384. margin-top: 16rpx;
  1385. .span1 {
  1386. color: rgba(136, 136, 136, 100);
  1387. font-size: 28rpx;
  1388. width: 100%;
  1389. color: #333333;
  1390. }
  1391. }
  1392. }
  1393. .details-row-1 {
  1394. width: 47%;
  1395. padding-left: 0px !important;
  1396. //border-right: 1px solid #ededed;
  1397. }
  1398. }
  1399. }
  1400. .viewgun {
  1401. position: relative;
  1402. top: 200px;
  1403. text-align: center;
  1404. .viewspan {
  1405. width: 30%;
  1406. margin-left: 16rpx;
  1407. display: inline;
  1408. }
  1409. }
  1410. .headbotton1:after {
  1411. border-radius: 15px 0 0 15px;
  1412. }
  1413. .headbotton2:after {
  1414. border-radius: 0 15px 15px 0;
  1415. }
  1416. .detailstable {
  1417. padding: 30rpx 30rpx !important;
  1418. }
  1419. .detailstableHead {
  1420. .span1 {
  1421. font-size: 32rpx !important;
  1422. }
  1423. .details-row-head-1 {}
  1424. .details-row-head-2 {}
  1425. .details-row-head-3 {
  1426. width: 30% !important;
  1427. max-width: 150rpx;
  1428. .span {}
  1429. }
  1430. .span2 {
  1431. font-size: 44rpx !important;
  1432. font-weight: bold;
  1433. width: 100%;
  1434. color: #101010;
  1435. span {
  1436. font-size: 24rpx !important;
  1437. }
  1438. }
  1439. }
  1440. .detailslineHead {
  1441. border-top: 1px solid #ededed;
  1442. ;
  1443. .details-row {
  1444. padding-left: 8rpx !important;
  1445. }
  1446. font-size: 30rpx !important;
  1447. .span1 span {
  1448. font-size: 28rpx;
  1449. }
  1450. }
  1451. .detailstable,
  1452. .detailstableHead {
  1453. font-size: 16px;
  1454. p {
  1455. font-size: 14px;
  1456. }
  1457. .details-row-main {
  1458. border-bottom: 1px solid #ededed;
  1459. padding: 10px 0;
  1460. }
  1461. .detailsline {
  1462. border-bottom: 1px solid #ededed;
  1463. }
  1464. .detailsline,
  1465. .detailsline—bottom {
  1466. display: flex;
  1467. .details-row {
  1468. width: 50%;
  1469. display: flex;
  1470. justify-content: space-between;
  1471. flex-direction: column;
  1472. padding-left: 16rpx;
  1473. margin-bottom: 20rpx;
  1474. .span1 {
  1475. color: rgba(136, 136, 136, 100);
  1476. font-size: 28rpx;
  1477. width: 100%;
  1478. }
  1479. .span2 {
  1480. font-size: 36rpx;
  1481. width: 100%;
  1482. color: #101010;
  1483. span {
  1484. font-size: 24rpx;
  1485. }
  1486. }
  1487. }
  1488. }
  1489. .details-row-1 {
  1490. width: 47%;
  1491. padding-left: 0px !important;
  1492. border-right: 1px solid #ededed;
  1493. }
  1494. }
  1495. .details {
  1496. padding: 32rpx;
  1497. background-color: #fff;
  1498. border-radius: 8px;
  1499. }
  1500. .details-title {
  1501. margin-bottom: 16px;
  1502. h4 {
  1503. font-weight: normal;
  1504. font-size: 16px;
  1505. position: relative;
  1506. padding-left: 10px;
  1507. &::after {
  1508. content: '';
  1509. position: absolute;
  1510. height: 12px;
  1511. width: 4px;
  1512. background-color: #27B148;
  1513. left: 0;
  1514. top: 5px;
  1515. }
  1516. }
  1517. }
  1518. .details-row {
  1519. display: flex;
  1520. justify-content: space-between;
  1521. align-items: center;
  1522. margin-top: 30rpx;
  1523. p {
  1524. color: #37393c;
  1525. font-weight: bold;
  1526. }
  1527. }
  1528. .details-row2 {
  1529. display: flex;
  1530. justify-content: space-between;
  1531. align-items: center;
  1532. // margin-top: 15px;
  1533. p {
  1534. // color: #37393c;
  1535. // font-weight: bold;
  1536. }
  1537. }
  1538. .popup-screen {
  1539. padding: 20px;
  1540. position: relative;
  1541. .screen {
  1542. padding-bottom: 30px;
  1543. }
  1544. .screen-item {
  1545. margin-bottom: 20px;
  1546. .screen-head {
  1547. margin-bottom: 8px;
  1548. font-size: 16px;
  1549. }
  1550. .screen-main {
  1551. display: flex;
  1552. // display: -webkit-box;
  1553. flex-wrap: wrap;
  1554. }
  1555. .screen-entry {
  1556. width: 29%;
  1557. padding: 6px 0;
  1558. display: flex;
  1559. align-items: center;
  1560. justify-content: center;
  1561. background-color: #F2F5FA;
  1562. text-align: center;
  1563. margin-bottom: 10px;
  1564. border-radius: 3px;
  1565. margin-right: 6px;
  1566. }
  1567. .screen-entry.active {
  1568. background-color: #185AC6;
  1569. color: #fff;
  1570. }
  1571. }
  1572. .screen-foot {
  1573. position: fixed;
  1574. left: 0;
  1575. right: 0;
  1576. bottom: 0;
  1577. display: flex;
  1578. height: 50px;
  1579. border-top: 1px solid #ededed;
  1580. .screen-btn-l {
  1581. background-color: #fff;
  1582. flex: 0.2;
  1583. text-align: center;
  1584. line-height: 50px;
  1585. }
  1586. .screen-btn-r {
  1587. flex: 0.8;
  1588. text-align: center;
  1589. line-height: 50px;
  1590. background-color: #185AC6;
  1591. color: #fff;
  1592. }
  1593. }
  1594. }
  1595. .navbar-tit {
  1596. color: #fff;
  1597. font-size: 24px;
  1598. padding-left: 15px;
  1599. padding-top: 10px;
  1600. }
  1601. .statisticsData {
  1602. background-color: #fff;
  1603. margin: 0px 24rpx 24rpx;
  1604. //padding:0px 24rpx 24rpx;
  1605. border-radius: 8px;
  1606. }
  1607. .statisticsDataMain {
  1608. flex-wrap: wrap;
  1609. display: flex;
  1610. }
  1611. .statisticsData-item {
  1612. flex: 1;
  1613. width: 40%;
  1614. .statisticsData-head {
  1615. display: flex;
  1616. align-items: center;
  1617. p {
  1618. color: #637AA2;
  1619. font-size: 12px;
  1620. }
  1621. }
  1622. .statisticsData-main {
  1623. margin-top: 4px;
  1624. font-size: 18px;
  1625. }
  1626. .statisticsData-foot {
  1627. display: flex;
  1628. align-items: center;
  1629. margin-top: 16px;
  1630. p {
  1631. color: #637AA2;
  1632. }
  1633. h4 {
  1634. margin-left: 8px;
  1635. }
  1636. }
  1637. }
  1638. .statisticsChart {
  1639. margin: 32rpx;
  1640. .statisticsChart-head {
  1641. margin-bottom: 10rpx;
  1642. display: flex;
  1643. justify-content: space-between;
  1644. align-items: center;
  1645. h4 {
  1646. font-weight: normal;
  1647. font-size: 16px;
  1648. position: relative;
  1649. padding-left: 10px;
  1650. &::after {
  1651. content: '';
  1652. position: absolute;
  1653. height: 12px;
  1654. width: 4px;
  1655. background-color: #4E8DF6;
  1656. left: 0;
  1657. top: 5px;
  1658. }
  1659. }
  1660. .statisticsChart-time {
  1661. display: flex;
  1662. align-items: center;
  1663. p {
  1664. color: #666;
  1665. }
  1666. }
  1667. }
  1668. .statisticsChart-main {
  1669. background-color: #fff;
  1670. padding: 10px 16px 16px 16px;
  1671. border-radius: 8px;
  1672. }
  1673. }
  1674. </style>