Blame view

admin-web-master/src/views/couponmanagement/capitalpool.vue 23.7 KB
764a832f   李宇   资金池
1
2
  <template>
    <div style="background-color:#f7f7f7;padding:10px 10px;">
8db25941   李宇   2
3
      <div class="couponPage" v-if="type == '1'">
084351b6   李宇   1
4
5
        <div>
          <div style="height:58px;line-height:58px;">
e72f5b2f   李宇   1
6
7
            <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span
                style="color:#000000e6">资金池</span></div>
764a832f   李宇   资金池
8
          </div>
e72f5b2f   李宇   1
9
          <!-- 搜索 -->
084351b6   李宇   1
10
11
12
13
14
15
16
17
          <div class="formSearch">
            <!-- 搜索条件 -->
            <el-form :inline="true" :model="query" class="demo-form-inline">
              <el-form-item label="名称">
                <el-input v-model="query.poolName" placeholder="请输入名称" />
              </el-form-item>
              <el-form-item label="状态">
                <el-select v-model="query.fundsStatus" placeholder="请选择状态">
e72f5b2f   李宇   1
18
19
                  <el-option v-for="item in activityStatusSelect" :key="item.index" :label="item.label"
                    :value="item.value" />
084351b6   李宇   1
20
21
22
23
24
                </el-select>
              </el-form-item>
            </el-form>
            <div>
              <el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
e72f5b2f   李宇   1
25
26
              <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;"
                @click="clear">重置</el-button>
084351b6   李宇   1
27
28
29
            </div>
          </div>
          <div style="margin: 0  0 20px 0;">
e72f5b2f   李宇   1
30
31
            <el-button icon="el-icon-circle-plus-outline" style="background-color: #3F9B6A;color: #fff;"
              @click="addActivity">新增</el-button>
084351b6   李宇   1
32
33
34
          </div>
          <!-- 表格 -->
          <div class="tableBox">
e72f5b2f   李宇   1
35
            <el-table ref="multipleTable" :data="tableData"
a182f238   wesley88   1
36
              :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
e72f5b2f   李宇   1
37
38
              tooltip-effect="light">
              <!-- <el-table-column label="编号">
084351b6   李宇   1
39
                <template slot-scope="scope">{{ scope.row.poolId }}</template>
e72f5b2f   李宇   1
40
41
              </el-table-column> -->
              <el-table-column label="资金池名称">
084351b6   李宇   1
42
43
                <template slot-scope="scope">{{ scope.row.poolName }}</template>
              </el-table-column>
e72f5b2f   李宇   1
44
              <!-- <el-table-column label="出资方">
084351b6   李宇   1
45
                <template slot-scope="scope">{{ scope.row.contributor }}</template>
e72f5b2f   李宇   1
46
              </el-table-column> -->
084351b6   李宇   1
47
              <el-table-column label="总金额">
93c8bac5   李宇   1
48
                <template slot-scope="scope">{{ Number(scope.row.totalAmount)/100 }}</template>
084351b6   李宇   1
49
              </el-table-column>
e72f5b2f   李宇   1
50
51
52
53
54
55
56
57
58
59
60
              <el-table-column
                label="出资方">
                <template slot-scope="scope">
                  <el-popover trigger="hover" placement="top">
                    <p style="max-width: 300px;">{{ scope.row.contributor }}</p>
                    <div slot="reference" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width: 100%;" >
                      {{ scope.row.contributor }}
                    </div>
                  </el-popover>
                </template>
              </el-table-column>
084351b6   李宇   1
61
62
63
64
65
66
67
68
69
70
71
72
              <el-table-column label="状态">
                <template slot-scope="scope">
                  <span v-if="scope.row.fundsStatus == '1'">启用中</span>
                  <span v-else-if="scope.row.fundsStatus == '2'">已关闭</span>
                  <span v-else>未启用</span>
                </template>
              </el-table-column>
              <el-table-column label="操作" fixed="right">
                <template slot-scope="scope">
                  <div class="btnList">
                    <!-- <div class="tableBtn greens" @click="editActivity(scope.row)">编辑</div> -->
                    <div v-if="scope.row.fundsStatus == '1'" class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
