Commit 8a82ac93 by chenwq

feat(withdraw): 添加提现列表批量标签绑定功能

新增Element UI Cascader级联选择器并完成注册
新建批量标签配置弹窗组件
在提现列表页添加标签标注按钮及相关交互逻辑
1 parent 42591206
import Vue from 'vue' import Vue from 'vue'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Card, Table, TableColumn, Pagination, Loading, Dialog, Drawer, MessageBox, Upload, Tooltip, Popover, Tabs, TabPane, Container } from 'element-ui' import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Cascader, Tree, Card, Table, TableColumn, Pagination, Loading, Dialog, Drawer, MessageBox, Upload, Tooltip, Popover, Tabs, TabPane, Container } from 'element-ui'
Vue.use(Button) Vue.use(Button)
Vue.use(ButtonGroup) Vue.use(ButtonGroup)
Vue.use(Form) Vue.use(Form)
...@@ -15,6 +15,7 @@ Vue.use(Option) ...@@ -15,6 +15,7 @@ Vue.use(Option)
Vue.use(TimePicker) Vue.use(TimePicker)
Vue.use(Col) Vue.use(Col)
Vue.use(DatePicker) Vue.use(DatePicker)
Vue.use(Cascader)
Vue.use(Tree) Vue.use(Tree)
Vue.use(Card) Vue.use(Card)
Vue.use(Table) Vue.use(Table)
......
<template>
<GLDialog class="batch-tag-dialog" title="批量配置二/三标签" mode="mid" :visible.sync="isVisible" :close-on-click-modal="false" :before-close="handleClose" append-to-body :z-index="3000">
<div v-loading="loading" class="batch-tag-content">
<div class="batch-tag-tip">
您已勾选
<span>{{ ids.length }}</span>
条明细,请选择统一覆盖的目标二/三级标签路径:
</div>
<el-cascader v-model="tagPath" class="batch-tag-cascader" :options="tagOptions" :props="cascaderProps" placeholder="请选择二/三级标签" separator=" / " clearable filterable></el-cascader>
<div class="batch-tag-desc">提示:标签路径需在「自定义标签」中已补全至二级或三级后方可使用。</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="handleClose">取消</el-button>
<el-button type="primary" size="small" :loading="saving" @click="handleConfirm">确定</el-button>
</span>
</GLDialog>
</template>
<script>
export default {
name: 'BatchTagDialog',
props: {
visible: {
type: Boolean,
default: false
},
ids: {
type: Array,
default: () => []
}
},
data() {
return {
isVisible: false,
loading: false,
saving: false,
tagPath: [],
tagOptions: [],
cascaderProps: {
value: 'id',
label: 'name',
children: 'children',
emitPath: true
}
}
},
watch: {
visible: {
immediate: true,
handler(val) {
this.isVisible = val
if (val) {
this.tagPath = []
this.getTagTree()
}
}
}
},
methods: {
getTagTree() {
this.loading = true
this.$apis.withdraw
.getTagTree({ onlyComplete: true })
.then(res => {
const list = Array.isArray(res) ? res : res && Array.isArray(res.data) ? res.data : []
this.tagOptions = this.formatTree(list)
})
.finally(() => {
this.loading = false
})
},
formatTree(list) {
return (list || []).map(item => {
const sourceChildren = item.children || item.child || item.childList || []
const children = this.formatTree(sourceChildren)
const option = {
...item,
id: item.id,
name: item.name || item.label || item.tagName || ''
}
if (children.length) {
option.children = children
} else {
delete option.children
delete option.child
delete option.childList
}
return option
})
},
handleClose() {
this.$emit('update:visible', false)
},
handleConfirm() {
if (!this.tagPath.length) {
this.$message.warning('请选择二/三级标签')
return
}
this.saving = true
this.$apis.withdraw
.bindTag({
ids: this.ids,
tagId: this.tagPath[this.tagPath.length - 1]
})
.then(res => {
if (res) {
this.$message.success('保存成功')
this.$emit('success')
this.handleClose()
}
})
.finally(() => {
this.saving = false
})
}
}
}
</script>
<style lang="scss" scoped>
.batch-tag-dialog {
/deep/ {
.el-dialog {
width: 520px;
}
.el-dialog__body {
padding: 28px 24px 22px;
}
}
}
.batch-tag-content {
min-height: 94px;
}
.batch-tag-tip {
margin-bottom: 16px;
color: #606266;
font-size: 14px;
span {
color: #5850ff;
font-weight: 600;
}
}
.batch-tag-cascader {
width: 100%;
}
.batch-tag-desc {
margin-top: 10px;
color: #909399;
font-size: 12px;
line-height: 18px;
}
</style>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<!-- <el-button size="small" @click="handleCheck()" type="primary" plain>批量审核</el-button> <!-- <el-button size="small" @click="handleCheck()" type="primary" plain>批量审核</el-button>
<el-button size="small" @click="handlePay()">批量付款</el-button> --> <el-button size="small" @click="handlePay()">批量付款</el-button> -->
<!-- <el-button size="small" @click="">标签标注</el-button> --> <el-button size="small" @click="handleTagBind">标签标注</el-button>
<el-button size="small" @click="customTagVisible = true" type="primary">自定义标签</el-button> <el-button size="small" @click="customTagVisible = true" type="primary">自定义标签</el-button>
<el-button size="small" @click="handleImport">提现导入</el-button> <el-button size="small" @click="handleImport">提现导入</el-button>
<el-button size="small" @click="exportExcel">导出</el-button> <el-button size="small" @click="exportExcel">导出</el-button>
...@@ -196,6 +196,7 @@ ...@@ -196,6 +196,7 @@
</GLDialog> </GLDialog>
<!-- 详情 --> <!-- 详情 -->
<detail-dialog class="" :detail-visible="detailVisible" :id="id" @dialogClose="dialogClose"></detail-dialog> <detail-dialog class="" :detail-visible="detailVisible" :id="id" @dialogClose="dialogClose"></detail-dialog>
<batch-tag-dialog :visible.sync="batchTagVisible" :ids="ids" @success="handleTagBindSuccess"></batch-tag-dialog>
<custom-tag-drawer :visible.sync="customTagVisible"></custom-tag-drawer> <custom-tag-drawer :visible.sync="customTagVisible"></custom-tag-drawer>
<!-- 累计结算金额 --> <!-- 累计结算金额 -->
<GLDialog class="settleAmount-dialog" title="累计结算金额" mode="big" :visible.sync="isMore" :close-on-click-modal="false" :hasFooter="hasFooter"> <GLDialog class="settleAmount-dialog" title="累计结算金额" mode="big" :visible.sync="isMore" :close-on-click-modal="false" :hasFooter="hasFooter">
...@@ -215,6 +216,7 @@ ...@@ -215,6 +216,7 @@
<script> <script>
import * as XLSX from 'xlsx' import * as XLSX from 'xlsx'
import DetailDialog from './detail.vue' import DetailDialog from './detail.vue'
import BatchTagDialog from './components/batchTagDialog.vue'
import CustomTagDrawer from './components/customTagDrawer.vue' import CustomTagDrawer from './components/customTagDrawer.vue'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
...@@ -226,11 +228,14 @@ const tabelHeaderModel = ['商户名称', '商户号', '客户名称', '客户 ...@@ -226,11 +228,14 @@ const tabelHeaderModel = ['商户名称', '商户号', '客户名称', '客户
export default { export default {
components: { components: {
DetailDialog, DetailDialog,
BatchTagDialog,
CustomTagDrawer CustomTagDrawer
}, },
data() { data() {
return { return {
isMore: false, isMore: false,
ids: [],
batchTagVisible: false,
customTagVisible: false, customTagVisible: false,
statisticsTypeList, statisticsTypeList,
props: { props: {
...@@ -1333,6 +1338,19 @@ export default { ...@@ -1333,6 +1338,19 @@ export default {
selectionTable(val) { selectionTable(val) {
this.ids = val.map(item => item.id) this.ids = val.map(item => item.id)
}, },
handleTagBind() {
if (!this.ids.length) {
this.$message.warning('请选择要标签的明细')
return
}
this.batchTagVisible = true
},
handleTagBindSuccess() {
this.batchTagVisible = false
this.ids = []
this.$refs.withdrawRef.clearMutiSelect()
this.$refs.withdrawRef.refreshTable()
},
//批量审核 //批量审核
handleCheck(row, isRefuse = 0) { handleCheck(row, isRefuse = 0) {
// console.log(row) // console.log(row)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!