Commit 99963a37 by chenwq

feat(withdraw): 新增提现记录自定义标签管理功能

补充引入Element UI的Drawer和Popover组件,新增提现标签相关API接口,新建标签管理抽屉与编辑弹窗组件,并在提现列表页添加标签管理入口
1 parent b2fca6a8
......@@ -10,6 +10,49 @@ const getList = params => {
sign: true
})
}
// 积分提现记录打标签
const bindTag = params => {
params.method = 'scrm.api.shopmall.integral.transfer.out.tag.bind'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 删除积分提现标签
const deleteTag = params => {
params.method = 'scrm.api.shopmall.integral.transfer.out.tag.delete'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 查询积分提现标签树
const getTagTree = params => {
params.method = 'scrm.api.shopmall.integral.transfer.out.tag.tree'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 保存积分提现标签
const saveTag = params => {
params.method = 'scrm.api.shopmall.integral.transfer.out.tag.save'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//付款渠道树形接口
const getChannelTree = params => {
params.method = `scrm.api.shopmall.integral.transfer.channel.config.tree`
......@@ -360,4 +403,4 @@ const getAdmin = (params={}) => {
sign: true
})
}
export default {getListPayLevy,getListPaymentEntity,getChannelList,getChannelTree,payApprovalAgain,getChannelAccount,approvalDetail,removeApproval,getPaymentEntityList,applyApprovalOA,getApprovalLog,getApprovalPage,generateBatchCount, integralorderBatch,getPayAmount,getAllPayAmount, integralAllOut, integralAllpay, getList, getAdmin, orderExport, integralpay, integralApprove, integralOut, getSms, getMerchantList, getDetails, uploadXlsx, handleSaveImport, getBalance, getSettleAmount,getChannel ,checkRecordsTransferType}
export default {getListPayLevy,getListPaymentEntity,getChannelList,getChannelTree,payApprovalAgain,getChannelAccount,approvalDetail,removeApproval,getPaymentEntityList,applyApprovalOA,getApprovalLog,getApprovalPage,generateBatchCount, integralorderBatch,getPayAmount,getAllPayAmount, integralAllOut, integralAllpay, getList, bindTag, deleteTag, getTagTree, saveTag, getAdmin, orderExport, integralpay, integralApprove, integralOut, getSms, getMerchantList, getDetails, uploadXlsx, handleSaveImport, getBalance, getSettleAmount,getChannel ,checkRecordsTransferType}
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, MessageBox, Upload, Tooltip, Tabs, TabPane, Container } from 'element-ui'
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'
Vue.use(Button)
Vue.use(ButtonGroup)
Vue.use(Form)
......@@ -22,9 +22,13 @@ Vue.use(TableColumn)
Vue.use(Pagination)
Vue.use(Loading)
Vue.use(Dialog)
Vue.use(Drawer)
Vue.use(Upload)
Vue.use(Tooltip)
Vue.use(Popover)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm
export const message = Message
export const messageBox = MessageBox
<template>
<el-drawer class="custom-tag-drawer" title="自定义标签" :visible.sync="isVisible" direction="rtl" size="680px" :before-close="handleClose" :append-to-body="true" :wrapperClosable="false">
<div class="tag-tree-panel" v-loading="loading">
<div class="tag-tree-title">
<span>标签列表</span>
</div>
<div class="tag-tree-body">
<div class="tag-root-node">
<span class="tag-root-name">
<i class="el-icon-caret-bottom"></i>
全部
</span>
<i class="el-icon-plus tag-root-add" @click="handleAddRoot"></i>
</div>
<el-tree ref="tagTree" :data="tagTree" :props="treeProps" node-key="id" default-expand-all :expand-on-click-node="false" :highlight-current="true" empty-text="暂无标签">
<div class="tag-tree-node" slot-scope="{ node, data }">
<span class="tag-node-name" :title="data.name">{{ data.name }}</span>
<el-popover v-model="data.popoverVisible" placement="bottom-end" width="128" trigger="click" popper-class="tag-node-popover">
<div class="tag-node-menu">
<div v-if="node.level < 3" class="tag-menu-item tag-menu-add" @click="handleAdd(data)">
<span>新增子标签</span>
</div>
<div class="tag-menu-item" @click="handleEdit(data)">编辑</div>
<div class="tag-menu-item danger" @click="handleDelete(data)">删除</div>
</div>
<i slot="reference" class="el-icon-more tag-node-more"></i>
</el-popover>
</div>
</el-tree>
</div>
</div>
<tag-form-dialog :visible.sync="tagDialogVisible" :tagInfo="tagFormInfo" @success="getTagTree"></tag-form-dialog>
</el-drawer>
</template>
<script>
import TagFormDialog from './tagFormDialog.vue'
export default {
name: 'CustomTagDrawer',
components: {
TagFormDialog
},
props: {
visible: {
type: Boolean,
default: false
}
},
data() {
return {
isVisible: false,
loading: false,
tagTree: [],
tagDialogVisible: false,
tagFormInfo: {},
treeProps: {
children: 'children',
label: 'name'
}
}
},
watch: {
visible: {
immediate: true,
handler(val) {
this.isVisible = val
if (val) {
this.getTagTree()
}
}
}
},
methods: {
handleClose(done) {
this.$emit('update:visible', false)
if (typeof done === 'function') {
done()
}
},
getTagTree() {
this.loading = true
this.$apis.withdraw
.getTagTree({})
.then(res => {
const list = Array.isArray(res) ? res : res && Array.isArray(res.data) ? res.data : []
this.tagTree = this.formatTree(list)
})
.finally(() => {
this.loading = false
})
},
formatTree(list) {
return (list || []).map(item => {
const children = item.children || item.child || item.childList || []
return {
...item,
name: item.name || item.label || item.tagName || '',
popoverVisible: false,
children: this.formatTree(children)
}
})
},
handleAddRoot() {
this.tagFormInfo = {
parentId: '',
name: ''
}
this.tagDialogVisible = true
},
handleAdd(data) {
data.popoverVisible = false
this.tagFormInfo = {
parentId: data.id,
name: ''
}
this.$nextTick(() => {
this.tagDialogVisible = true
})
},
handleEdit(data) {
data.popoverVisible = false
this.tagFormInfo = {
id: data.id,
parentId: data.parentId || '',
name: data.name
}
this.$nextTick(() => {
this.tagDialogVisible = true
})
},
handleDelete(data) {
data.popoverVisible = false
this.$confirm('确定删除该标签?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
return this.$apis.withdraw.deleteTag({ id: data.id })
})
.then(res => {
console.log(res)
if (res) {
this.$message.success('删除成功')
this.getTagTree()
}
})
.catch(() => {})
}
}
}
</script>
<style lang="scss" scoped>
.custom-tag-drawer {
/deep/ {
.el-drawer__header {
margin-bottom: 0;
padding: 20px 24px 16px;
color: #333333;
font-size: 16px;
font-weight: 600;
}
.el-drawer__body {
padding: 0 24px 24px;
overflow: hidden;
}
}
}
.tag-tree-panel {
width: 100%;
height: calc(100vh - 84px);
border: 1px solid #e5e9f2;
background: #ffffff;
box-sizing: border-box;
overflow: hidden;
}
.tag-tree-title {
height: 44px;
line-height: 44px;
padding: 0 16px;
color: #333333;
font-size: 14px;
box-sizing: border-box;
}
.tag-tree-body {
height: calc(100% - 44px);
overflow: auto;
padding: 0 8px 12px;
box-sizing: border-box;
}
.tag-root-node {
height: 30px;
line-height: 30px;
padding: 0 8px 0 0;
display: flex;
align-items: center;
justify-content: space-between;
color: #333333;
font-size: 13px;
box-sizing: border-box;
}
.tag-root-name {
display: flex;
align-items: center;
i {
margin-right: 6px;
color: #b7c0ca;
font-size: 12px;
}
}
.tag-root-add {
color: #8993a4;
font-size: 14px;
cursor: pointer;
}
.tag-tree-body {
/deep/ {
.el-tree {
color: #333333;
font-size: 13px;
}
.el-tree-node__content {
height: 30px;
line-height: 30px;
position: relative;
}
.el-tree-node__content:hover,
.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
background-color: #edf3ff;
}
.el-tree-node__expand-icon {
color: #b7c0ca;
font-size: 12px;
}
.el-tree-node__expand-icon.is-leaf {
color: transparent;
}
}
}
.tag-tree-node {
min-width: 0;
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
height: 30px;
padding-right: 8px;
}
.tag-node-name {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-right: 8px;
}
.tag-node-more {
color: #8993a4;
font-size: 14px;
cursor: pointer;
transform: rotate(90deg);
}
</style>
<style lang="scss">
.tag-node-popover {
min-width: 128px;
padding: 6px 0;
box-sizing: border-box;
border-radius: 3px;
box-shadow: 0 4px 14px rgba(31, 45, 61, 0.14);
border: 0;
.tag-node-menu {
font-size: 14px;
color: #606266;
}
.tag-menu-item {
height: 34px;
line-height: 34px;
padding: 0 14px;
cursor: pointer;
white-space: nowrap;
&:hover {
background: #f5f7fa;
}
i {
margin-right: 7px;
font-size: 14px;
}
}
.tag-menu-add {
color: #5850ff;
}
.tag-menu-item.danger {
color: #f56c6c;
}
}
</style>
<template>
<GLDialog class="gl-form-page gl-form-min tag-form-dialog" :title="dialogTitle" mode="mid" :visible.sync="isVisible" :close-on-click-modal="false" :before-close="handleClose" append-to-body :z-index="3000">
<glsx-combi-form ref="tagFormRef" formRef="tagChildRef" defaultWidth="432px" :formObj="tagForm" :formData="tagFormData" :formRules="tagRule"></glsx-combi-form>
<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="loading" @click="handleConfirm">确定</el-button>
</span>
</GLDialog>
</template>
<script>
export default {
name: 'TagFormDialog',
props: {
visible: {
type: Boolean,
default: false
},
tagInfo: {
type: Object,
default: () => ({})
}
},
data() {
return {
isVisible: false,
loading: false,
tagForm: {
id: '',
parentId: '',
name: ''
},
tagFormData: [
{
label: '标签名称',
name: 'name',
type: 'input',
maxlength: 50
}
],
tagRule: {
name: [
{ required: true, message: '请输入标签名称', trigger: 'blur' },
{ min: 1, max: 50, message: '标签名称长度为1-50个字符', trigger: 'blur' }
]
}
}
},
computed: {
dialogTitle() {
return this.tagForm.id ? '编辑标签' : '新增标签'
}
},
watch: {
visible: {
immediate: true,
handler(val) {
this.isVisible = val
if (val) {
this.initForm()
}
}
}
},
methods: {
initForm() {
this.tagForm = {
id: this.tagInfo.id || '',
parentId: this.tagInfo.parentId || '',
name: this.tagInfo.name || ''
}
this.$nextTick(() => {
const formRef = this.$refs.tagFormRef && this.$refs.tagFormRef.$refs.tagChildRef
formRef && formRef.clearValidate()
})
},
handleClose() {
this.$emit('update:visible', false)
this.$emit('close')
},
handleConfirm() {
const formRef = this.$refs.tagFormRef && this.$refs.tagFormRef.$refs.tagChildRef
if (!formRef) return
formRef.validate(valid => {
if (!valid) return
this.loading = true
const params = {
name: this.tagForm.name,
parentId: this.tagForm.parentId
}
if (this.tagForm.id) {
params.id = this.tagForm.id
}
this.$apis.withdraw
.saveTag(params)
.then(res => {
if (res && res.code && res.code != '0') {
this.$message.error(res.message || '保存失败')
return
}
this.$message.success('保存成功')
this.$emit('success')
this.handleClose()
})
.finally(() => {
this.loading = false
})
})
}
}
}
</script>
<style lang="scss" scoped>
.tag-form-dialog {
/deep/ {
.el-form--inline .el-form-item {
display: block;
}
.el-form .el-input {
width: 100%;
}
}
}
</style>
......@@ -63,8 +63,8 @@
<!-- <el-button size="small" @click="handleCheck()" type="primary" plain>批量审核</el-button>
<el-button size="small" @click="handlePay()">批量付款</el-button> -->
<el-button size="small" @click="">标签标注</el-button>
<el-button size="small" @click="" type="primary">自定义标签</el-button>
<!-- <el-button size="small" @click="">标签标注</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="exportExcel">导出</el-button>
</div>
......@@ -196,6 +196,7 @@
</GLDialog>
<!-- 详情 -->
<detail-dialog class="" :detail-visible="detailVisible" :id="id" @dialogClose="dialogClose"></detail-dialog>
<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">
<div class="content">
......@@ -214,6 +215,7 @@
<script>
import * as XLSX from 'xlsx'
import DetailDialog from './detail.vue'
import CustomTagDrawer from './components/customTagDrawer.vue'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import util from '@/utils/index'
......@@ -223,11 +225,13 @@ const colors = ['#FDB757', '#2CCA74', '#5850FF', '#2CCA74', '#999999', '#EB4E4E'
const tabelHeaderModel = ['商户名称', '商户号', '客户名称', '客户手机号', '提现金额', '收款人姓名', '收款人身份证', '收款银行卡号', '收款银行', '收款人手机号']
export default {
components: {
DetailDialog
DetailDialog,
CustomTagDrawer
},
data() {
return {
isMore: false,
customTagVisible: false,
statisticsTypeList,
props: {
value: 'code',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!