e72f5b2f   李宇   1
73
74
75
76
77
78
                    <div v-if="scope.row.fundsStatus == '1'" class="tableBtn greens" @click="addcoupon(scope.row)">创建优惠券
                    </div>
                    <div v-if="scope.row.fundsStatus == '1'" class="tableBtn greens"
                      @click="endActivityeditPool(scope.row,'2')">禁用</div>
                    <div v-else-if="scope.row.fundsStatus == '2'" class="tableBtn greens" @click="delActivity(scope.row)">
                      删除</div>
084351b6   李宇   1
79
80
81
82
83
84
85
                    <div v-else class="tableBtn greens" @click="endActivityeditPool(scope.row,'1')">开启</div>
                    <!-- <div class="tableBtn greens" @click="delActivity(scope.row)">删除</div> -->
                  </div>
                </template>
              </el-table-column>
            </el-table>
            <div style="display: flex;justify-content: space-between;" class="bom">
e72f5b2f   李宇   1
86
87
88
              <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
              <el-pagination :current-page="query.pageNumber" :page-sizes="[10, 20, 50, 100]" :page-size="10" background
                small layout="prev, pager, next" :total="total" @size-change="handleSizeChange"
084351b6   李宇   1
89
90
91
                @current-change="handleCurrentChange">
              </el-pagination>
            </div>
764a832f   李宇   资金池
92
          </div>
764a832f   李宇   资金池
93
  
e72f5b2f   李宇   1
94
95
96
97
          <el-dialog :title="editForm ? '修改资金池' : '新增资金池'" :visible.sync="activityVisible" width="500px" center
            :close-on-click-modal="false" @close="activityVisible">
            <el-form ref="form" :model="form" label-width="100px" :rules="couponRules">
              <el-form-item label="资金池名称:" prop="poolName">
084351b6   李宇   1
98
99
                <el-input v-model="form.poolName" placeholder="请输入资金池名称" />
              </el-form-item>
e72f5b2f   李宇   1
100
101
              <el-form-item label="总金额:" style="margin: 20px 0;" prop="totalAmount">
                <el-input v-model.number="form.totalAmount" placeholder="请输入总金额" />
084351b6   李宇   1
102
              </el-form-item>
e72f5b2f   李宇   1
103
104
105
              <el-form-item label="出资方:" prop="contributor">
                <el-input maxlength="200" show-word-limit rows="4" type="textarea" v-model="form.contributor"
                  placeholder="请输入出资方" />
084351b6   李宇   1
106
107
              </el-form-item>
            </el-form>
e72f5b2f   李宇   1
108
            <div class="footer" style="margin-top: 25px;">
084351b6   李宇   1
109
              <div class="btn_list">
e72f5b2f   李宇   1
110
111
                <span @click="cancel" class="buttonHover"
                  style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span>
084351b6   李宇   1
112
113
                <span @click="save" style="background-color: #3F9B6A;color: #fff">保存</span>
              </div>
764a832f   李宇   资金池
114
            </div>
084351b6   李宇   1
115
116
117
          </el-dialog>
        </div>
      </div>
8db25941   李宇   2
118
      <div class="couponPage" v-if="type == '2'">
084351b6   李宇   1
119
        <div style="height:58px;line-height:58px;">
e72f5b2f   李宇   1
120
121
          <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span
              style="color:#000000e6">创建优惠券</span></div>
084351b6   李宇   1
122
        </div>
b1d468f9   李宇   1
123
124
        <TitleWithCircle title="资金池" style="margin-bottom: 15px;"/>
        <div style="display: flex;margin-bottom: 20px;padding-left: 30px;">
084351b6   李宇   1
125
          <div>资金池名称:{{ coupoobj.poolName }}</div>
93c8bac5   李宇   1
126
          <div style="margin-left: 30px;">资金池可用金额:<span style="font-weight: bold;">{{ Number(coupoobj.symon)/100 }}</span></div>
084351b6   李宇   1
127
        </div>
b1d468f9   李宇   1
128
        <coupon :couponfrom="couponfrom" :coupoobj="coupoobj" @changevalue="changevalue"/>
084351b6   李宇   1
129
        <div class="footer">
