Commit de6049c9 by wangzhihui

积分审批

1 parent d0dfde16
......@@ -199,4 +199,87 @@ const checkRecordsTransferType = params => {
})
}
export default { getPayAmount,getAllPayAmount, integralAllOut, integralAllpay, getList, getAdmin, orderExport, integralpay, integralApprove, integralOut, getSms, getMerchantList, getDetails, uploadXlsx, handleSaveImport, getBalance, getSettleAmount,getChannel ,checkRecordsTransferType}
// 积分提现 生成批次
const integralorderBatch = params => {
params.method = `scrm.api.shopmall.integral.transfer.out.approval.generate`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 生成审批-数据统计
const generateBatchCount = params => {
params.method = `scrm.api.shopmall.integral.transfer.out.approval.generate.count`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 操作记录列表查询
const getApprovalLog = params => {
params.method = `scrm.api.shopmall.integral.transfer.out.approval.log`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 积分提现审批分页查询
const getApprovalPage = params => {
params.method = `scrm.api.shopmall.integral.transfer.out.approval.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 付款OA审批提交
const applyApprovalOA = params => {
params.method = `scrm.api.shopmall.integral.transfer.out.approval.oa.apply`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 查询支付主体列表
const getPaymentEntityList = params => {
params.method = `scrm.api.shopmall.integral.transfer.out.approval.payment.entity`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 移除审批积分提现记录
const removeApproval = params => {
params.method = `scrm.api.shopmall.integral.transfer.out.approval.remove`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default {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}
<!-- 积分提现审批-->
<template>
<div class="points">
<div class="container">
<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>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 详情 -->
<detail-dialog :detail-visible="detailVisible" :id="id" @dialogClose="dialogClose"></detail-dialog>
<pay-approval :payVisible="payVisible" :id="id" @cancelPay="cancelPay" ></pay-approval>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import util from '@/utils/index'
import DetailDialog from './approveView.vue'
import PayApproval from './payApproval.vue'
const colors = ['#FDB757', '#2CCA74', '#5850FF', '#2CCA74', '#999999', '#EB4E4E', '#2CCA74']
const tableStatus = ['待审批', '审批中', '审批通过', '已驳回', '已付款', '到账异常']
export default {
components: {
DetailDialog,
PayApproval
},
data() {
return {
recordInfo:{},
id: '',
checkLoading: false,
loading: false,
detailVisible: false,
payVisible: false,
colors,
tableStatus,
size: 'small',
url: url,
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: 'channel',
type: 'select',
optionList: [],
addHtml: 'channel',
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'channelList'
},
{
label: '付款主体',
name: 'channel',
type: 'select',
optionList: [],
addHtml: 'channel',
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'PayerelList'
},
{
label: '状态',
name: 'status',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'statusList'
},
{
label: '审批时间',
name: 'applyDateStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: 'OA审批时间',
name: 'applyDateStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '付款时间',
name: 'payTimeStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
tableButtonList: [
{
type: 'el-button',
name: '查看',
attrs: {
type: 'text',
fn: '查看'
},
listeners: {
click: this.handleDetail
}
},
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => {
this.handleEdit(row)
}
}
},
{
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.handleParticulars(row)
}
}
},
{
type: 'el-button',
name: '导出',
attrs: {
type: 'text',
fn: '导出'
},
condition: row => {
return row.status == 1 || row.status == 6
},
listeners: {
click: row => {
this.handleExport(row)
}
}
}
],
// 表格
getListApi: this.$apis.withdraw.getList,
tableParams: {
listName: 'list',
tableOption: {
width: 170
},
tableColumns: [
{
label: '批次号',
prop: 'outSettleOrderId',
line: 1,
minWidth: 200
},
{
label: '客户数量',
prop: 'outSettleOrderId',
line: 1,
minWidth: 200
},
{
label: '积分总额',
prop: 'integralAmount',
width: 100
},
{
label: '付款总额/元',
prop: 'payAmount',
width: 100,
formatter: cellValue => {
return cellValue.payAmount ? (cellValue.payAmount / 100).toFixed(2) : '--'
}
},
{
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: '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: 'status',
width: '200px',
addHtml: 'colorStatus'
},
{
label: '批次生成时间',
prop: 'payDate',
width: '200px'
},
{
label: '审批人',
prop: 'customerName',
width: 150
},
{
label: '审批时间',
prop: 'payDate',
width: '200px'
},
{
label: 'OA审批时间',
prop: 'merchantName',
line: 1,
width: 150
},
{
label: '渠道到账时间',
prop: 'name',
width: '110px'
},
{
label: '用户到账时间',
prop: 'idCardNo',
width: '180px'
}
]
},
providers: {},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {
//付款主体
PayerelList: [
{
confId: '深圳广联数科科技有限公司',
confLabel: '深圳广联数科科技有限公司'
},
{
confId: '深圳市嘀加智慧云服务有限公司',
confLabel: '深圳市嘀加智慧云服务有限公司'
}
],
merchantList: [],
statusList: [
{
confId: '0',
confLabel: '待审批'
},
{
confId: '1',
confLabel: '审批中'
},
{
confId: '2',
confLabel: '审批通过'
},
{
confId: '3',
confLabel: '已驳回'
},
{
confId: '4',
confLabel: '已付款'
},
{
confId: '5',
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: '门店助手'
}
]
}
}
},
mounted() {
// this.$utils.getOptionsList(this, 'showFormData')
// this.getMerchantList()
// this.getSettleAmount()
},
methods: {
dialogClose() {
this.detailVisible = false
},
handleCheck(row) {
this.recordInfo=row
this.payVisible = true
},
cancelPay() {
console.log('取消')
this.payVisible = false
},
//查看
handleDetail(row) {
this.id = row.id
this.detailVisible = true
},
//导出
handleExport(row) {},
//到账明细
handleParticulars(row) {
this.$router.push({
path: '/withdraw/approveDetail',
query: {
id: row.id
}
})
},
//编辑
handleEdit(row) {
this.$router.push({
path: '/withdraw/approveEdit',
query: {
id: row.id
}
})
},
//选择服务商
selectChannelProvider(e) {
console.log(e, this.payForm.channelProvider)
if (this.payForm.channelProvider) {
this.payForm.channel = this.providers.channel
this.getBalance()
this.getAdmin()
}
},
//获取批量付款的金额
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()
},
exportExcel() {
const params = this.getParams()
this.$apis.withdraw.orderExport(params).then(res => {
this.$utils.aToExport(res)
})
}
}
}
</script>
<style scoped lang='scss'>
.table_point {
width: 6px;
height: 6px;
border-radius: 50%;
margin-right: 8px;
}
.gl-form-page /deep/ .el-dialog__footer {
text-align: center !important;
}
</style>
\ No newline at end of file
......@@ -66,7 +66,9 @@ const channelObj = {
'YUNHUO': '云获(嘀加)-银行卡',
"YUNHUO-ZY": '云获(中赢)-银行卡',
'YUNHUO-WX': '云获(中赢)-微信',
'SHENBIANYUN':'身边云-银行卡'
'SHENBIANYUN':'身边云-银行卡',
'BIRDWORK':'智鸟-银行卡',
'SHENBIANYUN_JX':'身边云(江西)-银行卡'
}
export default {
name: 'DetailDialog',
......
<!-- 提现列表 -->
<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>
<div class="select-wrap flex">
<el-button size="small" type="primary" style="margin-right: 10px" plain @click="handleAllBatch(true)">全部生成批次</el-button>
<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>
<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>
<!-- 表格区域 开始 -->
<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 slot="idCardNo" slot-scope="scope">
<span class="idCardNo" @click="openIdCardDialog">{{ scope.scope.idCardNo }}</span>
</div>
<div slot="agreement" slot-scope="scope">
<span class="agreement" @click="openAgreement(scope.scope)">协议</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>
<!-- 身份证 -->
<GLDialog class="gl-form-page gl-form-min idCard-dialog" title="身份证图片" mode="mid" :visible.sync="isIdCard" :close-on-click-modal="false" :before-close="CloseIdCard" :hasFooter="hasFooter">
<!-- <div class="idCard-wrap">
<div class="idCard-img">
<img :src="idCardUrl" alt />
</div>
</div> -->
</GLDialog>
<GLDialog class="gl-form-page gl-form-min idCard-dialog" title="协议" mode="mid" :visible.sync="isAgreement" :close-on-click-modal="false" :before-close="(isAgreement = false)" :hasFooter="hasFooter">
<iframe width="100%" height="700px" scrolling="yes" frameborder="0" :src="pdfUrl"></iframe>
</GLDialog>
<!-- 详情 -->
<detail-dialog :detail-visible="detailVisible" :id="id" @dialogClose="dialogClose"></detail-dialog>
</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 = ['商户名称', '商户号', '客户名称', '客户手机号', '提现金额', '收款人姓名', '收款人身份证', '收款银行卡号', '收款银行', '收款人手机号']
export default {
components: {
DetailDialog
},
data() {
return {
id: '',
isIdCard: false,
checkLoading: false,
loading: false,
isAgreement: false,
colors,
tableStatus,
size: 'small',
url: url,
settleAmount: {},
pdfUrl: '',
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: 'customerPhone',
type: 'input',
isClear: true,
maxlength: 20
},
{
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',
addHtml: '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: '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'
},
{
label: '免责协议',
prop: 'agreement',
addHtml: 'agreement'
}
]
},
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: '云获(中赢)-微信'
},
{
value: 'BIRDWORK',
label: '智鸟-银行卡'
},
{
value: 'SHENBIANYUN_JX',
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: ''
},
approvalForm: {
ids: []
},
isImport: false,
batchOptions: ['批量审核', '批量付款', '批量生成批次'],
keyOptions: ['一键审核', '一键付款']
}
},
watch: {
'searchForm.customerPhone'(newVal) {
if (isNaN(Number(newVal))) {
this.searchForm.customerPhone = newVal.replace(/[^\d]/g, '')
}
}
},
mounted() {
this.$utils.getOptionsList(this, 'showFormData')
this.getMerchantList()
this.getSettleAmount()
},
methods: {
generateBatchCount(all = true) {
return new Promise((resolve, reject) => {
let params = {
type: all ? 2 : 1 //1:批量生成,2:全部生成
},
numberOfRecord = 0,
paymentTotal = 0,
txt
!all ? (params.ids = this.ids) : ''
this.$apis.withdraw.generateBatchCount(params).then(res => {
if (res.code == 0) {
numberOfRecord = res.data.numberOfRecord
paymentTotal = res.data.paymentTotal
txt = all
? `当前共 ${numberOfRecord}条未处理【积分提现】记录,付款金额共 ${paymentTotal}元,是否确认生成批次?`
: `将对您选择的${numberOfRecord} 条【积分提现】记录生成批次,
付款金额共 ${paymentTotal} 元。`
resolve(txt)
} else {
this.$message.error(res.message)
}
})
})
},
//全部生成批次
async handleAllBatch(all = true) {
let title = all ? '全部生成批次提示' : '生成批次提示',
cxt = await this.generateBatchCount(all),
params = {
type: all ? 2 : 1
},
Method = 'integralorderBatch'
!all ? (params.ids = this.ids) : ''
this.$utils.secondConfirm(this, title, cxt, 'withdraw', Method, params)
},
openIdCardDialog() {
this.isIdCard = true
},
openAgreement() {
this.isAgreement = true
},
CloseIdCard() {
this.isIdCard = false
},
//选择服务商
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) {
if (index == 0 || index == 1) {
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()
}
}
} else {
if (!this.ids || this.ids.length == 0) {
this.$message.error('请选择需要生成批次的【提现积分】记录')
return
}
//批量生成批次
this.handleAllBatch(false)
}
},
//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)
}
})
}
}
}
}
</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 {
align-items: center;
.el-button + .el-button {
margin-left: 10px;
}
.selectBtn {
width: 100px;
margin-right: 10px;
/deep/.el-input__inner {
padding: 0 10px;
}
}
h2 {
color: #333333;
font-size: 16px;
}
}
.statistics {
font-size: 12px;
color: #999999;
line-height: 18px;
margin-bottom: 12px;
}
.price {
color: #5850ff;
}
.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;
}
.idCardNo,
.agreement {
color: #5850ff;
font-size: 14px;
}
</style>
\ No newline at end of file
<!-- 付款审批 -->
<template>
<GLDialog class="gl-form-page gl-form-min payWrap" title="付款审批" mode="mid" :visible.sync="isVisible" :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="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>
</template>
<script>
export default {
data() {
return {
isVisible: false,
count: '',
timer: null,
isCodeDisabled: false,
payForm: {
transferType: '',
withdrawalSource: '',
payMoney: '',
admin: '',
channel: '',
captcha: '',
remark: '',
channelProvider: ''
},
payFormData: [
{
label: '此次付款渠道',
name: 'channel',
type: 'select',
optionsName: 'payChannelList',
optionId: 'channel',
optionLabel: 'channelName',
changeAttr: val => {
console.log(val)
this.getAdmin()
this.isCodeDisabled = false
clearInterval(this.timer)
this.timer = null
this.payForm.captcha = ''
}
},
{
label: '此次付款主体',
name: 'withdrawalSource',
type: 'select',
optionsName: 'PayerelList',
optionId: 'confId',
optionLabel: 'confLabel',
changeAttr: val => {}
},
{
label: '批次号',
name: 'batchNo',
addHtml: 'batchNo'
},
{
label: '积分总额',
name: 'payMoney',
addHtml: 'batchNo'
},
{
label: '付款总额/元',
name: 'payMoney',
addHtml: 'batchNo'
},
{
label: '税点',
name: 'payMoney',
addHtml: 'batchNo'
},
{
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: 200
},
{
label: '备注',
name: 'remark',
type: 'input',
inputType: 'textarea',
maxlength: 50
}
],
payRule: {
admin: [{ required: true, message: '请选择管理员', trigger: 'change' }],
channel: [{ required: true, message: '请选择付款渠道', trigger: 'change' }],
withdrawalSource: [{ required: true, message: '请选择付款主体', trigger: 'change' }],
captcha: [{ required: true, message: '请输入验证码', trigger: 'blur' }]
},
// 基本数据
baseData: {
payChannelList: [],
//付款主体
PayerelList: [
{
confId: '深圳广联数科科技有限公司',
confLabel: '深圳广联数科科技有限公司'
},
{
confId: '深圳市嘀加智慧云服务有限公司',
confLabel: '深圳市嘀加智慧云服务有限公司'
}
]
}
}
},
props: {
payVisible: { type: Boolean, default: false },
recordInfo: {
type: Object,
default: () => {
return {}
}
}
},
watch: {
payVisible(newVal) {
console.log(newVal)
this.isVisible = newVal
if (newVal) {
this.getChannel()
this.$utils.getOptionsList(this, 'payFormData', false)
}
}
},
mounted() {},
methods: {
//积分提现获取业务对应的付款渠道
getChannel(transferType) {
this.$apis.withdraw
.getChannel({
transferType: this.recordInfo.transferType,
mode: this.recordInfo.mode,
isBatch: 1
})
.then(res => {
if (res) {
this.baseData.payChannelList = res
this.$utils.getOptionsList(this, 'payFormData', false, 'channel')
//默认选择
if (this.baseData.payChannelList.length > 0) {
this.payForm.channel = this.baseData.payChannelList[0].channel
}
this.getAdmin()
}
})
},
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
}
})
},
//付款
comfirmPay() {
// this.$refs.payFormRef.$refs.payChildRef.validate(valid => {
// if (valid) {
// }
// })
},
cancelPay() {
this.ids = ''
this.payForm = {
payMoney: '',
admin: '',
channel: '',
captcha: '',
remark: ''
}
this.isCodeDisabled = false
clearInterval(this.timer)
this.timer = null
this.$emit('cancelPay')
},
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)
}
})
}
}
}
}
</script>
<style lang="scss" scoped>
.payWrap {
/deep/ {
.el-form--inline .el-form-item {
display: block;
}
}
.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;
}
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!