plus-ui/src/views/act/couponActivity/receiveList.vue

88 lines
2.8 KiB
Vue
Raw Normal View History

<template>
<el-dialog title="领取记录" v-model="open" width="80%" append-to-body>
<el-form :model="queryParams" :inline="true" label-width="100px" size="default" class="ry_form">
<el-form-item label="使用状态" prop="useStatus">
2025-06-05 09:42:18 +08:00
<DictRadio v-model="queryParams.useStatus" @change="handleQuery" size="small" radioData="activity_coupon_status" :showAll="'all'" />
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableList" border>
2025-06-05 09:42:18 +08:00
<el-table-column label="券ID" prop="id" />
<el-table-column label="用户信息 ">
<template v-slot="scope">
<div class="flex-center">
<el-avatar :src="scope.row.avatar"></el-avatar>
<div class="tl ml5">
2025-06-05 09:42:18 +08:00
<p>{{ scope.row.nickname }}</p>
<p>{{ scope.row.phone }}</p>
</div>
</div>
</template>
</el-table-column>
2025-06-05 09:42:18 +08:00
<el-table-column label="领取时间" prop="createTime" width="180" />
<el-table-column label="使用状态">
<template v-slot="scope">
<dict-tag :value="scope.row.useStatus" prop-name="activity_coupon_status" />
</template>
</el-table-column>
2025-06-05 09:42:18 +08:00
<el-table-column label="有效期" width="180">
<template v-slot="scope">
<p>{{ scope.row.beginTime }}</p>
<p>~</p>
<p>{{ scope.row.endTime }}</p>
</template>
</el-table-column>
2025-06-05 09:42:18 +08:00
<el-table-column label="订单号" prop="orderId" />
<el-table-column label="使用时间" prop="useTime" width="180" />
</el-table>
2025-06-05 09:42:18 +08:00
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-dialog>
</template>
<script>
2025-06-05 09:42:18 +08:00
import { listMemberCoupon } from '@/api/act/memberCoupon';
export default {
dicts: ['activity_coupon_status'],
2025-06-05 09:42:18 +08:00
data() {
return {
open: false,
loading: false,
tableList: [],
queryParams: {
pageNum: 1,
pageSize: 10,
useStatus: null,
2025-06-05 09:42:18 +08:00
couponActivityId: null
},
2025-06-05 09:42:18 +08:00
total: 0
};
},
2025-06-05 09:42:18 +08:00
methods: {
async init(activityId) {
if (!activityId) {
2025-06-05 09:42:18 +08:00
return;
}
2025-06-05 09:42:18 +08:00
this.queryParams.couponActivityId = activityId;
await this.handleQuery();
this.open = true;
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
getList() {
this.loading = true;
2025-06-05 09:42:18 +08:00
const { pageNum, pageSize } = this.queryParams;
const query = { ...this.queryParams, pageNum: undefined, pageSize: undefined };
const pageReq = { page: pageNum - 1, size: pageSize };
return listMemberCoupon(query, pageReq).then((response) => {
const { content, totalElements } = response;
this.tableList = content;
this.total = totalElements;
this.loading = false;
});
2025-06-05 09:42:18 +08:00
}
}
2025-06-05 09:42:18 +08:00
};
</script>