123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826 |
- <template>
- <view>
- <ujp-navbar :is-back="false">
- <view class="navbar">
- <view class="navbar-tit" >充电明细</view>
- <view class="navbar-screen" v-show="current==0" @click="popupShow = true"><span>筛选</span>
- <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
- </view>
-
- </view>
- </ujp-navbar>
- <u-popup v-model="popupShow" mode="bottom" height="80%" >
- <view class="popup-screen">
- <view class="screen">
- <view class="screen-item">
- <view class="screen-head">查询日期</view>
- <view class="screen-main2">
-
- <u-calendar v-model="showdate" mode="date" @change="changedate"></u-calendar>
- <view @click="showdate = true" style="
- border: 1px solid;
- padding: 5px;
- " >{{startTime?startTime:'选择时间筛选'}}</view>
-
-
- <!--
- <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
- --></view>
- </view>
-
- <view class="screen-item">
- <view class="screen-head">站点</view>
- <view class="screen-main">
- <view class="screen-entry "
- :class="{
- active:selectstationId==''&&selectstationNo==''
- }"
- @click="selectstationId='',selectdeviceNo='',selectstationNo=''"
- >全部</view>
- <template v-for="(item,i) in stationList" >
-
- <view class="screen-entry"
- :class="{
- active:selectstationNo==item.stationNo.substring(0,1)
- }"
- @click="selectstationId='',selectdeviceNo='',selectstationNo=item.stationNo.substring(0,1)"
- v-if="getStationNo(i)" :key="i" >
-
- {{item.stationNo.substring(0,1)}}类</view>
-
- </template>
-
-
- <template v-for="(item,i) in stationList" >
-
- <view class="screen-head"
- style="width: 100%;"
- v-if="getStationNo(i)&&selectstationNo==item.stationNo.substring(0,1)" :key="i" >
-
- <span style="color: red;">*</span>{{item.stationNo.substring(0,1)}}类</view>
- <view
- :key="i"
- v-show="selectstationNo==item.stationNo.substring(0,1)"
- :class="{
- active:selectstationId==item.id
- }"
- @click="selectstationId=item.id,selectdeviceNo=''"
- class="screen-entry" >{{item.name}}</view>
- </template>
-
-
- </view>
- </view>
- <view v-show="selectstationId"
-
- class="screen-item">
- <view class="screen-head">桩号</view>
- <view class="screen-main">
-
- <view class="screen-entry "
- :class="{
- active:selectdeviceNo==''
- }"
- @click="selectdeviceNo=''"
- >全部</view>
- <view
- v-for="(item,i) in stationListSon" :key="i"
- v-show="selectstationId?(selectstationId==item.stationId):true"
- :class="{
- active:selectdeviceNo==item.deviceNo
- }"
-
- @click="selectdeviceNo=item.deviceNo"
- class="screen-entry" >{{item.name}}</view>
- </view>
- </view>
- </view>
- <view class="screen-foot">
- <view class="screen-btn-l" @click="resetBtn" >重置</view>
- <view class="screen-btn-r" @click="okbtn" >确定</view>
- </view>
- </view>
- </u-popup>
- <view v-if="showMonthlyCard">
- <u-tabs
- :bar-width="100"
- :list="tabList" :is-scroll="false" :current="current" @change="change" inactive-color="#acb2af"
- active-color="#101010"></u-tabs>
- </view>
-
-
- <view class="detailed" v-show="current==0" >
- <view style="text-align: center;margin-top: 100px" v-if="!list.length">
- <img src="@/assets/img/blankpage.png">
- <view>查询为空</view>
- </view>
-
- <view class="detailed-list" v-for="(item ,index) in list"
- @click="gotoUrl('pagesFinance/detailed/details?id='+item.id)"
- :key="index">
- <view class="detailed-time" style="background-color:#f3f4f7" v-if="item.show">
- <p>{{item.showtime}}</p>
- <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>
- </view>
- <view class="detailed-item" style="padding-top: 20rpx;">
- <p style=" text-align: end;" >
- <u-icon name="clock"></u-icon>
-
- {{item.endTime?item.endTime.slice(11):''}}</p>
- </view>
- <view class="detailed-item">
-
- <view class="detailed-item-name" style=" width: 70%; ">
- <h2 class="showName">{{item.stationName}}/{{item.deviceName}}</h2>
-
- </view>
- <view class="detailed-item-name" style="
-
- min-width: 60px;
- width: 30%;">
-
- <h2 style=" text-align: end;">{{item.actualFee?item.actualFee.toFixed(2):0}}元
- <span v-if="item.lossCompensate" style="color: red;" >*</span>
- </h2>
-
- </view>
-
- </view>
- <view class="detailed-item" style="padding-bottom: 20rpx;">
- <view class="detailed-item-name detailed-item-name-list" style="
- width: 100%;
- ">
- <span
-
- :style="{
- color:colorList[item.platform%3],
- borderColor:colorList[item.platform%3],
- }">{{item.platformText}}</span>
-
- <span
- v-show="item.payType"
-
- :style="{
-
- marginLeft: '2px',
- }">{{item.payTypeText}}</span>
-
-
- <span
- v-html="chargeUserPhoneXDT(item.phone,item.userType)" > </span>
-
-
- <span
- v-if="item.userCardId&&item.classify==1" style="color:#FF8B00 ;border-color:#FF8B00;">
- 月卡
- </span>
- <span
- v-if="item.userCardId&&item.classify==2" style="color:#FF8B00 ;border-color:#FF8B00;">
- 6折卡
- </span>
- </view>
- </view>
-
-
- </view>
- <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;" bg-color="#f7f7f7">已经到底了</u-divider>
-
-
- </view>
- <!-- 包月卡 -->
- <view class="detailed"
- style=" padding-bottom: 20px;"
- v-show="current==1">
-
- <view style="text-align: center;margin-top: 100px" v-if="!list2.length">
- <img src="@/assets/img/blankpage.png">
- <view>查询为空</view>
- </view>
-
- <view class="detailed-list2" v-for="(item ,index) in list2"
- @click="gotoUrl('pagesFinance/detailed/monthlyCardDetails?id='+item.id)"
-
- :key="index" >
-
- <view class="detailed-time" v-if="item.show" >
- <p>{{item.showtime}}</p>
-
- <p v-if="showMap2">共收{{showMap2.get(item.showtime).num}}笔,{{showMap2.get(item.showtime).amount.toFixed(2)}}元</p>
-
- </view>
- <view class="detailed-item-sp">
- <view class="detailed-item-name" style="
- width: 60%;
- ">
- <h2 class="showName">{{item.monthlyRentName}}</h2>
- <p>{{item.payTime?item.payTime.slice(11):''}}</p>
- </view>
- <view class="detailed-item-name" style="
- min-width: 65px;
- width: 40%;
- font-size: 16px;
- text-align: right;
- ">
- <h2>{{item.payFee.toFixed(2)}}<span style="font-size: 12px;">元</span></h2>
-
- </view>
- <!-- <view class="sign">
- <img src="../../assets/img/tixian.png" alt="">
- </view> -->
- </view>
-
-
-
- </view>
-
- <u-divider v-if="list2.length&&list2.length == recordsTotal2" color="#B6BDC3" style="margin-top:20px;" bg-color="#f7f7f7">已经到底了</u-divider>
-
- </view>
-
- <Tabbar :current="1" ref="tabbarMain"></Tabbar>
- </view>
- </template>
- <script>
- import Tabbar from '@/components/TabbarFinance.vue'
- import * as API from '@/apis/finance.js'
- // import {
- // beforeTimeStamp,
- // currentTimeStamp,
- // parseUnixTime
- // } from '@/utils'
-
- export default {
- data() {
- return {
- showdate: false,
- startTime: "",
- colorList:["#00B962","#1677FF","#eb372a"],
- endTime: "",
- selecttype:"",
- selectstationId:"",
- selectstationNo:"",
- selectdeviceNo:"",
- title:"",
- showMonthlyCard:false,
- form:{
-
- },
- stationNo:'',
- // current: 0,
- tabList: [{
- name: '充电订单'
- }, {
- name: '折扣卡订单'
- }],
- pageIndex: 1,
- recordsTotal: 0,
- list: [],
-
- pageIndex2: 1,
- recordsTotal2: 0,
- list2: [],
-
- popupShow: false,
- tabbarList: [{
- iconPath: "bar-chart-box-fill",
- selectedIconPath: "bar-chart-box-fill",
- text: '统计',
- count: 0,
- isDot: true,
- customIcon: true,
- },
- {
- iconPath: "article-fill",
- selectedIconPath: "article-fill",
- text: '明细',
- midButton: true,
- customIcon: true,
- },
- {
- iconPath: "account-pin-box-fill",
- selectedIconPath: "account-pin-box-fill",
- text: '我的',
- count: 0,
- isDot: false,
- customIcon: true,
- },
- ],
- showMap:null,
- showMap2:null,
- current: 0,
- value: '',
- type: 'select',
- show: false,
- border: true,
- stationList:[],
- stationListSon:[],
- actionSheetList: [
- {
- text: '男'
- },
- {
- text: '女'
- },
- {
- text: '保密'
- }
- ],
- }
- },
- components: {
- Tabbar
-
- },
- onReachBottom() {
-
- this.myLoadmore();
-
- },
- onShow() {
- if(this.$refs.tabbarMain){
- this.$refs.tabbarMain.setcount(1);
- }
- },
- onLoad() {
-
- },
- onReady() {
- this.info = this.carhelp.getPersonInfo()
- if(this.info &&this.info.showMonthlyCard){
- this.showMonthlyCard=this.info.showMonthlyCard;
- this.getList2()
- }
- this.getList()
-
- this.getStation()
-
- },
- methods: {
- getStationNo(i){
- var no=this.stationList[i].stationNo
- if(no){
- if(i==0){
- return true
- }else{
- var no2=this.stationList[i-1].stationNo
- //console.log(no2,no)
- if(no2){
- return no2.substring(0,1)!=no.substring(0,1)
- }else{
- return false
- }
-
- }
- }else{
- return false
- }
-
- },
- change(index) {
- this.current = index;
- },
- changedate(e) {
- // this.queryDate = e.result
- this.startTime = e.result
- this.endTime = e.result
-
- },
- resetBtn(){
- this.startTime=""
- this.endTime=""
- this.selecttype=""
- this.selectstationId=""
- this.selectdeviceNo=""
- this.selectstationNo=""
- this.pageIndex = 1;
- this.form = {
- startDate:"",
- endDate:"",
- pageIndex: this.pageIndex,
- type:this.selecttype,
- stationId:this.selectstationId,
- deviceNo:this.selectdeviceNo,
- };
- this.popupShow=false;
- this.list = [];
- this.getList()
-
- },
- okbtn(){
- if(this.selectstationNo&&this.selectstationId==''){
- uni.showToast({
- icon:"none",
- title:"请选择站点"
- })
- return
- }
- this.popupShow=false;
- this.pageIndex = 1;
-
- this.form = {
- startDate:this.startTime,
- endDate:this.endTime,
- pageIndex: this.pageIndex,
- type:this.selecttype,
- stationId:this.selectstationId,
- deviceNo:this.selectdeviceNo,
- };
- this.list = [];
- this.getList()
- },
- getList() {
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- this.form.pageIndex=this.pageIndex
- this.form.pageSize=20
-
- API.incomeList(this.form).then((res) => {
-
- var showMap=new Map()
-
-
- this.list = [
- ...this.list,
- ...res.data.data
- ];
-
- this.list.forEach(item=>{
- if(item.endTime){
- var ktime=item.endTime.split(" ")[0]
- if(showMap.has(ktime)){
- item.show=false;
-
-
- }else{
- var Amount=item.totalAmount
- var num=item.totalNum
- var eq=item.totalElectricQuantity
- showMap.set(ktime,{
- amount:Amount,
- num:num,
- eq:eq
- })
-
-
- item.show=true;
- item.showtime=ktime;
- }
- }
-
- })
-
- this.showMap=showMap;
- this.recordsTotal = res.data.recordsTotal
- uni.hideLoading()
-
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- getList2() {
-
- // uni.showLoading({
- // title: "加载中",
- // mask: true,
- // })
-
-
- API.buyCardList({
- pageIndex:this.pageIndex2,
- pageSize:20
- }).then((res) => {
- var showMap=new Map()
- this.showMap2=showMap;
- this.list2 = [
- ...this.list2,
- ...res.data.data
- ];
-
- this.list2.forEach(item=>{
- if(item.createTime){
- var ktime=item.createTime.split(" ")[0]
- if(showMap.has(ktime)){
- item.show=false;
-
-
- }else{
- var Amount=item.totalAmount
- var num=item.totalNum
-
- showMap.set(ktime,{
- amount:Amount,
- num:num,
-
- })
-
- item.show=true;
- item.showtime=ktime;
- }
- }
-
- })
-
- this.showMap2=showMap;
- this.recordsTotal2 = res.data.recordsTotal
- //uni.hideLoading()
-
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- getStation(bl) {
-
- API.stationList().then((res) => {
- var list= res.data.stationList
-
- var list2=list.sort(function(item1,item2){
-
-
- return (item1.stationNo>item2.stationNo)?1:-1
- })
- for(var i in list2){
- //console.log(list2[i].stationNo)
- }
-
- this.stationList =list2
-
- this.stationListSon=res.data.deviceList
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- myLoadmore() {
- if(this.current==0){
- if (this.list.length < this.recordsTotal) {
- this.pageIndex += 1;
- this.getList()
- }
-
- }else{
- if (this.list2.length < this.recordsTotal2) {
- this.pageIndex2 += 1;
- this.getList2()
- }
- }
-
-
- },
- // 点击actionSheet回调
- actionSheetCallback(index) {
- this.value = this.actionSheetList[index].text;
- }
- }
- }
- </script>
- <style>
- page{
- background-color: #F7F7F7;
- }
- </style>
- <style lang="scss" scoped>
- .product_tip{
- position: absolute;
- top: 0;
- right: 0;
- width: 26px;
- height: 26px;
- text-align: right;
- p{
- font-size: 24rpx;
- color: #ffffff;
- transform: rotate(45deg);
- position: relative;
- top: 0rpx;
- right: 0rpx;
- }
- .product_tip_bg{
- width: 0;
- height: 0;
- border-bottom: 48rpx solid #FD662A;
- border-right: 48rpx solid transparent;
- border-left: 48rpx solid transparent;
- transform: rotate(45deg);
- position: absolute;
- top: -7rpx;
- right: -29rpx;
- }
- }
- .popup-screen{
- padding: 20px;
- position: relative;
- .screen{
- padding-bottom: 30px;
- }
- .screen-item{
- margin-bottom: 20px;
- .screen-head{
- margin-bottom: 8px;
- font-size: 16px;
- }
- .screen-main{
- display: flex;
- // display: -webkit-box;
- flex-wrap: wrap;
-
- }
- .screen-entry{
- width: 29%;
- padding:6px 0;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #F2F5FA ;
- text-align: center;
- margin-bottom: 10px;
- border-radius: 3px;
-
- margin-right: 6px;
- }
- .screen-entry.active{
- background-color: #185AC6;
- color:#fff;
- }
- }
- .screen-foot{
- position: fixed;
- left: 0;
- right: 0;
- bottom: 0;
- display: flex;
- height:50px;
- border-top: 1px solid #ededed;
- .screen-btn-l{
- background-color: #fff;
- flex: 0.2;
- text-align: center;
- line-height: 50px;
- }
- .screen-btn-r{
- flex: 0.8;
- text-align: center;
- line-height: 50px;
- background-color: #185AC6;
- color:#fff;
- }
- }
- }
- .navbar{
- display: flex;
- justify-content: space-between;
- flex: 1;
- padding: 0 15px;
- }
- .navbar-tit{
- font-size: 20px;
- }
- .navbar-screen{
- display: flex;
- align-items: center;
- span{
- margin-right: 2px;
- color:#999;
- }
- }
- .detailed-time{
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 5px 10px;
- font-size: 16px;
- p{
- color:#666;
-
- }
- }
- .detailed-list{
- border-bottom: 1px solid #ededed;
-
- background-color: #fff;
- }
- .detailed-item-sp{
- background-color: #fff;
- display: flex;
- justify-content: space-between;
- padding: 10px 20px;
- border-bottom: 1px solid #ededed;
- position: relative;
- .sign{
- width: 32px;
- height: 32px;
- position: absolute;
- top: 0;
- right: 0;
- img{
- width: 100%;
- }
- }
-
- .detailed-item-name {
- h4 {
- font-weight: normal;
- }
-
- p {
- font-size: 15px;
- margin-top: 4px;
- color: #A2A9B5;
- }
- }
-
- .detailed-item-num {
- display: flex;
- align-items: center;
-
- h2 {
- margin-right: 4px;
- }
- }
- }
- .detailed-item{
-
- background-color: #fff;
- display: flex;
- justify-content: space-between;
- padding: 2px 15px;
-
- position: relative;
- .sign{
- width: 32px;
- height: 32px;
- position: absolute;
- top: 0;
- right: 0;
- img{
- width: 100%;
- }
- }
-
- .detailed-item-name-list{
- span{
- font-size: 24rpx;
- border: 1px solid rgba(119, 119, 119, 1);
- padding: 4rpx 12rpx;
- border-radius: 3px;
- color:rgba(119, 119, 119, 1);
- margin-right: 12rpx;
- }
- }
- .detailed-item-name{
- h4{
- font-weight: normal;
- }
-
- p{
- font-size: 15px;
- margin-top: 4px;
- color:#A2A9B5;
-
- }
- }
- .detailed-item-num{
- display: flex;
- align-items: center;
- h2{
- margin-right: 4px;
- }
- }
- }
- .showName{
- font-weight: unset;
- font-weight: unset;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: 16px;
- }
-
- .u-tabs{
- ::v-deep.uni-scroll-view-content {
- width: 56.2% !important;
- margin: auto;
- }
- }
-
- ::v-deep.u-tab-bar {
-
- background-color: #0076FF !important;
-
- }
- </style>
|