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
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
<template>
  <div>
  <el-bus-crud ref="crud" v-bind="tableConfig" />
  </div>
</template>
 
<script>
 
export default {
  data() {
    return {
      tableConfig: {
        url: 'flower/v2/withdraw-record/list',
        hasNew: false,
        hasEdit: false,
        hasDelete: false,
        hasView: false,
        columns: [
          {label: '供应商信息',
            minWidth: 120,
            formatter: (row) => `${row.supplierName || ''}:[ID:${row.supplierId || ''}]`},
          {label: '申请时间', prop: 'createTime', minWidth: 100},
          {label: '提现类型', prop: 'withdrawTypeStr', minWidth: 100},
          {label: '提现金额(元)', prop: 'amount', minWidth: 120},
          {label: '提现状态', prop: 'withdrawStateStr', minWidth: 120},
          {label: '提现方式', prop: 'methodStr', minWidth: 120},
          {label: '审核状态', prop: 'approveStateStr', minWidth: 120},
          {label: '审核时间', prop: 'approveTime', minWidth: 120},
          {label: '拒绝原因', prop: 'rejectReason', minWidth: 120},
          {label: '操作人', prop: 'approveName', minWidth: 120},
        ],
        searchFormAttrs: {
          labelWidth: 'auto',
        },
        searchForm: [
          {
            type: 'row',
            items: [
              {
                label: '审核状态:',
                id: 'approveState',
                type: 'bus-radio',
                el: {
                  hasAll: true,
                  childType: 'el-radio-button',
                  code: 'WALLET_APPROVE_STATE',
                },
                default: '',
                span: 24,
                searchImmediately: true,
              },
              {
                label: '提现状态:',
                id: 'withdrawState',
                type: 'bus-radio',
                el: {
                  hasAll: true,
                  childType: 'el-radio-button',
                  code: 'BILL_WITHDRAW_TYPE',
                },
                default: '',
                span: 24,
                searchImmediately: true,
              },
              {label: '供应商ID:', id: 'supplierId', type: 'input'},
              {label: '供应商名称:', id: 'supplierName', type: 'input'},
              {
                label: '提交时间',
                id: 'createStartDate',
                component: 'el-bus-date-range',
                commonFormat: true,
                commonFormatProps: ['createStartDate', 'endEndDate'],
                customClass: 'in-bus-form',
              },
              {
                label: '审核时间',
                id: 'approveStartDate',
                component: 'el-bus-date-range',
                commonFormat: true,
                commonFormatProps: ['approveStartDate', 'approveEndDate'],
                customClass: 'in-bus-form',
              },
 
            ],
          },
        ],
        extraDialogs: [
          {
            title: '提现拒绝',
            form: [
              {
                label: '原因:',
                id: 'rejectReason',
                type: 'input',
                el: {
                  type: 'textarea',
                  rows: 6,
                },
                rules: {
                  required: true,
                  message: '请输入原因',
                  trigger: 'blur',
                },
              },
            ],
            atConfirm: async (val) => {
              const { code } = await this.$elBusHttp.request(
                'flower/v2/withdraw-record/refuse',
                {
                  method: 'post',
                  data: val,
                }
              )
              if (code === 0) {
                this.$message.success('拒绝操作成功')
              }
            },
          },
        ],
        extraButtons: [
          {
            text: '通过',
            show: (row) => row.approveState === 'WAITING',
            atClick: async (row) => {
              try {
                await this.$elBusUtil.confirm('确定要通过吗?')
                const {code} = await this.$elBusHttp.request(
                  'flower/v2/withdraw-record/pass',
                  {
                    method: 'post',
                    data: {
                      id: row.id,
                    },
                  }
                )
                if (code === 0) {
                  this.$message.success('已通过')
                }
              } catch (e) {
                return false
              }
            },
          },
          {
            text: '拒绝',
            show: (row) => row.approveState === 'WAITING',
            atClick: (row) => {
              this.$refs.crud.$refs.extraDialog[0].show(row)
              return false
            },
          },
        ],
      },
    }
  },
  head() {
    return {
      title: '供应商提现审核',
    }
  },
}
 
</script>