index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  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">
  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.queryDate = e.result
  297. this.startTime = e.result
  298. this.endTime = e.result
  299. },
  300. resetBtn(){
  301. this.startTime=""
  302. this.endTime=""
  303. this.selecttype=""
  304. this.selectstationId=""
  305. this.selectdeviceNo=""
  306. this.pageIndex = 1;
  307. this.form = {
  308. startDate:"",
  309. endDate:"",
  310. pageIndex: this.pageIndex,
  311. type:this.selecttype,
  312. stationId:this.selectstationId,
  313. deviceNo:this.selectdeviceNo,
  314. };
  315. this.popupShow=false;
  316. this.list = [];
  317. this.getList()
  318. },
  319. okbtn(){
  320. this.popupShow=false;
  321. this.pageIndex = 1;
  322. this.form = {
  323. startDate:this.startTime,
  324. endDate:this.endTime,
  325. pageIndex: this.pageIndex,
  326. type:this.selecttype,
  327. stationId:this.selectstationId,
  328. deviceNo:this.selectdeviceNo,
  329. };
  330. this.list = [];
  331. this.getList()
  332. },
  333. getList() {
  334. uni.showLoading({
  335. title: "加载中",
  336. mask: true,
  337. })
  338. this.form.pageIndex=this.pageIndex
  339. this.form.pageSize=20
  340. API.incomeList(this.form).then((res) => {
  341. var showMap=new Map()
  342. this.list = [
  343. ...this.list,
  344. ...res.data.data
  345. ];
  346. this.list.forEach(item=>{
  347. if(item.endTime){
  348. var ktime=item.endTime.split(" ")[0]
  349. if(showMap.has(ktime)){
  350. item.show=false;
  351. }else{
  352. var Amount=item.totalAmount
  353. var num=item.totalNum
  354. showMap.set(ktime,{
  355. amount:Amount,
  356. num:num
  357. })
  358. item.show=true;
  359. item.showtime=ktime;
  360. }
  361. }
  362. })
  363. this.showMap=showMap;
  364. this.recordsTotal = res.data.recordsTotal
  365. uni.hideLoading()
  366. }).catch(error => {
  367. uni.showToast({
  368. title: error
  369. })
  370. })
  371. },
  372. getList2() {
  373. uni.showLoading({
  374. title: "加载中",
  375. mask: true,
  376. })
  377. API.buyCardList({
  378. pageIndex:this.pageIndex2,
  379. pageSize:20
  380. }).then((res) => {
  381. var showMap=new Map()
  382. this.showMap2=showMap;
  383. this.list2 = [
  384. ...this.list2,
  385. ...res.data.data
  386. ];
  387. this.list2.forEach(item=>{
  388. if(item.createTime){
  389. var ktime=item.createTime.split(" ")[0]
  390. if(showMap.has(ktime)){
  391. item.show=false;
  392. }else{
  393. var Amount=item.totalAmount
  394. var num=item.totalNum
  395. showMap.set(ktime,{
  396. amount:Amount,
  397. num:num
  398. })
  399. item.show=true;
  400. item.showtime=ktime;
  401. }
  402. }
  403. })
  404. this.showMap2=showMap;
  405. this.recordsTotal2 = res.data.recordsTotal
  406. uni.hideLoading()
  407. }).catch(error => {
  408. uni.showToast({
  409. title: error
  410. })
  411. })
  412. },
  413. getStation(bl) {
  414. API.stationList().then((res) => {
  415. var list= res.data.stationList
  416. var list2=list.sort(function(item1,item2){
  417. if(item1.stationNo.indexOf("D")==0){
  418. return 1
  419. }
  420. return (item1.stationNo>item2.stationNo)?1:-1
  421. })
  422. for(var i in list2){
  423. //console.log(list2[i].stationNo)
  424. }
  425. this.stationList =list2
  426. this.stationListSon=res.data.deviceList
  427. }).catch(error => {
  428. uni.showToast({
  429. title: error
  430. })
  431. })
  432. },
  433. myLoadmore() {
  434. if(this.current==0){
  435. if (this.list.length < this.recordsTotal) {
  436. this.pageIndex += 1;
  437. this.getList()
  438. }
  439. }else{
  440. if (this.list2.length < this.recordsTotal2) {
  441. this.pageIndex2 += 1;
  442. this.getList2()
  443. }
  444. }
  445. },
  446. // 点击actionSheet回调
  447. actionSheetCallback(index) {
  448. this.value = this.actionSheetList[index].text;
  449. }
  450. }
  451. }
  452. </script>
  453. <style>
  454. page{
  455. background-color: #F7F7F7;
  456. }
  457. </style>
  458. <style lang="scss" scoped>
  459. .product_tip{
  460. position: absolute;
  461. top: 0;
  462. right: 0;
  463. width: 26px;
  464. height: 26px;
  465. text-align: right;
  466. p{
  467. font-size: 24rpx;
  468. color: #ffffff;
  469. transform: rotate(45deg);
  470. position: relative;
  471. top: 0rpx;
  472. right: 0rpx;
  473. }
  474. .product_tip_bg{
  475. width: 0;
  476. height: 0;
  477. border-bottom: 48rpx solid #FD662A;
  478. border-right: 48rpx solid transparent;
  479. border-left: 48rpx solid transparent;
  480. transform: rotate(45deg);
  481. position: absolute;
  482. top: -7rpx;
  483. right: -29rpx;
  484. }
  485. }
  486. .popup-screen{
  487. padding: 20px;
  488. position: relative;
  489. .screen{
  490. padding-bottom: 30px;
  491. }
  492. .screen-item{
  493. margin-bottom: 20px;
  494. .screen-head{
  495. margin-bottom: 8px;
  496. font-size: 16px;
  497. }
  498. .screen-main{
  499. display: flex;
  500. // display: -webkit-box;
  501. flex-wrap: wrap;
  502. }
  503. .screen-entry{
  504. width: 29%;
  505. padding:6px 0;
  506. display: flex;
  507. align-items: center;
  508. justify-content: center;
  509. background-color: #F2F5FA ;
  510. text-align: center;
  511. margin-bottom: 10px;
  512. border-radius: 3px;
  513. margin-right: 6px;
  514. }
  515. .screen-entry.active{
  516. background-color: #185AC6;
  517. color:#fff;
  518. }
  519. }
  520. .screen-foot{
  521. position: fixed;
  522. left: 0;
  523. right: 0;
  524. bottom: 0;
  525. display: flex;
  526. height:50px;
  527. border-top: 1px solid #ededed;
  528. .screen-btn-l{
  529. background-color: #fff;
  530. flex: 0.2;
  531. text-align: center;
  532. line-height: 50px;
  533. }
  534. .screen-btn-r{
  535. flex: 0.8;
  536. text-align: center;
  537. line-height: 50px;
  538. background-color: #185AC6;
  539. color:#fff;
  540. }
  541. }
  542. }
  543. .navbar{
  544. display: flex;
  545. justify-content: space-between;
  546. flex: 1;
  547. padding: 0 15px;
  548. }
  549. .navbar-tit{
  550. font-size: 20px;
  551. }
  552. .navbar-screen{
  553. display: flex;
  554. align-items: center;
  555. span{
  556. margin-right: 2px;
  557. color:#999;
  558. }
  559. }
  560. .detailed-time{
  561. display: flex;
  562. justify-content: space-between;
  563. align-items: center;
  564. padding: 5px 10px;
  565. font-size: 16px;
  566. p{
  567. color:#666;
  568. }
  569. }
  570. .detailed-list{
  571. border-bottom: 1px solid #ededed;
  572. background-color: #fff;
  573. }
  574. .detailed-item-sp{
  575. background-color: #fff;
  576. display: flex;
  577. justify-content: space-between;
  578. padding: 10px 20px;
  579. border-bottom: 1px solid #ededed;
  580. position: relative;
  581. .sign{
  582. width: 32px;
  583. height: 32px;
  584. position: absolute;
  585. top: 0;
  586. right: 0;
  587. img{
  588. width: 100%;
  589. }
  590. }
  591. .detailed-item-name {
  592. h4 {
  593. font-weight: normal;
  594. }
  595. p {
  596. font-size: 15px;
  597. margin-top: 4px;
  598. color: #A2A9B5;
  599. }
  600. }
  601. .detailed-item-num {
  602. display: flex;
  603. align-items: center;
  604. h2 {
  605. margin-right: 4px;
  606. }
  607. }
  608. }
  609. .detailed-item{
  610. background-color: #fff;
  611. display: flex;
  612. justify-content: space-between;
  613. padding: 2px 15px;
  614. position: relative;
  615. .sign{
  616. width: 32px;
  617. height: 32px;
  618. position: absolute;
  619. top: 0;
  620. right: 0;
  621. img{
  622. width: 100%;
  623. }
  624. }
  625. .detailed-item-name{
  626. h4{
  627. font-weight: normal;
  628. }
  629. span{
  630. font-size: 24rpx;
  631. border: 1px solid rgba(119, 119, 119, 1);
  632. padding: 4rpx 12rpx;
  633. border-radius: 3px;
  634. color:rgba(119, 119, 119, 1);
  635. margin-right: 12rpx;
  636. }
  637. p{
  638. font-size: 15px;
  639. margin-top: 4px;
  640. color:#A2A9B5;
  641. }
  642. }
  643. .detailed-item-num{
  644. display: flex;
  645. align-items: center;
  646. h2{
  647. margin-right: 4px;
  648. }
  649. }
  650. }
  651. .showName{
  652. font-weight: unset;
  653. font-weight: unset;
  654. overflow: hidden;
  655. text-overflow: ellipsis;
  656. white-space: nowrap;
  657. font-size: 16px;
  658. }
  659. .u-tabs{
  660. /deep/.uni-scroll-view-content {
  661. width: 56.2% !important;
  662. margin: auto;
  663. }
  664. }
  665. /deep/.u-tab-bar {
  666. background-color: #0076FF !important;
  667. }
  668. </style>