index.vue
4.77 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
<template>
<div>
<WithdrawalSearch @sendSearchForm='getSearchForm' />
<div class='btnOptons'>
<el-button
size='small'
type='primary'
@click="handleDialog('check')"
>批量审核
</el-button
>
<!-- <el-button-->
<!-- size='small'-->
<!-- type='primary'-->
<!-- @click="handleDialog('transfer')"-->
<!-- >-->
<!-- 批量重新发起转账-->
<!-- </el-button-->
<!-- >-->
<el-button
size='small'
type='primary'
@click='handleOutput'
>导出
</el-button
>
</div>
<div class='account'>
<p>累计提现金额:{{ collectionCash.totalAmount }};</p>
<p>待审核:{{ collectionCash.reviewingAmount }};</p>
<p>到账中:{{ collectionCash.receivingAmount }};</p>
<p>已到账:{{ collectionCash.receivedAmount }};</p>
<p>到账失败:{{ collectionCash.failureAmount }}</p>
</div>
<WithdrawalTable ref='table' :searchForm='searchForm' @sendCollection='getCollection' />
<WithdrawalDialog :textTooltip='textTooltip' :auditId='auditId' ref='dialogRef' />
</div>
</template>
<script>
import { withdrawalApi } from '@/api/withdrawalManagement'
import WithdrawalSearch from './components/WithdrawalSearch'
import WithdrawalTable from './components/WithdrawalTable'
import WithdrawalDialog from './components/WithdrawalDialog'
import { profitApi } from '@/api/profitManagement'
export default {
components: {
WithdrawalSearch,
WithdrawalTable,
WithdrawalDialog
},
data() {
return {
textTooltip: '',
searchForm: {},
choiceStatus: [],
auditId: [],
collectionCash: {}
}
},
methods: {
getCollection(val) {
this.collectionCash = val
},
getSearchForm(val) {
let params = JSON.parse(JSON.stringify(val))
if (params && params.withdrawalTime) {
params.withdrawalBeginTime = params.withdrawalTime[0]
params.withdrawalEndTime = params.withdrawalTime[1]
}
if (params.withdrawalTime && params.withdrawalTime.length) delete params.withdrawalTime
if (params && params.reviewTime) {
params.reviewBeginTime = params.reviewTime[0]
params.reviewEndTime = params.reviewTime[1]
}
if (params.reviewTime && params.reviewTime.length) delete params.reviewTime
this.searchForm = params
setTimeout(() => {
this.$refs.table.$refs.withdrawalTable.refreshTable(true,true)
}, 500)
},
getSeletedData() {
this.choiceStatus = this.$refs.table.$children[0].mutiSelectArr.list &&
this.$refs.table.$children[0].mutiSelectArr.list.map(item => {
let { status, id, ...params } = item
return { status, id }
})
},
handleOutput() {
let params = JSON.parse(JSON.stringify(this.searchForm))
let pageConfig = {
pageSize: 9999, pageNum: 1
}
withdrawalApi.exportList({ ...params, ...pageConfig }).then(res => {
if (res.code == 0) {
this.$Utils.exportFn(res.data)
} else {
this.$message({
type: 'error',
message: '导出失败!'
})
}
})
},
vertify(selectType, status) {
this.getSeletedData()
let errMsg = selectType == 'check' ? '请选择待审核的提现记录!' : '请选择到账失败的提现记录'
if ((selectType && (this.choiceStatus && !this.choiceStatus.length)) || !(selectType && (this.choiceStatus && this.choiceStatus.every(item => item.status == status)))) {
this.$message({
type: 'error',
message: errMsg
})
return false
} else {
return true
}
},
handleDialog(type) {
let vertifycheck
if (type == 'check') {
vertifycheck = this.vertify('check', '1')
} else {
vertifycheck = this.vertify('transfer', '4')
}
if (vertifycheck) {
this.auditId = this.choiceStatus.map(item => item.id)
const checkText = `<p>审核通过, 系统将自动转账至员工的微信零钱中</p><p>是否确定审核?</p>`
const transferText = `<p>手动发起转账,系统将重新发起转账至员工的微信零钱中</p><p>是否确定发起?</p>`
this.textTooltip = type == 'check' ? checkText : transferText
this.$refs.dialogRef.dialogVisible = true
}
}
}
}
</script>
<style scoped>
.addList {
width: 112px;
background: #1994f9;
border-radius: 2px;
margin-bottom: 16px;
}
.el-icon-plus {
padding-right: 5px;
}
.my-row-height >>> .el-table__body-wrapper .el-table__row {
height: 48px;
}
.btnOptons {
margin-bottom: 10px;
}
.account {
display: flex;
}
.account > p {
margin-right: 10px;
}
</style>