e72f5b2f   李宇   1
130
131
132
          <div class="btn_list" style="margin-top: 30px;">
            <span @click="qxcoupon" class="buttonHover"
              style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span>
084351b6   李宇   1
133
            <span @click="savecoupon" style="background-color: #3F9B6A;color: #fff">保存</span>
764a832f   李宇   资金池
134
          </div>
084351b6   李宇   1
135
        </div>
764a832f   李宇   资金池
136
      </div>
8db25941   李宇   2
137
138
139
140
141
      <div class="couponPage" v-show="type == '3'">
        <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>
93c8bac5   李宇   1
142
143
        <allinfo :id="poolId" ref="allinforef" :type="typeinfo" @changetypeinfo="changetypeinfo" />
        <!-- <allinfo v-if="typeinfo =='2'" :id="poolId" :type="typeinfo" @changetypeinfo="changetypeinfo" /> -->
8db25941   李宇   2
144
145
146
147
        <div style="display: flex;">
          <el-button @click="changetype()"  class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" >返回</el-button>
        </div>
      </div>
764a832f   李宇   资金池
148
149
150
151
    </div>
  </template>
  
  <script>
e72f5b2f   李宇   1
152
153
154
155
156
157
    import {
      getcereFundsPoolData,
      addcereFundsPool,
      delPool,
      editPool,
      cereCouponMainTable,
b1d468f9   李宇   1
158
159
      totalCapitalBalance,
      addcereCouponCategory
e72f5b2f   李宇   1
160
161
162
    } from '@/api/couponmanagement/capitalpool.js'
    import router from '@/router';
    import coupon from './coupon.vue';
8db25941   李宇   2
163
    import allinfo from './allinfo.vue';
b1d468f9   李宇   1
164
    import TitleWithCircle from '@/components/top/index';
