index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. <template>
  2. <view>
  3. <ujp-navbar :is-back="false">
  4. <view class="navbar">
  5. <view class="navbar-tit" >充电明细</view>
  6. <view class="navbar-screen" v-show="current==0" @click="popupShow = true"><span>筛选</span>
  7. <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
  8. </view>
  9. </view>
  10. </ujp-navbar>
  11. <u-popup v-model="popupShow" mode="top" height="80%" >
  12. <view class="popup-screen">
  13. <view class="screen">
  14. <view class="screen-item">
  15. <view class="screen-head">查询日期</view>
  16. <view class="screen-main2">
  17. <u-calendar v-model="showdate" mode="date" @change="changedate"></u-calendar>
  18. <u-input :value="startTime?startTime:'选择时间筛选'" :type="type" :border="border" @click="showdate = true" />
  19. <!--
  20. <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
  21. --></view>
  22. </view>
  23. <view class="screen-item" v-if="false" >
  24. <view class="screen-head">充电桩类型</view>
  25. <view class="screen-main">
  26. <view
  27. :class="{
  28. active:selecttype==''
  29. }" @click="selecttype=''"
  30. class="screen-entry ">全部</view>
  31. <view
  32. :class="{
  33. active:selecttype=='0'
  34. }" @click="selecttype='0'"
  35. class="screen-entry type1">自行车充电</view>
  36. <view
  37. :class="{
  38. active:selecttype=='2'
  39. }" @click="selecttype='2'"
  40. class="screen-entry type3">交流慢充</view>
  41. <view
  42. :class="{
  43. active:selecttype=='1'
  44. }" @click="selecttype='1'"
  45. class="screen-entry type2">直流快充</view>
  46. </view>
  47. </view>
  48. <view class="screen-item">
  49. <view class="screen-head">站点</view>
  50. <view class="screen-main">
  51. <view class="screen-entry "
  52. :class="{
  53. active:selectstationId==''
  54. }"
  55. @click="selectstationId=''"
  56. >全部</view>
  57. <template v-for="(item,i) in stationList" >
  58. <view class="screen-head"
  59. style="width: 100%;"
  60. v-if="getStationNo(i)" :key="i" >
  61. {{item.stationNo.substring(0,1)}}类</view>
  62. <view
  63. :key="i"
  64. :class="{
  65. active:selectstationId==item.id
  66. }"
  67. @click="selectstationId=item.id,selectdeviceNo=''"
  68. class="screen-entry" >{{item.name}}</view>
  69. </template>
  70. </view>
  71. </view>
  72. <view v-show="selectstationId"
  73. class="screen-item">
  74. <view class="screen-head">桩号</view>
  75. <view class="screen-main">
  76. <view class="screen-entry "
  77. :class="{
  78. active:selectdeviceNo==''
  79. }"
  80. @click="selectdeviceNo=''"
  81. >全部</view>
  82. <view
  83. v-for="(item,i) in stationListSon" :key="i"
  84. v-show="selectstationId?(selectstationId==item.stationId):true"
  85. :class="{
  86. active:selectdeviceNo==item.deviceNo
  87. }"
  88. @click="selectdeviceNo=item.deviceNo"
  89. class="screen-entry" >{{item.name}}</view>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="screen-foot">
  94. <view class="screen-btn-l" @click="resetBtn" >重置</view>
  95. <view class="screen-btn-r" @click="okbtn" >确定</view>
  96. </view>
  97. </view>
  98. </u-popup>
  99. <view v-if="showMonthlyCard">
  100. <u-tabs
  101. :bar-width="100"
  102. :list="tabList" :is-scroll="false" :current="current" @change="change" inactive-color="#acb2af"
  103. active-color="#101010"></u-tabs>
  104. </view>
  105. <view class="detailed" v-show="current==0" >
  106. <view style="text-align: center;margin-top: 100px" v-if="!list.length">
  107. <img src="@/assets/img/blankpage.png">
  108. <view>查询为空</view>
  109. </view>
  110. <view class="detailed-list" v-for="(item ,index) in list"
  111. @click="gotoUrl('pagesFinance/detailed/details?id='+item.id)"
  112. :key="index">
  113. <view class="detailed-time" style="background-color:#f3f4f7" v-if="item.show">
  114. <p>{{item.showtime}}</p>
  115. <p v-if="showMap">共收{{showMap.get(item.showtime).num}}笔,{{showMap.get(item.showtime).amount.toFixed(2)}}元</p>
  116. </view>
  117. <view class="detailed-item" style="padding-top: 20rpx;">
  118. <p style=" text-align: end;" >
  119. <u-icon name="clock"></u-icon>
  120. {{item.endTime?item.endTime.slice(11):''}}</p>
  121. </view>
  122. <view class="detailed-item">
  123. <view class="detailed-item-name" style=" width: 70%; ">
  124. <h2 class="showName">{{item.stationName}}/{{item.deviceName}}</h2>
  125. </view>
  126. <view class="detailed-item-name" style="
  127. min-width: 60px;
  128. width: 30%;">
  129. <h2 style=" text-align: end;">{{item.actualFee?item.actualFee.toFixed(2):0}}元</h2>
  130. </view>
  131. </view>
  132. <view class="detailed-item" style="padding-bottom: 20rpx;">
  133. <view class="detailed-item-name" style="
  134. width: 100%;
  135. ">
  136. <span
  137. :style="{
  138. color:colorList[item.platform%3],
  139. borderColor:colorList[item.platform%3],
  140. }">{{item.platformText}}</span>
  141. <span
  142. v-show="item.payType"
  143. :style="{
  144. marginLeft: '2px',
  145. }">{{item.payType==1?'先付后退':''}}{{item.payType==2?'个人账户':''}}{{item.payType==3?'企业账户':''}}</span>
  146. <span style="" v-if="item.phone!='XDT41001000004'" >{{item.userType==1?'游客':''}}{{item.userType==2?'会员':''}}</span>
  147. <span style="" v-if="item.phone=='XDT41001000004'" >哪吒用户</span>
  148. <span v-if="item.userCardId&&item.classify==1" style="color:#FF8B00 ;border-color:#FF8B00;">
  149. 月卡
  150. </span>
  151. <span v-if="item.userCardId&&item.classify==2" style="color:#FF8B00 ;border-color:#FF8B00;">
  152. 6折卡
  153. </span>
  154. </view>
  155. </view>
  156. </view>
  157. <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;" bg-color="#f7f7f7">已经到底了</u-divider>
  158. </view>
  159. <!-- 包月卡 -->
  160. <view class="detailed"
  161. style=" padding-bottom: 20px;"
  162. v-show="current==1">
  163. <view style="text-align: center;margin-top: 100px" v-if="!list2.length">
  164. <img src="@/assets/img/blankpage.png">
  165. <view>查询为空</view>
  166. </view>
  167. <view class="detailed-list2" v-for="(item ,index) in list2"
  168. @click="gotoUrl('pagesFinance/detailed/monthlyCardDetails?id='+item.id)"
  169. :key="index" >
  170. <view class="detailed-time" v-if="item.show" >
  171. <p>{{item.showtime}}</p>
  172. <p v-if="showMap2">共收{{showMap2.get(item.showtime).num}}笔,{{showMap2.get(item.showtime).amount.toFixed(2)}}元</p>
  173. </view>
  174. <view class="detailed-item-sp">
  175. <view class="detailed-item-name" style="
  176. width: 60%;
  177. ">
  178. <h2 class="showName">{{item.monthlyRentName}}</h2>
  179. <p>{{item.payTime?item.payTime.slice(11):''}}</p>
  180. </view>
  181. <view class="detailed-item-name" style="
  182. min-width: 65px;
  183. width: 40%;
  184. font-size: 16px;
  185. text-align: right;
  186. ">
  187. <h2>{{item.payFee.toFixed(2)}}<span style="font-size: 12px;">元</span></h2>
  188. </view>
  189. <!-- <view class="sign">
  190. <img src="../../assets/img/tixian.png" alt="">
  191. </view> -->
  192. </view>
  193. </view>
  194. <u-divider v-if="list2.length&&list2.length == recordsTotal2" color="#B6BDC3" style="margin-top:20px;" bg-color="#f7f7f7">已经到底了</u-divider>
  195. </view>
  196. <Tabbar :current="1" ref="tabbarMain"></Tabbar>
  197. </view>
  198. </template>
  199. <script>
  200. import Tabbar from '@/components/TabbarFinance.vue'
  201. import * as API from '@/apis/finance.js'
  202. // import {
  203. // beforeTimeStamp,
  204. // currentTimeStamp,
  205. // parseUnixTime
  206. // } from '@/utils'
  207. export default {
  208. data() {
  209. return {
  210. showdate: false,
  211. startTime: "",
  212. colorList:["#00B962","#1677FF","#eb372a"],
  213. endTime: "",
  214. selecttype:"",
  215. selectstationId:"",
  216. selectdeviceNo:"",
  217. title:"",
  218. showMonthlyCard:false,
  219. form:{
  220. },
  221. stationNo:'',
  222. // current: 0,
  223. tabList: [{
  224. name: '充电订单'
  225. }, {
  226. name: '折扣卡订单'
  227. }],
  228. pageIndex: 1,
  229. recordsTotal: 0,
  230. list: [],
  231. pageIndex2: 1,
  232. recordsTotal2: 0,
  233. list2: [],
  234. popupShow: false,
  235. tabbarList: [{
  236. iconPath: "bar-chart-box-fill",
  237. selectedIconPath: "bar-chart-box-fill",
  238. text: '统计',
  239. count: 0,
  240. isDot: true,
  241. customIcon: true,
  242. },
  243. {
  244. iconPath: "article-fill",
  245. selectedIconPath: "article-fill",
  246. text: '明细',
  247. midButton: true,
  248. customIcon: true,
  249. },
  250. {
  251. iconPath: "account-pin-box-fill",
  252. selectedIconPath: "account-pin-box-fill",
  253. text: '我的',
  254. count: 0,
  255. isDot: false,
  256. customIcon: true,
  257. },
  258. ],
  259. showMap:null,
  260. showMap2:null,
  261. current: 0,
  262. value: '',
  263. type: 'select',
  264. show: false,
  265. border: true,
  266. stationList:[],
  267. stationListSon:[],
  268. actionSheetList: [
  269. {
  270. text: '男'
  271. },
  272. {
  273. text: '女'
  274. },
  275. {
  276. text: '保密'
  277. }
  278. ],
  279. }
  280. },
  281. components: {
  282. Tabbar
  283. },
  284. onReachBottom() {
  285. this.myLoadmore();
  286. },
  287. onShow() {
  288. if(this.$refs.tabbarMain){
  289. this.$refs.tabbarMain.setcount(1);
  290. }
  291. },
  292. onLoad() {
  293. },
  294. onReady() {
  295. this.info = this.carhelp.getPersonInfo()
  296. if(this.info &&this.info.showMonthlyCard){
  297. this.showMonthlyCard=this.info.showMonthlyCard;
  298. this.getList2()
  299. }
  300. this.getList()
  301. this.getStation()
  302. },
  303. methods: {
  304. getStationNo(i){
  305. var no=this.stationList[i].stationNo
  306. if(no){
  307. if(i==0){
  308. return true
  309. }else{
  310. var no2=this.stationList[i-1].stationNo
  311. console.log(no2,no)
  312. if(no2){
  313. return no2.substring(0,1)!=no.substring(0,1)
  314. }else{
  315. return false
  316. }
  317. }
  318. }else{
  319. return false
  320. }
  321. },
  322. change(index) {
  323. this.current = index;
  324. },
  325. changedate(e) {
  326. // this.queryDate = e.result
  327. this.startTime = e.result
  328. this.endTime = e.result
  329. },
  330. resetBtn(){
  331. this.startTime=""
  332. this.endTime=""
  333. this.selecttype=""
  334. this.selectstationId=""
  335. this.selectdeviceNo=""
  336. this.pageIndex = 1;
  337. this.form = {
  338. startDate:"",
  339. endDate:"",
  340. pageIndex: this.pageIndex,
  341. type:this.selecttype,
  342. stationId:this.selectstationId,
  343. deviceNo:this.selectdeviceNo,
  344. };
  345. this.popupShow=false;
  346. this.list = [];
  347. this.getList()
  348. },
  349. okbtn(){
  350. this.popupShow=false;
  351. this.pageIndex = 1;
  352. this.form = {
  353. startDate:this.startTime,
  354. endDate:this.endTime,
  355. pageIndex: this.pageIndex,
  356. type:this.selecttype,
  357. stationId:this.selectstationId,
  358. deviceNo:this.selectdeviceNo,
  359. };
  360. this.list = [];
  361. this.getList()
  362. },
  363. getList() {
  364. uni.showLoading({
  365. title: "加载中",
  366. mask: true,
  367. })
  368. this.form.pageIndex=this.pageIndex
  369. this.form.pageSize=20
  370. API.incomeList(this.form).then((res) => {
  371. var showMap=new Map()
  372. this.list = [
  373. ...this.list,
  374. ...res.data.data
  375. ];
  376. this.list.forEach(item=>{
  377. if(item.endTime){
  378. var ktime=item.endTime.split(" ")[0]
  379. if(showMap.has(ktime)){
  380. item.show=false;
  381. }else{
  382. var Amount=item.totalAmount
  383. var num=item.totalNum
  384. showMap.set(ktime,{
  385. amount:Amount,
  386. num:num
  387. })
  388. item.show=true;
  389. item.showtime=ktime;
  390. }
  391. }
  392. })
  393. this.showMap=showMap;
  394. this.recordsTotal = res.data.recordsTotal
  395. uni.hideLoading()
  396. }).catch(error => {
  397. uni.showToast({
  398. title: error
  399. })
  400. })
  401. },
  402. getList2() {
  403. // uni.showLoading({
  404. // title: "加载中",
  405. // mask: true,
  406. // })
  407. API.buyCardList({
  408. pageIndex:this.pageIndex2,
  409. pageSize:20
  410. }).then((res) => {
  411. var showMap=new Map()
  412. this.showMap2=showMap;
  413. this.list2 = [
  414. ...this.list2,
  415. ...res.data.data
  416. ];
  417. this.list2.forEach(item=>{
  418. if(item.createTime){
  419. var ktime=item.createTime.split(" ")[0]
  420. if(showMap.has(ktime)){
  421. item.show=false;
  422. }else{
  423. var Amount=item.totalAmount
  424. var num=item.totalNum
  425. showMap.set(ktime,{
  426. amount:Amount,
  427. num:num
  428. })
  429. item.show=true;
  430. item.showtime=ktime;
  431. }
  432. }
  433. })
  434. this.showMap2=showMap;
  435. this.recordsTotal2 = res.data.recordsTotal
  436. //uni.hideLoading()
  437. }).catch(error => {
  438. uni.showToast({
  439. title: error
  440. })
  441. })
  442. },
  443. getStation(bl) {
  444. API.stationList().then((res) => {
  445. var list= res.data.stationList
  446. var list2=list.sort(function(item1,item2){
  447. return (item1.stationNo>item2.stationNo)?1:-1
  448. })
  449. for(var i in list2){
  450. //console.log(list2[i].stationNo)
  451. }
  452. this.stationList =list2
  453. this.stationListSon=res.data.deviceList
  454. }).catch(error => {
  455. uni.showToast({
  456. title: error
  457. })
  458. })
  459. },
  460. myLoadmore() {
  461. if(this.current==0){
  462. if (this.list.length < this.recordsTotal) {
  463. this.pageIndex += 1;
  464. this.getList()
  465. }
  466. }else{
  467. if (this.list2.length < this.recordsTotal2) {
  468. this.pageIndex2 += 1;
  469. this.getList2()
  470. }
  471. }
  472. },
  473. // 点击actionSheet回调
  474. actionSheetCallback(index) {
  475. this.value = this.actionSheetList[index].text;
  476. }
  477. }
  478. }
  479. </script>
  480. <style>
  481. page{
  482. background-color: #F7F7F7;
  483. }
  484. </style>
  485. <style lang="scss" scoped>
  486. .product_tip{
  487. position: absolute;
  488. top: 0;
  489. right: 0;
  490. width: 26px;
  491. height: 26px;
  492. text-align: right;
  493. p{
  494. font-size: 24rpx;
  495. color: #ffffff;
  496. transform: rotate(45deg);
  497. position: relative;
  498. top: 0rpx;
  499. right: 0rpx;
  500. }
  501. .product_tip_bg{
  502. width: 0;
  503. height: 0;
  504. border-bottom: 48rpx solid #FD662A;
  505. border-right: 48rpx solid transparent;
  506. border-left: 48rpx solid transparent;
  507. transform: rotate(45deg);
  508. position: absolute;
  509. top: -7rpx;
  510. right: -29rpx;
  511. }
  512. }
  513. .popup-screen{
  514. padding: 20px;
  515. position: relative;
  516. .screen{
  517. padding-bottom: 30px;
  518. }
  519. .screen-item{
  520. margin-bottom: 20px;
  521. .screen-head{
  522. margin-bottom: 8px;
  523. font-size: 16px;
  524. }
  525. .screen-main{
  526. display: flex;
  527. // display: -webkit-box;
  528. flex-wrap: wrap;
  529. }
  530. .screen-entry{
  531. width: 29%;
  532. padding:6px 0;
  533. display: flex;
  534. align-items: center;
  535. justify-content: center;
  536. background-color: #F2F5FA ;
  537. text-align: center;
  538. margin-bottom: 10px;
  539. border-radius: 3px;
  540. margin-right: 6px;
  541. }
  542. .screen-entry.active{
  543. background-color: #185AC6;
  544. color:#fff;
  545. }
  546. }
  547. .screen-foot{
  548. position: fixed;
  549. left: 0;
  550. right: 0;
  551. bottom: 0;
  552. display: flex;
  553. height:50px;
  554. border-top: 1px solid #ededed;
  555. .screen-btn-l{
  556. background-color: #fff;
  557. flex: 0.2;
  558. text-align: center;
  559. line-height: 50px;
  560. }
  561. .screen-btn-r{
  562. flex: 0.8;
  563. text-align: center;
  564. line-height: 50px;
  565. background-color: #185AC6;
  566. color:#fff;
  567. }
  568. }
  569. }
  570. .navbar{
  571. display: flex;
  572. justify-content: space-between;
  573. flex: 1;
  574. padding: 0 15px;
  575. }
  576. .navbar-tit{
  577. font-size: 20px;
  578. }
  579. .navbar-screen{
  580. display: flex;
  581. align-items: center;
  582. span{
  583. margin-right: 2px;
  584. color:#999;
  585. }
  586. }
  587. .detailed-time{
  588. display: flex;
  589. justify-content: space-between;
  590. align-items: center;
  591. padding: 5px 10px;
  592. font-size: 16px;
  593. p{
  594. color:#666;
  595. }
  596. }
  597. .detailed-list{
  598. border-bottom: 1px solid #ededed;
  599. background-color: #fff;
  600. }
  601. .detailed-item-sp{
  602. background-color: #fff;
  603. display: flex;
  604. justify-content: space-between;
  605. padding: 10px 20px;
  606. border-bottom: 1px solid #ededed;
  607. position: relative;
  608. .sign{
  609. width: 32px;
  610. height: 32px;
  611. position: absolute;
  612. top: 0;
  613. right: 0;
  614. img{
  615. width: 100%;
  616. }
  617. }
  618. .detailed-item-name {
  619. h4 {
  620. font-weight: normal;
  621. }
  622. p {
  623. font-size: 15px;
  624. margin-top: 4px;
  625. color: #A2A9B5;
  626. }
  627. }
  628. .detailed-item-num {
  629. display: flex;
  630. align-items: center;
  631. h2 {
  632. margin-right: 4px;
  633. }
  634. }
  635. }
  636. .detailed-item{
  637. background-color: #fff;
  638. display: flex;
  639. justify-content: space-between;
  640. padding: 2px 15px;
  641. position: relative;
  642. .sign{
  643. width: 32px;
  644. height: 32px;
  645. position: absolute;
  646. top: 0;
  647. right: 0;
  648. img{
  649. width: 100%;
  650. }
  651. }
  652. .detailed-item-name{
  653. h4{
  654. font-weight: normal;
  655. }
  656. span{
  657. font-size: 24rpx;
  658. border: 1px solid rgba(119, 119, 119, 1);
  659. padding: 4rpx 12rpx;
  660. border-radius: 3px;
  661. color:rgba(119, 119, 119, 1);
  662. margin-right: 12rpx;
  663. }
  664. p{
  665. font-size: 15px;
  666. margin-top: 4px;
  667. color:#A2A9B5;
  668. }
  669. }
  670. .detailed-item-num{
  671. display: flex;
  672. align-items: center;
  673. h2{
  674. margin-right: 4px;
  675. }
  676. }
  677. }
  678. .showName{
  679. font-weight: unset;
  680. font-weight: unset;
  681. overflow: hidden;
  682. text-overflow: ellipsis;
  683. white-space: nowrap;
  684. font-size: 16px;
  685. }
  686. .u-tabs{
  687. /deep/.uni-scroll-view-content {
  688. width: 56.2% !important;
  689. margin: auto;
  690. }
  691. }
  692. /deep/.u-tab-bar {
  693. background-color: #0076FF !important;
  694. }
  695. </style>