index.vue 17 KB

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