AuditForm.vue
12.2 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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
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
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
<template>
<el-dialog :title="isDetail ? '审核详情' : '审核提现申请'" :close-on-click-modal="false" :visible.sync="visible" class="audit-dialog" lock-scroll width="900px" :show-close="true" :top="'5vh'">
<div class="dialog-content" v-loading="loading">
<!-- 申请信息 -->
<div class="info-section">
<div class="section-header">
<div class="header-icon">
<i class="el-icon-document"></i>
</div>
<div class="header-text">
<h3>申请信息</h3>
<p>提现申请的基本信息</p>
</div>
</div>
<div class="section-content">
<el-form :model="dataForm" size="small" label-width="120px" label-position="right">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="提现申请号">
<el-input v-model="dataForm.walletNo" readonly class="readonly-input" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="申请时间">
<el-input :value="dataForm.applyTime ? new Date(dataForm.applyTime).toLocaleString() : '-'" readonly class="readonly-input" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="提现金额">
<el-input :value="'¥' + dataForm.amount" readonly class="amount-input" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="用户当前余额">
<el-input :value="'¥' + userBalance" readonly class="balance-input" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<!-- 银行卡信息 -->
<div class="info-section">
<div class="section-header">
<div class="header-icon">
<i class="el-icon-credit-card"></i>
</div>
<div class="header-text">
<h3>银行卡信息</h3>
<p>收款账户详细信息</p>
</div>
</div>
<div class="section-content">
<el-form :model="dataForm" size="small" label-width="120px" label-position="right">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="收款账户户名">
<el-input v-model="dataForm.bankAccountName" readonly class="readonly-input" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收款银行名称">
<el-input v-model="dataForm.bankName" readonly class="readonly-input" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="收款账户卡号">
<el-input v-model="dataForm.bankAccountNumber" readonly class="bank-card-input" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<!-- 审核信息 -->
<div class="info-section" v-if="dataForm.auditStatus !== 0">
<div class="section-header">
<div class="header-icon">
<i class="el-icon-check"></i>
</div>
<div class="header-text">
<h3>审核信息</h3>
<p>审核结果和相关信息</p>
</div>
</div>
<div class="section-content">
<el-form :model="dataForm" size="small" label-width="120px" label-position="right">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="审核状态">
<el-tag v-if="dataForm.auditStatus === 1" type="success" size="medium">
<i class="el-icon-check"></i> 审核通过
</el-tag>
<el-tag v-else-if="dataForm.auditStatus === 2" type="danger" size="medium">
<i class="el-icon-close"></i> 审核驳回
</el-tag>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间">
<el-input :value="dataForm.auditTime ? new Date(dataForm.auditTime).toLocaleString() : '-'" readonly class="readonly-input" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" v-if="dataForm.auditStatus === 2">
<el-col :span="24">
<el-form-item label="驳回原因">
<el-input v-model="dataForm.rejectReason" type="textarea" readonly class="readonly-textarea" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<!-- 审核操作 -->
<div class="action-section" v-if="!isDetail && dataForm.auditStatus === 0">
<div class="section-header">
<div class="header-icon">
<i class="el-icon-edit"></i>
</div>
<div class="header-text">
<h3>审核操作</h3>
<p>请选择审核结果并填写相关信息</p>
</div>
</div>
<div class="section-content">
<el-form ref="auditForm" :model="auditForm" :rules="auditRules" size="small" label-width="120px" label-position="right">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="审核结果" prop="auditStatus">
<el-radio-group v-model="auditForm.auditStatus" class="audit-radio-group">
<el-radio :label="1" class="audit-radio">
<i class="el-icon-check"></i>
<span>审核通过</span>
</el-radio>
<el-radio :label="2" class="audit-radio">
<i class="el-icon-close"></i>
<span>审核驳回</span>
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" v-if="auditForm.auditStatus === 2">
<el-col :span="24">
<el-form-item label="驳回原因" prop="rejectReason">
<el-input v-model="auditForm.rejectReason" type="textarea" placeholder="请输入驳回原因" :rows="3" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取 消</el-button>
<el-button v-if="!isDetail && dataForm.auditStatus === 0" type="primary" @click="auditSubmit()" :loading="submitLoading">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
export default {
components: {},
props: [],
data() {
return {
loading: false,
submitLoading: false,
visible: false,
isDetail: false,
dataForm: {
id: '',
walletNo: '',
amount: 0,
bankAccountName: '',
bankAccountNumber: '',
bankName: '',
applyTime: '',
auditStatus: 0,
auditTime: '',
rejectReason: ''
},
userBalance: 0,
auditForm: {
auditStatus: 1,
rejectReason: ''
},
auditRules: {
auditStatus: [
{ required: true, message: '请选择审核结果', trigger: 'change' }
],
rejectReason: [
{ required: true, message: '驳回时必须填写驳回原因', trigger: 'blur' }
]
}
}
},
computed: {},
watch: {
'auditForm.auditStatus'(newVal) {
if (newVal === 1) {
this.auditForm.rejectReason = ''
}
}
},
created() {},
mounted() {},
methods: {
goBack() {
this.$emit('refresh')
},
init(id, isDetail) {
this.dataForm.id = id || 0
this.visible = true
this.isDetail = isDetail || false
this.loading = true
this.$nextTick(() => {
if (this.dataForm.id) {
// 获取审核详情
request({
url: '/api/Extend/UavWalletWithdrawApply/' + this.dataForm.id + '/AuditDetail',
method: 'get'
}).then(res => {
this.dataForm = res.data
this.userBalance = res.data.userBalance || 0
this.loading = false
}).catch(() => {
this.loading = false
})
} else {
this.loading = false
}
})
},
auditSubmit() {
this.$refs['auditForm'].validate((valid) => {
if (valid) {
this.submitLoading = true
request({
url: '/api/Extend/UavWalletWithdrawApply/' + this.dataForm.id + '/Audit',
method: 'put',
data: this.auditForm
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.submitLoading = false
})
}
})
}
}
}
</script>
<style scoped>
/* 弹窗整体样式 */
.audit-dialog {
border-radius: 12px;
overflow: hidden;
}
.audit-dialog >>> .el-dialog {
border-radius: 12px;
overflow: hidden;
}
.audit-dialog >>> .el-dialog__header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 20px 30px;
margin: 0;
}
.audit-dialog >>> .el-dialog__title {
color: white;
font-size: 18px;
font-weight: 600;
}
.audit-dialog >>> .el-dialog__headerbtn .el-dialog__close {
color: white;
font-size: 20px;
}
.audit-dialog >>> .el-dialog__body {
padding: 0;
background: #f8f9fa;
max-height: 85vh;
overflow-y: auto;
}
.dialog-content {
padding: 20px;
max-height: none;
overflow: visible;
}
/* 信息区块样式 */
.info-section, .action-section {
background: white;
border-radius: 12px;
margin-bottom: 20px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.section-header {
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
padding: 20px 30px;
border-bottom: 1px solid #e9ecef;
display: flex;
align-items: center;
}
.header-icon {
width: 50px;
height: 50px;
border-radius: 50%;
background: linear-gradient(135deg, #409EFF, #66b1ff);
display: flex;
align-items: center;
justify-content: center;
margin-right: 15px;
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}
.header-icon i {
color: white;
font-size: 20px;
}
.header-text h3 {
margin: 0 0 5px 0;
font-size: 18px;
font-weight: 600;
color: #303133;
}
.header-text p {
margin: 0;
font-size: 14px;
color: #909399;
}
.section-content {
padding: 20px;
}
/* 输入框样式 */
.readonly-input >>> .el-input__inner {
background-color: #f5f7fa;
border-color: #e4e7ed;
color: #606266;
cursor: not-allowed;
}
.amount-input >>> .el-input__inner {
background-color: #fef0f0;
border-color: #fbc4c4;
color: #f56c6c;
font-weight: bold;
font-size: 16px;
cursor: not-allowed;
}
.balance-input >>> .el-input__inner {
background-color: #f0f9ff;
border-color: #b3d8ff;
color: #409EFF;
font-weight: bold;
cursor: not-allowed;
}
.bank-card-input >>> .el-input__inner {
background-color: #f5f7fa;
border-color: #e4e7ed;
color: #606266;
font-family: 'Courier New', monospace;
font-size: 14px;
cursor: not-allowed;
}
.readonly-textarea >>> .el-textarea__inner {
background-color: #f5f7fa;
border-color: #e4e7ed;
color: #606266;
cursor: not-allowed;
}
/* 审核操作样式 */
.action-section {
border: 2px solid #409EFF;
background: linear-gradient(135deg, #f0f9ff 0%, #e6f7ff 100%);
}
.audit-radio-group {
display: flex;
gap: 20px;
}
.audit-radio {
display: flex;
align-items: center;
padding: 15px 25px;
border: 2px solid #e4e7ed;
border-radius: 8px;
background: white;
cursor: pointer;
transition: all 0.3s ease;
flex: 1;
justify-content: center;
}
.audit-radio:hover {
border-color: #409EFF;
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2);
}
.audit-radio.is-checked {
border-color: #409EFF;
background: linear-gradient(135deg, #f0f9ff, #e6f7ff);
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}
.audit-radio i {
margin-right: 8px;
font-size: 16px;
}
.audit-radio span {
font-weight: 500;
}
/* 底部按钮样式 */
.dialog-footer {
padding: 20px 30px;
background: #f8f9fa;
border-top: 1px solid #e9ecef;
text-align: right;
}
.dialog-footer .el-button {
padding: 10px 25px;
border-radius: 6px;
font-weight: 500;
}
.dialog-footer .el-button--primary {
background: linear-gradient(135deg, #409EFF, #66b1ff);
border: none;
}
.dialog-footer .el-button--primary:hover {
background: linear-gradient(135deg, #66b1ff, #409EFF);
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.4);
}
/* 响应式优化 */
@media (max-width: 768px) {
.dialog-content {
padding: 15px;
}
.section-header {
padding: 15px 20px;
}
.section-content {
padding: 15px;
}
.audit-radio-group {
flex-direction: column;
gap: 10px;
}
.audit-radio {
padding: 12px 20px;
}
.audit-dialog >>> .el-dialog__body {
max-height: 90vh;
}
}
/* 小屏幕优化 */
@media (max-width: 480px) {
.audit-dialog >>> .el-dialog {
width: 95% !important;
margin: 0 auto;
}
.audit-dialog >>> .el-dialog__body {
max-height: 95vh;
}
}
</style>