Commit f19f4fea by 前端

Merge branch 'SAAS+V4.56.0-0908' into 'master'

上线合并

See merge request !16
2 parents 2a3a0053 a013d4ad
......@@ -9,6 +9,18 @@ const getMerchantList = params => {
})
}
const getMerchantList1 = params => {
params.method = 'scrm.api.carlife.merchant.listWithPageByCurMerchant1'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getMerchantList
getMerchantList,
getMerchantList1
}
\ No newline at end of file
import { http } from '@/main'
import { http, http_dj } from '@/main'
const path = 'dj.api.smarcarlife.'
......@@ -91,7 +91,66 @@ const getIntegralDetailList = params => {
sign: true
})
}
// 阳光激励用户-列表
const getStaffScoreList = params => {
params.method = `dj.api.shopmall.staff.score.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 阳光激励用户-导出
const getStaffScoreExport = params => {
params.method = `dj.api.shopmall.staff.score.export`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 阳光激励用户-获取门店列表
const getShopMerchantList = params => {
params.method = `dj.smartcarlife.api.shopMerchant.list`
return http_dj({
url: 'rop-dj-smartcarlife/router',
method: 'POST',
data: params,
sign: true
})
}
// 积分管理-积分收益列表
const getScoreDetailList = params => {
params.method = `dj.api.shopmall.staff.score.detail.list`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 积分管理-积分收益列表
const exportDetailScore = params => {
params.method = `dj.api.shopmall.staff.score.detail.list.export`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 选择订单
const deductOrderPage = params => {
params.method = `dj.api.smartcarlife.merchant.score.deduct.order.page`
return http_dj({
url: 'rop-dj-smartcarlife/router',
method: 'POST',
data: params,
sign: true
})
}
// 用户积分明细详情-客户积分详情
const customerDetail = params => {
params.method = `scrm.api.shopmall.integralcustomer.detail`
......@@ -242,7 +301,7 @@ const getTypeListApi = params => {
/**
* 创建积分提醒短信
*/
const createSmsApi = params => {
const createSmsApi = params => {
params.method = 'scrm.api.shopmall.integral.remind.msg.create'
return http({
url: 'rop-scrm-shopmall/router',
......@@ -250,9 +309,9 @@ const getTypeListApi = params => {
})
}
/**
* 积分提醒短信详情
* 积分提醒短信详情
*/
const getSmsDetailApi = params => {
const getSmsDetailApi = params => {
params.method = 'scrm.api.shopmall.integral.remind.msg.detail'
return http({
url: 'rop-scrm-shopmall/router',
......@@ -262,7 +321,7 @@ const getTypeListApi = params => {
/**
* 开关提醒短信
*/
const openSmsApi = params => {
const openSmsApi = params => {
params.method = 'scrm.api.shopmall.integral.remind.msg.onOff'
return http({
url: 'rop-scrm-shopmall/router',
......@@ -270,9 +329,9 @@ const getTypeListApi = params => {
})
}
/**
* 触达客户
* 触达客户
*/
const smsCustomerApi = params => {
const smsCustomerApi = params => {
params.method = 'scrm.api.shopmall.integral.remind.record.page'
return http({
url: 'rop-scrm-shopmall/router',
......@@ -289,6 +348,12 @@ export default {
getIntegralCustomerList,
getIntegralCustomerExport,
getIntegralDetailList,
getStaffScoreList,
getStaffScoreExport,
getShopMerchantList,
getScoreDetailList,
exportDetailScore,
deductOrderPage,
customerDetail,
getIntegralDetailExport,
getghDirectionalGiftListApi,
......
import { http } from '@/main'
// 查询上传文件配置
const getUpDocConfig = params => {
params.method = `scrm.api.shopmall.scrm.pointsuploaddocumentconfig.findAll`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 上传文件处理配置
const updateUpDocConfig = params => {
params.method = `scrm.api.shopmall.scrm.pointsuploaddocumentconfig.update`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default {
getUpDocConfig,
updateUpDocConfig
}
......@@ -199,4 +199,107 @@ 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 approvalDetail = params => {
params.method = `scrm.api.shopmall.integral.transfer.out.approval.detail`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 积分提现 生成批次
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
})
}
// 积分提现审批分页查询
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
})
}
// 付款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
})
}
// 移除审批积分提现记录
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
})
}
// 积分提现获取付款渠道收款账号
const getChannelAccount = (params={}) => {
params.method = `scrm.api.shopmall.integral.transfer.out.getChannel.account`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default {getChannelAccount,approvalDetail,removeApproval,getPaymentEntityList,applyApprovalOA,getApprovalLog,getApprovalPage,generateBatchCount, integralorderBatch,getPayAmount,getAllPayAmount, integralAllOut, integralAllpay, getList, getAdmin, orderExport, integralpay, integralApprove, integralOut, getSms, getMerchantList, getDetails, uploadXlsx, handleSaveImport, getBalance, getSettleAmount,getChannel ,checkRecordsTransferType}
......@@ -77,4 +77,7 @@ p{
.el-message{
z-index: 9999999 !important;
}
.el-message-box__content{
height:auto !important;
}
\ No newline at end of file

10.3 KB | W: | H:

5.21 KB | W: | H:

src/assets/point-custom-0.png
src/assets/point-custom-0.png
src/assets/point-custom-0.png
src/assets/point-custom-0.png
  • 2-up
  • Swipe
  • Onion skin

10.5 KB | W: | H:

10.3 KB | W: | H:

src/assets/point-custom-1.png
src/assets/point-custom-1.png
src/assets/point-custom-1.png
src/assets/point-custom-1.png
  • 2-up
  • Swipe
  • Onion skin

10.2 KB | W: | H:

10.5 KB | W: | H:

src/assets/point-custom-2.png
src/assets/point-custom-2.png
src/assets/point-custom-2.png
src/assets/point-custom-2.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -24,3 +24,4 @@ start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params)
export const http_dj = params => Vue.prototype.$http_dj(params)
......@@ -12,15 +12,16 @@ let instance = null
Vue.use(ElementUI)
Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState ,routerBase}) {
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig(common)
const { response, request, sign, appkey, secret, sign_common, request_common, requestDj } = await fetchConfig(common)
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token:globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_dj = new common.Http({ response, request: requestDj, sign, secret, alert, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
......
export const colors = ['#B8B8B8', '#F59619', '#2CCA74', '#EB4E4EFF', '#2CCA74FF', '#2CCA74FF','#EB4E4EFF']
export const tableStatus = ['待审批', '审批中', '审批通过', '审批驳回', '渠道到账','用户到账', '到账异常']
export const operate_status = {
1: '付款审核',
2: '批次关闭',
3: 'OA审批',
4: '渠道到账',
5: '渠道付款'
}
export const modeTypeList = [
{
confId: '0',
confLabel: '银行卡'
},
{
confId: '1',
confLabel: '微信'
}
]
export const sourceList = [
{
confId: '0',
confLabel: '车生活助手'
},
{
confId: '1',
confLabel: '系统导入'
},
{
confId: '2',
confLabel: '生意助手员工版'
},
{
confId: '3',
confLabel: '门店助手'
}
]
export const withdrawalTypeList = [
{
confId: '0',
confLabel: '积分提现'
},
{
confId: '1',
confLabel: '普通提现'
},
{
confId: '2',
confLabel: '阳光激励'
}
]
export const PayerelList = [
{
confId: '深圳广联数科科技有限公司',
confLabel: '深圳广联数科科技有限公司'
},
{
confId: '深圳市嘀加智慧云服务有限公司',
confLabel: '深圳市嘀加智慧云服务有限公司'
},
{
confId: '深圳市优加智汇科技有限公司',
confLabel: '深圳市优加智汇科技有限公司'
}
]
export const statusList = [
{
confId: '0',
confLabel: '待审批'
},
{
confId: '1',
confLabel: '审批中'
},
{
confId: '2',
confLabel: '审批通过'
},
{
confId: '3',
confLabel: '审批驳回'
},
{
confId: '4',
confLabel: '渠道到账'
},
{
confId: '5',
confLabel: '用户到账'
},
{
confId: '6',
confLabel: '到账异常'
}
]
export const channelList = [
{
confId: '智鸟',
confLabel: '智鸟-银行卡'
},
{
confId: '身边云(江西)',
confLabel: '身边云(江西)-银行卡'
}
]
export const auditStatusStatusList = [
{
confId: '0',
confLabel: '待审核'
},
{
confId: '1',
confLabel: '已审核'
},
{
confId: '2',
confLabel: '第三方处理'
},
{
confId: '3',
confLabel: '成功'
},
{
confId: '4',
confLabel: '失败'
},
{
confId: '5',
confLabel: '驳回'
},
{
confId: '6',
confLabel: '受理失败'
},
{
confId: '7',
confLabel: '批次处理中'
}
]
export const channelObj = {
'TXIAT': '熠轩-银行卡',
'ZX': '中雄-银行卡',
'YUNHUO': '云获(嘀加)-银行卡',
"YUNHUO-ZY": '云获(中赢)-银行卡',
'YUNHUO-WX': '云获(中赢)-微信',
'SHENBIANYUN':'身边云-银行卡',
'BIRDWORK':'智鸟-银行卡',
'SHENBIANYUN_JX':'身边云(江西)-银行卡'
}
<template>
<div class="revocation-wrap">
<div class="content">
<div class="title">新增抵扣</div>
<div class="form-wrap">
<glsx-combi-form class="form-container" ref="formRef" label-width="154px" :isBlock="true" :form-ref="childRef" :form-obj="formObj" :form-data="formData" :form-rules="formRule">
<div slot="orderData">
<div class="order-btn" @click="handleChooseOrder">选择订单</div>
<d2-table :table-params="tableParams" :table-data="formObj.orderData" :has-page="false">
<div slot="orderGoodsName" slot-scope="scope">
<span v-for="(item, index) in scope.scope.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">
<el-tooltip class="item" :content="item.upgradeGoodsName" placement="right">
<span>
{{
item.upgradeGoodsName
? item.upgradeGoodsName.length > 10
? item.upgradeGoodsName.substring(0, 10) + "..."
: item.upgradeGoodsName
: "-"
}}
</span>
</el-tooltip>
</p>
<p v-else>{{ item.baseGoodsName }}</p>
</span>
</div>
<div slot="auth-button" slot-scope="scope">
<el-button type="text" @click="deleteTable(scope.scope)">删除</el-button>
</div>
</d2-table>
</div>
</glsx-combi-form>
</div>
</div>
<div class="btn-wrap">
<div class="btn btn-wrap-left" @click="submit">提交</div>
<div class="btn btn-wrap-right" @click="cancel">取消</div>
</div>
<!-- 选择订单 -->
<choose-order-dialog :visible="orderDialogVisible" v-if="orderDialogVisible" :choose-order-data="formObj.orderData" @dialogClose="handleClose" @chooseOrder="chooseOrder"></choose-order-dialog>
<!-- 确认提醒 -->
<confirm-dialog :visible="confirmDialogVisible" v-if="confirmDialogVisible" :data-info="formObj" @dialogClose="handleConfirmClose" @handleConfirm="handleComfirm"></confirm-dialog>
</div>
</template>
<script>
// import { Util } from "@/common/util"
// import { manualDeduct } from "@api/point"
import ChooseOrderDialog from "./components/chooseOrderDialog"
import ConfirmDialog from "./components/ConfirmDialog"
export default {
components: {
ChooseOrderDialog,
ConfirmDialog
},
data() {
function checkPrice(rule, value, callback) {
// if (!Util.validateNumber(value)) {
// callback(new Error("输入范围为大于0的数字,至少支持小数点后两位"))
// return false
// }
callback()
}
return {
orderDialogVisible: false,
confirmDialogVisible: false, //确认提醒
formObj: {
score: "",
orderData: [],
orderCode: "",
remark: "",
operator: ""
},
confirmData: {},
formData: [
{
label: "选择订单",
name: "orderData",
addHtml: "orderData"
},
{
label: "扣减积分",
name: "score",
type: "input",
maxlength: 20,
placeholder: "请输入",
tips: "此订单需要在员工账户里扣除的积分",
width: "136px"
},
{
label: "备注",
name: "remark",
type: "input",
maxlength: 100,
placeholder: "请输入",
inputType: "textarea",
width: "580px",
rows: 3
}
],
formRule: {
orderData: [
{
required: true,
message: "选择需要关联的已退款或已付款订单",
trigger: "change"
}
],
score: [
{ required: true, message: "请输入积分", trigger: "change" },
{ validator: checkPrice, trigger: "blur" }
]
},
tableParams: {
tableOption: true,
tableColumns: [
{
label: "订单编号",
prop: "orderCode",
width: "150px"
},
{
label: "订单时间",
prop: "orderTimeStr",
width: "200px"
},
{
label: "客户姓名",
prop: "customerName",
width: "120px"
},
{
label: "商品名称",
prop: "orderGoodsName",
addHtml: "orderGoodsName",
width: 240
},
{
label: "总价",
prop: "totalPrice",
width: "120px",
formatter: (cellValue) => {
return cellValue.totalPrice ? "¥" + cellValue.totalPrice : "0"
}
}
]
},
childRef: "editChildRef"
}
},
created() { },
methods: {
//订单选择成功
chooseOrder(data) {
console.log(data, '99999')
if (data.length) {
this.$refs.formRef.$refs[this.childRef].clearValidate("orderData")
}
this.formObj.orderData = data
this.orderDialogVisible = false
},
handleClose() {
this.orderDialogVisible = false
},
handleConfirmClose() {
this.confirmDialogVisible = false
},
handleComfirm() {
let params = {
orderCode: this.formObj.orderData[0].orderCode,
score: this.formObj.score,
remark: this.formObj.remark,
operator: this.formObj.operator
}
// manualDeduct(params)
// .then((result) => {
// console.log(result)
// if (result) {
// this.$router.go(-1)
// this.$notify({
// type: "success",
// title: "新增成功"
// })
// this.confirmDialogVisible = false
// }
// })
// .catch((err) => {
// // console.error(err)
// // this.$message.error(err)
// })
},
submit() {
this.$refs.formRef.$refs[this.childRef].validate((valid) => {
if (valid) {
this.confirmDialogVisible = true
}
})
},
cancel() {
this.$router.go(-1)
},
handleChooseOrder() {
this.orderDialogVisible = true
},
deleteTable() {
this.formObj.orderData = []
}
}
}
</script>
<style lang="scss" scoped>
.revocation-wrap {
margin: 16px 24px;
.content {
background-color: #fff;
.title {
padding: 12px 16px;
font-weight: 500;
font-size: 18px;
color: #333333;
line-height: 24px;
border-bottom: 1px solid #e8e8ea;
}
.title::before {
display: inline-block;
vertical-align: middle;
margin-right: 8px;
content: '';
width: 4px;
height: 16px;
background: #185efe;
border-radius: 2px;
}
.form-wrap {
padding: 16px 0;
min-height: 500px;
.order-btn {
width: 88px;
height: 32px;
background: #f8f8f8;
border: 1px solid #e6e6e6;
border-radius: 4px;
font-size: 14px;
color: #666666;
text-align: center;
line-height: 32px;
cursor: pointer;
}
}
}
.btn-wrap {
display: flex;
align-items: center;
padding: 16px 154px;
.btn {
width: 104px;
height: 36px;
border-radius: 4px;
font-weight: 500;
font-size: 16px;
text-align: center;
line-height: 36px;
}
&-right {
color: #666666;
background: #e8e8e8;
margin-left: 16px;
}
&-left {
background: #185efe;
color: #ffffff;
}
}
}
::v-deep .form-container {
.tips-icon {
border: none;
}
.el-form-item__error {
width: 300px;
}
}
</style>
\ No newline at end of file
<template>
<d2-dialog title="确认提醒" :is-visible="isVisible" width="720px" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<div class="confirm-wrap">
<div class="title">请确定以下信息是否正确</div>
<div class="point-info">
<div class="label">扣减积分:<span class="integral">{{dataInfo.score}}</span></div>
<div class="label" style="margin-top:8px">
备注:<span class="remark">{{dataInfo.remark||'--'}}</span>
</div>
</div>
<div class="order-detail">
<div class="title">订单详情</div>
<div class="item">订单编号:<span>{{dataInfo.orderData[0].orderCode}}</span></div>
<div class="item">订单时间:<span>{{dataInfo.orderData[0].orderTimeStr}}</span></div>
<div class="item">客户姓名:<span>{{dataInfo.orderData[0].customerName}}</span></div>
<div class="item">商品名称:<span v-for="(item, index) in dataInfo.orderData[0].subOrderList" :key="index">
<template v-if="item.upgradeGoodsId">
<span class="upgrade-goods">
{{
item.upgradeGoodsName? item.upgradeGoodsName: "-"
}}
</span>
</template>
<span v-else class="upgrade-goods">{{ item.baseGoodsName }}</span>
</span></div>
<div class="item">总价:<span>{{dataInfo.orderData[0].totalPrice?dataInfo.orderData[0].totalPrice:'0'}}</span></div>
</div>
</div>
</d2-dialog>
</template>
<script>
export default {
data() {
return {}
},
props: {
visible: {
type: Boolean,
default: false
},
dataInfo: {
type: Object,
default:()=> {}
}
},
computed: {
isVisible: {
get() {
return this.visible
},
set(newVal) { }
}
},
mounted() {
console.log(this.dataInfo)
},
methods: {
handleConfirm() {
this.$emit("handleConfirm")
},
handleClose() {
this.$emit("dialogClose")
}
}
}
</script>
<style lang="scss" scoped>
.confirm-wrap {
.title {
font-weight: 500;
font-size: 14px;
color: #1d1d1d;
margin-bottom: 18px;
}
.point-info {
margin-bottom: 18px;
// display: flex;
// align-items: center;
// justify-content: space-between;
.label {
font-weight: 500;
font-size: 14px;
color: #1d1d1d;
}
.integral {
font-weight: 600;
font-size: 20px;
color: #185efe;
}
.remark {
font-weight: 400;
font-size: 14px;
color: #1d1d1d;
}
}
.order-detail {
height: auto;
background: #fafafa;
padding: 8px 10px;
.title {
font-weight: 500;
font-size: 14px;
color: #1d1d1d;
}
.item {
color: #666666;
font-size: 14px;
margin-bottom: 8px;
span {
color: #333333;
}
}
}
}
.upgrade-goods {
margin-right: 4px;
}
</style>
\ No newline at end of file
<template>
<GLDialog title="选择订单" mode="big" :visible.sync="visible" @before-close="handleClose" @confirmDialog="handleAddConfirm" @onCancel="handleClose">
<div class="order-list">
<div class="flex">
<GLCombiForm :formObj="searchForm" :label-width="'90px'" :form-data="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- <div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
</div> -->
</div>
<div class="table-wrap">
<el-table :data="tableData" border>
<el-table-column align="center">
<template slot-scope="scope">
<el-radio v-model="orderId" :label="scope.row.orderCode" @input="getCurrentOrderData">
<span class="order-name">{{ scope.row.orderCode }}</span>
</el-radio>
</template>
</el-table-column>
<el-table-column prop="key" label="序号" align="center" />
<el-table-column label="订单编号" align="center" width="150" prop="orderCode" />
<el-table-column label="订单状态" align="center" prop="status">
<template slot-scope="scope">
<span>{{ statusOpts[scope.row.status] }}</span>
</template>
</el-table-column>
<el-table-column label="订单时间" align="center" width="160" prop="orderTimeStr" />
<el-table-column label="客户姓名" align="center" prop="customerName" />
<el-table-column label="商品名称" align="center" width="180" prop="subOrderList">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">
<el-tooltip class="item" :content="item.upgradeGoodsName" placement="right">
<span>
{{
item.upgradeGoodsName
? item.upgradeGoodsName.length > 10
? item.upgradeGoodsName.substring(0, 10) + "..."
: item.upgradeGoodsName
: "-"
}}
</span>
</el-tooltip>
</p>
<p v-else>{{ item.baseGoodsName }}</p>
</span>
</template>
</el-table-column>
<el-table-column label="总价" align="center" prop="totalPrice">
<template slot-scope="scope">
<span>
{{ scope.row.totalPrice ? "¥" + scope.row.totalPrice : 0 }}</span>
</template>
</el-table-column>
</el-table>
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.pageNum" :page-sizes="[10, 20, 30, 40]" :page-size="page.pageSize" :total="total" layout="sizes,total,->,prev,pager,next,jumper" />
</div>
</div>
</GLDialog>
</template>
<script>
// import { Util } from "@/common/util"
// import { deductOrderPage } from "@api/point"
import * as dayjs from 'dayjs'
export default {
data() {
return {
sellerUserId: "",
orderId: "",
tableData: [],
orderData: [],
searchForm: {
customerName: "",
orderCode: "",
status: "",
paySuccessDate: []
},
searchFormSearch: {},
total: 0,
page: {
pageNum: 1,
pageSize: 10
},
showFormData: [
{
label: "客户",
name: "customerName",
type: "input",
isClear: true
},
{
label: "订单编号",
name: "orderCode",
type: "input",
isClear: true
},
{
label: "订单状态",
name: "status",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "orderStatusList"
},
{
label: "订单日期",
name: "paySuccessDate",
type: "datePicker",
labelWidth: 72,
isClear: true,
pickerOptions: "rangePickerOptions"
}
],
statusOpts: {
1: "待升级",
2: "战败",
3: "待支付",
4: "已支付",
// 5: '已退款',
6: "已评价",
9: "已撤销",
10: "已关闭",
11: "错误订单",
12: "已退款",
13: "待上传"
},
baseData: {
orderStatusList: [
// {
// confId: 1,
// confLabel: "待升级"
// },
// {
// confId: 2,
// confLabel: "战败"
// },
// {
// confId: 3,
// confLabel: "待支付"
// },
{
confId: 4,
confLabel: "已支付"
},
/* {
confId: 5,
confLabel: '已退款'
}, */
// {
// confId: 6,
// confLabel: "已评价"
// },
// {
// confId: 9,
// confLabel: "已撤销"
// },
// {
// confId: 10,
// confLabel: "已关闭"
// },
// {
// confId: 11,
// confLabel: "错误订单"
// },
{
confId: 12,
confLabel: "已退款"
}
]
}
}
},
props: {
visible: {
type: Boolean,
default: false
},
chooseOrderData: {
type: Array,
default: () => []
}
},
computed: {
isVisible: {
get() {
return this.visible
},
set(newVal) { }
}
},
created() {
this.searchForm.userId = this.$route.query.userId
this.searchForm.merchantId = this.$route.query.merchantId
this.getList()
},
mounted() {
this.getOptionsList()
},
methods: {
getList() {
var params = this.getParams()
params = {
...this.page,
...params
}
console.log(params)
console.log(params)
this.$apis.points.deductOrderPage(params).then((res) => {
this.tableData = res.list.map((item, index) => {
item.paySuccessDate = item.paySuccessDate ? dayjs(item.paySuccessDate).format('YYYY-MM-DD HH:mm:ss') : ''
item.key = index + 1 + this.page.pageSize * (this.page.pageNum - 1)
return item
})
this.page.pageNum = res.pageNum
this.page.pageSize = res.pageSize
this.total = res.total
this.init()
})
},
// 每页条数
handleSizeChange(value) {
this.page.pageSize = value
this.getList()
},
// 页码
handleCurrentChange(value) {
this.page.pageNum = value
this.getList()
},
init() {
this.orderId = this.chooseOrderData.length
? this.chooseOrderData[0].orderCode
: ""
this.orderData = this.chooseOrderData
},
getCurrentOrderData(value) {
this.orderData = this.tableData.filter((item) => item.orderCode == value)
},
handleAddConfirm() {
this.$emit("chooseOrder", this.orderData)
},
handleClose() {
this.$emit("dialogClose")
},
handleSearch() {
this.page.pageNum = 1
this.getList()
},
getParams() {
this.searchFormSearch = this.$common.utils.deepClone(this.searchForm)
if (this.searchFormSearch.paySuccessDate && this.searchFormSearch.paySuccessDate.length) {
this.searchFormSearch.paySuccessStartDate = dayjs(this.searchFormSearch.paySuccessDate[0]).format('YYYY-MM-DD') + ' 00:00:00'
this.searchFormSearch.paySuccessEndDate = dayjs(this.searchFormSearch.paySuccessDate[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
delete this.searchFormSearch.paySuccessDate
return this.searchFormSearch
},
getOptionsList(hasAll = true) {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
hasAll &&
this.baseData[item.optionsName]?.length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
if (item.optionsName != "parkServiceList") {
// 服务对接由于是多选不应该添加全部选项
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
}
}
}
</script>
<style lang='scss' scoped>
.order-list {
height: 540px;
}
.flex {
display: flex;
align-items: center;
justify-content: space-between;
}
.table-wrap {
height: 500px;
overflow-y: auto;
}
.show-search {
display: flex;
align-items: center;
::v-deep .el-form {
display: flex;
align-items: center;
.el-form-item {
display: flex;
width: 100%;
margin-bottom: 0px;
}
.el-col {
width: auto !important;
}
.el-form-item__label {
width: 70px !important;
white-space: nowrap;
}
.el-form-item__content {
width: 170px;
}
}
::v-deep .d2-search-block {
padding: 16px 0 0 !important;
}
}
.order-name {
display: inline-block;
color: transparent;
width: 0;
}
</style>
\ No newline at end of file
<template>
<baseDialog :is-show.sync="dialogShow" :config="dialogConfig.setting" :dialog-config="dialogConfig.config" @closeDialog="handleDetailClose">
<div class="detail-content">
<div class="form_div">
<el-form class="edit-sub-block" label-width="110px" :inline="true">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="积分类型:">
{{ detailInfo.infoName ? detailInfo.infoName : "-" }}
</el-form-item></el-col>
<el-col :span="12">
<el-form-item label="积分明细:" class="halfItem">
{{
detailInfo.rewardScore
? (detailInfo.type == 0 ? "+" : "-") +
detailInfo.rewardScore
: "--"
}}
</el-form-item></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="客户名称:">
{{ detailInfo.customerName ? detailInfo.customerName : "-" }}
</el-form-item></el-col>
<el-col :span="12">
<el-form-item label="客户手机号:" class="halfItem">
{{ detailInfo.customerPhone ? detailInfo.customerPhone : "-" }}
</el-form-item></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="订单编号:">
{{ detailInfo.orderCode ? detailInfo.orderCode : "-" }}
</el-form-item></el-col>
<el-col :span="12">
<el-form-item label="商品名称:" class="halfItem">
{{ detailInfo.goodsName ? detailInfo.goodsName : "-" }}
</el-form-item></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="积分变化时间:">
{{ detailInfo.updatedTime ? detailInfo.updatedTime : "-" }}
</el-form-item></el-col>
<el-col :span="12">
<el-form-item label="员工名称:" class="halfItem">
{{ detailInfo.staffName ? detailInfo.staffName : "-" }}
</el-form-item></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="员工手机号:" class="halfItem">
{{ detailInfo.staffPhone ? detailInfo.staffPhone : "-" }}
</el-form-item></el-col>
<el-col :span="12">
<el-form-item label="门店名称:" class="halfItem">
{{ detailInfo.merchantName ? detailInfo.merchantName : "-" }}
</el-form-item></el-col>
</el-row>
<el-row>
<el-col :span="12">
<template v-if="
detailInfo.infoName == '积分兑换' ||
detailInfo.infoName == '积分返还'
">
<el-form-item label="兑换时间:" class="halfItem">
{{
detailInfo.withdrawalTime ? detailInfo.withdrawalTime : "-"
}}
</el-form-item>
</template>
<template v-if="detailInfo.infoName == '退款抵扣'">
<el-form-item label="退款时间:" class="halfItem">
{{ detailInfo.failTime ? detailInfo.failTime : "-" }}
</el-form-item></template>
<template v-if="detailInfo.infoName == '错单抵扣'">
<el-form-item label="错单时间:" class="halfItem">
{{ detailInfo.failTime ? detailInfo.failTime : "-" }}
</el-form-item>
</template>
<template v-if="detailInfo.infoName == '撤单抵扣'">
<el-form-item label="撤单时间:" class="halfItem">
{{ detailInfo.failTime ? detailInfo.failTime : "-" }}
</el-form-item>
</template>
</el-col>
<template v-if="detailInfo.infoName =='撤销抵扣'">
<el-col :span="12" v-if="detailInfo.relationRemark">
<el-form-item label="备注:" class="halfItem">
{{
detailInfo.relationRemark ? detailInfo.relationRemark : "-"
}}
</el-form-item>
</el-col>
</template>
<template v-else-if="detailInfo.infoName =='手动抵扣'">
<el-col :span="12" v-if="detailInfo.remark">
<el-form-item label="备注:" class="halfItem">
{{
detailInfo.remark ? detailInfo.remark : "-"
}}
</el-form-item>
</el-col>
</template>
<template v-if="detailInfo.infoName =='撤销抵扣'">
<el-col :span="12" v-if="detailInfo.remark">
<el-form-item label="撤销原因:" class="halfItem">
{{ detailInfo.remark ? detailInfo.remark : "-" }}
</el-form-item></el-col>
</template>
</el-row>
</el-form>
</div>
</div>
</baseDialog>
</template>
<script>
// import { Util } from "@/common/util"
// import { getScoreDetail } from "@api/point"
export default {
name: "DetailDialog",
props: {
visible: {
type: Boolean,
default: false
},
id: {
type: String,
default: ''
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit("update:visible", val)
}
}
},
watch: {
id(val) {
// if (val) this.getDetail()
}
},
mounted() {
this.getDetail()
},
data() {
return {
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
btnList: []
},
config: {
title: "查看详情",
width: "1080px"
}
},
detailInfo: {}
}
},
methods: {
handleDetailClose() {
this.dialogShow = false
},
// getDetail() {
// getScoreDetail({ id: this.id }).then((res) => {
// if (res) {
// res.updatedTime = res.updatedTime
// ? Util.dateFormate(res.updatedTime, "YYYY-MM-DD HH:mm:ss")
// : "--"
// res.withdrawalTime = res.withdrawalTime
// ? Util.dateFormate(res.withdrawalTime, "YYYY-MM-DD HH:mm:ss")
// : "--"
// res.refundTime = res.refundTime
// ? Util.dateFormate(res.refundTime, "YYYY-MM-DD HH:mm:ss")
// : "--"
// res.failTime = res.failTime
// ? Util.dateFormate(res.failTime, "YYYY-MM-DD HH:mm:ss")
// : "--"
// res.revokeTime = res.revokeTime
// ? Util.dateFormate(res.revokeTime, "YYYY-MM-DD HH:mm:ss")
// : "--"
// this.detailInfo = res
// }
// })
// }
}
}
</script>
<style lang="scss" scoped>
.form_div {
color: #333333;
padding: 20px 30px;
// border-bottom: 1px solid #eee;
// .edit-sub-title {
// font-weight: bold;
// margin-bottom: 10px;
// }
.edit-sub-block {
// padding: 0 10px;
.el-form-item {
width: 100%;
margin-bottom: 0px;
}
.itemDiv {
display: flex;
.halfItem {
width: 50%;
}
}
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
}
.edit-sub-block-two {
.el-form-item {
// width: 300px;
margin-bottom: 0px;
}
}
}
</style>
\ No newline at end of file
<!-- 驳回 -->
<template>
<d2-dialog
title="提示"
:is-visible="visible"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm"
>
<div class="reject-dialog">
<glsx-combi-form
class="edit-form-container"
ref="formRef"
label-width="112px"
default-width="390px"
:form-ref="rejectRef"
:form-obj="infoForm"
:form-data="editFormData"
:form-rules="formRules"
></glsx-combi-form>
</div>
</d2-dialog>
</template>
<script>
// import { cancelDeduct, getScoreDetail } from "@api/point"
export default {
name: "RejectDialog",
data() {
return {
infoForm: {
remark: ""
},
dialogConfig: {
title: "提示",
width: "576px",
height: "315px"
},
rejectRef: "rejectRef",
formRules: {
// remark: [{ required: true, message: "请输入撤销原因", trigger: "blur" }]
},
editFormData: [
{
label: "撤销原因",
name: "remark",
type: "input",
maxlength: 20,
inputType: "textarea",
showLimit: true,
rows: 4
}
],
baseData: {}
}
},
props: {
visible: {
type: Boolean,
default: false
},
id: {
type: String,
default: ""
}
},
computed: {
isVisible: {
get() {
return this.visible
},
set(newVal) {}
}
},
mounted() {},
methods: {
// handleAddConfirm() {
// this.$refs.formRef.$refs[this.rejectRef].validate(async (valid) => {
// if (valid) {
// let detailData = await getScoreDetail({ id: this.id })
// let params = {}
// params.remark = this.infoForm.remark
// params.orderCode = detailData.orderCode
// params.scoreId = this.id
// cancelDeduct(params).then((res) => {
// console.log(res)
// if (res) {
// this.$emit("handleConfirm", false)
// this.notice.okTips("操作成功")
// }
// })
// }
// })
// },
handleClose() {
this.$emit("dialogClose", false)
}
}
}
</script>
<style lang="scss" scoped>
.reject-dialog {
margin: 21px 0 83px;
::v-deep .el-textarea__inner {
height: 70px;
}
::v-deep .el-input__count {
right: 15px !important;
bottom: 3px !important;
font-size: 12px;
color: #999999;
}
}
</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">
<div slot="jifen">
<input-num-range :formData="searchForm" :keyObj="{ from: 'minIntegral', to: 'maxIntegral' }"></input-num-range>
</div>
</GLCombiForm>
<GLCombiForm ref="showSearch" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<div> </div>
<div>
<el-button size="small" @click="exportExcel" type="primary" plain>导出</el-button>
</div>
<h2>积分明细列表</h2>
<el-button size="small" @click="handleExport" type="primary" plain>导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="pointRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<GLTable ref="pointTable" :search-form="searchFormSearch" :table-params="tableParams" :get-list-api="getListApi" :pageConf="pageConf" :before-search-fn="beforeSearchFn">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
<!-- </div> -->
</template>
<script>
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
export default {
props: {
// 积分渠道,1.阳光激励 2.续保用户 3.管理层
channelSource: {
type: String,
default: '1'
}
},
data() {
//这里存放数据
return {
size: 'small',
url: url,
searchForm: {},
showFormData: [
{
label: '搜索',
name: 'term',
type: 'input',
placeholder: '请输入昵称、手机号',
isClear: true,
maxlength: 100
},
{
label: '当前积分',
name: '',
addHtml: 'jifen'
}
],
searchForm: {
staffName: '',
staffPhone: '',
merchantId: '',
rewardTime: [],
reviewTime: [],
successTime: []
},
searchFormSearch: {},
tableButtonList: [
{
type: 'GLButton',
......@@ -61,65 +50,204 @@ export default {
}
}
],
// 表格
getListApi: this.$apis.points.getIntegralCustomerList,
getListApi: this.$apis.points.getStaffScoreList,
showFormData: [
{
label: '员工名称',
name: 'staffName',
type: 'input',
isClear: true
},
{
label: '员工手机号',
name: 'staffPhone',
type: 'input',
isClear: true
},
{
label: '门店名称',
name: 'merchantId',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'merchantServiceList'
},
{
label: '积分收益时间',
name: 'rewardTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '积分付款时间',
name: 'reviewTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '积分到账时间',
name: 'successTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '昵称',
prop: 'customerWechatName'
label: '门店名称',
prop: 'merchantName'
},
{
label: '员工名称',
prop: 'staffName'
},
{
label: '手机号',
prop: 'customerPhone'
label: '员工手机号',
prop: 'staffPhone'
},
{
label: '当前积分',
prop: 'availableIntegral'
prop: 'currentScore'
},
{
label: '累计收益积分',
prop: 'totalRewardScore'
},
{
label: '累计收入',
prop: 'totalIntegral'
label: '累计兑换积分',
prop: 'totalWithdrawalScore'
},
{
label: '累计支出',
prop: 'usedIntegral'
label: '累计抵扣积分',
prop: 'totalDeductScore'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
statusList: []
merchantServiceList: []
}
}
},
mounted() { },
mounted() {
this.tableParams.tableColumns[1].label = this.channelSource == '1' ? '员工名称' : '客户名称'
this.tableParams.tableColumns[2].label = this.channelSource == '1' ? '员工手机号' : '客户手机号'
this.showFormData[0].label = this.channelSource == '1' ? '员工名称' : '客户名称'
this.showFormData[1].label = this.channelSource == '1' ? '员工手机号' : '客户手机号'
this.$apis.points.getShopMerchantList({}).then((res) => {
this.baseData.merchantServiceList = res
this.getOptionsList()
})
},
methods: {
// 导出
handleExport() {
let params = {
...this.searchFormSearch,
currentPage: 1,
pageSize: 9999
}
this.$apis.points.getStaffScoreExport(params).then((res) => {
console.log(res)
this.$utils.aToExport(res)
// this.$open(res)
})
},
handleDetail(row) {
let obj = {}
if (this.channelSource != 1) {
obj = {
searchObj: JSON.stringify({
merchantId: row.merchantId,
staffPhone: row.staffPhone
}),
staffName: row.staffName,
channelSource: this.channelSource
}
} else {
obj = {
searchObj: JSON.stringify({
staffId: row.staffId
}),
staffName: row.staffName,
channelSource: this.channelSource
}
}
this.$router.push({
path: '/pointsList/detail',
query: {
id: row.id
path: '/pointsList/userDetail',
query: obj
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = this.$common.utils.deepClone(this.searchForm)
console.log(this.channelSource, 'channelSource-----')
this.searchFormSearch.channelSource = this.channelSource
if (this.searchFormSearch.rewardTime && this.searchFormSearch.rewardTime.length) {
this.searchFormSearch.rewardBeginTime = dayjs(this.searchFormSearch.rewardTime[0]).format('YYYY-MM-DD') + ' 00:00:00'
this.searchFormSearch.rewardEndTime = dayjs(this.searchFormSearch.rewardTime[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchFormSearch.reviewTime && this.searchFormSearch.reviewTime.length) {
this.searchFormSearch.reviewBeginTime = dayjs(this.searchFormSearch.reviewTime[0]).format('YYYY-MM-DD') + ' 00:00:00'
this.searchFormSearch.reviewEndTime = dayjs(this.searchFormSearch.reviewTime[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchFormSearch.successTime && this.searchFormSearch.successTime.length) {
this.searchFormSearch.successBeginTime = dayjs(this.searchFormSearch.successTime[0]).format('YYYY-MM-DD') + ' 00:00:00'
this.searchFormSearch.successEndTime = dayjs(this.searchFormSearch.successTime[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
delete this.searchFormSearch.rewardTime
delete this.searchFormSearch.successTime
delete this.searchFormSearch.reviewTime
resolve()
})
},
handleSearch() {
this.$refs.pointRef.refreshTable()
this.$refs.pointTable.refreshTable()
},
handleReset() {
this.searchForm = {}
this.handleSearch()
},
exportExcel() {
this.$apis.points.getIntegralCustomerExport(this.searchForm).then(res => {
this.$utils.aToExport(res)
})
this.searchForm = {
staffName: '',
staffPhone: '',
merchantId: '',
rewardTime: [],
reviewTime: [],
successTime: []
}
this.searchFormSearch = {}
this.$refs.pointTable.refreshTable(true, true)
}
}
};
}
</script>
<style scoped>
</style>
<style scoped lang="scss">
.d2-container-content {
::v-deep {
.tableHeaderTitle {
font-weight: 500;
font-size: 16px;
color: #333333;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="points">
<div class="points edit-box">
<div class="container m-b-20 top">
<div class="page-title">积分详情</div>
<div class="flex box">
<div class="flex block" v-for="(item, index) in list" :key="index">
<img class="icon" :src="require(`@/assets/point-custom-${index}.png`)" />
<div>
<div>{{ item.title }}</div>
<div class="num">
{{ item.key == 'staffName' ? staffName : topPointsInfo[item.key] || topPointsInfo[item.key] == 0 ? topPointsInfo[item.key] : "--" }}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<GLCombiForm ref="showSearch" :formObj="searchForm" :label-width="'150px'" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset" />
<div class="table-header">
<h2>积分明细列表</h2>
<div>
<!-- <el-button size="small" type="primary" @click="addDeduction" v-if="channelSource == 1 && !topPointsInfo.staffSource == 1">新增手动抵扣</el-button> -->
<el-button size="small" @click="handleExport" type="primary" plain>导出</el-button>
</div>
</div>
<GLTable ref="pointTable" :search-form="searchFormSearch" :table-params="tableParams" :get-list-api="getListApi" :pageConf="pageConf" :before-search-fn="beforeSearchFn">
<div slot="auth-button" slot-scope="scope">
<!-- <el-button type="text" @click="handleDetail(scope.scope)">详情</el-button> -->
<el-button type="text" v-if="channelSource == 1 && !scope.scope.relateId && scope.scope.infoName == '手动抵扣'" @click="handleRevocation(scope.scope)">撤销</el-button>
</div>
</GLTable>
<!-- 详细信息 -->
<point-detail-dialog :visible.sync="detailVisible" v-if="detailVisible" :id="recordInfo.id" />
<!-- 撤销抵扣 -->
<revocation-dialog :visible.sync="revocationVisible" v-if="revocationVisible" :id="recordInfo.id" @dialogClose="handleRevocationClose" @handleConfirm="handleRevocationComfirm" />
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import pointDetailDialog from './components/pointDetailDialog'
import revocationDialog from './components/revocationDialog'
export default {
components: {
pointDetailDialog,
revocationDialog
},
data() {
return {
detailVisible: false,
revocationVisible: false,
recordInfo: {},
searchForm: {
infoName: "",
rewardTime: []
},
searchFormSearch: {},
list: [
{
title: "员工姓名",
key: "staffName"
},
{
title: "当前积分",
key: "currentScore"
},
{
title: "累计收益积分",
key: "totalRewardScore"
},
{
title: "累计兑换积分",
key: "totalWithdrawalScore"
}
],
showFormData: [
{
label: "积分类型",
name: "infoName",
type: "select",
optionId: "confId",
optionLabel: "confLabel",
optionsName: "infoNameList"
},
{
label: "积分变化时间",
name: "rewardTime",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
}
],
getListApi: this.$apis.points.getScoreDetailList,
baseData: {
infoNameList: [
{
confId: "积分收益",
confLabel: "积分收益"
},
{
confId: "积分兑换",
confLabel: "积分兑换"
},
{
confId: "退款抵扣",
confLabel: "退款抵扣"
},
{
confId: "撤单抵扣",
confLabel: "撤单抵扣"
},
{
confId: "错单抵扣",
confLabel: "错单抵扣"
},
{
confId: "手动抵扣",
confLabel: "手动抵扣"
},
{
confId: "撤销抵扣",
confLabel: "撤销抵扣"
},
{
confId: "售后返还",
confLabel: "售后返还"
},
{
confId: "购物兑换",
confLabel: "购物兑换"
}
]
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: false,
tableColumns: [
{
label: "积分类型",
prop: "infoName"
},
{
label: "积分明细",
prop: "rewardScore",
formatter: (cell) => {
return cell.rewardScore
? (cell.type == 0 ? "+" : "-") + cell.rewardScore
: "--"
}
},
{
label: "变化后积分",
prop: "finalTotalScore",
formatter: (cell) => {
return cell.finalTotalScore || cell.finalTotalScore == 0
? cell.finalTotalScore
: "--"
}
},
{
label: "变化前积分",
prop: "currentTotalScore",
formatter: (cell) => {
return cell.currentTotalScore || cell.currentTotalScore == 0
? cell.currentTotalScore
: "--"
}
},
{
label: "积分变化时间",
prop: 'updatedTime',
formatter: (cell) => {
return dayjs(cell.updatedTime).format('YYYY-MM-DD HH:MM:ss')
}
},
{
label: "操作人",
prop: "operator"
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
topPointsInfo: {}
}
},
created() {
// 积分渠道,1.阳光激励 2.续保用户 3.管理层
this.channelSource = this.$route.query.channelSource
this.staffName = this.$route.query.staffName
this.list[0].title = this.channelSource == '1' ? '员工名称' : '客户名称'
},
methods: {
//新增抵扣
addDeduction() {
this.$router.push({
path: '/pointsList/addDeduction',
query: {
userId: this.topPointsInfo.staffUuid,
merchantId: this.topPointsInfo.merchantId
}
})
// this.$router.push({
// name: 'deduction',
// query: {
// userId: this.topPointsInfo.staffUuid,
// merchantId: this.topPointsInfo.merchantId
// }
// })
},
// 导出
handleExport() {
let params = {
...this.searchFormSearch,
currentPage: 1,
pageSize: 9999
}
this.$apis.points.exportDetailScore(params).then((res) => {
console.log(res)
this.$utils.aToExport(res)
// this.$open(res)
})
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = this.$common.utils.deepClone(this.searchForm)
this.searchFormSearch.channelSource = this.channelSource
this.searchFormSearch = {
...this.searchFormSearch,
...JSON.parse(this.$route.query.searchObj)
}
if (this.searchFormSearch.rewardTime && this.searchFormSearch.rewardTime.length) {
this.searchFormSearch.rewardBeginTime = dayjs(this.searchFormSearch.rewardTime[0]).format('YYYY-MM-DD') + ' 00:00:00'
this.searchFormSearch.rewardEndTime = dayjs(this.searchFormSearch.rewardTime[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchFormSearch.withdrawalTime && this.searchFormSearch.withdrawalTime.length) {
this.searchFormSearch.withdrawalBeginTime = dayjs(this.searchFormSearch.withdrawalTime[0]).format('YYYY-MM-DD') + ' 00:00:00'
this.searchFormSearch.withdrawalEndTime = dayjs(this.searchFormSearch.withdrawalTime[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
delete this.searchFormSearch.rewardTime
delete this.searchFormSearch.withdrawalTime
console.log(this.searchFormSearch)
this.getTopPointsInfo()
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
// 查看详情
// handleDetail(data) {
// this.recordInfo = data
// this.detailVisible = true
// },
//撤销
handleRevocation(data) {
this.recordInfo = data
this.revocationVisible = true
},
//取消撤销
handleRevocationClose(value) {
this.revocationVisible = value
},
handleRevocationComfirm(value) {
this.revocationVisible = value
this.$refs.pointTable.refreshTable()
},
handleSearch() {
this.$refs.pointTable.refreshTable()
},
// 获取顶部积分信息
getTopPointsInfo() {
let params = {
...this.searchFormSearch,
currentPage: 1,
pageSize: 9999,
...JSON.parse(this.$route.query.searchObj)
}
// 根据staffId查询积分明细列表数据作为顶部积分信息
this.$apis.points.getStaffScoreList(params).then((res) => {
this.topPointsInfo = res.list?.[0] || {}
if (this.channelSource != 1) {
this.baseData.infoNameList = [
{
confId: "积分收益",
confLabel: "积分收益"
},
{
confId: "积分兑换",
confLabel: "积分兑换"
},
{
confId: "购物兑换",
confLabel: "购物兑换"
},
{
confId: "售后返还",
confLabel: "售后返还"
}
]
}
this.getOptionsList()
})
},
handleReset() {
this.searchForm = {
infoName: "",
rewardTime: []
}
this.searchFormSearch = {}
this.$refs.pointTable.refreshTable(true, true)
}
}
}
</script>
<style lang="scss" scoped>
.d2-container-content {
::v-deep {
.tableHeaderTitle {
font-weight: 500;
font-size: 16px;
color: #333333;
}
}
}
.header {
background: #ffffff;
}
.points {
.detail-tabs {
width: 100%;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-around;
padding: 20px 16px;
box-sizing: border-box;
margin-bottom: 16px;
.detail-tabs-item {
flex: 1;
height: 104px;
background: #f8faff;
border-radius: 5px;
padding: 20px;
box-sizing: border-box;
margin-right: 16px;
.title {
font-size: 16px;
color: #333333;
}
.score {
font-weight: 700;
font-size: 28px;
color: #185efe;
line-height: 42px;
}
}
}
}
.top .icon {
width: 44px;
height: 44px;
margin-right: 16px;
}
.top .box {
padding: 20px 20px 0;
}
.top .block {
box-sizing: border-box;
width: 271px;
height: 100px;
font-size: 14px;
color: #333333;
background: #f9fafc;
margin-right: 20px;
padding: 24px 16px 20px;
}
.top .num {
font-weight: 700;
font-size: 26px;
color: #333333;
margin-top: 10px;
}
</style>
\ No newline at end of file
<template>
<div>
<GLTabs v-model="channelSource" @tab-click="changeTab" :tabPaneList="tabPaneList"></GLTabs>
<div class="main-wrap">
<detailList v-show="channelSource == 2" :channelSource="2"></detailList>
<detailList v-show="channelSource == 1" :channelSource="1"></detailList>
<detailList v-show="channelSource == 3" :channelSource="3"></detailList>
</div>
</div>
</template>
<script>
import detailList from './detailList'
export default {
name: 'index',
components: {
detailList
},
data() {
return {
size: 'small',
loading: false,
channelSource: '2',
tabPaneList: [
{ name: '2', label: '续保用户' },
{ name: '1', label: '阳光激励用户' },
{ name: '3', label: '管理层' }
]
}
},
mounted() { },
methods: {
changeTab() { }
}
}
</script>
<style lang="scss" scoped>
.main-wrap {
background-color: #fff;
margin-top: 16px;
}
</style>
<template>
<div class="container">
<div class="config-card">
<h2 class="config-title">上传证件配置</h2>
<p class="config-desc">此开关用于配置用户提现时是否要上传身份证正反面</p>
<div class="table-container">
<GLTable :tableData="tableData" :tableParams="tableParams" :hasPage="false" :hasNum="false">
<template slot="switchSlot" slot-scope="scope">
<!-- <el-switch v-model="scope.scope.enabled" active-text="启用" inactive-text="停用"></el-switch> -->
<el-switch v-model="scope.scope.enabled"></el-switch>
<div class="switch-txt">{{ scope.scope.enabled ? '启用' : '停用' }}</div>
</template>
</GLTable>
</div>
<div class="form-actions">
<el-button type="primary" size="small" @click="handleConfirm">保存</el-button>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
props: {},
data() {
return {
url: url,
tableData: [
{ channelCode: 2, channelName: '续保用户', enabled: false },
{ channelCode: 1, channelName: '阳光激励用户', enabled: false },
{ channelCode: 3, channelName: '管理层', enabled: false }
],
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '渠道名称',
prop: 'channelName'
},
{
label: '上传身份证',
prop: 'enabled',
addHtml: 'switchSlot'
}
]
}
}
},
mounted() {
this.getConfig()
},
methods: {
getConfig() {
this.$apis.ruleConfig.getUpDocConfig({}).then(res => {
res.forEach(item => {
let idx = this.tableData.findIndex(i => i.channelCode == item.channelCode)
this.tableData[idx].id = item.id
// isEnabled 是否打开:0-关闭,1-打开
this.tableData[idx].enabled = !!item.isEnabled
})
})
},
handleConfirm() {
let params = {
uploadDocumentConfigRequestList: []
}
this.tableData.forEach(item => {
params.uploadDocumentConfigRequestList.push({
channelCode: item.channelCode,
id: item.id,
isEnabled: item.enabled ? 1 : 0
})
})
this.$apis.ruleConfig.updateUpDocConfig(params).then(res => {
let { code, message } = res
code == 0 ? this.$message.success('配置成功!') : this.$message.error(message)
})
}
}
}
</script>
<style scoped lang='scss'>
.container {
padding: 20px;
.switch-txt {
display: inline-block;
margin-left: 8px;
}
.config-card {
background: #fff;
border-radius: 4px;
padding: 20px;
position: relative;
.config-title {
font-size: 18px;
font-weight: bold;
margin-bottom: 8px;
}
.config-desc {
color: #909399;
font-size: 14px;
margin-bottom: 20px;
}
.table-container {
width: 580px;
margin-bottom: 20px;
}
.config-table {
width: 100%;
border-collapse: collapse;
th,
td {
padding: 12px 15px;
text-align: left;
border-bottom: 1px solid #ebeef5;
}
th {
background-color: #f5f7fa;
color: #606266;
font-weight: 500;
}
tr:last-child td {
border-bottom: none;
}
td:first-child {
color: #606266;
width: 150px;
}
}
.form-actions {
margin-top: 30px;
text-align: left;
}
}
}
</style>
\ No newline at end of file
......@@ -11,7 +11,7 @@
<div class="set-int">
<el-input @change="onchangeInput" class="intTime" v-model="formObj[item.attr].time" maxlength="4" oninput="if(value){value=value.replace(/[^\d]/g,'')} if(value<=0){value=''} if(value>1000){value=1000}" placeholder="请输入"></el-input>
</div>
<span>小时后,未提现或兑换时发送</span>
<span>小时后</span>
</div>
<div class="sms-box">
<div class="left">群发内容:</div>
......@@ -57,11 +57,16 @@
<script type='text/ecmascript-6'>
import glsxCombiForm from '@/components/glsx-combi-form'
import wTextarea from './tag-textarea.vue'
const DJ_MINI_APPID = '车生活助手'
// const DJ_MINI_APPID = '车生活助手'
const JF_MINI_APPID = '积分商城'
const MINI = [
// {
// confId: DJ_MINI_APPID,
// confName: '车生活助手'
// },
{
confId: DJ_MINI_APPID,
confName: '车生活助手'
confId: JF_MINI_APPID,
confName: '积分商城'
}
]
export default {
......@@ -78,7 +83,7 @@ export default {
miniId: [{ required: true, message: '短信签名', trigger: 'change' }]
},
formObj: {
miniId: DJ_MINI_APPID,
miniId: JF_MINI_APPID,
message_first: {
messageContext: '',
switch: false,
......
......@@ -82,10 +82,10 @@ export default {
prop: 'userPhone',
},
{
label: '当前积分',
prop: 'currentIntegral'
},
// {
// label: '当前积分',
// prop: 'currentIntegral'
// },
{
label: '所属门店',
prop: 'merchantName'
......
<template>
<div
class="layout"
v-loading="loading"
>
<div class="layout" v-loading="loading">
<div class="content">
<div class="title">积分充值</div>
<el-scrollbar class="box">
......@@ -21,59 +18,34 @@
</div>
</div>
</template>
<glsx-combi-form
ref="fromRef"
:isEdit="true"
:isBlock="true"
:formObj="configForm"
:formData="formData"
:formRules="rule"
>
<glsx-combi-form ref="fromRef" :isEdit="true" :isBlock="true" :formObj="configForm" :formData="formData" :formRules="rule">
<template #merchantId>
<div class="upload">
<div class="upload-btn">
<el-button
size="small"
@click="relateStoreVisible = true"
:disabled="pageObject.id"
>
<el-button size="small" @click="relateStoreVisible = true" :disabled="pageObject.id">
<i class="el-icon-plus"></i>
选择商户
</el-button>
</div>
</div>
<template v-if="configForm.merchantId">
<GLTable
:tableData="[configForm]"
:tableParams="merchantParams"
:hasPage="false"
class="merchant-box"
></GLTable>
<GLTable :tableData="[configForm]" :tableParams="merchantParams" :hasPage="false" class="merchant-box"></GLTable>
</template>
</template>
<template #table>
<el-radio-group :disabled="pageObject.id" v-model="configForm.personType">
<el-radio v-for="(item, idx) in baseData.personTypeList" :key="idx" :label="item.confId">{{ item.confLabel }}</el-radio>
</el-radio-group>
<div style="margin-bottom: 8px;"></div>
<div class="upload">
<div class="upload-btn">
<el-button
size="small"
:disabled="pageObject.disabled"
>
<el-button size="small" :disabled="pageObject.disabled">
<i class="el-icon-plus"></i>
上传名单
</el-button>
<input
type="file"
ref="file"
accept=".xlsx, .xlc, .xlm, .xls"
@change="uploadFile"
:disabled="pageObject.disabled"
:class="['input',{'is-disabled':pageObject.disabled}]"
/>
<input type="file" ref="file" accept=".xlsx, .xlc, .xlm, .xls" @change="uploadFile" :disabled="pageObject.disabled" :class="['input',{'is-disabled':pageObject.disabled}]" />
</div>
<a
href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/客户积分导入模板.xlsx"
target="_blank"
>下载模板</a>
<a href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/客户积分导入模板.xlsx" target="_blank">下载模板</a>
</div>
<template v-if="importObject.detailList">
<template v-if="importObject.name">
......@@ -84,148 +56,79 @@
</template>
<div class="table-box">
<div class="table">
<GLTable
:tableData="importObject.detailList[pageNum - 1]"
:tableParams="tableParams"
ref="listRef"
:pageConf="pageConf"
:tableTotal="totalForm.customerTotal"
:pageSizes="[50]"
@refreshTable="refreshTable"
>
<template
slot="cashBackValue"
slot-scope="scope"
>
<GLTable :tableData="importObject.detailList[pageNum - 1]" :tableParams="tableParams" ref="listRef" :pageConf="pageConf" :tableTotal="totalForm.customerTotal" :pageSizes="[50]" @refreshTable="refreshTable">
<template slot="cashBackValue" slot-scope="scope">
<template v-if="!pageObject.disabled">
<el-input
v-model.number.trim="scope.scope.cashBackValue"
@blur="updateTotal(scope.scope, scope.index, 'cashBackValue')"
maxLength="6"
></el-input>
<el-input v-model.number.trim="scope.scope.cashBackValue" @blur="updateTotal(scope.scope, scope.index, 'cashBackValue')" maxLength="6"></el-input>
</template>
<template v-else>
{{scope.scope.cashBackValue || '-'}}
</template>
</template>
<template
slot="buyValue"
slot-scope="scope"
>
<!-- <template slot="buyValue" slot-scope="scope">
<template v-if="!pageObject.disabled">
<el-input
v-model.number.trim="scope.scope.buyValue"
@blur="updateTotal(scope.scope, scope.index,'buyValue')"
maxLength="6"
></el-input>
<el-input v-model.number.trim="scope.scope.buyValue" @blur="updateTotal(scope.scope, scope.index,'buyValue')" maxLength="6"></el-input>
</template>
<template v-else>
{{scope.scope.buyValue || '-'}}
</template>
</template>
<template
slot="oilList"
slot-scope="scope"
>
</template> -->
<!-- <template slot="oilList" slot-scope="scope">
<template v-if="scope.scope.oilList && scope.scope.oilList.length">
<div class="flex">
<span>{{ filterData(scope.scope.oilList,'oilList').slice(0, 1).join('、') }}</span>
<el-popover
placement="top"
width="fit-content"
trigger="hover"
>
<div
v-for="(item,index) in filterData(scope.scope.oilList,'oilList')"
:key="index"
>
<el-popover placement="top" width="fit-content" trigger="hover">
<div v-for="(item,index) in filterData(scope.scope.oilList,'oilList')" :key="index">
{{item}}
</div>
<span
class="more-info"
slot="reference"
>...({{ scope.scope.oilList.length }})</span>
<span class="more-info" slot="reference">...({{ scope.scope.oilList.length }})</span>
</el-popover>
<template v-if="!pageObject.disabled">
<el-button
type="text"
@click="showConfig(scope.scope, scope.index)"
>编辑</el-button>
<el-button type="text" @click="showConfig(scope.scope, scope.index)">编辑</el-button>
</template>
</div>
</template>
<template v-else>
<template v-if="!pageObject.disabled">
<el-button
type="text"
@click="showConfig(scope.scope, scope.index)"
>配置</el-button>
<el-button type="text" @click="showConfig(scope.scope, scope.index)">配置</el-button>
</template>
<template v-else>
无
</template>
</template>
</template>
<template
slot="couponList"
slot-scope="scope"
>
</template> -->
<!-- <template slot="couponList" slot-scope="scope">
<template v-if="scope.scope.couponList && scope.scope.couponList.length">
<div class="flex">
<span>{{ filterData(scope.scope.couponList,'couponList').slice(0, 1).join('、') }}</span>
<el-popover
placement="top"
width="fit-content"
trigger="hover"
>
<div
v-for="(item,index) in filterData(scope.scope.couponList,'couponList')"
:key="index"
>
<el-popover placement="top" width="fit-content" trigger="hover">
<div v-for="(item,index) in filterData(scope.scope.couponList,'couponList')" :key="index">
{{item}}
</div>
<span
class="more-info"
slot="reference"
>...({{ scope.scope.couponList.length }})</span>
<span class="more-info" slot="reference">...({{ scope.scope.couponList.length }})</span>
</el-popover>
<template v-if="!pageObject.disabled">
<el-button
type="text"
@click="showConfig(scope.scope, scope.index, 1)"
>编辑</el-button>
<el-button type="text" @click="showConfig(scope.scope, scope.index, 1)">编辑</el-button>
</template>
</div>
</template>
<template v-else>
<template v-if="!pageObject.disabled">
<el-button
type="text"
@click="showConfig(scope.scope, scope.index, 1)"
>配置</el-button>
<el-button type="text" @click="showConfig(scope.scope, scope.index, 1)">配置</el-button>
</template>
<template v-else>
无
</template>
</template>
</template>
</template> -->
</GLTable>
</div>
<div
class="total"
:key="totalKey"
>
<div class="total" :key="totalKey">
<template v-for="(i, index) in totalFormData">
<template>
<div
:key="index"
class="item flex"
>
<div :key="index" class="item flex">
<div class="label">{{ i.label }}:</div>
<div
class="value"
:ref="`value-${index}`"
>
<div class="value" :ref="`value-${index}`">
<template v-if="i.formatter">
{{ i.formatter(totalForm) }}
</template>
......@@ -244,30 +147,12 @@
</el-scrollbar>
</div>
<GLFooter class="footer">
<el-button
@click="$router.go(-1)"
size="medium"
>取消</el-button>
<el-button
v-if="!isWatchPage"
type="primary"
@click="handleConfirm"
size="medium"
>确定</el-button>
<el-button @click="$router.go(-1)" size="medium">取消</el-button>
<el-button v-if="!isWatchPage" type="primary" @click="handleConfirm" size="medium">确定</el-button>
</GLFooter>
<select-store
:dialogVisible.sync="relateStoreVisible"
:storeSelected="selectedList"
:merchantInfo="configForm"
@handleRelateStoreConfirm="handleRelateStoreConfirm"
@handleRelateStoreClose="handleRelateStoreClose"
/>
<points-config
:configParams.sync="configParams"
:merchantId="configForm.merchantId"
@confirm="changeRowConfig"
/>
<select-store v-if="relateStoreVisible" :dialogVisible.sync="relateStoreVisible" :storeSelected="selectedList" :merchantInfo="configForm" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose" />
<!-- <points-config :configParams.sync="configParams" :merchantId="configForm.merchantId" @confirm="changeRowConfig" /> -->
<import-err-dialog :importObj.sync="importObj" />
</div>
......@@ -276,7 +161,7 @@
<script type="text/ecmascript-6">
import NP from 'number-precision'
import selectStore from './components/selectStore'
import pointsConfig from './components/pointsConfig.vue'
// import pointsConfig from './components/pointsConfig.vue'
import importErrDialog from './components/importErrDialog.vue'
const truncateDecimal = (number, decimalPlaces = 2) => {
let [integer, decimals] = String(number).split('.')
......@@ -288,11 +173,11 @@ const truncateDecimal = (number, decimalPlaces = 2) => {
export default {
components: {
selectStore,
pointsConfig,
// pointsConfig,
importErrDialog
},
name: '',
data () {
data() {
return {
NP,
loading: false,
......@@ -312,9 +197,12 @@ export default {
callback()
} else callback(new Error('请导入充值人群'))
}
}]
}],
personType: [{ required: true, message: '请选择用户类型', trigger: 'change' }],
},
configForm: {
personType: 1
},
configForm: {},
formData: [
{
label: '选择商户',
......@@ -357,17 +245,17 @@ export default {
return `${passageSum}*${passageServiceCharge}%=${sum}`
}
},
{
label: `油卡手续费(0%)`,
name: 'gasCardServiceCharge',
formatter: (cell) => {
const { gasService } = cell,
{ gasCardServiceCharge } = this.chargeObject,
gasCardSum = gasService.reduce((acc, cur) => acc + cur, 0),
sum = truncateDecimal(NP.times(gasCardSum, gasCardServiceCharge, 0.01))
return `${gasCardSum}*${gasCardServiceCharge}%=${sum}`
}
},
// {
// label: `油卡手续费(0%)`,
// name: 'gasCardServiceCharge',
// formatter: (cell) => {
// const { gasService } = cell,
// { gasCardServiceCharge } = this.chargeObject,
// gasCardSum = gasService.reduce((acc, cur) => acc + cur, 0),
// sum = truncateDecimal(NP.times(gasCardSum, gasCardServiceCharge, 0.01))
// return `${gasCardSum}*${gasCardServiceCharge}%=${sum}`
// }
// },
{
label: '总数',
name: 'sum',
......@@ -383,21 +271,21 @@ export default {
],
tableParams: {
tableColumns: [
{
label: '保单号',
prop: 'policyNo',
minWidth: 200
},
// {
// label: '保单号',
// prop: 'policyNo',
// minWidth: 200
// },
{
label: '用户姓名',
prop: 'customerName',
minWidth: 100
},
{
label: '身份证号',
prop: 'idCardNo',
minWidth: 200
},
// {
// label: '身份证号',
// prop: 'idCardNo',
// minWidth: 200
// },
{
label: '用户手机号',
minWidth: 150,
......@@ -408,21 +296,21 @@ export default {
minWidth: 128,
addHtml: 'cashBackValue',
},
{
label: '商品兑换积分',
addHtml: 'buyValue',
minWidth: 128
},
{
label: '赠送油券',
minWidth: 260,
addHtml: 'oilList'
},
{
label: '赠送自店服务',
minWidth: 260,
addHtml: 'couponList'
},
// {
// label: '商品兑换积分',
// addHtml: 'buyValue',
// minWidth: 128
// },
// {
// label: '赠送油券',
// minWidth: 260,
// addHtml: 'oilList'
// },
// {
// label: '赠送自店服务',
// minWidth: 260,
// addHtml: 'couponList'
// },
{
label: '充值积分小计',
prop: 'total',
......@@ -444,8 +332,8 @@ export default {
},
]
},
configParams: {
},
// configParams: {
// },
importObj: {
},
importObject: {},
......@@ -461,19 +349,31 @@ export default {
passageServiceCharge: 0
},
pageNum: 1,
isWatchPage:false
isWatchPage: false,
baseData: {
personTypeList: [
{
confLabel: '续保用户',
confId: 1
},
{
confLabel: '管理层',
confId: 2
}
]
}
}
},
mounted () {
mounted() {
const { id, type } = this.$route.query
if (id) this.getDetail(id, type)
this.isWatchPage = !type
},
methods: {
refreshTable ({ pageNum }) {
refreshTable({ pageNum }) {
this.pageNum = pageNum
},
async getDetail (id, type) {
async getDetail(id, type) {
try {
this.loading = true
const res = await this.$apis.points.getIntegralDetail({ id }),
......@@ -497,6 +397,7 @@ export default {
passageServiceCharge: res.integralRate
})
this.totalForm.customerTotal = detailList.length
this.configForm.personType = res.personType
const list = this.splitArray(detailList, 50)
this.importObject = {
detailList: list
......@@ -509,50 +410,53 @@ export default {
setTimeout(() => this.$router.go(-1), 1e3)
}
},
handleConfirm () {
handleConfirm() {
const { disabled, id } = this.pageObject
if (disabled) return this.$router.go(-1)
this.$refs.fromRef.$refs.formRef.validate(async valid => {
if (valid) {
try {
this.loading = true
const { merchantId, merchantName } = this.configForm,
const { merchantId, merchantName, personType } = this.configForm,
list = this.importObject.detailList
let detailList = []
list.map(i => {
i.map(e => {
let oilList = [], couponList = []
e.oilList?.map(o => {
oilList.push({
oilCouponId: o.oilCouponId,
amount: o.amount,
salesPrice: o.salesPrice,
aliasName: o.aliasName
})
})
e.couponList?.map(c => {
couponList.push({
couponId: c.couponId,
amount: c.amount,
couponName: c.couponName
})
})
// let oilList = []
// e.oilList?.map(o => {
// oilList.push({
// oilCouponId: o.oilCouponId,
// amount: o.amount,
// salesPrice: o.salesPrice,
// aliasName: o.aliasName
// })
// })
// let couponList = []
// e.couponList?.map(c => {
// couponList.push({
// couponId: c.couponId,
// amount: c.amount,
// couponName: c.couponName
// })
// })
detailList.push({
policyNo: e.policyNo,
// policyNo: e.policyNo,
customerName: e.customerName,
customerPhone: e.customerPhone,
idCardNo: e.idCardNo,
// idCardNo: e.idCardNo,
cashBackValue: e.cashBackValue || 0,
buyValue: e.buyValue || 0,
oilList,
couponList
// buyValue: e.buyValue || 0,
// oilList,
// couponList
})
})
})
let params = {
merchantId,
merchantName,
detailList
detailList,
personType
}
if (id) params.id = id
const res = await this.$apis.points.updateCustomerIntegral(params)
......@@ -571,7 +475,7 @@ export default {
}
})
},
async uploadFile (e) {
async uploadFile(e) {
try {
const [file] = e.srcElement.files
if (!file) return
......@@ -625,7 +529,7 @@ export default {
if (error) this.$message.error(error)
}
},
setTableHeight (detailList = []) {
setTableHeight(detailList = []) {
const { listRef } = this.$refs
if (listRef) {
let length = detailList.length
......@@ -636,13 +540,13 @@ export default {
},
// 选择门店
handleRelateStoreClose () {
handleRelateStoreClose() {
this.relateStoreVisible = false
},
validateField (id) {
validateField(id) {
this.$refs.fromRef.$refs.formRef.validateField(id)
},
async handleRelateStoreConfirm (selectedData, isEdit) {
async handleRelateStoreConfirm(selectedData, isEdit) {
selectedData.merchantId && (this.$set(this.configForm, 'merchantId', selectedData.merchantId))
selectedData.merchantName && (this.$set(this.configForm, 'merchantName', selectedData.merchantName))
this.validateField('merchantId')
......@@ -665,17 +569,17 @@ export default {
}
},
showConfig (row, index, type = 0) {
this.configParams = {
show: true,
row,
type,
index,
oilList: JSON.parse(JSON.stringify(row.oilList || [])),
couponList: JSON.parse(JSON.stringify(row.couponList || [])),
}
},
setRowTotal (row, index) {
// showConfig(row, index, type = 0) {
// this.configParams = {
// show: true,
// row,
// type,
// index,
// oilList: JSON.parse(JSON.stringify(row.oilList || [])),
// couponList: JSON.parse(JSON.stringify(row.couponList || [])),
// }
// },
setRowTotal(row, index) {
const { oilList, cashBackValue, buyValue } = row
let total = NP.plus((cashBackValue || 0), (buyValue || 0))
oilList && oilList.map(i => total += NP.times((i.amount || 0), (i.salesPrice || 0), 0.01))
......@@ -683,26 +587,26 @@ export default {
this.totalForm.total[index] = total
this.updateView()
},
changeRowConfig ({
oilList,
couponList
}) {
const { row, index } = this.configParams
row.oilList = oilList
row.couponList = couponList
this.configParams = this.$options.data.call(this).configParams
if (oilList && oilList.length) {
this.setRowTotal(row, index)
this.setGasService(row, index)
}
},
setPassageService (row, index) {
// changeRowConfig({
// oilList,
// couponList
// }) {
// const { row, index } = this.configParams
// row.oilList = oilList
// row.couponList = couponList
// this.configParams = this.$options.data.call(this).configParams
// if (oilList && oilList.length) {
// this.setRowTotal(row, index)
// this.setGasService(row, index)
// }
// },
setPassageService(row, index) {
const { cashBackValue, buyValue } = row,
passageService = NP.plus((cashBackValue || 0), (buyValue || 0))
this.totalForm.passageService[index] = passageService
this.updateView()
},
setGasService (row, index) {
setGasService(row, index) {
const { oilList } = row
let total = 0
if (oilList && oilList.length) oilList.map(i => {
......@@ -711,13 +615,13 @@ export default {
this.totalForm.gasService[index] = total
this.updateView()
},
updateTotal (row, index, key) {
updateTotal(row, index, key) {
if (key && !/^[0-9]\d*$/.test(row[key])) row[key] = ''
this.setRowTotal(row, index)
this.setPassageService(row, index)
this.setGasService(row, index)
},
updateView () {
updateView() {
this.totalKey = Date.now()
const REF = this.$refs,
refLength = this.totalFormData.length
......@@ -736,12 +640,12 @@ export default {
}
})
},
filterData (list, name) {
filterData(list, name) {
return list?.map(i => {
return name == 'oilList' ? `${i.aliasName}*${i.amount} (${NP.times(i.amount, i.salesPrice, 0.01)}积分)` : `${i.couponName}*${i.amount}`
}) || []
},
splitArray (arr, size) {
splitArray(arr, size) {
let result = [],
newArr = JSON.parse(JSON.stringify(arr))
for (let i = 0; i < newArr.length; i += size) {
......@@ -864,9 +768,9 @@ export default {
.table-box {
min-width: 864px;
max-width: calc(100vw - 446px);
background: #f9f9f9;
// background: #f9f9f9;
border-radius: 4px;
padding: 20px;
// padding: 20px;
margin-top: 10px;
/deep/ .el-input {
width: 100%;
......@@ -877,12 +781,15 @@ export default {
}
}
.total {
background: #f9f9f9;
display: flex;
flex-direction: column;
font-size: 14px;
color: #666666;
margin-top: 16px;
padding: 8px 0 16px;
.item {
justify-content: flex-end;
// justify-content: flex-end;
line-height: 20px;
margin-top: 10px;
.label {
......
......@@ -16,10 +16,9 @@
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
>
<template
<!-- <template
slot="oilList"
slot-scope="scope"
>
slot-scope="scope">
<template v-if="scope.scope.oilList && scope.scope.oilList.length">
<div class="flex">
......@@ -45,11 +44,10 @@
<template v-else>
无
</template>
</template>
<template
</template> -->
<!-- <template
slot="couponList"
slot-scope="scope"
>
slot-scope="scope">
<template v-if="scope.scope.couponList && scope.scope.couponList.length">
<div class="flex">
<span>{{ filterData(scope.scope.couponList,'couponList').slice(0, 1).join('、') }}</span>
......@@ -74,7 +72,7 @@
<template v-else>
无
</template>
</template>
</template> -->
</GLTable>
</GLDialog>
</div>
......@@ -101,21 +99,21 @@ export default {
tableParams: {
listName: 'list',
tableColumns: [
{
label: '保单号',
prop: 'policyNo',
minWidth: 200
},
// {
// label: '保单号',
// prop: 'policyNo',
// minWidth: 200
// },
{
label: '用户姓名',
prop: 'customerName',
minWidth: 100
},
{
label: '身份证号',
minWidth: 200,
prop: 'idCardNo',
},
// {
// label: '身份证号',
// minWidth: 200,
// prop: 'idCardNo',
// },
{
label: '用户手机号',
minWidth: 150,
......@@ -126,21 +124,21 @@ export default {
minWidth: 150,
prop: 'cashBackValue'
},
{
label: '商品兑换积分',
prop: 'buyValue',
minWidth: 150,
},
{
label: '赠送油券',
minWidth: 260,
addHtml: 'oilList'
},
{
label: '赠送自店服务',
minWidth: 260,
addHtml: 'couponList'
},
// {
// label: '商品兑换积分',
// prop: 'buyValue',
// minWidth: 150,
// },
// {
// label: '赠送油券',
// minWidth: 260,
// addHtml: 'oilList'
// },
// {
// label: '赠送自店服务',
// minWidth: 260,
// addHtml: 'couponList'
// },
{
label: '充值积分小计',
minWidth: 150,
......
<template>
<GLDialog
bigTitle="选择商户"
mode="big"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose"
class="select-store"
>
<glsx-combi-form
ref="showSearch"
labelWidth="105px"
:formObj="searchForm"
:formData="searchFormData"
>
<GLDialog bigTitle="选择商户" mode="big" :visible.sync="dialogVisible" :before-close="handleClose" :close-on-click-modal="false" @onOk="handleConfirm" @onCancel="handleClose" class="select-store">
<glsx-combi-form ref="showSearch" labelWidth="105px" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button
:size="size"
type="primary"
@click="getTable"
>查询</el-button>
<el-button
:size="size"
@click="resetTable"
>重置</el-button>
<el-button :size="size" type="primary" @click="getTable">查询</el-button>
<el-button :size="size" @click="resetTable">重置</el-button>
</span>
</glsx-combi-form>
<GLTable
ref="storeRef"
:tableTotal="total"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
@refreshTable="getList"
:tableData="storeList"
:hasNum="false"
:setTableFinishFun="setTableFinishFun"
>
<div
slot="radioHtml"
class="store-table"
slot-scope="scope"
>
<el-radio
v-model="merchantId"
:label="scope.scope.merchantNo"
@click.native="handleClick(scope.scope)"
></el-radio>
<GLTable ref="storeRef" :tableTotal="total" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @refreshTable="getList" :tableData="storeList" :hasNum="false" :setTableFinishFun="setTableFinishFun">
<div slot="radioHtml" class="store-table" slot-scope="scope">
<el-radio v-model="merchantId" :label="scope.scope.merchantNo" @click.native="handleClick(scope.scope)"></el-radio>
</div>
</GLTable>
</GLDialog>
......@@ -55,7 +16,7 @@
<script>
export default {
name: 'selectStore',
data () {
data() {
return {
searchForm: {
merchantId: '',
......@@ -150,27 +111,28 @@ export default {
// required: true
// }
},
watch: {
dialogVisible (n) {
if (n) this.init()
}
},
mounted () {
// watch: {
// dialogVisible(n) {
// if (n) this.init()
// }
// },
mounted() {
this.init()
},
methods: {
init () {
init() {
this.merchantId = String(this.merchantInfo.merchantId)
this.merchantName = this.merchantInfo.merchantName
this.getList()
},
getList (pageCon) {
getList(pageCon) {
pageCon && (this.pageConfig = pageCon)
var params = {
merchantId: this.merchantId,
...this.searchForm,
...this.pageConfig
}
this.$apis.common.getMerchantList(params).then(res => {
this.$apis.common.getMerchantList1(params).then(res => {
this.storeList = res.list
this.total = res.total
let nowIndex = this.pageConfig.pageSize * (this.pageConfig.currentPage - 1)
......@@ -179,26 +141,29 @@ export default {
})
})
},
getTable () {
getTable() {
this.$refs.storeRef.page.currentPage = 1
this.getList()
},
setTableFinishFun () {
setTableFinishFun() {
//接收到的数据为空
this.$refs.staffRef.tableHeightValues = '460px'
},
handleClick (val) {
handleClick(val) {
this.merchantId = val.merchantNo
this.merchantName = val.merchantName
},
resetTable () {
this.searchForm = {}
resetTable() {
this.searchForm = {
merchantId: '',
merchantName: ''
}
this.getTable()
},
handleClose () {
handleClose() {
this.$emit('handleRelateStoreClose')
},
handleConfirm () {
handleConfirm() {
const { merchantId, merchantName } = this
if (merchantId && merchantName) this.$emit('handleRelateStoreConfirm', {
merchantId,
......
<!-- 积分提现审批-->
<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" :recordInfo="recordInfo" @cancelPay="cancelPay"></pay-approval>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import DetailDialog from './approveView.vue'
import PayApproval from './payApproval.vue'
import { colors, tableStatus,PayerelList,channelList,statusList } from '@/utils/constants.js'
export default {
components: {
DetailDialog,
PayApproval
},
data() {
return {
recordInfo: {},
id: '',
checkLoading: false,
loading: false,
detailVisible: false,
payVisible: false,
colors,
tableStatus,
size: 'small',
url: url,
searchForm: {
batchNo: '',
paymentChannel: '',
approvalTime: [],
oaApprovalTime: [],
userSettleTime: []
},
hasFooter: false,
tableSearchForm: {},
showFormData: [
{
label: '批次号',
name: 'batchNo',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: 'OA审批编号',
name: 'oaSpNo',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '付款渠道',
name: 'paymentChannel',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'channelList'
},
{
label: '付款主体',
name: 'paymentSubject',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'PayerelList'
},
{
label: '状态',
name: 'status',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'statusList'
},
{
label: '审批时间',
name: 'approvalTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: 'OA审批时间',
name: 'oaApprovalTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '付款时间',
name: 'userSettleTime',
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: '编辑'
},
condition: row => {
return row.status == 0||row.status ==3
},
listeners: {
click: row => {
this.handleEdit(row)
}
}
},
{
type: 'el-button',
name: '付款审批',
attrs: {
type: 'text',
fn: '付款审批'
},
condition: row => {
return row.status == 0||row.status ==3
},
listeners: {
click: row => {
this.handleCheck(row)
}
}
},
{
type: 'el-button',
name: '到账明细',
attrs: {
type: 'text',
fn: '到账明细'
},
condition: row => {
return row.status == 5|| row.status == 6
},
listeners: {
click: row => {
this.handleParticulars(row)
}
}
},
{
type: 'el-button',
name: '导出',
attrs: {
type: 'text',
fn: '导出'
},
listeners: {
click: row => {
this.handleExport(row)
}
}
}
],
// 表格
getListApi: this.$apis.withdraw.getApprovalPage,
tableParams: {
listName: 'list',
tableOption: {
width: 170
},
tableColumns: [
{
label: '批次号',
prop: 'batchNo',
width: 120
},
{
label: '客户数量',
prop: 'customerCount',
width: 110
},
{
label: '积分总额',
prop: 'pointTotal',
width: 110
},
{
label: '付款总额/元',
prop: 'paymentTotal',
width: 120
},
{
label: '付款渠道',
prop: 'paymentChannel',
width: '200px'
},
{
label: '付款主体',
prop: 'paymentSubject',
width: '200px'
},
{
label: '状态',
prop: 'status',
width: '200px',
addHtml: 'colorStatus'
},
{
label: '批次生成时间',
prop: 'createdDate',
width: 180
},
{
label: '审批人',
prop: 'approver',
width: 150
},
{
label: '审批时间',
prop: 'approvalTime',
width: 180
},
{
label: 'OA审批编号',
prop: 'oaSpNo',
width: '200px'
},
{
label: 'OA审批时间',
prop: 'oaApprovalTime',
width: 180
},
{
label: '渠道到账时间',
prop: 'channelSettleTime',
width: 180
},
{
label: '用户到账时间',
prop: 'userSettleTime',
width: 180
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {
//付款主体
PayerelList,
merchantList: [],
statusList,
channelList,
}
}
},
mounted() {
this.$utils.getOptionsList(this, 'showFormData')
},
methods: {
dialogClose() {
this.detailVisible = false
},
handleCheck(row) {
this.recordInfo = row
this.payVisible = true
},
cancelPay() {
this.payVisible = false
this.handleSearch()
},
//查看
handleDetail(row) {
this.id = row.id
this.detailVisible = true
},
//导出
handleExport(row) {
const params ={approvalId: row.id}
this.$apis.withdraw.orderExport(params).then(res => {
this.$utils.aToExport(res)
})
},
//到账明细
handleParticulars(row) {
this.$router.push({
path: '/withdraw/approveDetail',
query: {
id: row.id
}
})
},
//编辑
handleEdit(row) {
this.$router.push({
path: '/withdraw/approveEdit',
query: {
id: row.id
}
})
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.approvalTime && this.searchForm.approvalTime.length) {
params.approvalTimeStart = dayjs(this.searchForm.approvalTime[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.approvalTimeEnd = dayjs(this.searchForm.approvalTime[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (this.searchForm.userSettleTime && this.searchForm.userSettleTime.length) {
params.userSettleTimeStart = dayjs(this.searchForm.userSettleTime[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.userSettleTimeEnd = dayjs(this.searchForm.userSettleTime[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
console.log(this.searchForm.oaApprovalTime)
if (this.searchForm.oaApprovalTime && this.searchForm.oaApprovalTime.length) {
params.oaApprovalTimeStart = dayjs(this.searchForm.oaApprovalTime[0]).format('YYYY-MM-DD') + ' 00:00:01'
params.oaApprovalTimeEnd = dayjs(this.searchForm.oaApprovalTime[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
delete params.userSettleTime, delete params.approvalTime, delete params.oaApprovalTime
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
handleSearch() {
this.$refs.withdrawRef.refreshTable()
},
handleReset() {
this.searchForm = {
batchNo: '',
oaSpNo:'',
paymentSubject: '',
paymentChannel: '',
approvalTime: [],
oaApprovalTime: [],
userSettleTime: []
}
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
<!-- 到账明细 -->
<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 url from '@/assets/empty.png'
import { modeTypeList } from '@/utils/constants.js'
const tableStatus = ['待审核', '已审核', '第三方处理', '成功', '失败', '驳回', '受理失败']
const colors = ['#FDB757', '#2CCA74', '#5850FF', '#2CCA74', '#999999', '#EB4E4E', '#2CCA74']
export default {
data() {
return {
id: this.$route.query.id,
size: 'small',
url: url,
tableStatus,
colors,
searchForm: {
customerName: '',
customerPhone: ''
},
tableSearchForm: {},
showFormData: [
{
label: '客户名称',
name: 'customerName',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '手机号',
name: 'customerPhone',
type: 'input',
isClear: true,
maxlength: 11
}
],
// 表格
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: 110,
formatter: cellValue => {
return cellValue.payAmount ? (cellValue.payAmount / 100).toFixed(2) : '--'
}
},
{
label: '提现时间',
prop: 'createdDate',
width: 180
},
{
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: 'status',
width: '200px',
addHtml: 'colorStatus'
},
{
label: '到账时间',
prop: 'receiptDate',
width: 180
},
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {
modeTypeList
}
}
},
mounted() {},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.approvalId=this.id
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
handleSearch() {
this.$refs.withdrawRef.refreshTable()
},
handleReset() {
this.searchForm = {
customerName: '',
customerPhone: ''
}
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;
}
.table-header {
align-items: center;
h2 {
color: #333333;
font-size: 16px;
}
}
.table_point {
width: 6px;
height: 6px;
border-radius: 50%;
margin-right: 8px;
}
}
</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">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header flex-sb">
<h2>积分提现明细</h2>
<el-button size="small" @click="handleDissolve(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="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import { modeTypeList } from '@/utils/constants.js'
export default {
data() {
return {
id: this.$route.query.id,
size: 'small',
url: url,
searchForm: {
customerName: '',
customerPhone: ''
},
tableSearchForm: {},
tableButtonList: [
{
type: 'el-button',
name: '移除',
attrs: {
type: 'text',
fn: '移除'
},
listeners: {
click: row => {
this.handleDissolve(false, row)
}
}
}
],
showFormData: [
{
label: '客户名称',
name: 'customerName',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '手机号',
name: 'customerPhone',
type: 'input',
isClear: true,
maxlength: 11
}
],
// 表格
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: 110,
formatter: cellValue => {
return cellValue.payAmount ? (cellValue.payAmount / 100).toFixed(2) : '--'
}
},
{
label: '提现时间',
prop: 'createdDate',
width: 180
},
{
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'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {
modeTypeList
}
}
},
mounted() {},
methods: {
handleDissolve(isAll, row) {
let title = isAll ? '解散批次提示' : '移除提示',
cxt = isAll ? '解散本批次,所有未驳回的积分提现记录将恢复「待审核」状态,如需重新生成批次,请选中后重新生成批次。' : '移除该记录,该条积分提现记录将恢复「待审核」状态,如需重新生成批次,请选中后重新生成批次。',
params = {
type: isAll ? 2 : 1
},
Method = 'removeApproval'
!isAll ? (params.id = row.id) : (params.id = this.id) //单个移除时传明细id,解散批次时传审批批次id
this.$utils.secondConfirm(this, title, cxt, 'withdraw', Method, params)
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.approvalId = this.id
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
handleSearch() {
this.$refs.withdrawRef.refreshTable()
},
handleReset() {
this.searchForm = {
customerName: '',
customerPhone: ''
}
this.handleSearch()
},
setTableFinishFun(data){
if(!data.length){
this.$router.back()
}
}
},
}
</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;
}
.table-header {
align-items: center;
h2 {
color: #333333;
font-size: 16px;
}
}
}
</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="120px" :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-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] === 0 ? recordInfo[subItem.name] + (subItem.suffix || '') : '-' }}</span>
</el-form-item>
</el-row>
</el-form>
</div>
<div>
<p class="edit-title">付款信息</p>
<el-form label-width="120px" :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="operationList && operationList.length">
<p class="edit-title">操作记录</p>
<div class="block">
<el-timeline>
<template v-for="(item, index) in operationList">
<el-timeline-item :key="index">
<div class="timeline-item">
<div class="operation-result">
{{ item.operationTypetext }}
<span :class="item.active">{{ item.operationResult }}</span>
</div>
<div class="operation-Note">{{ item.operationNote }}</div>
</div>
</el-timeline-item>
</template>
</el-timeline>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import { colors, tableStatus, operate_status } from '@/utils/constants.js'
export default {
name: 'DetailDialog',
data() {
return {
recordInfo: {},
operationList: [],
withdrawDataRow: [],
paymentDataRow: [],
withdrawData: [],
paymentData: [],
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.approvalDetail({ id: this.id }).then(res => {
this.recordInfo = res
this.getApprovalLog()
this.getConfig()
})
},
getApprovalLog() {
let arr
this.$apis.withdraw.getApprovalLog({ id: this.id }).then(res => {
arr = res.map(item => {
let active, operationTypetext
//单独处理付款审核时,屏蔽付款审核结果
if (item.operationType == 1) {
item.operationResult = ''
}
if (item.operationResult == '审批中') {
active = 'wait'
} else if (item.operationResult == '通过') {
active = 'success'
} else if (item.operationResult == '审批驳回' || item.operationResult == '不通过') {
active = 'fail'
} else {
active = 'close'
}
operationTypetext = operate_status[item.operationType]
return {
...item,
active,
operationTypetext
}
})
this.operationList = arr
})
},
getConfig() {
this.withdrawData = [
{
label: '批次号',
name: 'batchNo'
},
{
label: '客户数量',
name: 'customerCount'
},
{
label: '积分总额',
name: 'pointTotal'
},
{
label: '付款总额/元',
name: 'paymentTotal'
},
{
label: '状态',
name: 'status',
addStyle: obj => {
return {
status: tableStatus[obj.status],
color: colors[obj.status]
}
}
}
]
this.paymentData = [
{
label: '付款渠道',
name: 'paymentChannel'
},
{
label: '付款主体',
name: 'paymentSubject'
},
{
label: '渠道到账时间',
name: 'channelSettleTime'
}
]
this.formToRow('withdrawData')
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;
}
}
}
.edit-box {
.el-form--inline {
margin-bottom: 10px;
}
}
.detail-txt {
display: inline-block;
width: 190px;
}
.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;
}
.block {
margin-top: 20px;
max-height: 250px;
overflow-y: auto;
}
.timeline-item {
.operation-result {
color: #1d2129ff;
font-size: 14px;
line-height: 20px;
span {
margin-left: 12px;
}
.success {
color: #2cca74ff;
}
.wait {
color: #f59619ff;
}
.close {
color: #999999ff;
}
.fail {
color: #eb4e4eff;
}
}
.operation-Note {
color: #999999ff;
font-size: 12px;
margin-top: 4px;
}
}
</style>
\ No newline at end of file
......@@ -10,7 +10,7 @@
<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>
<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>
......@@ -27,7 +27,7 @@
<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>
<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-row v-if="this.recordInfo.status == 4">
......@@ -38,7 +38,7 @@
</el-row>
</el-form>
</div>
<div v-if="recordInfo.operationList">
<div v-if="recordInfo.operationList&&recordInfo.operationList.length">
<p class="edit-title">操作记录</p>
<template v-for="(record, recordIdx) in recordInfo.operationList">
<el-form label-width="154px" :inline="true" :key="recordIdx">
......@@ -48,7 +48,7 @@
<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>
<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>
......@@ -60,14 +60,8 @@
<script>
const tableStatus = ['待审核', '已审核', '第三方处理', '成功', '失败', '驳回']
const colors = ['#FDB757', '#2CCA74', '#5850FF', '#2CCA74', '#999999', '#EB4E4E']
const channelObj = {
'TXIAT': '熠轩-银行卡',
'ZX': '中雄-银行卡',
'YUNHUO': '云获(嘀加)-银行卡',
"YUNHUO-ZY": '云获(中赢)-银行卡',
'YUNHUO-WX': '云获(中赢)-微信',
'SHENBIANYUN':'身边云-银行卡'
}
import { channelObj,sourceList } from '@/utils/constants.js'
export default {
name: 'DetailDialog',
data() {
......@@ -80,24 +74,7 @@ export default {
paymentData: [],
operationData: [],
isVisible: this.detailVisible,
sourceList: [
{
confId: '0',
confLabel: '车生活助手'
},
{
confId: '1',
confLabel: '系统导入'
},
{
confId: '2',
confLabel: '生意助手员工版'
},
{
confId: '3',
confLabel: '门店助手'
}
]
sourceList:sourceList
}
},
props: {
......@@ -230,6 +207,10 @@ export default {
}
},
{
label: '付款主体',
name: 'paymentSubject'
},
{
label: '结算金额',
name: 'settleAmount',
addHtml: obj => {
......
<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>
<!--
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-08-25 17:33:09
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-09-09 18:11:46
* @FilePath: \scrm-micro-points\src\views\withdraw\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<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',
tabPaneList: [
{ name: '1', label: '提现列表' },
{ name: '2', label: '积分提现审批' }
]
}
},
watch: {
'searchForm.customerPhone'(newVal) {
if (isNaN(Number(newVal))) {
this.searchForm.customerPhone = newVal.replace(/[^\d]/g, '')
}
created() {
this.tabId = this.$route.query.type ? this.$route.query.type + '' : '1'
},
computed: {
tabName() {
let sname
switch (this.tabId) {
case '1':
sname = 'withdrawList'
break
case '2':
sname = 'approveList'
break
}
return sname
}
// '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
})
}
changeTab(e,i) {
// const arr = {
// 1: 'withdrawList',
// 2: 'approveList'
// }
// this.tabName = arr[+this.tabId]
this.$router.push({
path: '/withdraw/index',
query: { type: e.name }
})
},
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 {
.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>
<!-- 提现列表 -->
<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" style="margin-right: 10px" @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="selectOneBtn">
<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>
元, 智鸟-银行卡
<span class="price">{{ settleAmount.birdWorkSettleAmount }}</span>
元, 身边云(江西)-银行卡
<span class="price">{{ settleAmount.shenBianYunJXSettleAmount }}</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: scope.scope.idCardFront }" @click="openIdCardDialog(scope.scope)">{{ scope.scope.idCardNo }}</span>
</div>
<div slot="agreement" slot-scope="scope">
<span :class="{ 'agreement': scope.scope.disclaimerAgreementUrl }" @click="openAgreement(scope.scope.disclaimerAgreementUrl)">{{scope.scope.disclaimerAgreementUrl?'协议':'--'}}</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-item" v-for="(item, index) in idCardList" :key="index">
<div class="idCard-title">{{ item.label }}</div>
<div class="idCard-img">
<img :src="idCardForm[item.name]" alt class="idCard-img" />
</div>
</div>
</div>
</GLDialog>
<GLDialog class="gl-form-page gl-form-min" title="协议" mode="big" :visible.sync="isAgreement" :close-on-click-modal="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'
import { modeTypeList,auditStatusStatusList,sourceList,withdrawalTypeList } from '@/utils/constants.js'
const tableStatus = ['待审核', '已审核', '第三方处理', '成功', '失败', '驳回', '受理失败','批次处理中']
const colors = ['#FDB757', '#2CCA74', '#5850FF', '#2CCA74', '#999999', '#EB4E4E', '#2CCA74','#F59619FF']
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: '',
idCardForm: {},
idCardList: [
{
label: '身份证正面:',
name: 'idCardFront'
},
{
label: '身份证反面:',
name: 'idCardBack'
}
],
searchForm: {
name:'',
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: 'name',
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&&row.transferType!=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)&&row.transferType!=0
},
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: 'paymentSubject',
width: '200px'
// formatter: cellValue => {
// // 类型为「积分提现」该提现记录所归属的提现批次审批时选择的付款主体(嘀加/数科),非「积分提现」类型,或「积分提现」待审批,则展示=“-”
// cellValue.transferType ==0&&cellValue.status!=0?cellValue.paymentSubject:'--'
// }
},
{
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',
width: '120px'
}
]
},
providers: {},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {
adminList: [],
merchantList: [],
auditStatusStatusList:auditStatusStatusList,
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:withdrawalTypeList,
modeTypeList:modeTypeList,
sourceList:sourceList,
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(row) {
if (row.idCardFront) {
this.idCardForm = row
console.log( this.idCardForm)
this.isIdCard = true
}
},
//协议
openAgreement(url) {
this.pdfUrl=url
this.isAgreement = true
console.log(this.pdfUrl)
},
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: 120px;
margin-right: 10px;
/deep/.el-input__inner {
text-align: center;
padding: 0 20px 0 10px;
}
}
.selectOneBtn{
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;
cursor: pointer;
}
.idCard-wrap {
.idCard-item {
display: flex;
align-items: flex-start;
margin-bottom: 30px;
.idCard-title {
width: 154px;
text-align: right;
}
.idCard-img {
width: 286px;
height: 180px;
border-radius: 4px;
}
}
}
</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>
<template slot="textHtml" slot-scope="scope">
{{ recordInfo[scope.scope.name] }}
</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 {
loading: false,
isVisible: false,
count: '',
timer: null,
isCodeDisabled: false,
payForm: {
paymentChannelId: '',
paymentSubjectId: '',
explain: '',
approverId: '',
phone: '',
captcha: '',
remark: ''
},
payFormData: [
{
label: '此次付款渠道',
name: 'paymentChannelId',
type: 'select',
optionsName: 'payChannelList',
optionId: 'id',
optionLabel: 'name',
changeAttr: val => {
this.payForm.channel = this.baseData.payChannelList.find(item => item.id === val).channel
this.recordInfo.taxRate = this.baseData.payChannelList.find(item => item.id === val).tax + '%'
this.payForm.paymentSubjectId=''
this.getAdmin()
this.getPaymentEntityList()
this.calculateAmount()
this.isCodeDisabled = false
clearInterval(this.timer)
this.timer = null
this.payForm.captcha = ''
}
},
{
label: '此次付款主体',
name: 'paymentSubjectId',
type: 'select',
optionsName: 'paymentEntityList',
optionId: 'id',
optionLabel: 'name',
changeAttr: val => {}
},
{
label: '批次号',
name: 'batchNo',
addHtml: 'textHtml'
},
{
label: '积分总额',
name: 'pointTotal',
addHtml: 'textHtml'
},
{
label: '付款总额/元',
name: 'paymentTotal',
addHtml: 'textHtml'
},
{
label: '税点',
name: 'taxRate',
addHtml: 'textHtml'
},
{
label: '管理员',
name: 'approverId',
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: 'explain',
type: 'input',
inputType: 'textarea',
placeholder: '说明本次付款是否已升票、历次付款有无欠票及相应欠票金额,及其他需要补充说明的情况。如无则输入“无”。',
maxlength: 200
},
{
label: '备注',
name: 'remark',
type: 'input',
inputType: 'textarea',
maxlength: 50
}
],
payRule: {
approverId: [{ required: true, message: '请选择管理员', trigger: 'change' }],
paymentChannelId: [{ required: true, message: '请选择付款渠道', trigger: 'change' }],
paymentSubjectId: [{ required: true, message: '请选择付款主体', trigger: 'change' }],
captcha: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
explain: [{ required: true, message: '请输入发票及其他说明', trigger: 'blur' }]
},
// 基本数据
baseData: {
payChannelList: [],
//付款主体
paymentEntityList: []
}
}
},
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: {
calculateAmount() {
let { taxRate, pointTotal } = this.recordInfo,
rate = taxRate.split('%')[0]
console.log(rate)
//本批次号积分提现总金额+渠道税点(积分总额×税点),保留小数点后 2位
this.recordInfo.paymentTotal = (pointTotal + pointTotal * (rate / 100)).toFixed(2)
},
//积分提现获取业务对应的付款渠道
getChannel(transferType) {
let arr = []
this.$apis.withdraw.getChannelAccount().then(res => {
if (res) {
console.log(res)
// arr = res.map(item => {
// let channelInfo = item.name
// return {
// channelInfo,
// ...item
// }
// })
this.baseData.payChannelList = [
...res
]
this.$utils.getOptionsList(this, 'payFormData', false, 'paymentChannelId')
//默认选择
if (this.baseData.payChannelList.length > 0) {
this.payForm.paymentChannelId = this.baseData.payChannelList[0].id
this.payForm.channel = this.baseData.payChannelList[0].channel
this.recordInfo.taxRate = this.baseData.payChannelList[0].tax + '%'
this.calculateAmount()
}
this.getPaymentEntityList()
this.getAdmin()
}
})
},
//支付主体
getPaymentEntityList() {
let params = { channelAccountId: this.payForm.paymentChannelId }
this.$apis.withdraw.getPaymentEntityList(params).then(res => {
if (res) {
console.log(res)
this.baseData.paymentEntityList = res
this.$utils.getOptionsList(this, 'payFormData', false, 'paymentSubjectId')
// 默认选择
if (this.baseData.paymentEntityList.length > 0) {
this.payForm.paymentSubjectId = this.baseData.paymentEntityList[0].id
}
}
})
},
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, 'approverId')
this.payForm.approverId = this.baseData.adminList[0].adminId
this.payForm.phone = this.baseData.adminList[0].phone
}
})
},
//付款
comfirmPay() {
this.$refs.payFormRef.$refs.payChildRef.validate(valid => {
if (valid) {
this.loading = true
let params = {
phone: this.payForm.phone,
id: this.recordInfo.id,
paymentChannelId: this.payForm.paymentChannelId,
paymentSubjectId: this.payForm.paymentSubjectId,
captcha: this.payForm.captcha,
explain: this.payForm.explain,
remark: this.payForm.remark
}
params.approver = this.baseData.adminList.find(item => item.adminId == this.payForm.approverId).name
this.$apis.withdraw
.applyApprovalOA(params)
.then(res => {
if (res.code == '0') {
this.cancelPay()
}
this.$message({
message: res.code == '0' ? '付款审批成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
.finally(() => {
this.loading = false
})
}
})
},
cancelPay() {
this.ids = ''
this.payForm = {
paymentChannelId: '',
paymentSubjectId: '',
explain: '',
approverId: '',
phone: '',
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!