oil-station/gasStation-uni/pagesMy/fleetInfo/fund.vue

417 lines
9.4 KiB
Vue
Raw Normal View History

2024-09-23 17:39:15 +08:00
<template>
<view class="centenr">
<view class="Candywrapper">
<view class="tab-box">
<view class="tab_" :class="{active:index== type }" @click="getindex(index)"
v-for="(item,index) in tabs" :key="index">
{{ item.name }}
</view>
</view>
<view v-if="type==0">
2024-09-24 09:56:46 +08:00
<view class="card_box c-url">
2024-09-23 17:39:15 +08:00
<view style="margin: 13px 0px;">可用余额</view>
2024-09-29 18:02:39 +08:00
<view class="r-num">{{fleetBalance}}</view>
2024-09-23 17:39:15 +08:00
</view>
<view class="tab-bs">
<view class="w_box" @click="show1 = true">类型筛选 <u-icon name="arrow-down-fill"></u-icon> </view>
<view class="w_box" @click="show = true">全部时间 <u-icon name="arrow-down-fill"></u-icon> </view>
</view>
2024-09-29 18:02:39 +08:00
<view class="bai_box" v-for="item in pointsList">
2024-09-23 17:39:15 +08:00
<view class="left-img">
<!-- <image src="../../static/icon/hyxf.png" mode=""></image> -->
<image src="../../static/icon/jfdh.png" mode=""></image>
</view>
<view style="width: 85%;">
<view class="right-box">
2024-09-29 18:02:39 +08:00
<view class="l-text">{{item.fromType}}</view>
<view class="r-text">{{item.cardPaymentAmount}}</view>
2024-09-23 17:39:15 +08:00
</view>
<view class="right-box">
<view class="">储值卡</view>
2024-09-29 18:02:39 +08:00
<view class="">余额{{item.afterTheChange}}</view>
2024-09-23 17:39:15 +08:00
</view>
<view class="right-box">
2024-09-29 18:02:39 +08:00
<view class="">{{item.storeName}}</view>
<view class="">{{item.paymentTime}}</view>
2024-09-23 17:39:15 +08:00
</view>
</view>
</view>
<u-datetime-picker :show="show" v-model="value1" mode="year-month" @cancel="cancel1"
@confirm="confirm1"></u-datetime-picker>
2024-09-29 18:02:39 +08:00
<u-picker :show="show1" :columns="columnsBalance" keyName="label" @cancel="cancel" @confirm="confirmBalance"></u-picker>
2024-09-23 17:39:15 +08:00
</view>
<view v-if="type==1">
<view class="tab-bs">
<view class="w_box" @click="show1 = true">类型筛选 <u-icon name="arrow-down-fill"></u-icon> </view>
<view class="w_box" @click="show = true">全部时间 <u-icon name="arrow-down-fill"></u-icon> </view>
</view>
2024-09-29 18:02:39 +08:00
<view class="bai_box" v-for=" item in pointsList">
2024-09-23 17:39:15 +08:00
<view class="left-img">
<image src="../../static/icon/hyxf.png" mode=""></image>
</view>
<view style="width: 85%;">
<view class="right-box">
2024-09-29 18:02:39 +08:00
<view class="l-text" v-if="item.adjustType == 0">额度增加</view>
<view class="l-text" v-else>额度扣除</view>
<view class="r-text">
<span v-if="item.adjustType == 0">+</span>
<span v-else>-</span>
{{item.adjustLimit}}
</view>
2024-09-23 17:39:15 +08:00
</view>
<view class="right-box">
2024-09-29 18:02:39 +08:00
<view class="">{{item.userName}}</view>
<view class="">当前额度{{item.remainingCreditLimit}}</view>
2024-09-23 17:39:15 +08:00
</view>
<view class="right-box">
2024-09-29 18:02:39 +08:00
<view class="">操作人{{item.createName}}</view>
<view class="">{{item.createTime}}</view>
2024-09-23 17:39:15 +08:00
</view>
</view>
</view>
<!-- <view v-if="!pointsList || pointsList.length==0">
<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
</view> -->
<u-datetime-picker :show="show" v-model="value1" mode="year-month" @cancel="cancel1"
@confirm="confirm1"></u-datetime-picker>
2024-09-29 18:02:39 +08:00
<u-picker :show="show1" :columns="columns" keyName="label" @cancel="cancel"
@confirm="confirm"></u-picker>
2024-09-23 17:39:15 +08:00
</view>
</view>
</view>
</template>
<script>
import request from '../../utils/request'
export default {
data() {
return {
tabs: [{
name: '余额明细',
}, {
name: '额度明细',
}, ],
type: 0,
query: {
chainStoreId: '',
couponType: '',
useStatus: 0,
pageNo: 1,
pageSize: 10
},
cardBalance: {},
show: false,
show1: false,
value1: Number(new Date()),
2024-09-29 18:02:39 +08:00
fleetBalance:0,
2024-09-23 17:39:15 +08:00
columns: [
2024-09-29 18:02:39 +08:00
[{
label: '全部类型',
type: null
}, {
label: '额度增加',
type: 0
}, {
label: '额度扣除',
type: 1
}]
],
columnsBalance: [
[{
label:'全部类型',
type:null
}, {
label:'油品'
}, {
label:'积分兑换'
}, {
label:"会员充值"
}]
2024-09-23 17:39:15 +08:00
],
queryParams: {
pageNo: 1,
pageSize: 30,
type: "",
storeId: uni.getStorageSync("storeId"),
changeReason: "",
2024-09-29 18:02:39 +08:00
fleetId: "",
2024-09-23 17:39:15 +08:00
startTime: ""
},
pointsList: [],
2024-09-29 15:36:53 +08:00
total: 0,
2024-09-29 18:02:39 +08:00
fleetId: '',
storeId: ''
2024-09-23 17:39:15 +08:00
}
},
2024-09-29 15:36:53 +08:00
onLoad(e) {
2024-09-29 18:02:39 +08:00
this.queryParams.fleetId = e.fleetId
// console.log('this.fleetId', this.fleetId);
this.storeId = uni.getStorageSync("storeId"),
this.getFleetBalance()
2024-09-29 15:36:53 +08:00
},
2024-09-23 17:39:15 +08:00
onShow() {
this.query.chainStoreId = uni.getStorageSync('chainStoreId');
this.getUserBalance()
this.getList()
},
onPullDownRefresh() {
console.log("刷新");
this.pointsList = []
this.queryParams = {
pageNo: 1,
pageSize: 30,
type: "",
storeId: uni.getStorageSync("storeId"),
changeReason: "",
startTime: ""
}
this.getList()
},
onReachBottom() {
// 触底加载
if (this.pointsList.length < this.total) {
this.queryParams.pageNo++
this.getList()
}
},
methods: {
getindex(index) {
this.type = index
2024-09-29 18:02:39 +08:00
if (index == 1) {
this.getFleetLinesChange()
} else if (index == 0) {
this.getList()
}
2024-09-23 17:39:15 +08:00
},
// 获取余额信息
getUserBalance() {
request({
url: '/business/userManager/user/getUserBalanceApplet',
method: 'get',
params: this.query
}).then(res => {
if (res.code == 200) {
this.cardBalance = res.data
}
})
},
2024-09-29 18:02:39 +08:00
//获取车队金额
getFleetBalance(){
request({
url: '/fleetInfo/' + this.queryParams.fleetId,
method: 'get',
// params: this.query
}).then(res => {
if (res.code == 200) {
this.fleetBalance = res.data.totalBalance
}
})
},
//获取额度
getFleetLinesChange() {
request({
url: '/fleetLinesChange/queryByPageUni',
method: 'get',
params: this.queryParams
}).then(res => {
if (res.code == 200) {
this.pointsList = res.data.records,
this.total = res.data.total
}
})
},
2024-09-23 17:39:15 +08:00
getList() {
2024-09-29 18:02:39 +08:00
console.log('this.queryParams:', this.queryParams);
2024-09-23 17:39:15 +08:00
request({
2024-09-29 18:02:39 +08:00
url: '/fleetConsumeRecord/queryByPageUni',
2024-09-23 17:39:15 +08:00
method: 'get',
params: this.queryParams
}).then(res => {
if (res.code == 200) {
this.pointsList = res.data.records
this.total = res.data.total
}
})
},
confirm(e) {
this.queryParams.pageNo = 1
2024-09-29 18:02:39 +08:00
console.log("获取的e:", e);
2024-09-23 17:39:15 +08:00
if (e.value[0] == '全部类型') {
2024-09-29 18:02:39 +08:00
this.queryParams.adjustType = null
2024-09-23 17:39:15 +08:00
} else {
2024-09-29 18:02:39 +08:00
this.queryParams.adjustType = e.value[0].type
}
this.getFleetLinesChange()
this.show1 = false
},
confirmBalance(e) {
this.queryParams.pageNo = 1
console.log("获取的e:", e);
if (e.value[0] == '全部类型') {
this.queryParams.formType = null
} else {
this.queryParams.formType = e.value[0].type
2024-09-23 17:39:15 +08:00
}
this.getList()
this.show1 = false
},
cancel() {
this.show1 = false
},
timestampToString(timestamp) {
// 将时间戳转换为Date对象
const date = new Date(timestamp);
// 使用toLocaleDateString和toLocaleTimeString可以根据本地格式转换日期和时间
const dateString = date.toLocaleDateString()
const timeString = date.toLocaleTimeString();
// 返回日期和时间的组合
return date.getFullYear() + '-' + (date.getMonth() + 1);
},
confirm1(e) {
this.queryParams.startTime = this.timestampToString(e.value)
this.queryParams.pageNo = 1
2024-09-29 18:02:39 +08:00
this.getFleetLinesChange()
2024-09-23 17:39:15 +08:00
this.show = false
},
cancel1() {
this.show = false
}
}
}
</script>
<style scoped lang="scss">
.centenr {
width: 100%;
height: 100vh;
background: #F9F9F9;
}
.Candywrapper {
background: #F9F9F9;
box-sizing: border-box;
padding: 10px;
}
.card_box {
width: 100%;
height: 90px;
2024-09-24 09:56:46 +08:00
2024-09-23 17:39:15 +08:00
box-sizing: border-box;
padding: 10px;
color: #fff;
font-size: 14px;
}
2024-09-24 09:56:46 +08:00
.c-url {
background: url('../../static/imgs/jf.png') no-repeat;
background-size: 100% 100%;
}
2024-09-23 17:39:15 +08:00
.r-size {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
.r-num {
font-weight: 600;
font-size: 20px;
color: #FFFFFF;
}
.tab-bs {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
margin: 15px auto;
}
.w_box {
width: 50%;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 15px;
}
.bai_box {
width: 100%;
box-sizing: border-box;
padding: 15px 10px;
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
}
.left-img {
margin-right: 10px;
image {
width: 40px;
height: 40px;
}
}
.right-box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 12px;
color: #666666;
}
.l-text {
font-size: 16px;
color: #333333;
margin-bottom: 5px;
font-weight: bold;
}
.r-text {
font-size: 16px;
color: #333333;
margin-bottom: 5px;
font-weight: bold;
}
.tab-box {
width: 100%;
height: 40px;
background: #fff;
display: flex;
box-sizing: border-box;
margin-bottom: 25px;
justify-content: center;
}
.tab_ {
width: 75px;
height: 100%;
//border-bottom: 2px solid #FF770F;
display: flex;
font-weight: 500;
font-size: 14px;
color: #999999;
align-items: center;
justify-content: center;
margin-left: 50px;
cursor: pointer;
}
.active {
border-bottom: 2px solid #FF770F !important;
color: #FF770F !important;
}
</style>