capitalpool.vue
9.22 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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<template>
<div style="background-color:#f7f7f7;padding:10px 10px;">
<div class="couponPage">
<div style="height:58px;line-height:58px;">
<div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span style="color:#000000e6">资金池</span></div>
</div>
<!-- 搜索 -->
<div class="formSearch">
<!-- 搜索条件 -->
<el-form :inline="true" :model="query" class="demo-form-inline">
<el-form-item label="名称">
<el-input v-model="query.activityName" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="状态">
<el-select v-model="query.state" placeholder="请选择状态">
<el-option
v-for="item in activityStatusSelect"
:key="item.index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<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>
</div>
<div style="margin: 0 0 20px 0;">
<el-button icon="el-icon-circle-plus-outline"
style="background-color: #3F9B6A;color: #fff;" @click="addActivity">新建活动</el-button>
</div>
<!-- 表格 -->
<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 label="资金池名称" width="220">
<template slot-scope="scope">{{ scope.row.poolName }}</template>
</el-table-column>
<el-table-column label="出资方" width="220">
<template slot-scope="scope">{{ scope.row.contributor }}</template>
</el-table-column>
<el-table-column label="总金额" width="220">
<template slot-scope="scope">{{ scope.row.totalAmount }}</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
<span v-if="scope.row.fundsStatus == '0'">未启用</span>
<span v-if="scope.row.fundsStatus == '1'">启用中</span>
<span v-if="scope.row.fundsStatus == '2'">已关闭</span>
</template>
</el-table-column>
<!-- <el-table-column label="操作" show-overflow-tooltip>
<template slot-scope="scope">
<div class="btnList">
<div class="tableBtn greens" @click="details(scope.row)">详情</div>
<div v-if="scope.row.state != 4" class="tableBtn greens" @click="editActivity(scope.row)">编辑</div>
<div v-if="scope.row.state != 4" class="tableBtn greens" @click="endActivity(scope.row)">结束</div>
<div v-if="scope.row.state == 4" class="tableBtn greens" @click="delActivity(scope.row)">删除</div>
</div>
</template>
</el-table-column> -->
</el-table>
<div class="fenye">
<el-pagination
:current-page="query.pageNumber"
: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="editForm ? '修改资金池' : '新增资金池'"
:visible.sync="activityVisible"
width="500px"
center
:close-on-click-modal="false"
@close="closeModal">
<el-form ref="activityForm" :model="activityForm" label-width="100px">
<el-form-item label="资金池名称:">
<el-input v-model="activityForm.poolName" placeholder="请输入资金池名称" />
</el-form-item>
<el-form-item label="出资方:">
<el-input v-model="activityForm.contributor" placeholder="请输入出资方" />
</el-form-item>
<el-form-item label="总金额:">
<el-input v-model="activityForm.activityName" placeholder="请输入总金额" />
</el-form-item>
</el-form>
<div class="footer">
<div class="btn_list">
<span @click="cancel" class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span>
<span @click="save" style="background-color: #3F9B6A;color: #fff">保存</span>
</div>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import { getcereFundsPoolData,addcereFundsPool,}from '@/api/couponmanagement/capitalpool.js'
export default {
data () {
return {
query: {
activityName: '', // 活动名称
// 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
state: '',
pageNumber: 1,
pageSize: 10
},
total: 1,
tableData: [],
activityStatusSelect: [
{
index: 0,
label: '未启用',
value: 0
},
{
index: 1,
label: '启用中',
value: 1
},
{
index: 2,
label: '已关闭',
value: 2
},
],
activityVisible: false,
editForm: false,
activityDetailVisible: false,
activityForm: {}
}
},
created () {
this.getAll()
},
methods: {
save( ){
},
cancel() {
},
async getAll () {
const res = await getcereFundsPoolData(this.query)
this.tableData = res.data.list
this.total = res.data.total
},
handleSizeChange (val) {
this.query.pageSize = val
this.getAll()
},
handleCurrentChange (val) {
this.query.pageNumber = val
this.getAll()
},
search () {
this.total = 1
this.query.pageNumber = 1
this.getAll()
},
// 重置
clear () {
this.query = {
activityName: '',
state: '',
pageNumber: 1,
pageSize: 10
}
this.getAll()
},
// 活动详情
details (row) {
this.activityForm = row
this.activityDetailVisible = true
},
// 添加活动
addActivity () {
this.editForm = false
this.activityVisible = true
},
// 编辑
editActivity (row) {
this.editForm = true
this.activityForm = row
this.activityVisible = true
},
async endActivity (row) {
const res = await endCoupon({ activityId: row.activityId })
if (res.code === '') {
this.$message({
message: '结束成功',
type: 'success'
})
} else {
this.$message({
message: res.message,
type: 'error'
})
}
this.getAll()
},
async delActivity (row) {
const res = await delCoupon({ activityId: row.activityId })
if (res.code === '') {
this.$message({
message: '删除成功',
type: 'success'
})
} else {
this.$message({
message: res.message,
type: 'error'
})
}
this.getAll()
},
}
}
</script>
<style scoped lang="scss">
::v-deep .el-dialog__header{
border-bottom: 2px solid #eee;
background-color: #fff;
}
::v-deep .el-dialog__title {
color: #303133;
}
.footer{
font-size: 24px;
.btn_list {
display: flex;
flex-direction: row-reverse;
span {
padding: 0;
margin: 0;
width: 100px;
height:32px;
line-height:32px;
text-align: center;
display: inline-block;
font-size: 16px;
border-radius: 4px;
box-sizing: border-box;
&:hover {
cursor: pointer;
}
&:nth-child(1) {
background: rgba(255, 255, 255, 1);
order: 1px solid rgba(224, 229, 235, 1);
border: 1px solid rgba(224, 229, 235, 1);
}
&:nth-child(2) {
background: #3f9b6a;
color: #fff;
margin-right: 20px;
}
}
}
}
.couponPage{
padding: 0 20px 20px 20px;
min-height: calc(100vh - 50px - 20px);
background-color: #Fff;
.tableBox{
.fenye{
margin: 20px;
}
}
}
.couponDialogBox {
max-height: 600px;
overflow-y: auto;
}
.formSearch{
display: flex;
width: 100%;
font-size: 14px;
justify-content: space-between;
padding-bottom: 10px;
align-items: center;
}
.tableBtn {
display: inline-block;
margin-right: 10px;
}
.greens {
color: #3F9B6A;
}
::v-deep .buttonHover:hover{
color:#3f9b6a !important;
border-color: #c5e1d2 !important;
background-color: #ecf5f0 !important;
outline: none;
}
::v-deep .el-pagination__total {
position: absolute;
left: 10px;
}
::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active{
background-color:#3f9b6a;
}
</style>