cloudroam
2025-03-28 cef2bb0eeeb91a22860cf5d23c7348af1ba921dc
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
<template>
  <el-bus-crud v-bind="tableConfig" />
</template>
 
<script>
import { couponForm, couponSearchForm, couponColumn } from '@/utils/coupon-form'
export default {
  data() {
    return {
      tableConfig: {
        url: 'flower/api/v2/coupon/vip/page',
        newUrl: 'flower/api/v2/coupon/vip',
        viewUrl: 'flower/api/v2/coupon/vip',
        viewOnPath: true,
        editUrl: 'flower/api/v2/coupon/vip',
        editMethodType: 'put',
        editOnPath: true,
        deleteUrl: 'flower/api/v2/coupon/vip',
        deleteMethodType: 'delete',
        deleteOnPath: true,
        onResetView: (row) => {
          this.$router.push(`${this.$route.path}/${row.id}`)
        },
        operationAttrs: {
          width: 140,
          fixed: 'right',
        },
        columns: [
          ...couponColumn(),
          { label: '会员等级', prop: 'memberName' },
          {
            label: '有效期',
            formatter: (row) =>
              row.usageStartDate
                ? `${row.usageStartDate || ''} ~ ${row.usageEndDate || ''}`
                : '',
            minWidth: 320,
          },
          { label: '已发放数量', prop: 'getNum', minWidth: 120 },
          { label: '操作人', prop: 'createByName', minWidth: 120 },
        ],
        searchForm: [
          {
            type: 'row',
            items: [...couponSearchForm()],
          },
        ],
        form: [
          {
            label: '会员等级:',
            id: 'memberId',
            type: 'bus-select',
            el: {
              interfaceUri: 'flower/api/member/list',
              props: {
                label: 'name',
                value: 'id',
                dataPath: 'records',
              },
              extraQuery: {
                current: 1,
                size: 2000,
              },
              filterable: true,
              style: 'width:100%',
            },
            rules: { required: true, message: '请选择会员等级' },
          },
          ...couponForm(),
        ],
      },
    }
  },
  head() {
    return {
      title: '会员优惠券',
    }
  },
}
</script>