index.vue 16 KB

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