index.vue
6.44 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<!-- 搜索 -->
<el-select v-model="searchObj.vipType" filterable class="filter-item" clearable size="mini" placeholder="请选择VIP类型">
<el-option
v-for="item in vipTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select v-model="searchObj.status" filterable class="filter-item" clearable size="mini" placeholder="请选择状态">
<el-option
v-for="item in statusList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<!-- <el-select v-model="searchObj.channel" filterable class="filter-item" clearable size="mini" placeholder="请选择渠道">
<el-option
v-for="item in dictMap.channel"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
<el-select v-model="searchObj.region" filterable class="filter-item" clearable size="mini" placeholder="请选择地区">
<el-option
v-for="item in dictMap['region']"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-input v-model="searchObj.channel" clearable size="small" placeholder="请输入渠道" style="width: 200px;" class="filter-item" />
<el-input v-model="searchObj.cardNum" clearable size="small" placeholder="请输入卡号" style="width: 200px;" class="filter-item" />
<el-input v-model="searchObj.batch" clearable size="small" placeholder="请输入批次(数字)" style="width: 200px;" class="filter-item" />
<el-input v-model="searchObj.rcvMobile" clearable size="small" placeholder="请输入手机号" style="width: 200px;" class="filter-item" />
<poly-search :query-type-options="queryTypeOptions" @toQuery="searchQuery" />
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="getSmallSellList('reset')">搜索</el-button>
</div>
</div>
<!--表格渲染-->
<el-table
v-loading="loading"
:max-height="tableHeight"
:data="smallSellList"
>
<el-table-column label="ID" width="125px" prop="id" />
<el-table-column label="vip类型" width="125px" prop="vipType">
<template slot-scope="scope">
<span v-if="Number(scope.row.vipType) === 1">爱奇艺包月</span>
<span v-if="Number(scope.row.vipType) === 4">爱奇艺包年</span>
</template>
</el-table-column>
<el-table-column label="卡号" width="125px" prop="cardNum" />
<el-table-column label="卡密" width="125px" prop="cardKey" />
<el-table-column label="vip类型" width="125px" prop="status">
<template slot-scope="scope">
<span v-if="Number(scope.row.status) === 0">未兑换</span>
<span v-if="Number(scope.row.status) === 1">已兑换</span>
<span v-if="Number(scope.row.status) === 2">兑换失败</span>
<span v-if="Number(scope.row.status) === 3">已失效</span>
</template>
</el-table-column>
<el-table-column label="地区" width="125px" prop="region" />
<el-table-column label="渠道" width="125px" prop="channel" />
<el-table-column label="批次" width="125px" prop="batch" />
<el-table-column label="产品id" width="125px" prop="productId" />
<el-table-column label="产品" width="125px" prop="productName" />
<el-table-column label="大屏账号" width="125px" prop="account" />
<el-table-column label="订单号" width="125px" prop="bossOrderNo" />
<el-table-column label="备注" width="125px" prop="remark" />
<el-table-column label="领取手机号" width="125px" prop="rcvMobile" />
</el-table>
<el-pagination
:page-size.sync="searchObj.size"
:total="total"
:current-page.sync="searchObj.page"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="changeSize"
@current-change="changePage"
/>
</div>
</template>
<script>
import aiqiyi from '@/api/aiqiyi/aiqiyi'
import polySearch from '@/components/polySearch/index'
import initDict from '@/mixins/initDict'
export default {
name: 'AiqiyiVipCard',
components: { polySearch },
mixins: [initDict],
data() {
return {
loading: false,
smallSellList: [],
queryTypeOptions: [
{ key: 'account', display_name: '大屏账号' },
{ key: 'bossOrderNo', display_name: '订单号' }
],
vipTypeList: [{ label: '爱奇艺包月', value: '1' }, { label: '爱奇艺包年', value: '4' }],
statusList: [{ label: '未兑换', value: '0' }, { label: '已兑换', value: '1' }, { label: '兑换失败', value: '2' }, { label: '已失效', value: '3' }],
total: 0,
tableHeight: 800,
searchObj: {
page: 0,
size: 20,
vipType: '',
cardNum: '',
status: '',
region: '',
channel: '',
batch: '',
account: '',
bossOrderNo: '',
rcvMobile: '',
userId: this.$store.state.user.user.id
}
}
},
created() {
this.$nextTick(() => {
this.getDictMap('region')
this.getSmallSellList()
})
},
mounted() {
this.$nextTick(() => {
this.tableHeight = window.innerHeight - (window.innerWidth < 1200 ? 280 : 260)
})
},
methods: {
searchQuery(e) {
console.log(e)
this.queryTypeOptions.forEach(item => {
this.searchObj[item.key] = ''
})
this.searchObj[e.type] = e.value
},
getSmallSellList(type) {
if (type === 'reset') {
this.searchObj.page = 0
}
this.loading = true
aiqiyi.getSmallSellList(this.searchObj).then(res => {
this.loading = false
this.smallSellList = res.content
this.total = res.totalElements
}).catch(() => {
this.smallSellList = []
this.total = 0
this.loading = false
})
},
changePage(e) {
console.log(e)
this.searchObj.page = e
this.getSmallSellList()
},
changeSize(e) {
console.log(e)
this.searchObj.page = 0
this.searchObj.size = e
this.getSmallSellList()
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>