e72f5b2f   李宇   1
165
166
167
    export default {
  
      components: {
8db25941   李宇   2
168
        coupon,TitleWithCircle,allinfo
e72f5b2f   李宇   1
169
170
171
      },
      data() {
        return {
8db25941   李宇   2
172
173
          poolId:'',
          typeinfo:'1',
e72f5b2f   李宇   1
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
          couponRules: {
            poolName: [{
                required: true,
                message: '请输入资金池名称',
                trigger: 'blur'
              },
              {
                min: 0,
                max: 20,
                message: '长度不超过20个字符',
                trigger: 'blur'
              }
            ],
            totalAmount: [{
              required: true,
              message: '请输入总金额',
              trigger: 'blur'
            }, ],
            contributor: [{
              required: true,
              message: '请输入出资方',
              trigger: 'blur'
            }, ],
764a832f   李宇   资金池
197
          },
b1d468f9   李宇   1
198
199
          useCategorylist:'',
          usedMerchantslist:'',
e72f5b2f   李宇   1
200
          couponfrom: {
8db25941   李宇   2
201
            receiveAgain:0,
b1d468f9   李宇   1
202
            usedMerchants: 1,
e72f5b2f   李宇   1
203
204
205
            couponName: '',
            remark: '',
            couponType: '1', // 默认值
b1d468f9   李宇   1
206
            useCategory: 1,
e72f5b2f   李宇   1
207
208
209
210
211
212
            maxDiscountAmount: null,
            usageThreshold: null, //使用门槛不用
            discountContent: null,
            pointsRequired: 0,
            startTime: '',
            endTime: '',
8db25941   李宇   2
213
            totalCoupons: 1,
e72f5b2f   李宇   1
214
            totalFunds: null,
764a832f   李宇   资金池
215
          },
e72f5b2f   李宇   1
216
217
218
219
220
221
222
223
          coupoobj: {},
          type: '1',
          query: {
            activityName: '', // 活动名称
            // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
            state: '',
            pageNumber: 1,
            pageSize: 10
764a832f   李宇   资金池
224
          },
e72f5b2f   李宇   1
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
          total: 0,
          tableData: [],
          activityStatusSelect: [{
              index: 0,
              label: '未启用',
              value: 0
            },
            {
              index: 1,
              label: '启用中',
              value: 1
            },
            {
              index: 2,
              label: '已关闭',
              value: 2
            },
          ],
          activityVisible: false,
          editForm: false,
          activityDetailVisible: false,
          form: {
            poolName: '',
            contributor: '',
            totalAmount: null,
            fundsStatus: '0'
          }
084351b6   李宇   1
252
        }
e72f5b2f   李宇   1
253
254
255
256
257
      },
      created() {
        this.getAll()
      },
      methods: {
8db25941   李宇   2
258
        changetypeinfo(e) {
93c8bac5   李宇   1
259
          console.error(e)
8db25941   李宇   2
260
261
262
          let that = this
          this.typeinfo = e.type
          setTimeout(()=>{
93c8bac5   李宇   1
263
              that.$refs.allinforef.int(e.id,e.info)
8db25941   李宇   2
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
            },300)
        },
        changetype() {
          let that = this
          if(this.typeinfo == '1') {
            this.type = 1
          } else {
            this.typeinfo = '1'
            console.error(this.poolId)
            //延迟执行this.$refs.allinforef.int(this.poolId)
            setTimeout(()=>{
              that.$refs.allinforef.int(this.poolId)
            },300)
          }
        },
b1d468f9   李宇   1
279
280
281
282
        changevalue(e,list) {
          console.error(e,list )
          this[e] = list
        },
e72f5b2f   李宇   1
283
        xq(e) {
93c8bac5   李宇   1
284
          console.log(e)
8db25941   李宇   2
285
286
287
          this.type = '3'
          this.typeinfo = '1'
          this.poolId = e.poolId
93c8bac5   李宇   1
288
          this.$refs.allinforef.int(this.poolId,e)
8db25941   李宇   2
289
290
291
292
293
294
295
          // // 跳转路由
          // router.push({
          //   path: '/other/capitalpoolinfo',
          //   query: {
          //     id: e.poolId
          //   }
          // })
e72f5b2f   李宇   1
296
297
298
        },
        savecoupon() {
          let that = this
8db25941   李宇   2
299
          console.error(this.couponfrom )
b1d468f9   李宇   1
300
          if(!this.couponfrom.couponName) {
8db25941   李宇   2
301
302
303
304
            that.$message({
                message: '请填写优惠券名称',
                error: 'success'
            });
b1d468f9   李宇   1
305
306
            return
          }
8db25941   李宇   2
307
308
  
  
b1d468f9   李宇   1
309
          if(!this.couponfrom.discountContent) {
8db25941   李宇   2
310
311
312
313
            that.$message({
                message: '请填写优惠内容',
                error: 'success'
            });
b1d468f9   李宇   1
314
315
            return 
          }
8db25941   李宇   2
316
317
          
          
b1d468f9   李宇   1
318
          if(this.couponfrom.couponType == '1') {
8db25941   李宇   2
319
320
321
322
323
324
325
326
327
328
329
330
            if(!this.couponfrom.usageThreshold) {
              that.$message({
                message: '请填写优惠内容',
                error: 'success'
            });
             return 
            }
            if(Number(this.couponfrom.discountContent) >= Number(this.couponfrom.usageThreshold)) {
              that.$message({
                message: '请满减金额大于优惠金额',
                error: 'success'
            });
b1d468f9   李宇   1
331
332
              return 
            }   
8db25941   李宇   2
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
          } else {
            if(!this.couponfrom.maxDiscountAmount) {
              that.$message({
                message: '请填写优惠内容',
                error: 'success'
            });
            return 
            }
  
          }
          if(!this.couponfrom.startTime) {
            that.$message({
                message: '请选择时间',
                error: 'success'
            });
            return
          }
          if(!this.couponfrom.totalCoupons) {
            that.$message({
                message: '请填写数量',
                error: 'success'
            });
            return
          }
e72f5b2f   李宇   1
357
358
          let c1 = this.changecouponfrom()
          console.error(c1)
b1d468f9   李宇   1
359
360
          console.error(this.useCategorylist)
          console.error(this.usedMerchantslist)
e72f5b2f   李宇   1
361
          console.error(this.coupoobj)
93c8bac5   李宇   1
362
          let from = JSON.parse(JSON.stringify(this.couponfrom))
e72f5b2f   李宇   1
363
364
          from.fundPoolId = this.coupoobj.poolId
          from.totalFunds = c1
93c8bac5   李宇   1
365
          if (c1 > (Number(this.coupoobj.symon)/100)) {
e72f5b2f   李宇   1
366
367
368
369
370
371
            that.$message({
              message: '金额不足',
              error: 'error'
            });
            return
          }
93c8bac5   李宇   1
372
373
374
375
376
377
378
379
380
381
382
383
384
          from.totalCoupons = Number(from.totalCoupons) //总数
          from.pointsRequired = Number(from.pointsRequired) //积分
          
          from.usageThreshold = Number(from.usageThreshold)*100
          
          from.totalFunds  = Number(from.totalFunds)*100
          if(this.couponfrom.couponType == '1') {
            from.discountContent = Number(from.discountContent)*100
            from.maxDiscountAmount = from.discountContent
          } else {
            from.maxDiscountAmount = Number(from.maxDiscountAmount)*100
            from.discountContent = Number(from.discountContent)
          }
e72f5b2f   李宇   1
385
386
387
          console.error({
            ...from
          })
b1d468f9   李宇   1
388
          // return
e72f5b2f   李宇   1
389
          cereCouponMainTable(from).then(res => {
084351b6   李宇   1
390
            console.error(res)
e72f5b2f   李宇   1
391
            if (res.data) {
b1d468f9   李宇   1
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
              if(res.data.useCategory == '2') {
                let info1 = {
                  couponId:res.data.id,
                  usedMerchants:1,
                  categoryIds:that.useCategorylist
                }
                addcereCouponCategory(info1).then(res1 => {
                  console.error(res1)
                })
              }
              if(res.data.usedMerchants == '3') {
                let info2 = {
                  couponId:res.data.id,
                  usedMerchants:3,
                  categoryIds:that.usedMerchantslist
                }
                addcereCouponCategory(info2).then(res2 => {
                  console.error(res2)
                })
              }
8db25941   李宇   2
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
              this.couponfrom={
                receiveAgain:0,
                usedMerchants: 1,
                couponName: '',
                remark: '',
                couponType: '1', // 默认值
                useCategory: 1,
                maxDiscountAmount: null,
                usageThreshold: null, //使用门槛不用
                discountContent: null,
                pointsRequired: 0,
                startTime: '',
                endTime: '',
                totalCoupons: 1,
                totalFunds: null,
              }
084351b6   李宇   1
428
429
430
431
              that.$message({
                message: '提交成功',
                type: 'success'
              });
e72f5b2f   李宇   1
432
            } else {
084351b6   李宇   1
433
434
435
436
437
              that.$message({
                message: '提交失败',
                error: 'success'
              });
            }
8db25941   李宇   2
438
            that.type = '1'
084351b6   李宇   1
439
          })
e72f5b2f   李宇   1
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
        },
        changecouponfrom() {
          let num = 0
          if (this.couponfrom.couponType == '1') {
            num = (this.couponfrom.discountContent ? Number(this.couponfrom.discountContent) : 0) * (this.couponfrom
              .totalCoupons ? Number(this.couponfrom.totalCoupons) : 0)
          } else if (this.couponfrom.couponType == '2') {
            num = (this.couponfrom.maxDiscountAmount ? Number(this.couponfrom.maxDiscountAmount) : 0) * (this.couponfrom
              .totalCoupons ? Number(this.couponfrom.totalCoupons) : 0)
          }
          return num
        },
        qxcoupon() {
          this.type = '1'
        },
        async addcoupon(e) {
          let that = this
  
          let c1 = {
            symon: 0,
            ...e
          }
          await totalCapitalBalance({
            poolId: e.poolId
          }).then(res => {
084351b6   李宇   1
465
            console.error(res)
e72f5b2f   李宇   1
466
467
468
469
470
471
472
473
474
475
476
477
            c1.symon = res.data
          })
          this.type = '2'
          this.coupoobj = c1
          console.error(this.coupoobj)
        },
        endActivityeditPool(item, type) {
          let that = this
          let form = item
          form.totalAmount = Number(form.totalAmount)
          form.fundsStatus = type
          editPool(form).then(res => {
084351b6   李宇   1
478
            console.error(res)
e72f5b2f   李宇   1
479
            if (res.data) {
084351b6   李宇   1
480
481
482
483
              that.$message({
                message: '修改成功',
                type: 'success'
              });
e72f5b2f   李宇   1
484
            } else {
084351b6   李宇   1
485
486
487
488
489
490
              that.$message({
                message: '修改失败',
                error: 'success'
              });
            }
            that.search()
084351b6   李宇   1
491
          })
e72f5b2f   李宇   1
492
493
494
495
496
        },
        save() {
          let that = this
          console.error(this.form)
          let form = this.form
93c8bac5   李宇   1
497
          
e72f5b2f   李宇   1
498
499
          that.$refs.form.validate((valid) => {
            if (valid) {
93c8bac5   李宇   1
500
501
              // form.totalAmount = Number(form.totalAmount)
              form.totalAmount = Number(form.totalAmount) * 100
e72f5b2f   李宇   1
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
              if (that.editForm) {
                editPool(form).then(res => {
                  // console.error(res)
                  if (res.data) {
                    that.$message({
                      message: '修改成功',
                      type: 'success'
                    });
                  } else {
                    that.$message({
                      message: '修改失败',
                      error: 'success'
                    });
                  }
                  that.search()
                  that.activityVisible = false
                  that.form = {
                    poolName: '',
                    contributor: '',
                    totalAmount: null,
                    fundsStatus: '0'
                  }
                })
              } else {
                addcereFundsPool(form).then(res => {
                  // console.error(res)
                  if (res.data) {
                    that.$message({
                      message: '提交成功',
                      type: 'success'
                    });
                  } else {
                    that.$message({
                      message: '提交失败',
                      error: 'success'
                    });
                  }
                  that.search()
                  that.activityVisible = false
                  that.form = {
                    poolName: '',
                    contributor: '',
                    totalAmount: null,
                    fundsStatus: '0'
                  }
                })
              }
            } else {
              console.log('error submit!!');
              return false;
084351b6   李宇   1
552
            }
e72f5b2f   李宇   1
553
          });
764a832f   李宇   资金池
554
  
e72f5b2f   李宇   1
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
  
        },
        cancel() {
          this.activityVisible = false
          this.form = {
            poolName: '',
            contributor: '',
            totalAmount: null,
            fundsStatus: '0'
          }
        },
        async getAll() {
          const res = await getcereFundsPoolData(this.query)
          this.tableData = res.data.content
          this.total = res.data.numberOfElements
        },
        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.form = row
          this.activityDetailVisible = true
        },
        // 添加活动
        addActivity() {
          this.editForm = false
          this.activityVisible = true
        },
        // 编辑
        editActivity(row) {
          this.editForm = true
          this.form = row
          this.activityVisible = true
        },
        async endActivity(row) {
          const res = await endCoupon({
            activityId: row.activityId
764a832f   李宇   资金池
613
          })
e72f5b2f   李宇   1
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
          if (res.code === '') {
            this.$message({
              message: '结束成功',
              type: 'success'
            })
          } else {
            this.$message({
              message: res.message,
              type: 'error'
            })
          }
          this.getAll()
        },
        async delActivity(row) {
          let that = this
          this.$confirm('此作将永久操删除该文件, 是否继续?', '提示', {
084351b6   李宇   1
630
631
632
633
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
e72f5b2f   李宇   1
634
635
636
            delPool({
              poolId: row.poolId
            }).then(res => {
084351b6   李宇   1
637
              console.error(res)
e72f5b2f   李宇   1
638
              if (res.data) {
084351b6   李宇   1
639
640
641
642
                that.$message({
                  message: '删除成功',
                  type: 'success'
                });
e72f5b2f   李宇   1
643
              } else {
084351b6   李宇   1
644
645
646
647
648
649
                that.$message({
                  message: '删除失败',
                  error: 'success'
                });
              }
              that.search()
b1d468f9   李宇   1
650
            }).catch(error => {
084351b6   李宇   1
651
652
653
654
655
            })
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '已取消删除'
e72f5b2f   李宇   1
656
            });
084351b6   李宇   1
657
          });
