WithdrawalDialog.vue
1.28 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
<template>
<el-dialog title='提示' :visible.sync='dialogVisible' width='30%'>
<div v-html='textTooltip'></div>
<span slot='footer' class='dialog-footer'>
<el-button @click='dialogVisible = false'>取 消</el-button>
<el-button type='primary' @click='handleDebounce'
>确 定</el-button
>
</span>
</el-dialog>
</template>
<script>
import { withdrawalApi } from '@/api/withdrawalManagement'
import debounce from '@/utils/debounce'
import { profitApi } from '@/api/profitManagement'
export default {
name: 'WithdrawalDialog',
props: ['textTooltip', 'auditId'],
data() {
return {
dialogVisible: false
}
},
methods: {
handleDebounce: debounce(
async function() {
const params = {
...JSON.parse(JSON.stringify(
{ idList: this.auditId }
)),
withDrawType: 1
}
await withdrawalApi.batchWithdrawal(params).then(res => {
if (res.code !== '0') {
this.$message.error('审核失败')
} else {
this.$message.success('审核成功')
}
}).catch(err => {
this.$message.error(err)
}
)
this.dialogVisible = false
},
1000
)
}
}
</script>
<style scoped>
</style>