index.vue
9.74 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<!-- -->
<template>
<div style="padding: 0 10px;background-color:#f7f7f7;">
<div class="commonActivityPage">
<div class="acTab">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="全部" name="1" />
<el-tab-pane label="我参与的" name="2" />
</el-tabs>
<el-radio-group v-model="formInline.signType" @change="signTypeChange">
<el-radio-button :label="1">平台优惠券</el-radio-button>
<el-radio-button :label="2">平台秒杀</el-radio-button>
<el-radio-button :label="3">平台限时折扣</el-radio-button>
</el-radio-group>
</div>
<!-- 搜索 -->
<FixedNav
class="toolbar"
:height="260"
>
<div style="width:80%;display:flex;padding:20px 0;">
<div class="searchItem">
<span>活动名称:</span>
<el-input v-model="formInline.activityName" placeholder="请输入活动名称" style="width:168px;margin-right:15px;" />
</div>
<div class="searchItem">
<span>活动状态:</span>
<el-select v-model="formInline.state" placeholder="请选择活动状态" clearable style="width:168px;margin-right:15px;">
<el-option label="报名未开始" value="0" />
<el-option label="报名进行中" value="1" />
<el-option label="活动待开始" value="2" />
<el-option label="活动进行中" value="3" />
<el-option label="活动已结束" value="4" />
</el-select>
</div>
<div class="searchItem">
<span>审核状态:</span>
<el-select v-model="formInline.examineState" placeholder="请选择审核状态" clearable style="width:168px;margin-right:15px;">
<el-option label="待审核" value="0" />
<el-option label="报名成功" value="1" />
<el-option label="报名失败" value="2" />
</el-select>
</div>
</div>
<div>
<el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
<el-button class="buttonHover"
style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="clear">重置</el-button>
</div>
</FixedNav>
<!-- 表格 -->
<div class="tableBox">
<el-table
ref="multipleTable"
:data="tableData"
:header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
tooltip-effect="dark"
>
<el-table-column prop="activityName" label="活动名称" show-overflow-tooltip />
<el-table-column prop="bondMoney" label="活动保证金" show-overflow-tooltip />
<el-table-column prop="signTime" label="报名时间" width="300" />
<el-table-column prop="activityTime" label="活动时间" width="300" />
<el-table-column label="活动优惠" show-overflow-tooltip>
<template slot-scope="scope">
<div v-if="scope.row.discountProgramme == 1">满减</div>
<div v-if="scope.row.discountProgramme == 2">优惠券</div>
<div>{{ scope.row.details }}</div>
</template>
</el-table-column>
<el-table-column prop="activityIntroduce" label="活动简介" show-overflow-tooltip />
<el-table-column label="活动状态" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.state == 0">报名未开始</span>
<span v-if="scope.row.state == 1">报名进行中</span>
<span v-if="scope.row.state == 2">活动待开始</span>
<span v-if="scope.row.state == 3">活动进行中</span>
<span v-if="scope.row.state == 4">活动已结束</span>
</template>
</el-table-column>
<el-table-column label="报名状态" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.signState == 0">待审核</span>
<span v-if="scope.row.signState == 1">报名成功</span>
<span v-if="scope.row.signState == 2">报名失败</span>
<span v-if="scope.row.signState == null">未报名</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" show-overflow-tooltip width="220">
<template slot-scope="scope">
<div class="btnList">
<div
v-if="scope.row.operation === 1"
class="tableBtn greens"
@click="getTotal(scope.row,1)"
>立即报名</div>
<div
v-if="scope.row.operation === 2"
class="tableBtn greens"
disabled
@click="getTotal(scope.row,1)"
>立即报名</div>
<div
v-if="scope.row.operation === 4"
class="tableBtn greens"
@click="getTotal(scope.row,1)"
>重新报名</div>
<div
v-if="scope.row.operation === 5"
class="tableBtn greens"
@click="getTotal(scope.row,1)"
>继续报名</div>
<div v-if="scope.row.operation === 3" @click="goActiveData(scope.row)" class="tableBtn greens">活动数据</div>
</div>
</template>
</el-table-column>
</el-table>
<div class="fenye">
<el-pagination
:current-page="formInline.page"
:page-sizes="[10, 20, 50, 100]"
:page-size="10"
background
small
layout="prev, pager, next,total"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</div>
<el-dialog
title="活动报名"
:visible.sync="signVisible"
width="80%"
center
custom-class="bian_css"
:close-on-click-modal="false"
@close="closeDialog"
>
<SignActivity
ref="signActivity"
:form="form"
@cancel="goList"
/>
</el-dialog>
<el-dialog
title="活动报名"
:visible.sync="detailVisible"
width="80%"
center
custom-class="bian_css"
:close-on-click-modal="false"
>
<DataActivity
:form="form"
@cancel="detailVisible = false"
/>
</el-dialog>
</div>
</div>
</template>
<script>
import FixedNav from '@/components/FixedNav/index.vue'
import SignActivity from '@/views/active/getActive.vue'
import DataActivity from '@/views/active/activeData.vue'
import { activityGetAll } from '@/api/active'
export default {
components: {
FixedNav,
SignActivity,
DataActivity
},
data() {
return {
activeName: '1',
formInline: {
type: 1, // 查询类型 1-全部 2-我参与的
activityName: '', // 活动名称
state: '',
examineState: '',
page: 1,
pageSize: 10,
signType: 1
},
total: 1,
tableData: [],
signVisible: false,
form: {},
detailVisible: false,
active: 1
}
},
mounted() {
this.getAll(this.formInline)
},
methods: {
closeDialog() {
console.log(this.$refs.signActivity, 'this.$refs.signActivity')
this.$refs.signActivity.reset()
},
goList() {
console.log('122121212')
this.signVisible = false
this.getAll(this.formInline)
},
//
signTypeChange() {
this.getAll(this.formInline)
},
handleSizeChange(val) {
this.formInline.pageSize = val
this.getAll(this.formInline)
},
handleCurrentChange(val) {
this.formInline.page = val
this.getAll(this.formInline)
},
// 活动切换
handleClick(tab, event) {
this.formInline.type = parseInt(tab.name)
if (tab.name === '2') {
this.getAll(this.formInline)
} else {
this.getAll(this.formInline)
}
},
// 查询
search() {
this.total = 1
this.formInline.page = 1
this.getAll(this.formInline)
},
// 清除
clear() {
this.activeName = '1'
this.formInline = {
activityName: '', // 活动名称
state: '',
examineState: '',
page: 1,
pageSize: 10
}
this.getAll(this.formInline)
},
// 立即报名
getTotal(row, index) {
this.active = 1
this.signVisible = true
this.form = {
activityId: row.activityId,
bondMoney: row.bondMoney,
type: index,
ifBond: row.ifBond,
signType: row.signType
}
},
// 活动数据
goActiveData(row) {
this.form = {
activityName: row.activityName,
activityId: row.activityId,
signId: row.signId
}
this.detailVisible = true
},
// 初始化查询所有数据
async getAll(formInline) {
const res = await activityGetAll(formInline)
this.tableData = res.data.list
this.total = res.data.total
},
// 查看
seeMore() {},
// 编辑
edit() {},
// 删除
del() {}
}
}
</script>
<style lang='scss' scoped>
//@import url(); 引入公共css类
@import url("../../styles/elDialog.scss");
.commonActivityPage{
padding: 0 20px 20px 20px;
background-color:#fff;
}
.toolbar {
display: flex;
width: 100%;
font-size: 14px;
justify-content: space-between;
}
::v-deep .el-pagination__total {
position: absolute;
left: 10px;
}
.fenye{
display: flex;
justify-content: flex-end;
}
</style>