oil-station/fuintAdmin/src/views/member/userInfoOrder/balanceRecord.vue

132 lines
4.3 KiB
Vue
Raw Normal View History

2023-11-30 11:48:14 +08:00
<template>
<div>
2023-11-30 18:30:46 +08:00
<el-radio-group v-model="tabPosition" size="mini" style="margin-bottom: 30px;">
<el-radio-button label="giftCard">储值卡记录</el-radio-button>
<el-radio-button label="literCard">升数卡记录</el-radio-button>
</el-radio-group>
<div v-if="tabPosition=='giftCard'">
2023-12-09 15:23:37 +08:00
<el-table ref="tables" v-loading="loading" :data="cardList">
<el-table-column align="center" prop="storeName" label="所属油站"/>
<!-- <el-table-column prop="date" label="变动账户"/> -->
<el-table-column align="center" prop="changeType" label="类型">
<template slot-scope="scope">
<el-tag v-if="scope.row.changeType == 0">减少</el-tag>
<el-tag type="success" v-else>增加</el-tag>
</template>
2023-11-30 18:30:46 +08:00
</el-table-column>
2023-12-09 15:23:37 +08:00
<el-table-column align="center" label="详细信息">
<el-table-column align="center" prop="balance" label="变动金额"/>
<el-table-column align="center" prop="address" label="变动前余额">
<template slot-scope="scope">
<span>{{ scope.row.afterTheChange?scope.row.afterTheChange + scope.row.balance : '/'}}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="afterTheChange" label="变动后余额">
<template slot-scope="scope">
<span>{{ scope.row.afterTheChange?scope.row.afterTheChange : '/'}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" prop="orderNo" label="订单号"/>
<el-table-column align="center" prop="fromType" label="描述"/>
<el-table-column align="center" prop="createTime" label="变动时间"/>
2023-11-30 18:30:46 +08:00
</el-table>
2023-11-30 11:48:14 +08:00
2023-11-30 18:30:46 +08:00
<pagination
2023-12-09 15:23:37 +08:00
:total="cardTotal"
:page.sync="queryCardParams.page"
:limit.sync="queryCardParams.pageSize"
@pagination="getCardList"
2023-11-30 18:30:46 +08:00
/>
</div>
<div v-else>
2023-12-09 15:23:37 +08:00
<el-table ref="tables2" v-loading="loading" :data="fuelList">
<el-table-column align="center" label="所属油站" prop="storeName"/>
<el-table-column align="center" label="变动账户" prop="oilType" />
<el-table-column label="类型" align="center" prop="changeType">
<template slot-scope="scope">
<el-tag v-if="scope.row.changeType == 0">减少</el-tag>
<el-tag type="success" v-else>增加</el-tag>
</template>
</el-table-column>
<el-table-column label="变动升数" align="center" prop="balance"/>
<el-table-column label="订单号" align="center" prop="orderNo"/>
<el-table-column label="描述" align="center" prop="fromType"/>
<el-table-column label="变动时间" align="center" prop="createTime"/>
2023-11-30 18:30:46 +08:00
</el-table>
<pagination
2023-12-09 15:23:37 +08:00
:total="fuelTotal"
:page.sync="queryFuelParams.page"
:limit.sync="queryFuelParams.pageSize"
@pagination="getFuelList"
2023-11-30 18:30:46 +08:00
/>
</div>
2023-11-30 11:48:14 +08:00
</div>
</template>
<script>
2023-12-09 15:23:37 +08:00
import { getCardRecordList, getFuelRecordList } from "@/api/userInfoOrder.js";
2023-11-30 11:48:14 +08:00
export default {
2023-11-30 18:30:46 +08:00
props:["pUserId"],
data(){
return {
tabPosition: 'giftCard',
userId:"",
loading:false,
list:[],
2023-12-09 15:23:37 +08:00
cardList:[],
fuelList:[],
cardTotal:0,
fuelTotal:0,
queryCardParams:{
page:1,
pageSize:10,
},
queryFuelParams:{
2023-11-30 18:30:46 +08:00
page:1,
pageSize:10,
}
}
},
created() {
2023-12-09 15:23:37 +08:00
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
this.getCardList()
this.getFuelList()
2023-11-30 18:30:46 +08:00
},
methods:{
2023-12-09 15:23:37 +08:00
getCardList() {
this.loading = true
this.queryCardParams.userId = this.userId
getCardRecordList(this.queryCardParams).then(res=>{
if (res.code == 200) {
this.cardList = res.data.records
this.cardTotal = res.data.total
this.loading = false
}
})
},
2023-11-30 11:48:14 +08:00
2023-12-09 15:23:37 +08:00
getFuelList() {
this.loading = true
this.queryFuelParams.userId = this.userId
getFuelRecordList(this.queryFuelParams).then(res=>{
if (res.code == 200) {
this.fuelList = res.data.records
this.fuelTotal = res.data.total
this.loading = false
}
})
2023-11-30 18:30:46 +08:00
}
}
2023-11-30 11:48:14 +08:00
}
</script>
<style lang="scss" scoped>
</style>