payFeeCoupon.vue
1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<template>
<el-card v-if="feeCoupons.length > 0">
<div slot="header" class="flex justify-between">
<span>{{ $t('payFeeCoupon.couponInfo') }}</span>
</div>
<el-table :data="feeCoupons" border style="width: 100%">
<el-table-column prop="ruleName" align="center" :label="$t('payFeeCoupon.ruleName')" />
<el-table-column prop="couponName" align="center" :label="$t('payFeeCoupon.couponName')" />
<el-table-column prop="quantity" align="center" :label="$t('payFeeCoupon.quantity')">
<template slot-scope="scope">
{{ scope.row.quantity }}{{ $t('payFeeCoupon.unit') }}
</template>
</el-table-column>
<el-table-column prop="toTypeName" align="center" :label="$t('payFeeCoupon.purpose')" />
</el-table>
</el-card>
</template>
<script>
import { getCommunityId } from '@/api/community/communityApi'
import { computePayFeeCoupon } from '@/api/fee/payFeeOrderApi'
export default {
name: 'PayFeeCoupon',
data() {
return {
dialogVisible: false,
feeCoupons: [],
feeId: '',
communityId: '',
cycles: 1,
endTime: ''
}
},
methods: {
open(params) {
this.feeId = params.feeId
this.cycles = params.cycles || 1
this.endTime = params.endTime || ''
this.listFeeCoupons()
},
close() {
this.dialogVisible = false
},
async listFeeCoupons() {
try {
this.communityId = await getCommunityId()
const params = {
page: 1,
row: 20,
feeId: this.feeId,
communityId: this.communityId,
cycles: this.cycles,
endTime: this.endTime
}
const response = await computePayFeeCoupon(params)
this.feeCoupons = response.data || []
} catch (error) {
console.error('查询优惠券信息失败:', error)
}
},
handleClose() {
this.feeCoupons = []
}
}
}
</script>
<style scoped>
.el-table {
margin-top: 20px;
}
</style>