|
@@ -2,7 +2,7 @@
|
|
|
<view>
|
|
|
<u-navbar :is-back="false">
|
|
|
<view class="navbar">
|
|
|
- <view class="navbar-tit">收益明细</view>
|
|
|
+ <view class="navbar-tit" v-text="title" >收益明细</view>
|
|
|
<view class="navbar-screen" @click="popupShow = true"><span>筛选</span><u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon></view>
|
|
|
</view>
|
|
|
</u-navbar>
|
|
@@ -12,64 +12,110 @@
|
|
|
<view class="screen-item">
|
|
|
<view class="screen-head">查询日期</view>
|
|
|
<view class="screen-main">
|
|
|
- <u-input v-model="value" :type="type" :border="border" @click="show = true" />
|
|
|
+
|
|
|
+ <u-calendar v-model="showdate" mode="range" @change="changedate"></u-calendar>
|
|
|
+
|
|
|
+ <u-input :value="startTime?startTime+'至'+endTime:'选择时间筛选'" :type="type" :border="border" @click="showdate = true" />
|
|
|
+ <!--
|
|
|
<u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
|
|
|
- </view>
|
|
|
+ --></view>
|
|
|
</view>
|
|
|
<view class="screen-item">
|
|
|
<view class="screen-head">充电桩类型</view>
|
|
|
<view class="screen-main">
|
|
|
- <view class="screen-entry active">全部</view>
|
|
|
- <view class="screen-entry">自行车充电</view>
|
|
|
- <view class="screen-entry">交流慢充</view>
|
|
|
- <view class="screen-entry">直流快充</view>
|
|
|
+ <view
|
|
|
+ :class="{
|
|
|
+ active:selecttype==''
|
|
|
+ }" @click="selecttype=''"
|
|
|
+ class="screen-entry ">全部</view>
|
|
|
+ <view
|
|
|
+ :class="{
|
|
|
+ active:selecttype=='0'
|
|
|
+ }" @click="selecttype='0'"
|
|
|
+
|
|
|
+ class="screen-entry type1">自行车充电</view>
|
|
|
+ <view
|
|
|
+ :class="{
|
|
|
+ active:selecttype=='2'
|
|
|
+ }" @click="selecttype='2'"
|
|
|
+ class="screen-entry type3">交流慢充</view>
|
|
|
+ <view
|
|
|
+ :class="{
|
|
|
+ active:selecttype=='1'
|
|
|
+ }" @click="selecttype='1'"
|
|
|
+ class="screen-entry type2">直流快充</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="screen-item">
|
|
|
<view class="screen-head">站点</view>
|
|
|
<view class="screen-main">
|
|
|
- <view class="screen-entry active">全部</view>
|
|
|
- <view class="screen-entry">荆鹏</view>
|
|
|
- <view class="screen-entry">长大</view>
|
|
|
+ <view class="screen-entry "
|
|
|
+ :class="{
|
|
|
+ active:selectstationId==''
|
|
|
+ }"
|
|
|
+ @click="selectstationId=''"
|
|
|
+ >全部</view>
|
|
|
+ <view
|
|
|
+ v-for="(item,i) in stationList" :key="i"
|
|
|
+ :class="{
|
|
|
+ active:selectstationId==item.id
|
|
|
+ }"
|
|
|
+ @click="selectstationId=item.id,selectdeviceNo=''"
|
|
|
+ class="screen-entry" >{{item.name}}</view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="screen-item">
|
|
|
<view class="screen-head">桩号</view>
|
|
|
<view class="screen-main">
|
|
|
- <view class="screen-entry active">全部</view>
|
|
|
- <view class="screen-entry">A0001</view>
|
|
|
- <view class="screen-entry">B0001</view>
|
|
|
- <view class="screen-entry">A0003</view>
|
|
|
+
|
|
|
+ <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.id
|
|
|
+ }"
|
|
|
+
|
|
|
+ @click="selectdeviceNo=item.id"
|
|
|
+ class="screen-entry" >{{item.name}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="screen-foot">
|
|
|
- <view class="screen-btn-l">重置</view>
|
|
|
- <view class="screen-btn-r">确定</view>
|
|
|
+ <view class="screen-btn-l" @click="resetBtn" >重置</view>
|
|
|
+ <view class="screen-btn-r" @click="okbtn" >确定</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
<view class="detailed">
|
|
|
- <template v-for="(item ,index) in list" >
|
|
|
- <view class="detailed-time" :key="item.id" v-if="false">
|
|
|
- <p>2020年5月1日</p>
|
|
|
- <p>共收入 178.00</p>
|
|
|
- </view>
|
|
|
- <view class="detailed-list"
|
|
|
+
|
|
|
+
|
|
|
+ <view class="detailed-list" v-for="(item ,index) in list"
|
|
|
@click="gotoUrl('pagesFinance/detailed/details?id='+item.id)"
|
|
|
- :key="item.id">
|
|
|
+ :key="index">
|
|
|
+ <view class="detailed-time" v-if="item.show">
|
|
|
+ <p>{{item.showtime}}</p>
|
|
|
+ <p>共收入 {{showMap.get(item.showtime)}}</p>
|
|
|
+ </view>
|
|
|
+
|
|
|
<view class="detailed-item">
|
|
|
<view class="detailed-item-name">
|
|
|
<h4>{{item.stationName}}/{{item.deviceNo}}</h4>
|
|
|
<p>{{item.createTime}}</p>
|
|
|
</view>
|
|
|
<view class="detailed-item-num">
|
|
|
- <h2>{{item.shareProfitAmount}}</h2>
|
|
|
+ <h2>{{iswuye?item.costAmount:item.shareProfitAmount}}</h2>
|
|
|
<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </template>
|
|
|
+
|
|
|
|
|
|
</view>
|
|
|
<Tabbar :current="1"></Tabbar>
|
|
@@ -79,15 +125,28 @@
|
|
|
<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: "",
|
|
|
+
|
|
|
+ endTime: "",
|
|
|
+ selecttype:"",
|
|
|
+ selectstationId:"",
|
|
|
+ selectdeviceNo:"",
|
|
|
+ title:"",
|
|
|
+ iswuye:false,
|
|
|
form:{
|
|
|
|
|
|
},
|
|
|
- startDate:'',
|
|
|
- endDate:'',
|
|
|
+
|
|
|
pageIndex: 1,
|
|
|
recordsTotal: 0,
|
|
|
list: [],
|
|
@@ -116,11 +175,14 @@
|
|
|
customIcon: true,
|
|
|
},
|
|
|
],
|
|
|
+ showMap:null,
|
|
|
current: 0,
|
|
|
value: '',
|
|
|
type: 'select',
|
|
|
show: false,
|
|
|
border: true,
|
|
|
+ stationList:[],
|
|
|
+ stationListSon:[],
|
|
|
actionSheetList: [
|
|
|
{
|
|
|
text: '男'
|
|
@@ -143,35 +205,98 @@
|
|
|
this.myLoadmore();
|
|
|
}
|
|
|
},
|
|
|
+ onLoad() {
|
|
|
+ this.title="收益明细"
|
|
|
+ var obj=this.carhelp.getPersonInfoPlus("merchantUser");
|
|
|
+ if(obj&&obj.role){
|
|
|
+ var role=obj.role;
|
|
|
+ if(role.id=="4"){
|
|
|
+ this.title="电费明细"
|
|
|
+ this.iswuye=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
onReady() {
|
|
|
// this.startDate=parseUnixTime(beforeTimeStamp(5),"{y}-{m}-{d}")
|
|
|
// this.endDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
|
|
|
|
|
|
this.getList()
|
|
|
+ this.getStation()
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- getList(bl) {
|
|
|
+ changedate(e) {
|
|
|
+ this.startTime = e.startDate
|
|
|
+ this.endTime = e.endDate
|
|
|
+
|
|
|
+ },
|
|
|
+ resetBtn(){
|
|
|
+ this.startTime=""
|
|
|
+ this.endTime=""
|
|
|
+ this.selecttype=""
|
|
|
+ this.selectstationId=""
|
|
|
+ this.selectdeviceNo=""
|
|
|
+ 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(){
|
|
|
+ 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,
|
|
|
})
|
|
|
- if (bl) {
|
|
|
- this.list = [];
|
|
|
- this.pageIndex = 1;
|
|
|
- }
|
|
|
- var data = {
|
|
|
- // startDate:this.startDate,
|
|
|
- // endDate:this.endDate,
|
|
|
- pageIndex: this.pageIndex
|
|
|
- };
|
|
|
- API.incomeList(data).then((res) => {
|
|
|
+ this.form.pageIndex=this.pageIndex
|
|
|
+
|
|
|
+ API.incomeList(this.form).then((res) => {
|
|
|
|
|
|
this.list = [
|
|
|
...this.list,
|
|
|
...res.data.data
|
|
|
];
|
|
|
+ var showMap=new Map()
|
|
|
+ this.list.forEach(item=>{
|
|
|
+ var ktime=item.createTime.split(" ")[0]
|
|
|
+ if(showMap.has(ktime)){
|
|
|
+ item.show=false;
|
|
|
+
|
|
|
+
|
|
|
+ }else{
|
|
|
+ var Amount=this.iswuye?item.todayCostAmount:item.todaySPAmount
|
|
|
+
|
|
|
+ showMap.set(ktime,Amount)
|
|
|
+
|
|
|
+ item.show=true;
|
|
|
+ item.showtime=ktime;
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ this.showMap=showMap;
|
|
|
this.recordsTotal = res.data.recordsTotal
|
|
|
uni.hideLoading()
|
|
|
|
|
@@ -182,10 +307,25 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ getStation(bl) {
|
|
|
+
|
|
|
+ API.stationList().then((res) => {
|
|
|
+
|
|
|
+ this.stationList = res.data.stationList
|
|
|
+ this.stationListSon=res.data.deviceList
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+
|
|
|
+ title: error
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
myLoadmore() {
|
|
|
|
|
|
this.pageIndex += 1;
|
|
|
this.getList()
|
|
|
+
|
|
|
},
|
|
|
// 点击actionSheet回调
|
|
|
actionSheetCallback(index) {
|