e72f5b2f   李宇   1
658
        },
764a832f   李宇   资金池
659
  
e72f5b2f   李宇   1
660
      }
764a832f   李宇   资金池
661
    }
764a832f   李宇   资金池
662
663
664
  </script>
  
  <style scoped lang="scss">
e72f5b2f   李宇   1
665
666
667
668
669
  
    .el-table {
      height: calc(100vh - 330px);
    }
  
93c8bac5   李宇   1
670
   
e72f5b2f   李宇   1
671
672
673
674
675
676
  
    .el-form-item {
      margin-bottom: 0;
    }
  
    ::v-deep .el-dialog__header {
764a832f   李宇   资金池
677
678
679
      border-bottom: 2px solid #eee;
      background-color: #fff;
    }
e72f5b2f   李宇   1
680
  
764a832f   李宇   资金池
681
682
683
    ::v-deep .el-dialog__title {
      color: #303133;
    }
e72f5b2f   李宇   1
684
685
  
    .footer {
764a832f   李宇   资金池
686
      font-size: 24px;
e72f5b2f   李宇   1
687
  
764a832f   李宇   资金池
688
689
690
      .btn_list {
        display: flex;
        flex-direction: row-reverse;
e72f5b2f   李宇   1
691
  
764a832f   李宇   资金池
692
693
694
695
        span {
          padding: 0;
          margin: 0;
          width: 100px;
e72f5b2f   李宇   1
696
697
          height: 32px;
          line-height: 32px;
764a832f   李宇   资金池
698
699
700
701
702
          text-align: center;
          display: inline-block;
          font-size: 16px;
          border-radius: 4px;
          box-sizing: border-box;
e72f5b2f   李宇   1
703
  
764a832f   李宇   资金池
704
705
706
          &:hover {
            cursor: pointer;
          }
e72f5b2f   李宇   1
707
  
764a832f   李宇   资金池
708
709
710
          &:nth-child(1) {
            background: rgba(255, 255, 255, 1);
            order: 1px solid rgba(224, 229, 235, 1);
e72f5b2f   李宇   1
711
  
764a832f   李宇   资金池
712
713
            border: 1px solid rgba(224, 229, 235, 1);
          }
e72f5b2f   李宇   1
714
  
764a832f   李宇   资金池
715
716
717
718
719
720
721
722
          &:nth-child(2) {
            background: #3f9b6a;
            color: #fff;
            margin-right: 20px;
          }
        }
      }
    }
