oil-station/fuintCashierWeb/src/views/details/userInfoOrder/oilStorageCard.vue
DESKTOP-369JRHT\12997 78effe2560 10.8
2024-10-08 17:58:32 +08:00

130 lines
3.7 KiB
Vue

<template>
<div>
<el-table ref="tables2" key="2" v-loading="loading" :data="fuelList">
<el-table-column align="center" label="所属油站" prop="storeName">
<template slot-scope="scope">
<span>{{store.name}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="油品类型" >
<template slot-scope="scope">
<span> {{scope.row.type?scope.row.type:' -- '}}</span>
</template>
</el-table-column>
<el-table-column label="类型" align="center">
<template slot-scope="scope">
<el-tag type="danger" v-if="scope.row.changeType === '0'">消费</el-tag>
<el-tag type="success" v-else-if="scope.row.changeType === '1' ">充值</el-tag>
<el-tag type="success" v-else>--</el-tag>
</template>
</el-table-column>
<el-table-column label="变动升数" align="center" prop="oilBalance">
<template slot-scope="scope">
<span>{{scope.row.oilBalance?scope.row.oilBalance:"--"}}</span>
</template>
</el-table-column>
<el-table-column label="变动之后升数" align="center" prop="afterOilChange">
<template slot-scope="scope">
<span>{{scope.row.afterOilChange?scope.row.afterOilChange:"--"}}</span>
</template>
</el-table-column>
<el-table-column label="订单号" align="center" prop="orderNo"/>
<el-table-column label="描述" align="center" prop="fromType"/>
<el-table-column label="变动时间" align="center" prop="createTime"/>
</el-table>
<pagination
:total="fuelTotal"
:page.sync="queryFuelParams.page"
:limit.sync="queryFuelParams.pageSize"
@pagination="getFuelList"
/>
</div>
</template>
<script>
import {getCardRecordList, getFuelRecordList} from "@/api/cashier/userInfoOrder";
import {listCardBalanceRecord, listCardOilRecord} from "@/api/cashier/balancecardrecord";
import {ljStoreInfo} from "@/api/cashier/user/store";
export default {
props:["pUserId"],
data(){
return {
tabPosition: 'giftCard',
userId:"",
loading:false,
list:[],
cardList:[],
fuelList:[],
cardTotal:0,
fuelTotal:0,
queryCardParams:{
page:1,
pageSize:10,
},
queryFuelParams:{
page:1,
pageSize:10,
},
store:{}
}
},
created() {
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
this.getCardList()
this.getFuelList()
this.getStoreInfo()
},
methods:{
// 获取店铺信息
getStoreInfo(){
ljStoreInfo().then(res => {
this.store = res.data
})
},
changeCard(val){
console.log(val,this.tabPosition)
},
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
}
})
},
getFuelList() {
this.loading = true
this.queryFuelParams.userId = this.userId
listCardOilRecord(this.queryFuelParams).then(res=>{
if (res.code == 200) {
this.fuelList = res.data.records
this.fuelTotal = res.data.total
this.loading = false
}
})
// getFuelRecordList(this.queryFuelParams).then(res=>{
// if (res.code == 200) {
// this.fuelList = res.data.records
// this.fuelTotal = res.data.total
// this.loading = false
// }
// })
}
}
}
</script>
<style lang="scss" scoped>
</style>