index.vue 53 KB

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