764a832f   李宇   资金池
723
  
e72f5b2f   李宇   1
724
725
726
727
728
    .couponPage {
  
      padding: 0 20px 20px 20px;
      min-height: calc(100vh - 50px - 20px);
      background-color: #Fff;
764a832f   李宇   资金池
729
730
  
  
e72f5b2f   李宇   1
731
732
733
734
735
736
      .tableBox {
        text-align: center;
  
        .fenye {
          // margin: 20px;
        }
764a832f   李宇   资金池
737
738
      }
    }
e72f5b2f   李宇   1
739
740
741
742
743
744
745
  
    .couponDialogBox {
      max-height: 600px;
      overflow-y: auto;
    }
  
    .formSearch {
764a832f   李宇   资金池
746
747
748
749
750
751
752
753
  
      display: flex;
      width: 100%;
      font-size: 14px;
      justify-content: space-between;
      padding-bottom: 10px;
      align-items: center;
  
e72f5b2f   李宇   1
754
755
    }
  
d64cd58f   wesley88   上传验收小程序
756
    
764a832f   李宇   资金池
757
  
e72f5b2f   李宇   1
758
    .greens {
764a832f   李宇   资金池
759
760
      color: #3F9B6A;
    }
e72f5b2f   李宇   1
761
762
763
  
    ::v-deep .buttonHover:hover {
      color: #3f9b6a !important;
764a832f   李宇   资金池
764
765
766
767
      border-color: #c5e1d2 !important;
      background-color: #ecf5f0 !important;
      outline: none;
    }
e72f5b2f   李宇   1
768
  
764a832f   李宇   资金池
769
770
771
772
    ::v-deep .el-pagination__total {
      position: absolute;
      left: 10px;
    }
e72f5b2f   李宇   1
773
774
775
  
    ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
      background-color: #3f9b6a;
764a832f   李宇   资金池
776
777
    }
  </style>