index.vue 52 KB

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