index.vue 52 KB

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