Commit 21b251a4 by chenwq

```

feat(withdraw): 添加批量驳回功能

- 新增selectedRows和isBatchReject数据属性用于管理批量操作状态
- 实现handleBatchReject方法处理批量驳回逻辑,验证可驳回状态
- 在表格选择时同步更新selectedRows数据
- 批量驳回操作中调用API进行批量驳回请求
- 完善驳回成功后的状态重置和表格刷新逻辑
- 在清空选择时重置相关状态变量
```
1 parent 87cae278
...@@ -238,6 +238,8 @@ export default { ...@@ -238,6 +238,8 @@ export default {
return { return {
isMore: false, isMore: false,
ids: [], ids: [],
selectedRows: [],
isBatchReject: false,
batchTagVisible: false, batchTagVisible: false,
customTagVisible: false, customTagVisible: false,
statisticsTypeList, statisticsTypeList,
...@@ -1162,6 +1164,7 @@ export default { ...@@ -1162,6 +1164,7 @@ export default {
} }
switch (index) { switch (index) {
case 2: case 2:
this.handleBatchReject()
break break
case 3: case 3:
//批量生成批次 //批量生成批次
...@@ -1499,6 +1502,7 @@ export default { ...@@ -1499,6 +1502,7 @@ export default {
}, },
//获取复选table数据 //获取复选table数据
selectionTable(val) { selectionTable(val) {
this.selectedRows = val
this.ids = val.map(item => item.id) this.ids = val.map(item => item.id)
}, },
handleTagBind() { handleTagBind() {
...@@ -1511,9 +1515,21 @@ export default { ...@@ -1511,9 +1515,21 @@ export default {
handleTagBindSuccess() { handleTagBindSuccess() {
this.batchTagVisible = false this.batchTagVisible = false
this.ids = [] this.ids = []
this.selectedRows = []
this.$refs.withdrawRef.clearMutiSelect() this.$refs.withdrawRef.clearMutiSelect()
this.$refs.withdrawRef.refreshTable() this.$refs.withdrawRef.refreshTable()
}, },
handleBatchReject() {
const canReject = this.selectedRows.every(row => row.status == 0 || row.status == 1 || row.status == 6)
if (!canReject) {
this.$message.error('请选择能够驳回的提现记录')
return
}
this.operaForm.select = false
this.isBatchReject = true
this.isRefuse = 2
this.showPassDialog = true
},
//批量审核 //批量审核
handleCheck(row, isRefuse = 0) { handleCheck(row, isRefuse = 0) {
// console.log(row) // console.log(row)
...@@ -1622,6 +1638,25 @@ export default { ...@@ -1622,6 +1638,25 @@ export default {
return return
} }
this.checkLoading = true this.checkLoading = true
if (this.isBatchReject) {
this.$apis.withdraw
.batchReject({
ids: this.ids,
rejectReason: this.form.remark
})
.then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
.finally(() => {
this.handleReset()
this.clearSelect()
this.checkLoading = false
})
return
}
let { isRefuse } = this, let { isRefuse } = this,
{ select } = this.operaForm, //true为一键操作 { select } = this.operaForm, //true为一键操作
Methods = select ? 'integralAllOut' : this.isRefuse == 2 ? 'integralOut' : 'integralApprove', Methods = select ? 'integralAllOut' : this.isRefuse == 2 ? 'integralOut' : 'integralApprove',
...@@ -1651,6 +1686,8 @@ export default { ...@@ -1651,6 +1686,8 @@ export default {
}, },
clearSelect() { clearSelect() {
this.ids = '' this.ids = ''
this.selectedRows = []
this.isBatchReject = false
this.form.remark = '' this.form.remark = ''
this.showPassDialog = false this.showPassDialog = false
this.$refs.withdrawRef.clearMutiSelect() this.$refs.withdrawRef.clearMutiSelect()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!