index.vue 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094
  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. windowWidth:0,
  532. }
  533. },
  534. onShow() {
  535. if (this.$refs.tabbarMain) {
  536. this.$refs.tabbarMain.setcount(0);
  537. }
  538. API.homeChargingGunStatus().then((res) => {
  539. this.indexData4 = res.data;
  540. }).catch(error => {
  541. uni.showToast({
  542. title: error
  543. })
  544. })
  545. },
  546. onLoad() {
  547. this.info = this.carhelp.getPersonInfo()
  548. this.title = this.info.merchantAccountName
  549. uni.getSystemInfo().then(e=>{
  550. this.windowWidth=e[1].windowWidth
  551. })
  552. },
  553. components: {
  554. Tabbar
  555. },
  556. onReady() {
  557. var date = new Date();
  558. this.nowTime = 7
  559. this.queryTime = parseUnixTime(currentTimeStamp(), '{y}-{m}');
  560. this.queryTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}'),
  561. this.startDate_head = parseUnixTime(beforeTimeStamp(30), '{y}-{m}-{d}')
  562. this.startTime = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  563. this.endTime = parseUnixTime(beforeTimeStamp(0), '{y}-{m}-{d}')
  564. //this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  565. this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  566. this.getStation()
  567. },
  568. computed: {
  569. // startTime(){
  570. // return this.queryTime+'-1'
  571. // },
  572. startTime2() {
  573. return this.queryTime2 + '-01'
  574. },
  575. },
  576. methods: {
  577. indexDate5Ck(t,status) {
  578. //单车充电
  579. API.homeChargingGunStatus().then((res) => {
  580. this.indexData4 = res.data;
  581. }).catch(error => {
  582. uni.showToast({
  583. title: error
  584. })
  585. })
  586. this.indexData5Obj.type=t
  587. API.homeChargingSingleCarStatusDetail({
  588. status:status
  589. }).then((res) => {
  590. this.popupShow6=true;
  591. this.indexData5List = res.data.stationList;
  592. for(var i in this.indexData5List){
  593. var item=this.indexData5List[i];
  594. if(item.deviceNum){
  595. this.popupShow6 = true
  596. break
  597. }
  598. this.popupShow6 = false;
  599. }
  600. if(!this.popupShow6 ){
  601. uni.showToast({
  602. title:"电单车充电桩"+(t?"正常":"故障")+"0支"
  603. })
  604. }
  605. }).catch(error => {
  606. uni.showToast({
  607. title: error
  608. })
  609. })
  610. },
  611. indexDate4Ck(c, t) {
  612. //汽车充电
  613. API.homeChargingGunStatus().then((res) => {
  614. this.indexData4 = res.data;
  615. }).catch(error => {
  616. uni.showToast({
  617. title: error
  618. })
  619. })
  620. this.indexData4Obj.type=c
  621. if(c==1){
  622. this.indexData4Obj.typeName="快(超)充"
  623. }
  624. if(c==2){
  625. this.indexData4Obj.typeName="慢充"
  626. }
  627. if(t==1){
  628. this.indexData4Obj.text="在用"
  629. this.indexData4Obj.value="bot1span"
  630. }
  631. if(t==0){
  632. this.indexData4Obj.text="空闲"
  633. this.indexData4Obj.value="bot2span"
  634. }
  635. if(t==99){
  636. this.indexData4Obj.text="故障"
  637. this.indexData4Obj.value="bot3span"
  638. }
  639. API.homeChargingGunStatusDetail({
  640. type:c,
  641. status:t
  642. }).then((res) => {
  643. this.indexData4List = res.data.stationList;
  644. for(var i in this.indexData4List){
  645. var item=this.indexData4List[i];
  646. if(item.queryNum){
  647. this.popupShow5 = true
  648. break
  649. }
  650. this.popupShow5 = false;
  651. }
  652. if(!this.popupShow5 ){
  653. uni.showToast({
  654. title:this.indexData4Obj.typeName+"枪"+ this.indexData4Obj.text+"0支"
  655. })
  656. }
  657. }).catch(error => {
  658. uni.showToast({
  659. title: error
  660. })
  661. })
  662. },
  663. changeitem(e) {
  664. if (this.stationFlowList.length > 1 && e.index == this.stationFlowList.length - 1 && e.show) {
  665. this.changeitemBl = true;
  666. } else {
  667. this.changeitemBl = false;
  668. }
  669. },
  670. showTime(name) {
  671. if (!name) {
  672. return ''
  673. }
  674. return name.replace('-', '年') + '月';
  675. },
  676. getStation(bl) {
  677. API.stationList().then((res) => {
  678. this.stationList = res.data.stationList
  679. this.stationList.unshift({
  680. id: '',
  681. name: "全部站点"
  682. })
  683. this.selectstationName = "全部站点"
  684. this.stationListSon = res.data.deviceList
  685. this.getDataHome2()
  686. this.getData()
  687. this.getData2()
  688. }).catch(error => {
  689. uni.showToast({
  690. title: error
  691. })
  692. })
  693. },
  694. resetBtn() {
  695. this.nowTime = 7
  696. this.startTime = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  697. this.endTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  698. this.selecttype = ""
  699. this.selectstationId = ""
  700. this.selectdeviceNo = ""
  701. this.form = {
  702. type: this.selecttype,
  703. stationId: this.selectstationId,
  704. deviceNo: this.selectdeviceNo,
  705. };
  706. this.popupShow = false;
  707. this.list = [];
  708. this.getData()
  709. },
  710. okbtn() {
  711. this.popupShow = false;
  712. this.form = {
  713. type: this.selecttype,
  714. stationId: this.selectstationId,
  715. deviceNo: this.selectdeviceNo,
  716. };
  717. this.list = [];
  718. this.getData()
  719. },
  720. resetBtn2() {
  721. this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  722. this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  723. this.selectstationId2 = ""
  724. this.form2 = {
  725. stationId: this.selectstationId2,
  726. };
  727. this.popupShow2 = false;
  728. this.getData2()
  729. },
  730. okbtn2() {
  731. this.popupShow2 = false;
  732. this.form2 = {
  733. stationId: this.selectstationId2,
  734. };
  735. this.getData2()
  736. },
  737. getDataHome2() {
  738. var endtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  739. API.homeHeadChargingStatistics({
  740. type: this.type_head,
  741. startDate: this.startDate_head,
  742. endDate: endtime
  743. }).then((res) => {
  744. this.indexData3 = res.data;
  745. uni.hideLoading()
  746. // if( this.info.accountType==3){
  747. // //getPie2
  748. // this.getPie2()
  749. // }else{
  750. // //getPie
  751. // this.getPie()
  752. // }
  753. this.getPie(this.info.accountType)
  754. }).catch(error => {
  755. uni.showToast({
  756. title: error
  757. })
  758. })
  759. },
  760. // getDataHome() {
  761. // API.homeHeadStatistics().then((res) => {
  762. // this.indexData = res.data;
  763. // }).catch(error => {
  764. // uni.showToast({
  765. // title: error
  766. // })
  767. // })
  768. // },
  769. getData() {
  770. this.form.startDate = this.startTime,
  771. this.form.endDate = this.endTime
  772. API.homeFlowStatistics(this.form).then((res) => {
  773. this.stationFlowList = res.data.stationFlowList;
  774. this.nowTime = daysDistance(this.startTime, this.endTime) + 1;
  775. this.serviceMoneySum = 0;
  776. this.allMoneySum = 0;
  777. for (var i in this.stationFlowList) {
  778. var item = this.stationFlowList[i];
  779. this.allMoneySum += item.actualMoney
  780. this.serviceMoneySum += item.serviceMoney
  781. this.serviceMoneySum += item.cardMoney
  782. }
  783. }).catch(error => {
  784. uni.showToast({
  785. title: error
  786. })
  787. })
  788. },
  789. getData2() {
  790. uni.showLoading({
  791. title: "加载中",
  792. mask: true,
  793. })
  794. this.form2.startDate = this.startTime2,
  795. this.form2.endDate = this.endTime2
  796. API.homeIncomeStatistics(this.form2).then((res) => {
  797. this.indexData2 = res.data
  798. uni.hideLoading()
  799. }).catch(error => {
  800. uni.showToast({
  801. title: error
  802. })
  803. })
  804. },
  805. changesub(e) {
  806. this.current = e
  807. this.type_head = e;
  808. uni.showLoading({
  809. title: "加载中",
  810. mask: true,
  811. })
  812. if (e == 1) {
  813. this.startDate_head = parseUnixTime(beforeTimeStamp(30), '{y}-{m}-{d}')
  814. } else {
  815. this.startDate_head = parseUnixTime(beforeTimeStamp(365), '{y}-{m}-01')
  816. }
  817. // this.getPie()
  818. this.getDataHome2()
  819. },
  820. changedate4(e) {
  821. this.startTime = e.startDate
  822. this.endTime = e.endDate
  823. this.okbtn()
  824. },
  825. changedate3(e) {
  826. var index = e[0];
  827. var obj = this.stationList[index];
  828. this.selectstationId2 = obj.id;
  829. this.selectstationIndex = index;
  830. this.selectstationName = obj.name;
  831. this.okbtn2()
  832. },
  833. changedate(e) {
  834. this.queryTime = e.year + '-' + e.month;
  835. this.startTime = e.year + '-' + e.month + '-01';
  836. if (e.month == '12') {
  837. this.endTime = (e.year) + "-12-31"
  838. } else {
  839. var b = e.year + '/' + (parseInt(e.month) + 1) + '/1';
  840. var a = beforeTimeStamp(1, b);
  841. this.endTime = parseUnixTime(a, '{y}-{m}-{d}')
  842. }
  843. this.okbtn()
  844. },
  845. changedate2(e) {
  846. this.queryTime2 = e.year + '-' + e.month;
  847. if (e.month == '12') {
  848. this.endTime2 = (e.year) + "-12-31"
  849. } else {
  850. var b = e.year + '/' + (parseInt(e.month) + 1) + '/1';
  851. var a = beforeTimeStamp(1, b);
  852. this.endTime2 = parseUnixTime(a, '{y}-{m}-{d}')
  853. }
  854. this.okbtn2()
  855. },
  856. getPie(type) {
  857. //true 正常版本 false 个人版本
  858. var typebl = !(this.info.accountType == 3);
  859. var dataInterval = null;
  860. if (typebl) {
  861. if (this.type_head == 1) {
  862. dataInterval = [0, 25, 50, 75, 100,
  863. 125, 150, 200, 250, 300, 400, 500,
  864. 600, 800, 1000, 1200, 1400, 1600, 1800,
  865. 2000, 2300, 2600, 2800,
  866. 3000, 3400, 3800, 4200,
  867. 4800, 5200, 5600, 6000, 6500, 7000, 7500, 8000, 9000, 10000, 12000, 14000, 16000, 20000,
  868. 30000, 999999
  869. ];
  870. } else {
  871. dataInterval = [0, 500, 1000, 2000, 5000, 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000,
  872. 90000, 100000, 120000, 140000, 160000, 180000, 200000, 250000, 300000, 400000, 500000,
  873. 999999
  874. ];
  875. }
  876. }
  877. this.headitemby = "";
  878. var showkey = "";
  879. var getData = this.indexData3.graphMap;
  880. for (var i in getData) {
  881. var item = getData[i]
  882. item.todayEQAmount2 = (item.todayEQAmount / 10000)
  883. }
  884. this.indexData3.graphMap = getData
  885. //var unit = this.current ? '笔' : '元'
  886. var colorName = "#333"
  887. // this.showlist1 = ['收入', '利润', '次数','新电途'];
  888. var showlistColor = ['#5872c0', '#de6e6a', '#f3c96b', '#69be8d', '#c661b4'];
  889. // this.showlist1 = ['收入', '利润', '电量', '新电途'];
  890. // var sz2 = ['todayAmount', 'todayProfit', 'todayEQAmount2', 'todayXDTAmount'];
  891. this.showlist1 = ['收入', '利润', '电量', '新电途', '快电'];
  892. var sz2 = ['todayAmount', 'todayProfit', 'todayEQAmount2', 'todayXDTAmount','todayKDAmount'];
  893. var zLevel = [20, 40, 10, 30,9];
  894. //var sz2 = ['todayAmount', 'todayProfit', 'todayEQNum','todayXDTAmount'];
  895. if (!this.myChart) {
  896. this.myChart = echarts.init(document.getElementById('pieEcharts'));
  897. this.myChart.on("dataZoom", (res) => {
  898. showkey = "";
  899. this.headitemby = "";
  900. });
  901. }
  902. this.myChart.clear();
  903. //
  904. var timelist = []
  905. for (var i in getData) {
  906. if (this.type_head == 1) {
  907. timelist.push(i.substring(5))
  908. } else {
  909. timelist.push(i)
  910. }
  911. }
  912. var list = [];
  913. for (var j in this.showlist1) {
  914. var ap = {
  915. name: this.showlist1[j],
  916. type: 'line',
  917. lineStyle: {
  918. color: showlistColor[j]
  919. },
  920. itemStyle: {
  921. color: showlistColor[j]
  922. },
  923. z: zLevel[j],
  924. // label: {
  925. // show: true,
  926. // position: 'top'
  927. // },
  928. data: []
  929. }
  930. if (this.type_head == 1) {
  931. ap.symbolSize = 3;
  932. }
  933. var bl = true;
  934. for (var i in getData) {
  935. //var time=this.queryDate.replace("-","/").replace("-","/")
  936. //time+' '+i
  937. var obj = getData[i][sz2[j]];
  938. //**********
  939. if (typebl) {
  940. const min_v = Math.max(...dataInterval.filter((v) => v <= obj));
  941. // 2.寻找在数据间隔里大于amount的最小值
  942. const max_v = Math.min(...dataInterval.filter((v) => v > obj));
  943. // 3.寻找 min_v 所在的下标
  944. const index = dataInterval.findIndex((v) => v === min_v);
  945. // 4.计算该amount在y轴上应该展示的位置
  946. const y_value = ((obj - min_v) / (max_v - min_v)) * 10 + index * 10;
  947. obj = y_value;
  948. }
  949. //**********
  950. //'todayAmount', 'todayProfit', 'todayEQNum'
  951. // if (bl&&getData[i].todayAmount == 0 && getData[i].todayProfit == 0 &&getData[i].todayEQNum == 0) {
  952. // //&& &&getData[i].todayEQNum == 0
  953. // continue;
  954. // }
  955. bl = false;
  956. var time = i
  957. if (this.type_head == 1) {
  958. //time = i.substring(5)
  959. } else {
  960. }
  961. ap.data.push([time, obj]);
  962. }
  963. if (bl) {
  964. ap.data = [];
  965. for (var i in getData) {
  966. //var time=this.queryDate.replace("-","/").replace("-","/")
  967. //time+' '+i
  968. var obj = getData[i][sz2[j]];
  969. var time = i
  970. if (this.type_head == 1) {
  971. time = i.substring(5)
  972. } else {
  973. }
  974. // if(j!=2){
  975. // obj=obj.toFixed(2)
  976. // }
  977. ap.data.push([time, obj]);
  978. }
  979. }
  980. list.push(ap)
  981. }
  982. var yshow = 0;
  983. // 指定图表的配置项和数据
  984. var option = {
  985. tooltip: {
  986. position: (e)=>{
  987. var x=e[0]
  988. var y=e[1]
  989. // if(y<50){
  990. // y+=20
  991. // }
  992. // console.log(e)
  993. // return [x,y]
  994. if(this.windowWidth){
  995. if(y<100){
  996. if(x<this.windowWidth/2){
  997. return ['30%','60%']
  998. }else{
  999. return ['10%','60%']
  1000. }
  1001. }else{
  1002. if(x<this.windowWidth/2){
  1003. return ['30%','-45%']
  1004. }else{
  1005. return ['10%','-45%']
  1006. }
  1007. }
  1008. }
  1009. },
  1010. formatter: (value) => {
  1011. //getPie
  1012. var name = value[0].data[0];
  1013. var info = getData[name];
  1014. var style = "float: right;margin-left: 3px;"
  1015. var text1 = ""
  1016. for (var i in value) {
  1017. var u = "元"
  1018. var num = info[sz2[value[i].seriesIndex]];
  1019. if(!num){
  1020. num=0;
  1021. }
  1022. if (value[i].seriesName == '电量') {
  1023. u = '度'
  1024. num = num.toFixed(2)
  1025. } else if (value[i].seriesName == '次数') {
  1026. u = '次'
  1027. } else {
  1028. num = num.toFixed(2)
  1029. }
  1030. text1 += "<p>" + value[i].marker + value[i].seriesName + '<span style="' + style +
  1031. '">' + num + u + '</span></p>';
  1032. if (this.type_head == 2) {
  1033. console.log(i,this.queryTime2)
  1034. if (value[i].seriesName == "收入") {
  1035. if(name!=this.queryTime2){
  1036. if(info.yoyNum!=null){
  1037. text1 += "<p>" + value[i].marker + "收入同比"+(info.yoyNum<0?'减少':'增长') + '<span style="' + style +
  1038. '">' + (info.yoyNum<0?info.yoyNum*-1:info.yoyNum) + '%' + '</span></p>';
  1039. }else{
  1040. text1 += "<p>" + value[i].marker + "收入同比"+ '<span style="' + style +
  1041. '">' +'无数据' + '</span></p>';
  1042. }
  1043. if(info.qoqNum!=null){
  1044. text1 += "<p>" + value[i].marker + "收入环比" +(info.qoqNum<0?'减少':'增长') + '<span style="' + style +
  1045. '">' + (info.qoqNum<0?info.qoqNum*-1:info.qoqNum) + '%' + '</span></p>';
  1046. }else{
  1047. text1 += "<p>" + value[i].marker + "收入环比"+ '<span style="' + style +
  1048. '">' +'无数据' + '</span></p>';
  1049. }
  1050. }
  1051. }
  1052. }
  1053. if(i==value.length-1){
  1054. text1 += "<p><span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:#FF3D00;'></span>6折卡数量"+ '<span style="' + style +
  1055. '">' +(info.discountCardBuyNum?info.discountCardBuyNum:0) + '张</span></p>';
  1056. text1 += "<p><span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:#FF3D00;'></span>月卡数量"+ '<span style="' + style +
  1057. '">' +(info.monthCardBuyNum?info.monthCardBuyNum:0) + '张</span></p>';
  1058. text1 += "<p><span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:#FF3D00;'></span>折扣卡金额"+ '<span style="' + style +
  1059. '">' +(info.cardBuyFee?info.cardBuyFee:0).toFixed(2) + '元</span></p>';
  1060. }
  1061. }
  1062. if (this.type_head == 1) {
  1063. //time = i.substring(5)
  1064. var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
  1065. var now = newDate(name);
  1066. var day = now.getDay();
  1067. var week = weeks[day];
  1068. return `<p>${name} ${week}</p>` + text1
  1069. } else {
  1070. return `<p>${name}</p>` + text1
  1071. }
  1072. },
  1073. trigger: 'axis',
  1074. borderColor: "#F0F0F0",
  1075. borderWidth: 1,
  1076. backgroundColor: "#ffffff",
  1077. textStyle: {
  1078. color: "#333"
  1079. }
  1080. },
  1081. legend: {
  1082. itemGap :1,
  1083. data: this.showlist1,
  1084. textStyle: {
  1085. color: "#333"
  1086. }
  1087. },
  1088. grid: {
  1089. top: '16%',
  1090. left: '3%',
  1091. right: '8%',
  1092. bottom: '8%',
  1093. containLabel: true
  1094. },
  1095. xAxis: {
  1096. //type: 'value',
  1097. type: 'category',
  1098. splitNumber: 4,
  1099. boundaryGap: false,
  1100. axisLabel: {
  1101. formatter: (value) => {
  1102. if (this.headitemby == "") {
  1103. this.headitemby = value
  1104. }
  1105. var i = 0
  1106. if (this.type_head == 1) {
  1107. i = 0;
  1108. } else {
  1109. i = 3;
  1110. }
  1111. var showvalue = "";
  1112. var key = value.substring(0, 8 - i);
  1113. if (showkey == "" || value == this.headitemby) {
  1114. showkey = key
  1115. showvalue = value
  1116. showvalue = value.substring(5 - i)
  1117. } else {
  1118. if (key != showkey) {
  1119. showkey = key
  1120. showvalue = value
  1121. showvalue = value.substring(5 - i)
  1122. } else {
  1123. showvalue = value.substring(8 - i)
  1124. }
  1125. }
  1126. return showvalue.replace("-", ".");
  1127. },
  1128. textStyle: {
  1129. color: "#333"
  1130. }
  1131. },
  1132. axisLine: {
  1133. show: true,
  1134. lineStyle: {
  1135. color: "#333"
  1136. }
  1137. },
  1138. },
  1139. yAxis: {
  1140. type: 'value',
  1141. // name: '单位('+this.typeN+')',
  1142. axisLabel: {
  1143. formatter: (v, i) => {
  1144. //console.log(v,i)
  1145. if (dataInterval == null) {
  1146. return v
  1147. }
  1148. if (i == 0) {
  1149. yshow = 0
  1150. return 0
  1151. }
  1152. if (yshow != parseInt(v / 10)) {
  1153. yshow = parseInt(v / 10);
  1154. return dataInterval[parseInt(v / 10)]
  1155. } else {
  1156. return ''
  1157. }
  1158. },
  1159. textStyle: {
  1160. color: "#333"
  1161. }
  1162. },
  1163. axisLine: {
  1164. show: true,
  1165. lineStyle: {
  1166. color: "#333"
  1167. }
  1168. },
  1169. },
  1170. series: list
  1171. };
  1172. // option.dataZoom = [{
  1173. // type: 'inside',
  1174. // start: 0,
  1175. // end: 100
  1176. // },
  1177. // {
  1178. // start: 0,
  1179. // end: 100
  1180. // }
  1181. // ]
  1182. if (this.type_head == 1) {
  1183. } else {
  1184. //timelist.push(i)
  1185. }
  1186. //console.log(option)
  1187. // 使用刚指定的配置项和数据显示图表。
  1188. this.myChart.setOption(option);
  1189. }
  1190. }
  1191. }
  1192. </script>
  1193. <style>
  1194. page {
  1195. background: url(../../assets/img/index_header_bg.png) no-repeat top center #f7f7f7;
  1196. background-size: 100%;
  1197. }
  1198. </style>
  1199. <style lang="scss" scoped>
  1200. .indexData5content {
  1201. padding: 40rpx 20rpx;
  1202. .contentTitle{
  1203. color:#333333;
  1204. font-size: 40rpx;
  1205. text-align: center;
  1206. font-weight: bold;
  1207. margin-bottom: 8px;
  1208. }
  1209. .contentBody{
  1210. color: #777777 ;
  1211. font-size: 28rpx;
  1212. display: flex;
  1213. justify-content: space-between;
  1214. flex-direction: row;
  1215. padding: 0 16rpx;
  1216. margin-bottom: 16rpx;
  1217. .body1{
  1218. color:#333333;
  1219. margin-left: 20rpx;
  1220. }
  1221. .body2{
  1222. display: flex;
  1223. .body2-0{
  1224. width: 110rpx;
  1225. }
  1226. .body2-1{
  1227. padding: 0 8rpx;
  1228. color: #00B962;
  1229. }
  1230. .body2-2{
  1231. width: 120rpx;
  1232. }
  1233. }
  1234. .body3{
  1235. padding: 0 8rpx;
  1236. color:#FF3D00 ;
  1237. }
  1238. }
  1239. .contentItem{
  1240. border-bottom: 1px solid #ededed;
  1241. // margin: 16rpx;
  1242. // padding:12rpx;
  1243. img,svg{
  1244. vertical-align: bottom;
  1245. height: 44rpx;
  1246. //margin-right: 8rpx;
  1247. }
  1248. .span1{
  1249. text-align: left;
  1250. font-weight: bold;
  1251. font-size: 36rpx;
  1252. width: 310rpx;
  1253. overflow: hidden;
  1254. text-overflow: ellipsis;
  1255. white-space: nowrap;
  1256. }
  1257. .color777{
  1258. color: #777777;
  1259. }
  1260. .color333{
  1261. color: #333333;
  1262. }
  1263. .span2{
  1264. border-right: 1px solid #ededed;
  1265. width: 120rpx;
  1266. padding: 0 8rpx;
  1267. span{
  1268. padding: 0 8rpx;
  1269. }
  1270. }
  1271. .span3{
  1272. padding: 0 0 0 12rpx;
  1273. span{
  1274. padding: 0 8rpx;
  1275. }
  1276. width: 154rpx;
  1277. .bot1span {
  1278. color: #00B962;
  1279. }
  1280. .bot2span {
  1281. color: #AAAAAA;
  1282. }
  1283. .bot3span {
  1284. color: #FF3D00;
  1285. }
  1286. }
  1287. }
  1288. }
  1289. .indexData4content {
  1290. padding: 40rpx 20rpx;
  1291. .contentTitle{
  1292. color:#333333;
  1293. font-size: 40rpx;
  1294. text-align: center;
  1295. font-weight: bold;
  1296. margin-bottom: 8px;
  1297. }
  1298. .contentItem{
  1299. border-bottom: 1px solid #ededed;
  1300. display: flex;
  1301. justify-content: space-between;
  1302. flex-direction: row;
  1303. margin: 16rpx;
  1304. padding:12rpx;
  1305. .span1{
  1306. img{
  1307. vertical-align: bottom;
  1308. height: 44rpx;
  1309. margin-right: 8rpx;
  1310. }
  1311. font-weight: bold;
  1312. font-size: 36rpx;
  1313. width: 400rpx;
  1314. overflow: hidden;
  1315. text-overflow: ellipsis;
  1316. white-space: nowrap;
  1317. }
  1318. .color777{
  1319. color: #777777;
  1320. }
  1321. .color333{
  1322. color: #333333;
  1323. }
  1324. .span2{
  1325. border-right: 1px solid #ededed;
  1326. width: 120rpx;
  1327. padding: 0 16rpx;
  1328. span{
  1329. padding: 0 8rpx;
  1330. }
  1331. }
  1332. .span3{
  1333. padding: 0 0 0 16rpx;
  1334. span{
  1335. padding: 0 8rpx;
  1336. }
  1337. width: 154rpx;
  1338. color: #333;
  1339. .bot1span {
  1340. color: #00B962;
  1341. }
  1342. .bot2span {
  1343. color: #AAAAAA;
  1344. }
  1345. .bot3span {
  1346. color: #FF3D00;
  1347. }
  1348. }
  1349. }
  1350. }
  1351. .chargingpile {
  1352. img {
  1353. vertical-align: bottom;
  1354. height: 44rpx;
  1355. margin-right: 8rpx;
  1356. }
  1357. p {
  1358. color: #185AC6;
  1359. font-size: 36rpx;
  1360. font-weight: bold;
  1361. span {
  1362. color: #777777;
  1363. margin-left: 8rpx;
  1364. font-size: 32rpx;
  1365. font-weight: normal;
  1366. }
  1367. }
  1368. .detailstablepile {
  1369. .details-row-main {
  1370. border-bottom: 1px solid #ededed;
  1371. padding: 10px 0;
  1372. }
  1373. span {
  1374. margin: 0 8rpx;
  1375. }
  1376. .bot {
  1377. display: inline-block;
  1378. width: 24rpx;
  1379. height: 24rpx;
  1380. margin-left: 4rpx;
  1381. border-radius: 999px;
  1382. }
  1383. .bot1 {
  1384. background-color: #00B962;
  1385. }
  1386. .bot2 {
  1387. //margin-left: 16rpx;
  1388. background-color: #AAAAAA;
  1389. }
  1390. .bot3 {
  1391. //margin-left: 16rpx;
  1392. background-color: #FF3D00;
  1393. }
  1394. .bot1span {
  1395. color: #00B962;
  1396. }
  1397. .bot2span {
  1398. color: #AAAAAA;
  1399. }
  1400. .bot3span {
  1401. color: #FF3D00;
  1402. }
  1403. .detailsline {
  1404. border-bottom: 1px solid #ededed;
  1405. }
  1406. .detailsline,
  1407. .detailsline—bottom {
  1408. display: flex;
  1409. .details-row {
  1410. width: 33%;
  1411. // display: flex;
  1412. // justify-content: space-between;
  1413. // flex-direction: column;
  1414. padding-left: 16rpx;
  1415. margin-bottom: 16rpx;
  1416. margin-top: 16rpx;
  1417. .span1 {
  1418. color: rgba(136, 136, 136, 100);
  1419. font-size: 28rpx;
  1420. width: 100%;
  1421. color: #333333;
  1422. }
  1423. }
  1424. }
  1425. .details-row-1 {
  1426. width: 47%;
  1427. padding-left: 0px !important;
  1428. //border-right: 1px solid #ededed;
  1429. }
  1430. }
  1431. }
  1432. .viewgun {
  1433. position: relative;
  1434. top: 200px;
  1435. text-align: center;
  1436. .viewspan {
  1437. width: 30%;
  1438. margin-left: 16rpx;
  1439. display: inline;
  1440. }
  1441. }
  1442. .headbotton1:after {
  1443. border-radius: 15px 0 0 15px;
  1444. }
  1445. .headbotton2:after {
  1446. border-radius: 0 15px 15px 0;
  1447. }
  1448. .detailstable {
  1449. padding: 30rpx 30rpx !important;
  1450. }
  1451. .detailstableHead {
  1452. .span1 {
  1453. font-size: 32rpx !important;
  1454. }
  1455. .details-row-head-1 {}
  1456. .details-row-head-2 {}
  1457. .details-row-head-3 {
  1458. width: 30% !important;
  1459. max-width: 150rpx;
  1460. .span {}
  1461. }
  1462. .span2 {
  1463. font-size: 44rpx !important;
  1464. font-weight: bold;
  1465. width: 100%;
  1466. color: #101010;
  1467. span {
  1468. font-size: 24rpx !important;
  1469. }
  1470. }
  1471. }
  1472. .detailslineHead {
  1473. border-top: 1px solid #ededed;
  1474. ;
  1475. .details-row {
  1476. padding-left: 8rpx !important;
  1477. }
  1478. font-size: 30rpx !important;
  1479. .span1 span {
  1480. font-size: 28rpx;
  1481. }
  1482. }
  1483. .detailstable,
  1484. .detailstableHead {
  1485. font-size: 16px;
  1486. p {
  1487. font-size: 14px;
  1488. }
  1489. .details-row-main {
  1490. border-bottom: 1px solid #ededed;
  1491. padding: 10px 0;
  1492. }
  1493. .detailsline {
  1494. border-bottom: 1px solid #ededed;
  1495. }
  1496. .detailsline,
  1497. .detailsline—bottom {
  1498. display: flex;
  1499. .details-row {
  1500. width: 50%;
  1501. display: flex;
  1502. justify-content: space-between;
  1503. flex-direction: column;
  1504. padding-left: 16rpx;
  1505. margin-bottom: 20rpx;
  1506. .span1 {
  1507. color: rgba(136, 136, 136, 100);
  1508. font-size: 28rpx;
  1509. width: 100%;
  1510. }
  1511. .span2 {
  1512. font-size: 36rpx;
  1513. width: 100%;
  1514. color: #101010;
  1515. span {
  1516. font-size: 24rpx;
  1517. }
  1518. }
  1519. }
  1520. }
  1521. .details-row-1 {
  1522. width: 47%;
  1523. padding-left: 0px !important;
  1524. border-right: 1px solid #ededed;
  1525. }
  1526. }
  1527. .details {
  1528. padding: 32rpx;
  1529. background-color: #fff;
  1530. border-radius: 8px;
  1531. }
  1532. .details-title {
  1533. margin-bottom: 16px;
  1534. h4 {
  1535. font-weight: normal;
  1536. font-size: 16px;
  1537. position: relative;
  1538. padding-left: 10px;
  1539. &::after {
  1540. content: '';
  1541. position: absolute;
  1542. height: 12px;
  1543. width: 4px;
  1544. background-color: #27B148;
  1545. left: 0;
  1546. top: 5px;
  1547. }
  1548. }
  1549. }
  1550. .details-row {
  1551. display: flex;
  1552. justify-content: space-between;
  1553. align-items: center;
  1554. margin-top: 30rpx;
  1555. p {
  1556. color: #37393c;
  1557. font-weight: bold;
  1558. }
  1559. }
  1560. .details-row2 {
  1561. display: flex;
  1562. justify-content: space-between;
  1563. align-items: center;
  1564. // margin-top: 15px;
  1565. p {
  1566. // color: #37393c;
  1567. // font-weight: bold;
  1568. }
  1569. }
  1570. .popup-screen {
  1571. padding: 20px;
  1572. position: relative;
  1573. .screen {
  1574. padding-bottom: 30px;
  1575. }
  1576. .screen-item {
  1577. margin-bottom: 20px;
  1578. .screen-head {
  1579. margin-bottom: 8px;
  1580. font-size: 16px;
  1581. }
  1582. .screen-main {
  1583. display: flex;
  1584. // display: -webkit-box;
  1585. flex-wrap: wrap;
  1586. }
  1587. .screen-entry {
  1588. width: 29%;
  1589. padding: 6px 0;
  1590. display: flex;
  1591. align-items: center;
  1592. justify-content: center;
  1593. background-color: #F2F5FA;
  1594. text-align: center;
  1595. margin-bottom: 10px;
  1596. border-radius: 3px;
  1597. margin-right: 6px;
  1598. }
  1599. .screen-entry.active {
  1600. background-color: #185AC6;
  1601. color: #fff;
  1602. }
  1603. }
  1604. .screen-foot {
  1605. position: fixed;
  1606. left: 0;
  1607. right: 0;
  1608. bottom: 0;
  1609. display: flex;
  1610. height: 50px;
  1611. border-top: 1px solid #ededed;
  1612. .screen-btn-l {
  1613. background-color: #fff;
  1614. flex: 0.2;
  1615. text-align: center;
  1616. line-height: 50px;
  1617. }
  1618. .screen-btn-r {
  1619. flex: 0.8;
  1620. text-align: center;
  1621. line-height: 50px;
  1622. background-color: #185AC6;
  1623. color: #fff;
  1624. }
  1625. }
  1626. }
  1627. .navbar-tit {
  1628. color: #fff;
  1629. font-size: 24px;
  1630. padding-left: 15px;
  1631. padding-top: 10px;
  1632. }
  1633. .statisticsData {
  1634. background-color: #fff;
  1635. margin: 0px 24rpx 24rpx;
  1636. //padding:0px 24rpx 24rpx;
  1637. border-radius: 8px;
  1638. }
  1639. .statisticsDataMain {
  1640. flex-wrap: wrap;
  1641. display: flex;
  1642. }
  1643. .statisticsData-item {
  1644. flex: 1;
  1645. width: 40%;
  1646. .statisticsData-head {
  1647. display: flex;
  1648. align-items: center;
  1649. p {
  1650. color: #637AA2;
  1651. font-size: 12px;
  1652. }
  1653. }
  1654. .statisticsData-main {
  1655. margin-top: 4px;
  1656. font-size: 18px;
  1657. }
  1658. .statisticsData-foot {
  1659. display: flex;
  1660. align-items: center;
  1661. margin-top: 16px;
  1662. p {
  1663. color: #637AA2;
  1664. }
  1665. h4 {
  1666. margin-left: 8px;
  1667. }
  1668. }
  1669. }
  1670. .statisticsChart {
  1671. margin: 32rpx;
  1672. .statisticsChart-head {
  1673. margin-bottom: 10rpx;
  1674. display: flex;
  1675. justify-content: space-between;
  1676. align-items: center;
  1677. h4 {
  1678. font-weight: normal;
  1679. font-size: 16px;
  1680. position: relative;
  1681. padding-left: 10px;
  1682. &::after {
  1683. content: '';
  1684. position: absolute;
  1685. height: 12px;
  1686. width: 4px;
  1687. background-color: #4E8DF6;
  1688. left: 0;
  1689. top: 5px;
  1690. }
  1691. }
  1692. .statisticsChart-time {
  1693. display: flex;
  1694. align-items: center;
  1695. p {
  1696. color: #666;
  1697. }
  1698. }
  1699. }
  1700. .statisticsChart-main {
  1701. background-color: #fff;
  1702. padding: 10px 16px 16px 16px;
  1703. border-radius: 8px;
  1704. }
  1705. }
  1706. </style>