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
81
82
83
<template>
  <div>
  <el-bus-crud v-bind="tableConfig"/>
  <el-dialog title="成长值变动记录" :visible.sync="dialogVisible" width="80%">
    <el-bus-crud
      v-if="userId"
      :key="dialogId"
      :extra-query="{ userId }"
      v-bind="recordTableConfig"
    />
  </el-dialog>
  </div>
</template>
 
<script>
import {v4 as uuidv4} from "uuid";
 
export default {
  data() {
    return {
      dialogVisible: false,
      userId: null,
      dialogId: null,
      tableConfig: {
        url: 'flower/api/userGrowthRecord/list',
        hasNew: false,
        hasEdit: false,
        hasDelete: false,
        hasView: false,
        columns: [
          {label: '序号', type: 'index'},
          {label: '用户名称', prop: 'nickName'},
          {label: '联系方式', prop: 'tel'},
          {label: '当前成长值', prop: 'sumGrowthValue'},
          {label: '当前会员等级', prop: 'levelName'},
        ],
        searchForm: [
          {
            type: 'row',
            items: [
              {label: '用户名称:', id: 'nickName', type: 'input'},
              {label: '联系方式:', id: 'tel', type: 'input'},
              {label: '会员等级:', id: 'levelName', type: 'input'}
            ],
          },
        ],
        extraButtons: [
          {
            text: '成长值变动记录',
            atClick: (row) => {
              this.dialogId = uuidv4()
              this.userId = row.userId
              this.dialogVisible = true
            },
          },
        ],
      },
      recordTableConfig: {
        url: 'flower/api/getmemberGrowthRecord/list',
        saveQuery: false,
        hasNew: false,
        hasOperation: false,
        columns: [
          { label: '序号', type: 'index' },
          { label: '成长值类型', prop: 'typeStr' },
          { label: '成长值来源', prop: 'sourceStr' },
          { label: '成长值', prop: 'growth' },
          { label: '记录日期', prop: 'recordDate' },
          { label: '备注', prop: 'remarks' },
        ],
        searchFormAttrs: {
          labelWidth: 'auto',
        },
      },
    }
  },
  head() {
    return {
      title: '会员成长值记录',
    }
  },
}
</script>