Commit 3a9d7297 by wangzhihui

积分审批

1 parent de6049c9
<!-- 到账明细 -->
<template>
<div class="points">
<div class="header">
<div class="title">到账明细</div>
</div>
<div class="container gl-form-page">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 -->
<GLTable ref="withdrawRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @selectionTable="selectionTable">
<div class="flex_sc" slot="colorStatus" slot-scope="scope">
<div class="table_point" :style="{ background: colors[scope.scope.status] }"></div>
<span>{{ tableStatus[scope.scope.status] }}</span>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as XLSX from 'xlsx'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import util from '@/utils/index'
const tableStatus = ['待审核', '已审核', '第三方处理', '成功', '失败', '驳回', '受理失败']
const colors = ['#FDB757', '#2CCA74', '#5850FF', '#2CCA74', '#999999', '#EB4E4E', '#2CCA74']
const tabelHeaderModel = ['商户名称', '商户号', '客户名称', '客户手机号', '提现金额', '收款人姓名', '收款人身份证', '收款银行卡号', '收款银行', '收款人手机号']
export default {
data() {
return {
id: '',
checkLoading: false,
loading: false,
colors,
tableStatus,
size: 'small',
url: url,
settleAmount: {},
searchForm: {
customerName: ''
},
hasFooter: false,
tableSearchForm: {},
showFormData: [
{
label: '',
labelWidth: '0',
name: 'customerName',
placeholder: '客户名称/手机号',
type: 'input',
isClear: true,
maxlength: 20
}
],
// 表格
getListApi: this.$apis.withdraw.getList,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '客户名称',
prop: 'customerName',
width: 150
},
{
label: '提现方式',
prop: 'mode',
width: '200px'
// formatter: cellValue => {
// let arr = this.baseData.modeTypeList.filter(item => item.confId == cellValue.mode)
// return arr.length > 0 ? arr[0].confLabel : '--'
// }
},
{
label: '手机号',
prop: 'customerPhone',
width: '140px'
},
{
label: '所属门店',
prop: 'merchantName',
line: 1,
width: 150
},
{
label: '提现积分',
prop: 'integralAmount',
width: 100
},
{
label: '提现金额/元',
prop: 'payAmount',
width: 100,
formatter: cellValue => {
return cellValue.payAmount ? (cellValue.payAmount / 100).toFixed(2) : '--'
}
},
{
label: '收款人姓名',
prop: 'name',
width: '110px'
},
{
label: '收款人身份证',
prop: 'idCardNo',
width: '180px'
},
{
label: '收款银行卡号',
prop: 'recvBankCardNo',
width: 230
},
{
label: '收款银行',
prop: 'recvBank',
line: 1,
width: 150
},
{
label: '收款手机号',
prop: 'mobile',
width: '130px'
},
{
label: '客户名称',
prop: 'customerName',
width: 150
},
{
label: '客户手机号',
prop: 'customerPhone',
width: '140px'
},
{
label: '所属门店',
prop: 'merchantName',
line: 1,
width: 150
},
{
label: '提现积分',
prop: 'integralAmount',
width: 100
},
{
label: '提现金额',
prop: 'payAmount',
width: 100,
formatter: cellValue => {
return cellValue.payAmount ? (cellValue.payAmount / 100).toFixed(2) : '--'
}
},
{
label: '收款人姓名',
prop: 'name',
width: '110px'
},
{
label: '收款人身份证',
prop: 'idCardNo',
width: '180px'
},
{
label: '收款银行卡号',
prop: 'recvBankCardNo',
width: 230
},
{
label: '收款银行',
prop: 'recvBank',
line: 1,
width: 150
},
{
label: '收款手机号',
prop: 'mobile',
width: '130px'
},
{
label: '到账情况',
prop: 'customerOpenId',
width: '130px'
},
{
label: '到账时间',
prop: 'receiptDate',
width: '200px'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {}
}
},
mounted() {},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
console.log(this.searchForm)
if (this.searchForm.applyDateStr) {
params.applyDateStart = dayjs(this.searchForm.applyDateStr[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.applyDateEnd = dayjs(this.searchForm.applyDateStr[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchForm.payTimeStr) {
params.payDateStart = dayjs(this.searchForm.payTimeStr[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.payDateEnd = dayjs(this.searchForm.payTimeStr[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchForm.receiptDateStr) {
params.receiptDateStart = dayjs(this.searchForm.receiptDateStr[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.receiptDateEnd = dayjs(this.searchForm.receiptDateStr[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchForm.channel) {
params.channel = this.searchForm.channel[0]
params.channelProvider = this.searchForm.channel.length > 1 ? this.searchForm.channel[1] : ''
}
delete params.payTimeStr, delete params.applyDateStr, delete params.receiptDateStr
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.payTimeStr
delete this.tableSearchForm.applyDateStr
resolve()
})
},
handleSearch() {
this.$refs.withdrawRef.refreshTable()
},
handleReset() {
this.searchForm = {
outSettleOrderId: '',
customerName: '',
customerPhone: '',
status: '',
channel: '',
merchantName: '',
mode: '',
withdrawalSource: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped lang='scss'>
.points {
.header {
padding: 14px 20px;
background: #fff;
color: #333333;
font-size: 20px;
font-weight: 600;
border-bottom: 1px solid #e5e5e5;
}
}
.gl-form-page /deep/ .search-list .search-item .name {
width: 0px !important;
}
.gl-form-page /deep/ .glsx-combi-form .el-form-item--small {
width: auto;
}
</style>
\ No newline at end of file
<!-- 编辑 -->
<template>
<div class="points">
<div class="header">
<div class="title">编辑</div>
</div>
<div class="container gl-form-page">
<div class="flex-sb">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<el-button size="small" @click="handleCheck('', true)" type="primary" plain>全部驳回</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="withdrawRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @selectionTable="selectionTable">
<div class="flex_sc" slot="colorStatus" slot-scope="scope">
<div class="table_point" :style="{ background: colors[scope.scope.status] }"></div>
<span>{{ tableStatus[scope.scope.status] }}</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 驳回 -->
<GLDialog class="gl-form-page gl-form-min" :title="isAll ? '全部驳回' : '驳回'" mode="mid" :visible.sync="showPassDialog" :close-on-click-modal="false" :before-close="clearSelect">
<div class="remind">
<img class="tip" src="@/assets/tips.png" alt="" />
请填写驳回原因,{{ isAll ? '全部驳回' : '驳回' }}后本批次将关闭,且提现积分原路返回。
</div>
<el-form ref="form" :model="form" label-width="154px" :rules="formRule">
<el-form-item label="驳回原因:" prop="remark" required>
<el-input type="textarea" v-model="form.remark" :rows="3" maxlength="50"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="clearSelect">取消</el-button>
<el-button type="primary" size="small" :loading="checkLoading" @click="comfirmCheck">确定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
import * as XLSX from 'xlsx'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import util from '@/utils/index'
const tableStatus = ['待审核', '已审核', '第三方处理', '成功', '失败', '驳回', '受理失败']
const colors = ['#FDB757', '#2CCA74', '#5850FF', '#2CCA74', '#999999', '#EB4E4E', '#2CCA74']
const tabelHeaderModel = ['商户名称', '商户号', '客户名称', '客户手机号', '提现金额', '收款人姓名', '收款人身份证', '收款银行卡号', '收款银行', '收款人手机号']
export default {
data() {
return {
id: '',
isAll: true,
checkLoading: false,
showPassDialog: false,
loading: false,
colors,
tableStatus,
size: 'small',
url: url,
settleAmount: {},
searchForm: {
customerName: ''
},
hasFooter: false,
tableSearchForm: {},
tableButtonList: [
{
type: 'el-button',
name: '驳回',
attrs: {
type: 'text',
fn: '驳回'
},
listeners: {
click: row => {
this.handleCheck(row, false)
}
}
}
],
showFormData: [
{
label: '',
labelWidth: '0',
name: 'customerName',
placeholder: '客户名称/手机号',
type: 'input',
isClear: true,
maxlength: 20
}
],
// 表格
getListApi: this.$apis.withdraw.getList,
tableParams: {
listName: 'list',
tableOption: {
width: 100
},
tableColumns: [
{
label: '客户名称',
prop: 'customerName',
width: 150
},
{
label: '提现方式',
prop: 'mode',
width: '200px'
// formatter: cellValue => {
// let arr = this.baseData.modeTypeList.filter(item => item.confId == cellValue.mode)
// return arr.length > 0 ? arr[0].confLabel : '--'
// }
},
{
label: '手机号',
prop: 'customerPhone',
width: '140px'
},
{
label: '所属门店',
prop: 'merchantName',
line: 1,
width: 150
},
{
label: '提现积分',
prop: 'integralAmount',
width: 100
},
{
label: '提现金额/元',
prop: 'payAmount',
width: 100,
formatter: cellValue => {
return cellValue.payAmount ? (cellValue.payAmount / 100).toFixed(2) : '--'
}
},
{
label: '收款人姓名',
prop: 'name',
width: '110px'
},
{
label: '收款人身份证',
prop: 'idCardNo',
width: '180px'
},
{
label: '收款银行卡号',
prop: 'recvBankCardNo',
width: 230
},
{
label: '收款银行',
prop: 'recvBank',
line: 1,
width: 150
},
{
label: '收款手机号',
prop: 'mobile',
width: '130px'
},
{
label: '客户名称',
prop: 'customerName',
width: 150
},
{
label: '客户手机号',
prop: 'customerPhone',
width: '140px'
},
{
label: '所属门店',
prop: 'merchantName',
line: 1,
width: 150
},
{
label: '提现积分',
prop: 'integralAmount',
width: 100
},
{
label: '提现金额',
prop: 'payAmount',
width: 100,
formatter: cellValue => {
return cellValue.payAmount ? (cellValue.payAmount / 100).toFixed(2) : '--'
}
},
{
label: '收款人姓名',
prop: 'name',
width: '110px'
},
{
label: '收款人身份证',
prop: 'idCardNo',
width: '180px'
},
{
label: '收款银行卡号',
prop: 'recvBankCardNo',
width: 230
},
{
label: '收款银行',
prop: 'recvBank',
line: 1,
width: 150
},
{
label: '收款手机号',
prop: 'mobile',
width: '130px'
},
{
label: '到账情况',
prop: 'customerOpenId',
width: '130px'
},
{
label: '到账时间',
prop: 'receiptDate',
width: '200px'
}
]
},
form: {
remark: ''
},
formRule: {
remark: [{ required: true, message: '请输入驳回原因', trigger: 'blur' }]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {}
}
},
mounted() {},
methods: {
clearSelect() {
this.ids = ''
this.form.remark = ''
this.showPassDialog = false
},
comfirmCheck() {
this.$refs.form.validate(valid => {
if (valid) {
// this.checkLoading = true
// this.$apis.withdraw[Methods](params)
// .then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : res.message,
// type: res.code == '0' ? 'success' : 'error'
// })
// })
// .finally(() => {
// this.handleReset()
// this.clearSelect()
// this.checkLoading = false
// })
}
})
},
//驳回
handleCheck(row, isAll) {
this.isAll = isAll
this.form.id = !this.isAll ? row.id : ''
this.showPassDialog = true
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
console.log(this.searchForm)
if (this.searchForm.applyDateStr) {
params.applyDateStart = dayjs(this.searchForm.applyDateStr[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.applyDateEnd = dayjs(this.searchForm.applyDateStr[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchForm.payTimeStr) {
params.payDateStart = dayjs(this.searchForm.payTimeStr[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.payDateEnd = dayjs(this.searchForm.payTimeStr[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchForm.receiptDateStr) {
params.receiptDateStart = dayjs(this.searchForm.receiptDateStr[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.receiptDateEnd = dayjs(this.searchForm.receiptDateStr[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchForm.channel) {
params.channel = this.searchForm.channel[0]
params.channelProvider = this.searchForm.channel.length > 1 ? this.searchForm.channel[1] : ''
}
delete params.payTimeStr, delete params.applyDateStr, delete params.receiptDateStr
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.payTimeStr
delete this.tableSearchForm.applyDateStr
resolve()
})
},
handleSearch() {
this.$refs.withdrawRef.refreshTable()
},
handleReset() {
this.searchForm = {
outSettleOrderId: '',
customerName: '',
customerPhone: '',
status: '',
channel: '',
merchantName: '',
mode: '',
withdrawalSource: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped lang='scss'>
.points {
.header {
padding: 14px 20px;
background: #fff;
color: #333333;
font-size: 20px;
font-weight: 600;
border-bottom: 1px solid #e5e5e5;
}
.remind {
display: flex;
align-items: center;
width: 680px;
height: 36px;
border-radius: 3.6px;
border: 1px solid #5850ff;
background: #ebebff;
padding-left: 16px;
box-sizing: border-box;
color: #000000a6;
font-size: 14px;
margin-bottom: 20px;
.tip {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
}
.gl-form-page /deep/ .search-list .search-item .name {
width: 0px !important;
}
.gl-form-page /deep/ .glsx-combi-form .el-form-item--small {
width:auto;
}
</style>
\ No newline at end of file
<!-- 查看 -->
<!-- 盘点详情弹窗弹窗 -->
<template>
<GLDialog bigTitle="详细信息" :visible.sync="isVisible" :hasFooter="false" :before-close="handleClose" class="points" mode="big" okText="关闭" @onCancel="handleClose" @onOk="handleClose">
<div class="wrap edit-box">
<div>
<p class="edit-title">订单信息</p>
<el-form label-width="150px" :inline="true">
<el-row v-for="(item, index) in withdrawDataRow" :key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label + ':'" class="row-item">
<span v-if="subItem.addHtml">
{{ subItem.addHtml(recordInfo) }}
</span>
<span v-else class="detail-txt ellipsis-1" :title="recordInfo[subItem.name]">{{ recordInfo[subItem.name] ? recordInfo[subItem.name] + (subItem.suffix || '') : '-' }}</span>
</el-form-item>
</el-row>
</el-form>
</div>
<div>
<p class="edit-title">付款信息</p>
<el-form label-width="154px" :inline="true">
<el-row v-for="(item, index) in paymentDataRow" :key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label + ':'" class="row-item">
<span v-if="subItem.addHtml">
{{ subItem.addHtml(recordInfo) }}
</span>
<span v-else-if="subItem.addStyle" class="flex_sc">
<div class="table_point" :style="{ background: subItem.addStyle(recordInfo).color }"></div>
{{ subItem.addStyle(recordInfo).status }}
</span>
<span v-else class="detail-txt ellipsis-1" :title="recordInfo[subItem.name]">{{ recordInfo[subItem.name] ? recordInfo[subItem.name] + (subItem.suffix || '') : '-' }}</span>
</el-form-item>
</el-row>
</el-form>
</div>
<div v-if="recordInfo.operationList">
<p class="edit-title">操作记录</p>
<!-- <template v-for="(record, recordIdx) in recordInfo.operationList">
<el-form label-width="154px" :inline="true" :key="recordIdx">
<el-row v-for="(item, index) in operationDataRow" :key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label(record) + ':'" class="row-item">
<span v-if="subItem.addHtml" class="flex_sc">
<div class="table_point" :style="{ background: subItem.addHtml(record).color }"></div>
{{ subItem.addHtml(record).status }}
</span>
<span v-else class="detail-txt ellipsis-1" :title="record[subItem.name]">{{ record[subItem.name] ? record[subItem.name] + (subItem.suffix || '') : '-' }}</span>
</el-form-item>
</el-row>
</el-form>
</template> -->
</div>
</div>
</GLDialog>
</template>
<script>
const tableStatus = ['待审核', '已审核', '第三方处理', '成功', '失败', '驳回']
const colors = ['#FDB757', '#2CCA74', '#5850FF', '#2CCA74', '#999999', '#EB4E4E']
const channelObj = {
'TXIAT': '熠轩-银行卡',
'ZX': '中雄-银行卡',
'YUNHUO': '云获(嘀加)-银行卡',
"YUNHUO-ZY": '云获(中赢)-银行卡',
'YUNHUO-WX': '云获(中赢)-微信',
'SHENBIANYUN':'身边云-银行卡'
}
export default {
name: 'DetailDialog',
data() {
return {
recordInfo: {},
withdrawDataRow: [],
paymentDataRow: [],
operationDataRow: [],
withdrawData: [],
paymentData: [],
operationData: [],
isVisible: this.detailVisible,
}
},
props: {
detailVisible: {
type: Boolean,
default: false
},
id: {
type: Number,
default: 0
}
},
watch: {
detailVisible(newVal) {
this.isVisible = newVal
this.getDetails()
}
},
computed: {},
mounted() {},
methods: {
getDetails() {
this.$apis.withdraw.getDetails({ id: this.id }).then(res => {
this.recordInfo = res
this.getConfig()
})
},
getConfig() {
this.withdrawData = [
{
label: '批次号',
name: 'outSettleOrderId'
},
{
label: '客户数量',
name: 'transferType',
addHtml: obj => {
return obj.transferType == 0 ? '积分提现' : obj.transferType == 1 ? '普通提现' : '阳光激励'
}
},
{
label: '积分总额:',
name: 'integralAmount'
},
{
label: '付款总额/元:',
name: 'payAmount',
addHtml: obj => {
return obj.payAmount ? (obj.payAmount / 100).toFixed(2) : '--'
}
},
{
label: '状态',
name: 'status',
addStyle: obj => {
return {
status: tableStatus[obj.status],
color: colors[obj.status]
}
}
}
]
this.paymentData = [
{
label: '付款渠道',
name: 'name'
},
{
label: '付款主体',
name: 'idCardNo'
},
{
label: '渠道到账时间',
name: 'receiptDate'
}
]
this.formToRow('withdrawData')
// this.formToRow('operationData')
this.formToRow('paymentData')
},
handleJudgment(target, key) {
let arr = target,
len = arr.length,
item
for (let i = 0; i < len; i++) {
item = arr[i]
if (item.name == key) {
arr.splice(i, 1)
}
}
},
formToRow(formName, numOfRow = 3) {
var rowNum = Math.ceil(this[formName].length / numOfRow)
for (var i = 0; i < rowNum; i++) {
for (var j = 0; j < numOfRow; j++) {
if (j == 0) {
this[formName + 'Row'][i] = {
rowList: []
}
}
if (i * numOfRow + j < this[formName].length) {
this[formName + 'Row'][i].rowList.push(this[formName][i * numOfRow + j])
}
}
}
},
handleClose() {
this.isVisible = false
this.$emit('dialogClose')
}
}
}
</script>
<style scoped lang="scss">
.edit-box .row-item {
width: 30%;
/deep/ {
.el-form-item__content {
height: 30px;
}
}
}
.detail-txt {
display: inline-block;
width: 136px;
}
.edit-title {
font-weight: 600;
font-size: 16px;
color: #000000d9;
line-height: 24px;
}
.m-b-20 {
margin-top: 20px;
}
/deep/ .el-form-item {
margin-bottom: 0;
}
.table_point {
width: 6px;
height: 6px;
border-radius: 50%;
margin-right: 8px;
}
.copy {
color: #5850ff;
margin-left: 20px;
cursor: pointer;
}
</style>
\ No newline at end of file
<template>
<div class="points">
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset">
<template slot="channel">
<el-cascader :options="baseData.channelList" style="width: 100%" v-model="searchForm.channel" :placeholder="'请选择'" filterable @change="selectAddAttr($event)"></el-cascader>
</template>
</GLCombiForm>
<div class="table-header">
<!-- <h2>积分提现列表</h2> -->
<div class="statistics">
累计结算金额:熠轩-银行卡
<span class="price">{{ settleAmount.yiXuanSettleAmount }}</span>
元, 中雄-银行卡
<span class="price">{{ settleAmount.zxSettleAmount }}</span>
元,云获(嘀加)-银行卡
<span class="price">{{ settleAmount.yunHuoSettleAmount }}</span>
元, 云获(中赢)-银行卡
<span class="price">{{ settleAmount.yunHuoZYSettleAmount }}</span>
元, 云获(中赢)-微信
<span class="price">{{ settleAmount.yunHuoWXSettleAmount }}</span>
元,身边云(翔禾)-银行卡
<span class="price">{{ settleAmount.shenBianYunXHSettleAmount }}</span>
元,身边云(雅钧)-银行卡
<span class="price">{{ settleAmount.shenBianYunYJSettleAmount }}</span>
元,身边云(博晟)-银行卡
<span class="price">{{ settleAmount.shenBianYunBCSettleAmount }}</span>
元, 身边云(晨景)-银行卡
<span class="price">{{ settleAmount.shenBianYunCJSettleAmount }}</span>
</div>
<div>
<div class="select-wrap flex">
<el-select v-model="operaForm.batch" placeholder="批量操作" class="selectBtn">
<el-option v-for="(item, index) in batchOptions" :key="index" :label="item" :value="index" @click.native="handleSelectBtn(index, 'batch')"></el-option>
</el-select>
<el-select v-model="operaForm.key" placeholder="一键操作" class="selectBtn">
<el-option v-for="(item, index) in keyOptions" :key="index" :label="item" :value="index" @click.native="handleSelectBtn(index, 'key')"></el-option>
</el-select>
<!-- <el-button size="small" @click="handleCheck()" type="primary" plain>批量审核</el-button>
<el-button size="small" @click="handlePay()">批量付款</el-button> -->
<el-button size="small" @click="handleImport">提现导入</el-button>
<el-button size="small" @click="exportExcel">导出</el-button>
</div>
</div>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="withdrawRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @selectionTable="selectionTable">
<div class="flex_sc" slot="colorStatus" slot-scope="scope">
<div class="table_point" :style="{ background: colors[scope.scope.status] }"></div>
<span>{{ tableStatus[scope.scope.status] }}</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 审核驳回 -->
<GLDialog class="gl-form-page gl-form-min" :title="isRefuse != 2 ? '审核' : '驳回'" mode="mid" :visible.sync="showPassDialog" :close-on-click-modal="false" :before-close="clearSelect">
<el-form ref="form" :model="form" label-width="154px">
<el-form-item :label="isRefuse != 2 ? '备注:' : '驳回原因:'">
<el-input type="textarea" v-model="form.remark" :rows="3" maxlength="50"></el-input>
</el-form-item>
<span class="describe" v-if="isRefuse != 2">审核通过后,转账业务单据自动流转至财务确认。</span>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="clearSelect">取消</el-button>
<el-button type="primary" size="small" :loading="checkLoading" @click="comfirmCheck">确定</el-button>
</span>
</GLDialog>
<!-- 付款 -->
<GLDialog class="gl-form-page gl-form-min payWrap" title="付款" mode="mid" :visible.sync="isPay" :close-on-click-modal="false" :before-close="cancelPay">
<glsx-combi-form formRef="payChildRef" defaultWidth="284px" ref="payFormRef" :formObj="payForm" :formData="payFormData" :formRules="payRule">
<template slot="channelProvider">
<div v-if="providers && providers.channelProviderList" class="provider-wrap">
<div class="provider-title">
<img src="@/assets/icon.png" alt class="provider-icon" />
<div>身边云-银行卡</div>
</div>
<el-radio-group v-model="payForm.channelProvider" class="provider-radio" @change="selectChannelProvider()">
<el-radio v-for="item in providers.channelProviderList" :key="item.value" :label="item.value">{{ item.text }}</el-radio>
</el-radio-group>
</div>
</template>
<tempalte slot="balance">
<div class="channelMoney">
可用余额:
<span class="price">{{ this.payForm.balance }}</span>
<template v-if="this.payForm.balance != '-'">元</template>
</div>
</tempalte>
<template slot="captcha">
<div class="captcha-wrap">
<el-input v-model="payForm.captcha" placeholder="请输入"></el-input>
<div class="captcha-text" @click.prevent="getCode">
{{ !isCodeDisabled ? '获取验证码' : count + 's' }}
</div>
</div>
</template>
</glsx-combi-form>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="cancelPay">取消</el-button>
<el-button type="primary" size="small" :loading="loading" @click="comfirmPay">确定</el-button>
</span>
</GLDialog>
<!-- 提现导入 -->
<GLDialog class="gl-form-page gl-form-min" title="提现导入" mode="mid" :visible.sync="isImport" :close-on-click-modal="false" :before-close="cancelImport">
<template v-if="importForm.isLoading == 0">
<el-form ref="form" :model="importForm" label-width="154px" :rules="importRule">
<el-form-item label="上传文件:" prop="fileName">
<el-input v-model="importForm.fileName" placeholder="请选择文件" disabled></el-input>
<div class="import-btn">
<i class="el-icon-plus"></i>
选择文件
<input id="fileUpload" type="file" style="opacity: 0" ref="file" class="import-input" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel" @change="e => uploadFile(e)" />
</div>
<a class="download-url" href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/提现导入模版.xlsx">下载模版</a>
</el-form-item>
</el-form>
</template>
<div class="middle" v-if="importForm.isLoading == 1">
<i class="el-icon el-icon-loading"></i>
<div class="resulttip">正在处理中</div>
<div class="state">说明:系统正在加急导入中,请耐心等待;导入过程中,请不要退出当前操作,否则将导致本次提现导入无效。</div>
</div>
<div class="middle" v-if="importForm.isSuccess == 1">
<i class="el-icon el-icon-success"></i>
<div class="resulttip">处理成功</div>
<div class="state">已自动为您导入{{ importForm.successCount }}条提现记录,可返回列表查看。</div>
</div>
<div class="middle" v-if="importForm.isSuccess == 2">
<i class="el-icon el-icon-error"></i>
<div class="resulttip">处理失败</div>
<div class="state">
可点击
<a class="err-url" :href="importForm.errorUrl">下载失败模版</a>
查看失败原因。
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="cancelImport" v-show="importForm.isSuccess == 0">取消</el-button>
<el-button type="primary" size="small" :loading="checkLoading" @click="comfirmImport" v-show="importForm.isLoading != 1">确定</el-button>
</span>
</GLDialog>
<!-- 详情 -->
<detail-dialog :detail-visible="detailVisible" :id="id" @dialogClose="dialogClose"></detail-dialog>
<template>
<div>
<GLTabs v-model="tabId" @tab-click="changeTab" :tabPaneList="tabPaneList"></GLTabs>
<component :is="tabName" class="main-wrap"></component>
</div>
</template>
<script>
import * as XLSX from 'xlsx'
import DetailDialog from './detail.vue'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import util from '@/utils/index'
const tableStatus = ['待审核', '已审核', '第三方处理', '成功', '失败', '驳回', '受理失败']
const colors = ['#FDB757', '#2CCA74', '#5850FF', '#2CCA74', '#999999', '#EB4E4E', '#2CCA74']
const tabelHeaderModel = ['商户名称', '商户号', '客户名称', '客户手机号', '提现金额', '收款人姓名', '收款人身份证', '收款银行卡号', '收款银行', '收款人手机号']
import withdrawList from './list'
import approveList from './approve'
export default {
components: {
DetailDialog
},
components: { withdrawList, approveList },
data() {
return {
id: '',
checkLoading: false,
loading: false,
colors,
tableStatus,
size: 'small',
url: url,
settleAmount: {},
searchForm: {
outSettleOrderId: '',
customerName: '',
customerPhone: '',
status: '',
channel: '',
merchantName: '',
transferType: '',
mode: '',
withdrawalSource: ''
},
hasFooter: false,
tableSearchForm: {},
showFormData: [
{
label: '提现单号',
name: 'outSettleOrderId',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '客户名称',
name: 'customerName',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '手机号',
name: 'customerPhone',
type: 'input',
isClear: true,
maxlength: 11
},
{
label: '状态',
name: 'status',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'auditStatusStatusList'
},
{
label: '申请时间',
name: 'applyDateStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '付款时间',
name: 'payTimeStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '付款渠道',
name: 'channel',
type: 'select',
optionList: [],
addHtml: 'channel',
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'channelList'
},
{
label: '所属门店',
name: 'merchantName',
type: 'select',
optionList: [],
optionId: 'merchantName',
optionLabel: 'merchantName',
optionsName: 'merchantList'
},
{
label: '到账时间',
name: 'receiptDateStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '提现类型',
name: 'transferType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'withdrawalTypeList'
},
{
label: '提现方式',
name: 'mode',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'modeTypeList'
},
{
label: '来源',
name: 'withdrawalSource',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'sourceList'
}
],
tableButtonList: [
{
type: 'el-button',
name: '查看',
attrs: {
type: 'text',
fn: '查看'
},
listeners: {
click: this.handleDetail
}
},
{
type: 'el-button',
name: '审核',
attrs: {
type: 'text',
fn: '审核'
},
condition: row => {
return row.status == 0
},
listeners: {
click: row => {
this.handleCheck(row)
}
}
},
{
type: 'el-button',
name: '驳回',
attrs: {
type: 'text',
fn: '驳回'
},
condition: row => {
return row.status == 0 || row.status == 1 || row.status == 6
},
listeners: {
click: row => {
this.handleCheck(row, 2)
}
}
},
{
type: 'el-button',
name: '付款',
attrs: {
type: 'text',
fn: '付款'
},
condition: row => {
return row.status == 1 || row.status == 6
},
listeners: {
click: row => {
this.handlePay(row)
}
}
}
],
// 表格
getListApi: this.$apis.withdraw.getList,
tableParams: {
listName: 'list',
tableOption: {
width: 150
},
mutiSelectName: 'goodsIndex',
mutiSelectUniqueKey: 'id',
tableColumns: [
{
label: '提现单号',
prop: 'outSettleOrderId',
line: 1,
minWidth: 200
},
{
label: '提现类型',
prop: 'transferType',
width: '200px',
formatter: cellValue => {
let arr = this.baseData.withdrawalTypeList.filter(item => item.confId == cellValue.transferType)
return arr.length > 0 ? arr[0].confLabel : '--'
}
},
{
label: '提现方式',
prop: 'mode',
width: '200px',
formatter: cellValue => {
let arr = this.baseData.modeTypeList.filter(item => item.confId == cellValue.mode)
return arr.length > 0 ? arr[0].confLabel : '--'
}
},
{
label: '客户名称',
prop: 'customerName',
width: 150
},
{
label: '客户手机号',
prop: 'customerPhone',
width: '140px'
},
{
label: '所属门店',
prop: 'merchantName',
line: 1,
width: 150
},
{
label: '提现积分',
prop: 'integralAmount',
width: 100
},
{
label: '提现金额',
prop: 'payAmount',
width: 100,
formatter: cellValue => {
return cellValue.payAmount ? (cellValue.payAmount / 100).toFixed(2) : '--'
}
},
{
label: '收款人姓名',
prop: 'name',
width: '110px'
},
{
label: '收款人身份证',
prop: 'idCardNo',
width: '180px'
},
{
label: '收款银行卡号',
prop: 'recvBankCardNo',
width: 230
},
{
label: '收款银行',
prop: 'recvBank',
line: 1,
width: 150
},
{
label: '收款手机号',
prop: 'mobile',
width: '130px'
},
{
label: '微信openid',
prop: 'customerOpenId',
width: '130px'
},
{
label: '状态',
prop: 'status',
width: '200px',
addHtml: 'colorStatus'
},
{
label: '申请时间',
prop: 'createdDate',
width: '200px'
},
{
label: '来源',
prop: 'withdrawalSource',
width: '200px',
formatter: cellValue => {
let arr = this.baseData.sourceList.filter(item => item.confId == cellValue.withdrawalSource)
return arr.length > 0 ? arr[0].confLabel : '--'
}
},
{
label: '付款时间',
prop: 'payDate',
width: '200px'
},
{
label: '付款渠道',
prop: 'channel',
width: '200px',
formatter: cellValue => {
let arr = this.baseData.channelList.filter(item => item.value == cellValue.channel)
return arr.length > 0 ? arr[0].label : '--'
}
},
{
label: '服务商',
prop: 'channelProvider',
width: '200px',
formatter: cellValue => {
let Providers = [
{
value: 'SHENBIANYUN-XH',
label: '翔禾'
},
{
value: 'SHENBIANYUN-YJ',
label: '雅钧'
},
{
value: 'SHENBIANYUN-BC',
label: '博晟'
},
{
value: 'SHENBIANYUN-CJ',
label: '晨景'
}
]
let arr = cellValue.channelProvider ? Providers.filter(item => item.value == cellValue.channelProvider) : ''
return arr.length > 0 ? arr[0].label : '--'
}
},
{
label: '到账时间',
prop: 'receiptDate',
width: '200px'
},
{
label: '结算金额/元',
prop: 'settleAmount',
formatter: cellValue => {
return cellValue.settleAmount ? (cellValue.settleAmount / 100).toFixed(2) : '--'
},
width: '150px'
}
]
},
providers: {},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {
adminList: [],
merchantList: [],
auditStatusStatusList: [
{
confId: '0',
confLabel: '待审核'
},
{
confId: '1',
confLabel: '已审核'
},
{
confId: '2',
confLabel: '第三方处理'
},
{
confId: '3',
confLabel: '成功'
},
{
confId: '4',
confLabel: '失败'
},
{
confId: '5',
confLabel: '驳回'
},
{
confId: '6',
confLabel: '受理失败'
}
],
channelList: [
{
value: 'SHENBIANYUN',
label: '身边云-银行卡',
children: [
{
value: 'SHENBIANYUN-XH',
label: '翔禾'
},
{
value: 'SHENBIANYUN-YJ',
label: '雅钧'
},
{
value: 'SHENBIANYUN-BC',
label: '博晟'
},
{
value: 'SHENBIANYUN-CJ',
label: '晨景'
}
]
},
{
value: 'TXIAT',
label: '熠轩-银行卡'
},
{
value: 'ZX',
label: '中雄-银行卡'
},
{
value: 'YUNHUO',
label: '云获(嘀加)-银行卡'
},
{
value: 'YUNHUO-ZY',
label: '云获(中赢)-银行卡'
},
{
value: 'YUNHUO-WX',
label: '云获(中赢)-微信'
}
],
withdrawalTypeList: [
{
confId: '0',
confLabel: '积分提现'
},
{
confId: '1',
confLabel: '普通提现'
},
{
confId: '2',
confLabel: '阳光激励'
}
],
modeTypeList: [
{
confId: '0',
confLabel: '银行卡'
},
{
confId: '1',
confLabel: '微信'
}
],
sourceList: [
{
confId: '0',
confLabel: '车生活助手'
},
{
confId: '1',
confLabel: '系统导入'
},
{
confId: '2',
confLabel: '生意助手员工版'
},
{
confId: '3',
confLabel: '门店助手'
}
],
payChannelList: []
},
showPassDialog: false,
form: {
remark: ''
},
detailVisible: false,
isRefuse: 1,
recordInfo: '',
isPay: false,
isCodeDisabled: false,
count: '',
timer: null,
payForm: {
transferType: '',
payMoney: '',
admin: '',
channel: '',
captcha: '',
remark: '',
balance: '',
channelProvider: ''
},
payFormData: [
{
label: '付款总金额',
name: 'payMoney',
type: 'input',
isDisabled: 'true'
},
{
label: '付款渠道',
type: 'radio',
name: 'channel',
optionId: 'channel',
optionLabel: 'channelName',
optionsName: 'payChannelList',
optionList: [],
handleRadioChange: val => {
console.log(555)
this.payForm.channelProvider = ''
this.getBalance()
this.getAdmin()
this.isCodeDisabled = false
clearInterval(this.timer)
this.timer = null
this.payForm.captcha = ''
}
},
{
label: '',
addHtml: 'channelProvider'
},
{
label: '',
name: 'balance',
type: 'input',
addHtml: 'balance'
},
{
label: '管理员',
name: 'admin',
type: 'select',
optionsName: 'adminList',
optionId: 'adminId',
optionLabel: 'adminName',
changeAttr: val => {
this.payForm.phone = val
this.isCodeDisabled = false
clearInterval(this.timer)
this.timer = null
this.payForm.captcha = ''
}
},
{
label: '验证码',
addHtml: 'captcha',
name: 'captcha'
},
{
label: '备注',
name: 'remark',
type: 'input',
inputType: 'textarea',
maxlength: 50
}
],
payRule: {
channel: [{ required: true, message: '请选择付款渠道', trigger: 'change' }],
captcha: [{ required: true, message: '请输入验证码', trigger: 'blur' }]
},
importRule: {
fileName: [{ required: true, message: '请选择', trigger: 'blur' }]
},
importForm: {
isLoading: 0,
isSuccess: 0,
result: '',
fileName: '',
fileUrl: '',
successCount: '',
batchNo: '',
errorUrl: ''
},
operaForm: {
select: true,
batch: '',
key: ''
},
isImport: false,
batchOptions: ['批量审核', '批量付款'],
keyOptions: ['一键审核', '一键付款']
tabId: '1',
tabName: 'withdrawList',
tabPaneList: [
{ name: '1', label: '提现列表' },
{ name: '2', label: '积分提现审批' }
]
}
},
watch: {
'searchForm.customerPhone'(newVal) {
if (isNaN(Number(newVal))) {
this.searchForm.customerPhone = newVal.replace(/[^\d]/g, '')
}
}
// 'payForm.channel'(newVal) {
// if (newVal) {
// }
// }
},
mounted() {
this.$utils.getOptionsList(this, 'showFormData')
this.getMerchantList()
this.getSettleAmount()
},
mounted() {},
methods: {
//选择服务商
selectChannelProvider(e) {
console.log(e, this.payForm.channelProvider)
if (this.payForm.channelProvider) {
this.payForm.channel = this.providers.channel
this.getBalance()
this.getAdmin()
}
},
selectAddAttr(e) {
console.log(e)
},
//批量操作/一键操作
async handleSelectBtn(index, type) {
this.operaForm.select = type == 'batch' ? false : true
this.operaForm[type] = ''
let result = await this.getAllPayAmount(index, type)
if (result) {
if (index == 0) {
this.handleCheck()
} else if (index == 1) {
//付款前校验记录列表是否是同一个提现类型
let data = await this.checkRecordsTransferType(type)
this.payForm.transferType = data.transferType
this.payForm.mode = data.mode
this.handlePay()
}
}
},
//canApprove=false的时候就提示只能选待审核的,付款的时候canPay=false就提示只能选待付款和受理失败的
//获取批量付款的金额
getAllPayAmount(index, type) {
return new Promise(resolve => {
let key = index == 0 ? 'canApprove' : 'canPay',
Method = type == 'batch' ? 'getPayAmount' : 'getAllPayAmount',
textErr = ['请选择待审核的提现记录', '请选择已审核或受理失败的提现记录']
let params = {}
if (type == 'batch') {
if (!this.ids || this.ids.length == 0) {
this.$message.error(textErr[index])
return
}
params.ids = this.ids
} else {
params = {
...this.tableSearchForm
}
}
params[key] = false
this.$apis.withdraw[Method](params).then(res => {
if (!res[key]) {
this.$message.error(textErr[index])
resolve(false)
} else {
if (index == 1) {
this.payForm.payMoney = (res.payAmount / 100).toFixed(2)
}
resolve(true)
}
})
})
},
isZeroTrue(value) {
return value === 0 ? true : Boolean(value)
},
checkRecordsTransferType(type) {
return new Promise(resolve => {
let params = {}
if (type == 'batch') {
params.ids = this.ids
} else {
params = {
...this.tableSearchForm
}
}
this.$apis.withdraw.checkRecordsTransferType(params).then(res => {
// console.log(res)
if (this.isZeroTrue(res)) {
resolve(res)
}
})
})
},
getSettleAmount() {
let params = {
...this.tableSearchForm
}
this.$apis.withdraw.getSettleAmount(params).then(res => {
this.settleAmount = res
})
},
getMerchantList() {
this.$apis.withdraw.getMerchantList({}).then(res => {
this.baseData.merchantList = res.map(item => {
return {
merchantName: item
}
})
this.$utils.getOptionsList(this, 'showFormData', false, 'merchantName')
})
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
console.log(this.searchForm)
if (this.searchForm.applyDateStr) {
params.applyDateStart = dayjs(this.searchForm.applyDateStr[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.applyDateEnd = dayjs(this.searchForm.applyDateStr[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchForm.payTimeStr) {
params.payDateStart = dayjs(this.searchForm.payTimeStr[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.payDateEnd = dayjs(this.searchForm.payTimeStr[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchForm.receiptDateStr) {
params.receiptDateStart = dayjs(this.searchForm.receiptDateStr[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.receiptDateEnd = dayjs(this.searchForm.receiptDateStr[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchForm.channel) {
params.channel = this.searchForm.channel[0]
params.channelProvider = this.searchForm.channel.length > 1 ? this.searchForm.channel[1] : ''
}
delete params.payTimeStr, delete params.applyDateStr, delete params.receiptDateStr
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.payTimeStr
delete this.tableSearchForm.applyDateStr
resolve()
})
},
handleSearch() {
this.$refs.withdrawRef.refreshTable()
this.getSettleAmount()
},
handleReset() {
this.searchForm = {
outSettleOrderId: '',
customerName: '',
customerPhone: '',
status: '',
channel: '',
merchantName: '',
mode: '',
withdrawalSource: ''
}
this.handleSearch()
},
handleDetail(row) {
// console.log(row)
this.id = row.id
this.detailVisible = true
},
exportExcel() {
const params = this.getParams()
this.$apis.withdraw.orderExport(params).then(res => {
this.$utils.aToExport(res)
})
},
async uploadFile(e) {
const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx'
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const header = await this.compareHeader(file)
if (!util.getArrayIsSubset(header, tabelHeaderModel)) {
this.$message.error('模版错误')
} else {
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
this.importForm.fileUrl = file.name.split('.').pop() + '@' + arrBase64[1]
this.importForm.fileName = file.name
}
}
},
compareHeader(file) {
return new Promise(resolve => {
const reader = new FileReader()
reader.onload = event => {
/* 解析数据 */
const bstr = event.target.result
const wb = XLSX.read(bstr, { type: 'binary' })
/* 获取文件的第一个工作表(WorkSheet) */
const wsname = wb.SheetNames[0]
let ws = wb.Sheets[wsname]
if (!ws['!ref']) {
this.$message.error('格式错误')
return
}
ws = this.handleStartTd(ws, 'A9')
const data = this.getHeaderRow(ws)
resolve(data)
}
reader.readAsBinaryString(file)
})
},
handleStartTd(worksheet, start) {
let old = worksheet['!ref']
old = old.split(':')
worksheet['!ref'] = start + ':' + old[1]
return worksheet
},
getHeaderRow(sheet) {
// console.log(sheet)
const headers = []
/* sheet['!ref']表示所有单元格的范围,例如从A1到F8则记录为 A1:F8*/
const range = XLSX.utils.decode_range(sheet['!ref'])
let C,
R = range.s.r /* 从第一行开始 */
/* 按列进行数据遍历 */
for (C = range.s.c; C <= range.e.c; ++C) {
/* 查找第一行中的单元格 */
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
let hdr = 'UNKNOWN ' + C // <-- 进行默认值设置
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
if (!hdr.includes('UNKNOWN')) {
headers.push(hdr)
}
}
return headers
},
handleSaveImport() {
let params = {
batchNo: this.importForm.batchNo
}
this.$apis.withdraw.handleSaveImport(params).then(res => {
this.handleReset()
})
},
//提现导入
handleImport() {
this.isImport = true
this.clearFile()
},
clearFile() {
this.importForm = {
isLoading: 0,
isSuccess: 0,
result: '',
fileName: '',
fileUrl: '',
successCount: '',
batchNo: '',
errorUrl: ''
}
},
comfirmImport() {
let {
importForm: { isSuccess, fileName, isLoading },
isImport
} = this
if (fileName == '' && isLoading == 0) {
this.$message({
message: '请先选择文件',
type: 'error'
})
return
}
if (isImport && isSuccess != 0) {
this.isImport = false
this.clearFile()
return
}
this.importForm.isLoading = 1
this.$apis.withdraw.uploadXlsx({ file: this.importForm.fileUrl }).then(res => {
if (this.isImport) {
if (res.code == 0) {
this.importForm.isLoading = 2
if (res.data.importStatue == 0) {
this.importForm.successCount = res.data.successCount
this.importForm.isSuccess = 1 //处理成功
this.importForm.batchNo = res.data.batchNo
this.handleSaveImport()
} else {
this.importForm.errorUrl = res.data.errorUrl
this.importForm.isSuccess = 2 //处理失败
}
} else {
this.importForm.isLoading = 0
this.$message({
message: res.message,
type: 'error'
})
}
}
})
},
cancelImport() {
this.isImport = false
this.clearFile()
},
//获取复选table数据
selectionTable(val) {
this.ids = val.map(item => item.id)
},
//批量审核
handleCheck(row, isRefuse = 0) {
// console.log(row)
// isRefuse: 0:审批,2:驳回
if (row) {
this.operaForm.select = false
this.ids = isRefuse == 0 ? [row.id] : row.id
}
//驳回
this.isRefuse = isRefuse
this.showPassDialog = true
},
//付款
handlePay(row) {
if (row) {
this.operaForm.select = false
this.ids = [row.id]
this.payForm.payMoney = (row.payAmount / 100).toFixed(2)
this.payForm.transferType = row.transferType
this.payForm.mode = row.mode
}
this.getChannel()
this.isPay = true
},
getAdmin() {
this.$apis.withdraw.getAdmin({ channel: this.payForm.channel }).then(res => {
if (res) {
this.baseData.adminList = res.map(item => {
return {
adminId: `${item.phone}`,
adminName: `${item.name} ${item.phone}`,
name: item.name,
phone: item.phone
}
})
this.$utils.getOptionsList(this, 'payFormData', false, 'admin')
this.payForm.admin = this.baseData.adminList[0].adminId
this.payForm.phone = this.baseData.adminList[0].phone
}
})
},
//积分提现获取业务对应的付款渠道
getChannel(transferType) {
this.$apis.withdraw
.getChannel({
transferType: this.payForm.transferType,
mode: this.payForm.mode
})
.then(res => {
if (res) {
this.baseData.payChannelList = res
let index = this.baseData.payChannelList.findIndex(item => {
return item.channel == 'SHENBIANYUN'
})
if (index != -1) {
this.providers = this.baseData.payChannelList.splice(index, 1)[0]
}
if (this.baseData.payChannelList.length == 0) {
this.payForm.channel = this.providers.channel
this.payForm.channelProvider = this.providers.channelProviderList[0].value
}
this.$utils.getOptionsList(this, 'payFormData', false, 'channel')
//默认选择
if (this.baseData.payChannelList.length > 0) {
this.payForm.channel = this.baseData.payChannelList[0].channel
}
this.getBalance()
this.getAdmin()
}
})
},
getBalance() {
this.$apis.withdraw.getBalance({ channel: this.payForm.channel, channelProvider: this.payForm.channelProvider }).then(res => {
if (res) {
this.payForm.balance = res
} else {
this.payForm.balance = '-'
}
// this.payFormData.forEach((item, index) => {
// if (item.name == 'balance') {
// item.isHide = !res
// // this.$set(this.payFormData, index, item)
// }
// })
})
},
comfirmCheck() {
// console.log(this.ids)
if (this.isRefuse == 2 && this.form.remark == '') {
this.$message({
message: '请输入驳回原因',
type: 'error'
})
return
}
this.checkLoading = true
let { isRefuse } = this,
{ select } = this.operaForm, //true为一键操作
Methods = select ? 'integralAllOut' : this.isRefuse == 2 ? 'integralOut' : 'integralApprove',
params = select
? {
...this.tableSearchForm,
remark: this.form.remark
}
: {
remark: this.form.remark,
[isRefuse == 2 ? 'id' : 'ids']: this.ids,
type: isRefuse
}
this.$apis.withdraw[Methods](params)
.then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
.finally(() => {
this.handleReset()
this.clearSelect()
this.checkLoading = false
})
},
clearSelect() {
this.ids = ''
this.form.remark = ''
this.showPassDialog = false
this.$refs.withdrawRef.clearMutiSelect()
},
dialogClose() {
this.detailVisible = false
},
//付款
comfirmPay() {
this.$refs.payFormRef.$refs.payChildRef.validate(valid => {
if (valid) {
let { select } = this.operaForm,
Methods = select ? 'integralAllpay' : 'integralpay', //true为一键操作
params = select
? {
phone: this.payForm.phone,
...this.tableSearchForm,
payChannel: this.payForm.channel,
captcha: this.payForm.captcha,
remark: this.payForm.remark,
payChannelProvider: this.payForm.channelProvider
}
: {
phone: this.payForm.phone,
ids: this.ids,
channel: this.payForm.channel,
captcha: this.payForm.captcha,
remark: this.payForm.remark,
channelProvider: this.payForm.channelProvider
}
this.loading = true
this.$apis.withdraw[Methods](params)
.then(res => {
this.$message({
message: res.code == '0' ? '付款成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
.finally(() => {
this.handleReset()
this.getSettleAmount()
this.cancelPay()
this.loading = false
})
}
})
},
cancelPay() {
this.ids = ''
this.isPay = false
this.payForm = {
payMoney: '',
admin: '',
channel: '',
captcha: '',
remark: '',
balance: ''
}
this.isCodeDisabled = false
clearInterval(this.timer)
this.timer = null
this.$refs.withdrawRef.clearMutiSelect()
},
getCode() {
if (this.isCodeDisabled) return
if (!this.timer) {
this.count = 60
// var params = {
// phoneType: 'RG',
// phone: this.ruleForm.registerPhone
// }
this.$apis.withdraw
.getSms({
channel: this.payForm.channel,
phone: this.payForm.phone
})
.then(res => {
if (res.code == 0) {
this.$message.success('短信验证码发送成功')
this.isCodeDisabled = true
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= 60) {
this.count--
} else {
this.isCodeDisabled = false
clearInterval(this.timer)
this.timer = null
}
}, 1000)
} else {
this.$message.error(res.message)
}
})
changeTab() {
const arr = {
1: 'withdrawList',
2: 'approveList'
}
this.tabName = arr[+this.tabId]
}
}
}
</script>
<style scoped lang='scss'>
.describe {
font-size: 12px;
color: #999999;
margin-left: 154px;
}
.table_point {
width: 6px;
height: 6px;
border-radius: 50%;
margin-right: 8px;
}
.captcha-wrap {
.captcha-text {
font-size: 12px;
color: #5850ff;
position: absolute;
right: 0;
top: 2px;
margin-right: 10px;
cursor: pointer;
width: 100px;
height: 32px;
text-align: right;
}
}
.table-header {
.el-button + .el-button {
margin-left: 10px;
}
.selectBtn {
width: 100px;
margin-right: 10px;
/deep/.el-input__inner {
padding: 0 10px;
}
}
}
.price {
color: #5850ff;
}
.statistics {
font-size: 14px;
color: #999999;
}
.channelMoney {
font-size: 12px;
margin-left: 154px;
color: #999999;
margin-top: -20px;
.price {
color: #333333;
}
}
.import-btn {
position: relative;
width: 116px;
height: 32px;
text-align: center;
border-radius: 4px;
color: #666666;
font-size: 14px;
margin-left: 8px;
border: 1px solid #00000026;
line-height: 32px;
display: inline-block;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 32px;
cursor: pointer;
font-size: 0;
}
.download-url {
margin-top: 7px;
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 20px;
display: block;
}
.err-url {
margin-top: 7px;
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 20px;
display: inline-block;
}
.middle {
margin: 0 auto;
.el-icon {
font-size: 48px;
text-align: center;
position: relative;
left: 50%;
margin-left: -24px;
}
.el-icon-success {
color: #2dca75;
}
.el-icon-error {
color: #ec4f4f;
}
.resulttip {
font-weight: 600;
font-size: 16px;
color: #000000;
margin: 12px 0;
text-align: center;
}
.state {
font-size: 14px;
color: #666666;
text-align: center;
margin: 0 67px;
line-height: 20px;
}
}
.gl-form-page /deep/ .el-dialog__footer {
text-align: center !important;
}
.select-wrap {
/deep/ {
::-webkit-input-placeholder {
/*Webkit browsers*/
color: #606266;
font-size: 14px;
}
:-moz-placeholder {
/*Mozilla Firefox 4 to 8*/
color: #606266;
font-size: 14px;
}
::moz-placeholder {
/*Mozilla Firefox 19+*/
color: #606266;
font-size: 14px;
}
:-ms-input-placeholder {
/*Internet Explorer 10+*/
color: #606266;
font-size: 14px;
}
}
}
.payWrap {
/deep/ {
.el-form--inline .el-form-item {
display: block;
}
}
}
/deep/ {
.el-form-item:has(.el-radio-group) {
// display: flex!important;
// align-items: flex-start;
}
.el-radio-group {
width: 200px;
.el-radio {
margin-bottom: 4px;
// height: 32px;
width: 180px;
line-height: 32px;
}
}
}
.provider-wrap {
color: #666666;
font-size: 14px;
margin-left: 154px;
margin-top: -20px;
}
.provider-title {
display: flex;
align-items: center;
.provider-icon {
width: 16px;
height: 16px;
margin-right: 4px;
}
}
.provider-radio {
margin-left: 20px;
.main-wrap{
margin-top: 16px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!