源文件

This commit is contained in:
gyq
2024-05-23 14:39:33 +08:00
commit a1128dd791
2997 changed files with 500069 additions and 0 deletions

View File

@@ -0,0 +1,98 @@
<template>
<a-modal v-model:visible="visible" :footer="null">
<div class="modal-title">入账订单详细</div>
<div class="statistics-list" style="padding-bottom: 20px;">
<div v-for="(item, index) in props.countDetailList[0] as any" :key="index" class="item item-box-title">
<div v-if="item.type == 'line'" class="line" />
<div class="title">{{ item.title }}</div>
<div v-if="item.title" class="amount">
<a-tooltip v-if="item.title == '实付金额'">
<template #title>{{ item.content }}</template>
<span class="amount-num">{{ item.content }}</span><span></span>
</a-tooltip>
<a-tooltip v-else>
<template #title> - {{ item.content }}</template>
<span class="amount-num">-{{ item.content }}</span><span></span>
</a-tooltip>
</div>
<div v-if="item.count >= 0" class="detail">
<span>{{ item.count }}</span>
</div>
<span class="item-box-title-border"></span>
</div>
</div>
<div class="statistics-list" style="padding-bottom: 55px;">
<div v-for="(item, index) in props.countDetailList[1] as any" :key="index" class="item item-box-title">
<div v-if="item.type == 'line'" class="line" />
<div class="title">{{ item.title }}</div>
<div v-if="item.title" class="amount">
<a-tooltip v-if="item.title == '补贴金额'">
<template #title> {{ item.content }}</template>
<span class="amount-num">{{ item.content }}</span><span></span>
</a-tooltip>
<a-tooltip v-else>
<template #title>- {{ item.content }}</template>
<span class="amount-num">-{{ item.content }}</span><span></span>
</a-tooltip>
</div>
<div v-if="item.count >= 0" class="detail">
<span>{{ item.count }}</span>
</div>
<span class="item-box-title-border"></span>
</div>
</div>
<div class="close" @click=" visible = false">
<a-button type="primary">知道了</a-button>
</div>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, reactive } from 'vue'
const visible = ref<boolean>(false)
const props = defineProps({
countDetailList: {type: Array, default: () => []},
sucDetailList: {type: Array, default: () => []}
})
const showModal = () => visible.value = true
defineExpose({showModal})
</script>
<style scoped lang="less">
.modal-title, .modal-describe{
text-align: center;
margin-bottom: 15px;
}
.modal-title {
margin-bottom: 20px;
text-align: center;
font-size: 18px;
font-weight: 600;
}
.close {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
border-top: 1px solid #EFEFEF;
display: flex;
align-items: center;
justify-content: center;
padding: 10px 0;
}
.amount {
//max-width:150px;
//overflow:hidden;
//text-overflow:ellipsis;
//white-space:nowrap;
}
.item-box-title{
//width: 30%;
}
.item-box-title-border{
//border-right: 1px solid #EFEFEF !important;
height: 100px;
}
</style>

View File

@@ -0,0 +1,447 @@
<template>
<a-drawer
v-model:visible="vdata.visible"
width="50%"
placement="right"
:closable="true"
:title="vdata.visible === true? '订单详情':''"
@close="onClose"
>
<a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">订单信息</a-divider>
<a-row justify="space-between" type="flex">
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="平台订单号">
{{ vdata.detailData.payOrderId }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="通道订单号">
{{ vdata.detailData.channelOrderNo??"--" }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="渠道订单号">
{{ vdata.detailData.platformOrderNo??"--" }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="商户订单号">
{{ vdata.detailData.mchOrderNo??"--" }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="落单订单号">
{{ vdata.detailData.platformMchOrderNo??"--" }}
</a-descriptions-item>
</a-descriptions>
</a-col>
</a-row>
<a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">基础信息</a-divider>
<a-row justify="space-between" type="flex">
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="商户简称">
{{ vdata.detailData.mchName }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="商户号">
{{ vdata.detailData.mchExtNo }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="门店名称">
{{ vdata.detailData.storeName }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="门店编号">
{{ vdata.detailData.storeId }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="应用名称">
{{ vdata.detailData.appName }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="应用ID">
{{ vdata.detailData.appId }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="用户名称">
{{vdata.detailData.mchUserName}}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="用户ID">
{{ vdata.detailData.mchNo }} [ {{vdata.detailData.mchUserPhone}} ]
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="服务商名称">
{{ vdata.detailData.agentName }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="服务商号">
{{ vdata.detailData.agentNo }} [ {{vdata.detailData.agentContactTel}} ]
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="支付金额(元)">
<a-tag color="green">
{{ vdata.detailData.amount/100 }}
</a-tag>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="订单状态">
<span v-if="vdata.detailData.state !== 5 ">
<a-tag
:key="vdata.detailData.state"
:color="vdata.detailData.state === 0?'blue':vdata.detailData.state === 1?'orange':vdata.detailData.state === 2?'green':vdata.detailData.state === 6?'':'volcano'"
>
{{ vdata.detailData.state === 0?'订单生成':vdata.detailData.state === 1?'支付中':vdata.detailData.state === 2?'支付成功':vdata.detailData.state === 3?'支付失败':vdata.detailData.state === 4?'已撤销':vdata.detailData.state === 6?'订单关闭':'未知' }}
</a-tag>
</span>
<span v-else-if="vdata.detailData.state === 5 ">
<a-tag
:key="vdata.detailData.refundState"
:color="vdata.detailData.refundState === 0?'red':vdata.detailData.refundState === 1?'orange':vdata.detailData.refundState === 2?'red':'red'"
>
{{ vdata.detailData.refundState === 0?'':vdata.detailData.refundState === 1?'部分退款':vdata.detailData.refundState === 2?'全额退款':'未知' }}
</a-tag>
</span>
</a-descriptions-item>
</a-descriptions>
</a-col>
<!-- <a-col :sm="12">-->
<!-- <a-descriptions><a-descriptions-item label="实际手续费"><a-tag color="pink">{{ vdata.detailData.mchFeeAmount/100 }}</a-tag></a-descriptions-item></a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions><a-descriptions-item label="收单手续费"><a-tag color="pink">{{ vdata.detailData.mchOrderFeeAmount/100 }}</a-tag></a-descriptions-item></a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions><a-descriptions-item label="商家费率">{{ vdata.detailData.mchFeeRate }}</a-descriptions-item></a-descriptions>-->
<!-- </a-col>-->
<a-col :sm="12">
<a-descriptions><a-descriptions-item label="收单费率">{{ vdata.detailData.mchFeeRateNum }}%</a-descriptions-item></a-descriptions>
</a-col>
<a-col :sm="12">
<!-- <a-descriptions><a-descriptions-item label="收单手续费(元)">{{ (vdata.detailData.findAmt / 100).toFixed(2) }} * {{ vdata.detailData.mchFeeRateNum }} = {{ (vdata.detailData.mchOrderFeeAmount / 100).toFixed(2) }}</a-descriptions-item></a-descriptions>-->
收单手续费
<a-popover placement="top">
<template #content>
<p>收单手续费 = 实付金额 - * 收单费率</p>
</template>
<question-circle-outlined/>
</a-popover>
{{ (vdata.detailData.findAmt / 100).toFixed(2) }} * {{ vdata.detailData.mchFeeRateNum }} = {{ (vdata.detailData.mchOrderFeeAmount / 100).toFixed(2) }}
</a-col>
<a-col :sm="12">
<a-descriptions><a-descriptions-item label="垫资费率">{{ vdata.detailData.cashRate }}%</a-descriptions-item></a-descriptions>
</a-col>
<a-col :sm="12">
垫资手续费
<a-popover placement="top">
<template #content>
<p>垫资手续费 = 实付金额 - * 垫资费率</p>
</template>
<question-circle-outlined/>
</a-popover>
{{ (vdata.detailData.findAmt / 100).toFixed(2) }} * {{ vdata.detailData.cashRate }} = {{ (vdata.detailData.cashFee / 100).toFixed(2) }}
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="退款次数">
{{ vdata.detailData.refundTimes }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="退款总额">
<a-tag v-if="vdata.detailData.refundAmount" color="cyan">
{{ (vdata.detailData.refundAmount / 100).toFixed(2)}}
</a-tag>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions><a-descriptions-item label="优惠金额">{{ (vdata.detailData.discountAmt / 100).toFixed(2) }}</a-descriptions-item></a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions><a-descriptions-item label="补贴金额">{{ (vdata.detailData.marketAmt / 100).toFixed(2) }}</a-descriptions-item></a-descriptions>
</a-col>
<a-col :sm="12" style="margin-bottom: 12px">
预计入账金额
<!-- <a-tooltip title="入账金额 = 实付金额 - 收单手续费 - 垫资手续费 - 退款总额" >-->
<!-- <question-circle-outlined style="padding-right: 10px"/>-->
<!-- </a-tooltip>-->
<a-popover placement="top">
<template #content>
<p>入账金额 = 实付金额 - 收单手续费 - 垫资手续费 - 退款总额</p>
</template>
<question-circle-outlined/>
</a-popover>
{{vdata.detailData.findAmt / 100}} - {{vdata.detailData.mchOrderFeeAmount / 100}} - {{vdata.detailData.cashFee / 100}} - {{vdata.detailData.refundAmount / 100}} = {{ ((vdata.detailData.findAmt - vdata.detailData.mchOrderFeeAmount - vdata.detailData.cashFee - vdata.detailData.refundAmount + vdata.detailData.marketAmt) / 100).toFixed(2) }}
</a-col>
<a-col :sm="12"></a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="支付错误码">
{{ vdata.detailData.errCode }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="支付错误描述">
{{ vdata.detailData.errMsg }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="买家备注">
{{ vdata.detailData.buyerRemark }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="卖家备注">
{{ vdata.detailData.sellerRemark }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="订单失效时间">
{{ vdata.detailData.expiredTime }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="创建时间">
{{ vdata.detailData.createdAt }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="更新时间">
{{ vdata.detailData.updatedAt }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="支付成功时间">
{{ vdata.detailData.successTime??"--" }}
</a-descriptions-item>
</a-descriptions>
</a-col>
</a-row>
<a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">其他信息</a-divider>
<a-row justify="space-between" type="flex">
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="商品标题">
{{ vdata.detailData.subject }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="商品描述">
{{ vdata.detailData.body }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="接口代码">
{{ vdata.detailData.ifCode }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="货币代码">
{{ vdata.detailData.currency }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="支付方式">
{{ vdata.detailData.wayCode }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="客户端IP">
{{ vdata.detailData.clientIp }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="用户标识">
{{ vdata.detailData.channelUser }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="异步通知地址">
{{ vdata.detailData.notifyUrl }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="页面跳转地址">
{{ vdata.detailData.returnUrl }}
</a-descriptions-item>
</a-descriptions>
</a-col>
</a-row>
<a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">分账信息</a-divider>
<a-row justify="start" type="flex">
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="订单分账模式">
<span v-if="vdata.detailData.divisionMode == 0">该笔订单不允许分账</span>
<span v-else-if="vdata.detailData.divisionMode == 1">支付成功按配置自动完成分账</span>
<span v-else-if="vdata.detailData.divisionMode == 2">商户手动分账(解冻商户金额)</span>
<span v-else>未知</span>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="分账状态">
<a-tag v-if="vdata.detailData.divisionState == 0" color="blue">未发生分账</a-tag>
<a-tag v-else-if="vdata.detailData.divisionState == 1" color="orange">待分账</a-tag>
<a-tag v-else-if="vdata.detailData.divisionState == 2" color="red">分账处理中</a-tag>
<a-tag v-else-if="vdata.detailData.divisionState == 3" color="green">任务已结束</a-tag>
<a-tag v-else color="#f50">未知</a-tag>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions><a-descriptions-item label="最新分账发起时间">{{ vdata.detailData.divisionLastTime }}</a-descriptions-item></a-descriptions>
</a-col>
</a-row>
<!-- <a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">扩展信息</a-divider>-->
<!-- <a-row justify="start" type="flex">-->
<!-- <a-col :sm="24">-->
<!-- <span style="color: black;">扩展参数:</span>-->
<!-- <a-form-item>-->
<!-- <a-input-->
<!-- v-model:value="vdata.detailData.extParam"-->
<!-- type="textarea"-->
<!-- disabled="disabled"-->
<!-- style="height: 100px;color: black;margin-top: 10px;"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- </a-row>-->
</a-drawer>
</template>
<script lang="ts" setup>
import { API_URL_MCH_APPLYMENT_LIST, req } from '@/api/manage'
import {defineProps,reactive, getCurrentInstance} from 'vue'
const { $hasAgentEnt, $SYS_NAME_MAP } = getCurrentInstance()!.appContext.config.globalProperties
const props = defineProps({
callbackFunc: { type: Function,default:null }
})
const vdata:any = reactive({
btnLoading: false,
detailData: {}, // 数据对象
recordId: null, // 更新对象ID
visible: false, // 是否显示弹层/抽屉
termNo: false, // 是否显示弹层/抽屉
})
function show (data) { // 弹层打开事件
vdata.detailData = data // 数据清空
vdata.visible = true
}
function onClose () {
vdata.visible = false
}
defineExpose({
show //抛出show函数给父组件
})
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
<template>
<a-modal v-model:visible="visible" :footer="null">
<div class="modal-title">成交订单详细</div>
<div class="modal-describe">创建订单金额/笔数 = 成交订单金额/笔数 + 未付款订单金额/笔数</div>
<div class="statistics-list" style="padding-bottom: 55px;">
<div v-for="(item, index) in props.sucDetailList as any" :key="index" class="item">
<div v-if="item.type == 'line'" class="line" />
<div class="title">{{ item.title }}</div>
<div v-if="item.title" class="amount">
<a-tooltip>
<template #title>{{ item.content }}</template>
<span class="amount-num">{{ item.content }}</span><span></span>
</a-tooltip>
</div>
<div v-if="item.count >= 0" class="detail">
<span>{{ item.count }}</span>
</div>
</div>
</div>
<div class="close" @click=" visible = false">
<a-button type="primary">知道了</a-button>
</div>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, reactive } from 'vue'
const visible = ref<boolean>(false)
const props = defineProps({
countDetailList: {type: Array, default: () => []},
sucDetailList: {type: Array, default: () => []}
})
const showModal = () => visible.value = true
defineExpose({showModal})
</script>
<style scoped lang="less">
.modal-title, .modal-describe{
text-align: center;
margin-bottom: 15px;
}
.modal-title {
margin-bottom: 20px;
text-align: center;
font-size: 18px;
font-weight: 600;
}
.close {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
border-top: 1px solid #EFEFEF;
display: flex;
align-items: center;
justify-content: center;
padding: 10px 0;
}
.amount {
max-width:150px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
</style>

View File

@@ -0,0 +1,170 @@
<template>
<div>
<a-modal
v-model:visible="vdata.visible"
title="退款"
:confirm-loading="vdata.confirmLoading"
:closable="false"
@ok="handleOk"
@cancel="handleCancel"
>
<a-row>
<a-col :sm="24">
<a-descriptions>
<a-descriptions-item label="支付订单号">
<a-tag color="purple">
{{ vdata.detailData.payOrderId }}
</a-tag>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="24">
<a-descriptions>
<a-descriptions-item label="支付金额">
<a-tag color="green">
{{ vdata.detailData.amount/100 }}
</a-tag>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="24">
<a-descriptions>
<a-descriptions-item label="可退金额">
<a-tag color="pink">
{{ nowRefundAmount }}
</a-tag>
</a-descriptions-item>
</a-descriptions>
</a-col>
</a-row>
<a-form ref="refundInfo" :rules="rules" :model="vdata.refund">
<a-form-item label="退款金额" name="refundAmount">
<a-input-number v-model:value="vdata.refund.refundAmount" :precision="2" style="width:100%" />
</a-form-item>
<a-form-item label="退款原因" name="refundReason">
<a-input v-model:value="vdata.refund.refundReason" type="textarea" autocomplete="off" />
</a-form-item>
<a-form-item label="支付密码" name="refundPassword">
<a-input v-model:value="vdata.refund.refundPassword" maxlength="6" type="password" autocomplete="off" />
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script setup lang="tsx">
import { API_URL_PAY_ORDER_LIST, req, $payOrderRefund } from '@/api/manage'
import {ref, onMounted, reactive, getCurrentInstance,computed} from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
// 获取全局函数
const { $infoBox,$access } = getCurrentInstance()!.appContext.config.globalProperties
const props = defineProps ({
callbackFunc: { type: Function, default: () => () => ({}) }
})
const refundInfo = ref()
const vdata : any = reactive({
refundErrorModal: null, // 退款错误信息的modal对象
recordId: '',
labelCol: { span: 4 },
wrapperCol: { span: 16 },
visible: false,
confirmLoading: false,
detailData: {} as any,
refund: {
refundReason: '', // 退款原因
refundAmount: '' // 退款金额
} as any,
})
const rules = {
refundReason: [{ min: 0, max: 256, required: true, trigger: 'blur', message: '请输入退款原因最长不超过256个字符' }],
refundPassword: [{required: true, trigger: 'blur', message: '请输入支付密码' }],
refundAmount: [{ required: true, message: '请输入金额', trigger: 'blur',type:'number' },
{
validator: (rule, value) => {
console.log(value)
if (value < 0.01 || value > nowRefundAmount.value) {
return Promise.reject('退款金额不能小于0.01并且不能大于可退金额')
}else{
return Promise.resolve()
}
}
}]
}
const nowRefundAmount = computed(()=>{
return (vdata.detailData.amount - vdata.detailData.refundAmount) / 100
})
defineExpose({show})
function show (recordId) {
if (refundInfo.value !== undefined) {
refundInfo.value.resetFields()
}
vdata.recordId = recordId
vdata.visible = true
vdata.refund = {}
req.getById(API_URL_PAY_ORDER_LIST, recordId).then(res => {
vdata.detailData = res
})
}
function handleOk () {
refundInfo.value.validate().then(valid =>{
vdata.confirmLoading = true
// 退款接口
$payOrderRefund(vdata.recordId, vdata.refund.refundAmount, vdata.refund.refundReason, vdata.refund.refundPassword).then(res => {
vdata.visible = false // 关闭弹窗
vdata.confirmLoading = false // 取消按钮转圈
if (res.state === 0 || res.state === 3) { // 订单生成 || 失败
vdata.refundErrorModal = $infoBox.modalError('退款失败', buildModalText(res))
} else if (res.state === 1) { // 退款中
vdata.refundErrorModal = $infoBox.modalWarning('退款中', buildModalText(res))
props.callbackFunc()
} else if (res.state === 2) { // 退款成功
$infoBox.message.success('退款成功')
props.callbackFunc()
} else {
vdata.refundErrorModal = $infoBox.modalWarning('退款状态未知', buildModalText(res))
}
}).catch(() => {
vdata.confirmLoading = false // 取消按钮转圈
})
})
}
function handleCancel (e) {
vdata.visible = false
}
// 跳转到退款列表函数
function toRefundList () {
vdata.refundErrorModal.destroy()
router.push({
path: '/refund',
})
}
function buildModalText (res) {
return <div>
{ res.errCode? <div>错误码{res.errCode} </div> : '' }
{ res.errMsg? <div>错误信息{res.errMsg} </div> : '' }
<div>请到<a onClick={ toRefundList }>退款列表</a>中查看详细信息</div>
</div>
}
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,368 @@
<template>
<a-drawer
v-model:visible="vdata.visible"
width="60%"
placement="right"
:closable="true"
:title="vdata.visible === true? '退款订单详情':''"
@close="onClose"
>
<a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">订单信息</a-divider>
<a-row justify="space-between" type="flex">
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="退款订单号">
{{ vdata.detailData.refundOrderId }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="通道订单号">
{{ vdata.detailData.channelPayOrderNo }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="平台订单号">
{{ vdata.detailData.payOrderId }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="商户退款订单号">
{{ vdata.detailData.mchRefundNo }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="渠道订单号">
--
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="落单订单号">
--
</a-descriptions-item>
</a-descriptions>
</a-col>
</a-row>
<a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">其他信息</a-divider>
<a-row justify="space-between" type="flex">
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="商户简称">
{{ vdata.detailData.mchName }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="商户号">
{{ vdata.detailData.mchExtNo }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="门店名称">
{{ vdata.detailData.storeName }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="门店编号">
{{ vdata.detailData.storeId }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="渠道名称">
{{ vdata.detailData.isvName }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="渠道号">
{{ vdata.detailData.isvNo }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="应用名称">
{{ vdata.detailData.appName }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="应用ID">
{{ vdata.detailData.appId }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="用户名称">
{{vdata.detailData.mchUserName}}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="用户ID">
{{ vdata.detailData.mchNo }} [ {{vdata.detailData.mchUserPhone}} ]
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="服务商名称">
{{ vdata.detailData.agentName }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="服务商号">
{{ vdata.detailData.agentNo }} [ {{vdata.detailData.agentContactTel}} ]
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="支付金额">
<a-tag color="green">
{{ vdata.detailData.payAmount/100 }}
</a-tag>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="退款金额">
<a-tag color="red">
{{ vdata.detailData.refundAmount/100 }}
</a-tag>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="手续费退还金额">
<a-tag color="green">
{{ vdata.detailData.refundFeeAmount/100 }}
</a-tag>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="退款状态">
<a-tag :color="vdata.detailData.state === 0?'blue':vdata.detailData.state === 1?'orange':vdata.detailData.state === 2?'green':'volcano'">
{{ vdata.detailData.state === 0?'订单生成':vdata.detailData.state === 1?'退款中':vdata.detailData.state === 2?'退款成功':vdata.detailData.state === 3?'退款失败':vdata.detailData.state === 4?'任务关闭':'未知' }}
</a-tag>
<a-tooltip :title="vdata.detailData.errMsg" v-if="vdata.detailData.state == 3">
<question-circle-outlined style="color: #FF0000;"/>
</a-tooltip>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="退款类型">
<a-tag
:key="vdata.detailData.refundType"
:color="vdata.detailData.refundType === 0?'blue':vdata.detailData.refundType === 1?'red':vdata.detailData.refundType === 2?'orange':'volcano'"
>
{{ vdata.detailData.refundType === 1?'全额退款':vdata.detailData.refundType === 2?'部分退款':'' }}
</a-tag>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="退款模式">
<a-tag
:key="vdata.detailData.extParam"
:color="vdata.detailData.extParam === '1'?'blue':vdata.detailData.extParam === '2'?'orange':'volcano'"
>
{{ vdata.detailData.extParam === '1'?'收款商户号':vdata.detailData.extParam === '2'?'退款专用账户':'' }}
</a-tag>
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="24">
<a-descriptions>
<a-descriptions-item label="退款成功时间">
{{ vdata.detailData.successTime }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="创建时间">
{{ vdata.detailData.createdAt }}
</a-descriptions-item>
</a-descriptions>
</a-col>
<a-col :sm="12">
<a-descriptions>
<a-descriptions-item label="更新时间">
{{ vdata.detailData.updatedAt }}
</a-descriptions-item>
</a-descriptions>
</a-col>
</a-row>
<!-- <a-divider />-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="接口代码">-->
<!-- {{ vdata.detailData.ifCode }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="货币代码">-->
<!-- {{ vdata.detailData.currency }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="方式代码">-->
<!-- {{ vdata.detailData.wayCode }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="客户端IP">-->
<!-- {{ vdata.detailData.clientIp }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="24">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="异步通知地址">-->
<!-- {{ vdata.detailData.notifyUrl }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- </a-row>-->
<!-- <a-divider />-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="渠道订单号">-->
<!-- {{ vdata.detailData.channelOrderNo }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="渠道错误码">-->
<!-- {{ vdata.detailData.errCode }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="渠道错误描述">-->
<!-- {{ vdata.detailData.errMsg }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="24">-->
<!-- <span style="color: black;">渠道额外参数:</span>-->
<!-- <a-form-item>-->
<!-- <a-input-->
<!-- v-model:value="vdata.detailData.channelExtra"-->
<!-- type="textarea"-->
<!-- disabled="disabled"-->
<!-- style="height: 100px;color: black;margin-top: 10px;"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-divider />-->
<!-- <a-col :sm="24">-->
<!-- <span style="color: black;">扩展参数:</span>-->
<!-- <a-form-item>-->
<!-- <a-input-->
<!-- v-model:value="vdata.detailData.extParam"-->
<!-- type="textarea"-->
<!-- disabled="disabled"-->
<!-- style="height: 100px;color: black;margin-top: 10px;"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :sm="24">
<span style="color: black;">备注:</span>
<a-form-item>
<a-input
v-model:value="vdata.detailData.remark"
type="textarea"
disabled="disabled"
style="height: 100px;color: black;margin-top: 10px;"
/>
</a-form-item>
</a-col>
</a-drawer>
</template>
<script lang="ts" setup>
import { req } from '@/api/manage'
import {defineProps,reactive, getCurrentInstance} from 'vue'
const { $hasAgentEnt, $SYS_NAME_MAP } = getCurrentInstance()!.appContext.config.globalProperties
const props = defineProps({
callbackFunc: { type: Function,default:null }
})
const vdata:any = reactive({
btnLoading: false,
detailData: {}, // 数据对象
recordId: null, // 更新对象ID
visible: false, // 是否显示弹层/抽屉
termNo: false, // 是否显示弹层/抽屉
})
function show (data) { // 弹层打开事件
vdata.detailData = data // 数据清空
vdata.visible = true
}
function onClose () {
vdata.visible = false
}
defineExpose({
show //抛出show函数给父组件
})
</script>

View File

@@ -0,0 +1,675 @@
<template>
<page-header-wrapper>
<a-card>
<JeepaySearchForm :searchFunc="searchFunc" :resetFunc="onReset">
<a-form-item label="" class="table-search-item">
<JeepayDateRangePicker ref="dateRangePicker" v-model:value="vdata.searchData['queryDateRange']" customDateRangeType="dateTime" />
</a-form-item>
<a-form-item class="table-search-item">
<a-select v-model:value="vdata.searchData['agentName']" placeholder="请选择服务商" @change="handleChange">
<a-select-option value="">全部</a-select-option>
<a-select-option value="onlyOne">仅自己</a-select-option>
<a-select-option v-for="d in vdata.agentList" :key="d.agentNo" v-model:value="d.agentNo">
{{ d.agentName + " [ ID: " + d.agentNo + " ]" }}
</a-select-option>
</a-select>
</a-form-item>
<JeepaySearchInfoInput v-model:value="vdata.searchData['mchUserName']" placeholder="用户号/名称" :textUpStyle="true" :mchNoAndName="true" showType="MCH" />
<!-- <jeepay-text-up v-model:value="vdata.searchData.unionOrderId" :placeholder="'退款/支付/渠道/商户退款号'" />-->
<!-- <jeepay-text-up :placeholder="'退款订单号'" :msg="searchData.refundOrderId" v-model="searchData.refundOrderId" />-->
<!-- <jeepay-text-up :placeholder="'商户退款单号'" :msg="searchData.mchRefundNo" v-model="searchData.mchRefundNo" />-->
<!-- <jeepay-text-up :placeholder="'支付订单号'" :msg="searchData.payOrderId" v-model="searchData.payOrderId" />-->
<!-- <jeepay-text-up :placeholder="'渠道订单号'" :msg="searchData.channelPayOrderNo" v-model="searchData.channelPayOrderNo" />-->
<jeepay-text-up v-model:value="vdata.searchData.unionOrderId" :placeholder="'订单号'" />
<jeepay-text-up v-model:value="vdata.searchData.mchInfo" :placeholder="'商户名称/商户号'" />
<jeepay-text-up v-model:value="vdata.searchData.storeInfo" :placeholder="'门店名称/门店编号'" />
<jeepay-text-up v-model:value="vdata.searchData.ifCode" :placeholder="'支付通道'" />
<jeepay-text-up v-model:value="vdata.searchData.isvNo" :placeholder="'渠道名称/渠道号'" />
<jeepay-text-up v-model:value="vdata.searchData.appId" :placeholder="'应用名称/应用ID'" />
<a-form-item label="" class="table-search-item">
<a-select v-model:value="vdata.searchData.state" placeholder="退款状态">
<a-select-option value="">全部</a-select-option>
<a-select-option value="0">订单生成</a-select-option>
<a-select-option value="1">退款中</a-select-option>
<a-select-option value="2">退款成功</a-select-option>
<a-select-option value="3">退款失败</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="" class="table-search-item">
<a-select v-model:value="vdata.searchData.refundType" placeholder="退款类型">
<a-select-option value="">全部</a-select-option>
<a-select-option value="1">全额退款</a-select-option>
<a-select-option value="2">部分退款</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="" class="table-search-item">
<a-select v-model:value="vdata.searchData.extParam" placeholder="退款模式">
<a-select-option value="">全部</a-select-option>
<a-select-option value="1">收款商户号</a-select-option>
<a-select-option value="2">退款专用账户</a-select-option>
</a-select>
</a-form-item>
</JeepaySearchForm>
<!-- 列表渲染 -->
<JeepayTable
ref="infoTable"
:initData="true"
:closable="true"
:searchData="vdata.searchData"
:reqTableDataFunc="reqTableDataFunc"
:tableColumns="tableColumns"
rowKey="refundOrderId"
:tableRowCrossColor="true"
:statisticsIsShow="$access('ENT_REFUND_ORDER_COUNT')"
:tableExportFunc="tableExportFunc"
@btnLoadClose="vdata.btnLoading=false"
>
<template #statistics>
<div class="statistics-list">
<div v-for="(item, index) in orderCountList" :key="index" class="item">
<div v-if="item.type == 'line'" class="line" />
<div class="title">{{ item.title }}</div>
<div v-if="item.title" class="amount" :style="{color: item.textColor}">
<!-- <span v-if="item.symbol" class="symbol">{{ item.symbol == 'add' ? '+' : '-' }}</span> -->
<span class="amount-num">{{ item.content }}</span>{{ item.unit?item.unit:'元' }}
</div>
<div v-if="item.title" class="amount" >
<!-- <span v-if="item.symbol" class="symbol">{{ item.symbol == 'add' ? '+' : '-' }}</span> -->
<span class="amount-num">{{ item.num }}</span>
</div>
</div>
</div>
</template>
<!-- <template #bodyCell="{column,record}">-->
<!-- <template v-if="column.key == 'payAmount'"><b>{{ record.payAmount/100 }}</b></template>-->
<!-- <template v-if="column.key == 'refundAmount'"><b>{{ record.refundAmount/100 }}</b></template>-->
<!-- <template v-if="column.key == 'refundFeeAmount'"><b>{{ record.refundFeeAmount/100 }}</b></template>-->
<!-- <template v-if="column.key == 'state'">-->
<!-- <div>-->
<!-- <a-tag-->
<!-- :key="record.state"-->
<!-- :color="record.state === 0?'blue':record.state === 1?'orange':record.state === 2?'green':'volcano'"-->
<!-- >-->
<!-- {{ record.state === 0?'订单生成':record.state === 1?'退款中':record.state === 2?'退款成功':record.state === 3?'退款失败':record.state === 4?'任务关闭':'未知' }}-->
<!-- </a-tag>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-if="column.key == 'refund'">-->
<!-- <div class="order-list">-->
<!-- <p><span style="color:#729ED5;background:#e7f5f7">支付</span>{{ record.payOrderId }}</p>-->
<!-- <p v-if="record.channelPayOrderNo" style="margin-bottom: 0;">-->
<!-- <span style="color:#fff;background:#E09C4D">渠道</span>-->
<!-- <a-tooltip v-if="record.channelPayOrderNo.length > record.payOrderId.length" placement="bottom" style="font-weight: normal;">-->
<!-- <template #title>-->
<!-- <span>{{ record.channelPayOrderNo }}</span>-->
<!-- </template>-->
<!-- {{ changeStr2ellipsis(record.channelPayOrderNo, record.payOrderId.length) }}-->
<!-- </a-tooltip>-->
<!-- <span v-else style="font-weight: normal;">{{ record.channelPayOrderNo }}</span>-->
<!-- </p>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-if="column.key == 'pay'">-->
<!-- <div class="order-list">-->
<!-- <p><span style="color:#729ED5;background:#e7f5f7">退款</span>{{ record.refundOrderId }}</p>-->
<!-- <p style="margin-bottom: 0;">-->
<!-- <span style="color:#56cf56;background:#d8eadf">商户</span>-->
<!-- <a-tooltip v-if="record.mchRefundNo.length > record.refundOrderId.length" placement="bottom" style="font-weight: normal;">-->
<!-- <template #title>-->
<!-- <span>{{ record.mchRefundNo }}</span>-->
<!-- </template>-->
<!-- {{ changeStr2ellipsis(record.mchRefundNo, record.refundOrderId.length) }}-->
<!-- </a-tooltip>-->
<!-- <span v-else style="font-weight: normal;">{{ record.mchRefundNo }}</span>-->
<!-- </p>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-if="column.key === 'ifCode'">-->
<!-- <span>{{ record.ifName }} ({{ record.ifCode }})</span>-->
<!-- </template>-->
<!-- <template v-if="column.key == 'op'">-->
<!-- &lt;!&ndash; 操作列插槽 &ndash;&gt;-->
<!-- <a-button v-if="$access('ENT_REFUND_ORDER_VIEW')" type="link" @click="detailFunc(record.refundOrderId)">详情</a-button>-->
<!-- </template>-->
<!-- </template>-->
<template #bodyCell="{column,record}">
<!-- <template v-if="column.key == 'payAmount'"><b>{{ record.payAmount/100 }}</b></template>-->
<template v-if="column.key == 'refundAmount'">
<a-tooltip>
<template #title>
<p>退款金额{{ record.payAmount/100 }}</p>
<p>手续费退还金额{{ record.refundFeeAmount/100 }}</p>
</template>
<b style="color: #1890ff">{{ record.refundAmount/100 }}</b>
</a-tooltip>
</template>
<template v-if="column.key === 'agentName'">
<a-tooltip class="my-tooltip" overlayClassName="tooltip-box-name">
<template #title>
<span>服务商名称{{record.agentName}}</span><br>
<span>服务商号{{record.agentNo}}</span>
</template>
<div class="my-tooltip-title-box"> {{record.agentName}}</div>
</a-tooltip>
</template>
<template v-if="column.key === 'mchUserName'">
<a-tooltip class="my-tooltip" overlayClassName="tooltip-box-name">
<template #title>
<span>用户名称{{record.mchUserName}}</span><br>
<span>用户手机号{{record.mchUserPhone}}</span>
</template>
<div class="my-tooltip-title-box"> {{record.mchUserName}}</div>
</a-tooltip>
</template>
<!-- <template v-if="column.key == 'refundFeeAmount'"><b>{{ record.refundFeeAmount/100 }}</b></template>-->
<template v-if="column.key == 'state'">
<div>
<a-tag
:key="record.state"
:color="record.state === 0?'blue':record.state === 1?'orange':record.state === 2?'green':'volcano'"
>
{{ record.state === 0?'订单生成':record.state === 1?'退款中':record.state === 2?'退款成功':record.state === 3?'退款失败':record.state === 4?'任务关闭':'未知' }}
</a-tag>
<a-tooltip :title="record.errMsg" v-if="record.state == 3">
<question-circle-outlined style="color: #FF0000;"/>
</a-tooltip>
<a-tooltip title="快钱通道部分退款类型的退款金额将于第二个工作日凌晨4-5点到账" v-if="record.ifCode == 'kqpay' && record.state==2 && record.refundType ==2">
<question-circle-outlined style="color: #FF0000;"/>
</a-tooltip>
</div>
</template>
<template v-if="column.key == 'refundType'">
<div>
<a-tag
:key="record.state"
:color="record.refundType === 0?'blue':record.refundType === 1?'red':record.refundType === 2?'orange':'volcano'"
>
{{ record.refundType === 1?'全额退款':record.refundType === 2?'部分退款':'' }}
</a-tag>
</div>
</template>
<template v-if="column.key == 'extParam'">
<div>
<a-tag
:key="record.extParam"
:color="record.extParam === '1'?'blue':record.extParam === '2'?'orange':''"
>
{{ record.extParam === "1"?'收款商户号':record.extParam === "2"?'退款专用账户':'' }}
</a-tag>
</div>
</template>
<template v-if="column.key === 'appId'">
<a-tooltip class="my-tooltip" overlayClassName="tooltip-box-name">
<template #title>
<span>应用名称{{record.appName}}</span><br>
<span>应用ID{{record.appId}}</span>
</template>
<div class="my-tooltip-title-box"> {{record.appName}}</div>
</a-tooltip>
</template>
<template v-if="column.key === 'mchName'">
<a-tooltip class="my-tooltip" overlayClassName="tooltip-box-name">
<template #title>
<span>商户名称{{record.mchName}}</span><br>
<span>商户号{{record.mchExtNo}}</span>
</template>
<div class="my-tooltip-title-box"> {{record.mchName}}</div>
</a-tooltip>
</template>
<template v-if="column.key === 'storeName'">
<a-tooltip class="my-tooltip" overlayClassName="tooltip-box-name">
<template #title>
<span>门店名称{{record.storeName}}</span><br>
<span>门店编号{{record.storeId}}</span>
</template>
<div class="my-tooltip-title-box"> {{record.storeName}}</div>
</a-tooltip>
</template>
<template v-if="column.key === 'isvName'">
<a-tooltip class="my-tooltip" overlayClassName="tooltip-box-name">
<template #title>
<span>渠道名称{{record.isvName}}</span><br>
<span>渠道号{{record.isvNo}}</span>
</template>
<div class="my-tooltip-title-box"> {{record.isvName}}</div>
</a-tooltip>
</template>
<template v-if="column.key == 'refund'">
<a-tooltip>
<template #title>
<p>渠道{{ record.channelPayOrderNo }}</p>
</template>
<b style="color: #1890ff">{{ record.payOrderId }}</b>
</a-tooltip>
</template>
<template v-if="column.key == 'pay'">
<a-popover placement="top">
<template #content>
<p>商户退款单号{{ record.mchRefundNo }}</p>
<p>渠道退款单号{{ record.channelPayOrderNo }}</p>
<p>平台订单号{{ record.payOrderId }}</p>
</template>
<b style="color: #1890ff"> {{ record.refundOrderId??"--" }} </b>
</a-popover>
</template>
<template v-if="column.key == 'op'">
<!-- 操作列插槽 -->
<a-button v-if="$access('ENT_REFUND_ORDER_VIEW')" type="link" @click="detailFunc(record)">详情</a-button>
<!-- <a-button v-if="$access('ENT_REFUND_ORDER_VIEW')" type="link" @click="detailFunc(record)">详情</a-button>-->
</template>
</template>
</JeepayTable>
</a-card>
<!-- 日志详情抽屉 -->
<!-- <template>-->
<!-- <a-drawer-->
<!-- v-model:visible="vdata.visible"-->
<!-- width="50%"-->
<!-- placement="right"-->
<!-- :closable="true"-->
<!-- :title="vdata.visible === true? '退款订单详情':''"-->
<!-- @close="onClose"-->
<!-- >-->
<!-- <a-row justify="space-between" type="flex">-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="所属系统">-->
<!-- {{ vdata.detailData.mchType === 1?'普通商户':vdata.detailData.mchType === 2?'特约商户':'未知' }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="渠道商号">-->
<!-- {{ vdata.detailData.isvNo }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="退款订单号">-->
<!-- <a-tag color="purple">-->
<!-- {{ vdata.detailData.refundOrderId }}-->
<!-- </a-tag>-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="用户号">-->
<!-- {{ vdata.detailData.mchNo }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="支付订单号">-->
<!-- {{ vdata.detailData.payOrderId }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="商户退款单号">-->
<!-- {{ vdata.detailData.mchRefundNo }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="渠道支付订单号">-->
<!-- {{ vdata.detailData.channelPayOrderNo }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="应用APPID">-->
<!-- {{ vdata.detailData.appId }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="支付金额">-->
<!-- <a-tag color="green">-->
<!-- {{ vdata.detailData.payAmount/100 }}-->
<!-- </a-tag>-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="退款金额">-->
<!-- <a-tag color="green">-->
<!-- {{ vdata.detailData.refundAmount/100 }}-->
<!-- </a-tag>-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="手续费退还金额">-->
<!-- <a-tag color="green">-->
<!-- {{ vdata.detailData.refundFeeAmount/100 }}-->
<!-- </a-tag>-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="订单状态">-->
<!-- <a-tag :color="vdata.detailData.state === 0?'blue':vdata.detailData.state === 1?'orange':vdata.detailData.state === 2?'green':'volcano'">-->
<!-- {{ vdata.detailData.state === 0?'订单生成':vdata.detailData.state === 1?'退款中':vdata.detailData.state === 2?'退款成功':vdata.detailData.state === 3?'退款失败':vdata.detailData.state === 4?'任务关闭':'未知' }}-->
<!-- </a-tag>-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="24">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="退款成功时间">-->
<!-- {{ vdata.detailData.successTime }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="创建时间">-->
<!-- {{ vdata.detailData.createdAt }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="更新时间">-->
<!-- {{ vdata.detailData.updatedAt }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-divider />-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="接口代码">-->
<!-- {{ vdata.detailData.ifCode }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="货币代码">-->
<!-- {{ vdata.detailData.currency }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="方式代码">-->
<!-- {{ vdata.detailData.wayCode }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="客户端IP">-->
<!-- {{ vdata.detailData.clientIp }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="24">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="异步通知地址">-->
<!-- {{ vdata.detailData.notifyUrl }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- </a-row>-->
<!-- <a-divider />-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="渠道订单号">-->
<!-- {{ vdata.detailData.channelOrderNo }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="渠道错误码">-->
<!-- {{ vdata.detailData.errCode }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="12">-->
<!-- <a-descriptions>-->
<!-- <a-descriptions-item label="渠道错误描述">-->
<!-- {{ vdata.detailData.errMsg }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<!-- </a-col>-->
<!-- <a-col :sm="24">-->
<!-- <span style="color: black;">渠道额外参数:</span>-->
<!-- <a-form-item>-->
<!-- <a-input-->
<!-- v-model:value="vdata.detailData.channelExtra"-->
<!-- type="textarea"-->
<!-- disabled="disabled"-->
<!-- style="height: 100px;color: black;margin-top: 10px;"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-divider />-->
<!-- <a-col :sm="24">-->
<!-- <span style="color: black;">扩展参数:</span>-->
<!-- <a-form-item>-->
<!-- <a-input-->
<!-- v-model:value="vdata.detailData.extParam"-->
<!-- type="textarea"-->
<!-- disabled="disabled"-->
<!-- style="height: 100px;color: black;margin-top: 10px;"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :sm="24">-->
<!-- <span style="color: black;">备注:</span>-->
<!-- <a-form-item>-->
<!-- <a-input-->
<!-- v-model:value="vdata.detailData.remark"-->
<!-- type="textarea"-->
<!-- disabled="disabled"-->
<!-- style="height: 100px;color: black;margin-top: 10px;"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- </a-drawer>-->
<!-- </template>-->
<RefundDetail ref="refundDetail" />
</page-header-wrapper>
</template>
<script lang="ts" setup>
import { API_URL_REFUND_ORDER_LIST, API_URL_AGENT_LIST, req, $exportExcel, exportExcelUrl, $getPayConfigIfcodes, $refundOrderCount } from '@/api/manage'
import moment from 'moment'
import fileDownload from 'js-file-download'
import {ref, onMounted, reactive, getCurrentInstance} from 'vue'
import RefundDetail from "./RefundDetail.vue";
const refundDetail = ref() // 对话框
// 获取全局函数
const { $infoBox,$access } = getCurrentInstance()!.appContext.config.globalProperties
// eslint-disable-next-line no-unused-vars
// const tableColumns = reactive([
// { key: 'pay', title: '退款订单号', scopedSlots: { customRender: 'refundOrderSlot' }, width: '260px' },
// { key: 'refund', title: '支付订单号', scopedSlots: { customRender: 'payOrderSlot' }, width: '260px' },
// { key: 'storeName', title: '门店名称', dataIndex: 'storeName', defaultHidden: true },
// { key: 'storeId', title: '门店ID', dataIndex: 'storeId', defaultHidden: true },
// { key: 'payAmount', title: '支付金额' },
// { key: 'refundAmount', title: '退款金额' },
// { key: 'refundFeeAmount', title: '手续费退还金额' },
// { key: 'mchName', title: '用户名称', dataIndex: 'mchName', ellipsis: true, },
// { key: 'ifCode', title: '支付接口'},
// { key: 'state', title: '支付状态', scopedSlots: { customRender: 'stateSlot' } },
// { key: 'createdAt', dataIndex: 'createdAt', title: '创建日期' },
// { key: 'op', title: '操作', width: '100px', fixed: 'right', align: 'center', scopedSlots: { customRender: 'opSlot' } }
// ])
const tableColumns = reactive([
// { key: 'pay', title: '退款订单号', scopedSlots: { customRender: 'refundOrderSlot' } },
{ key: 'pay', title: '退款订单号' },
{ key: 'mchUserName', title: '用户名称', dataIndex: 'mchUserName'},
{ key: 'agentName', title: '服务商名称', dataIndex: 'agentName' },
{ key: 'mchName', title: '商户名称', dataIndex: 'mchName' },
{ key: 'storeName', title: '门店名称', dataIndex: 'storeName' },
// { key: 'refund', title: '支付订单号', scopedSlots: { customRender: 'payOrderSlot' }, width: '260px' },
{ key: 'ifName', title: '支付通道', dataIndex: 'ifName',},
{ key: 'isvName', title: '所属渠道', dataIndex: 'isvName' },
{ key: 'appId', title: '所属应用', dataIndex: 'appId' },
// { key: 'payAmount', title: '支付金额' },
{ key: 'refundAmount', title: '退款金额(元)' },
// { key: 'refundFeeAmount', title: '手续费退还金额' },
// { key: 'refundOrderId', title: '退款订单号', dataIndex: 'refundOrderId' },
// { key: 'mchRefundNo', title: '商户退款单号', dataIndex: 'mchRefundNo' },
// { key: 'payOrderId', title: '支付订单号', dataIndex: 'payOrderId' },
// { key: 'channelPayOrderNo', title: '渠道订单号', dataIndex: 'channelPayOrderNo' },
{ key: 'state', title: '退款状态', scopedSlots: { customRender: 'stateSlot' } },
{ key: 'refundType', title: '退款类型', scopedSlots: { customRender: 'stateSlot' } },
{ key: 'extParam', title: '退款模式' },
{ key: 'createdAt', dataIndex: 'createdAt', title: '创建日期' },
{ key: 'op', title: '操作', width: '100px', fixed: 'right', align: 'center', scopedSlots: { customRender: 'opSlot' } }
])
const ifCodeRef = ref()
const dateRangePicker = ref()
const infoTable = ref()
const vdata :any = reactive({
btnLoading: false,
tableColumns: tableColumns,
searchData: {queryDateRange: 'today'} as any,
createdStart: '', // 选择开始时间
createdEnd: '', // 选择结束时间
visible: false,
detailData: {} as any,
agentList: [] as any, // 服务商下拉列表
})
onMounted(()=>{
if($access('ENT_AGENT_RATE_CONFIG')){
$getPayConfigIfcodes('AGENT', 'agentApplyment', '').then((res) => {
vdata.ifCodeList = res
})
}
getOrderCount()
})
let orderCountList:any = ref([]) // 数据统计数组
// 数据统计
const getOrderCount = () => {
if(!$access('ENT_REFUND_ORDER_COUNT')){
return false
}
$refundOrderCount(vdata.searchData).then( res => {
orderCountList.value = [
{title: '退款金额', symbol: 'add', textColor: '#1A66FF', content: (res.totalAmount / 100).toFixed(2), num:res.allCount },
{type: 'line'},
{title: '退款成功金额',symbol: 'add', textColor: '#389e0d',content: (res.totalRefundAmount / 100).toFixed(2), num:res.succesCount },
{type: 'line'},
{title: '手续费退款金额',symbol: 'add',textColor: '#FF0000', content: (res.totalRefundFeeAmt / 100).toFixed(2), num:res.feeCount},
]
})
}
function queryFunc () {
vdata.btnLoading = true
infoTable.value.refTable(true)
}
// 请求table接口数据
function reqTableDataFunc(params){
return req.list(API_URL_REFUND_ORDER_LIST, params)
}
function searchFunc() { // 点击【查询】按钮点击事件
infoTable.value.refTable(true)
getOrderCount()
}
function detailFunc(recordId) {
refundDetail.value.show(recordId)
// req.getById(API_URL_REFUND_ORDER_LIST, recordId).then(res => {
// vdata.detailData = res
// console.log(res)
//
// })
vdata.visible = true
}
function onClose () {
vdata.visible = false
}
function changeStr2ellipsis (orderNo, baseLength) {
const halfLengh = baseLength / 2
return orderNo.substring(0, halfLengh - 1) + '...' + orderNo.substring(orderNo.length - halfLengh, orderNo.length)
}
function tableExportFunc(){
return $exportExcel(exportExcelUrl.refundOrder, Object.assign({}, vdata.searchData, {'pageSize': -1})).then(res => {
fileDownload(res.data, '退款订单.xlsx')
}).catch ((error) =>{console.log(error)} )
}
function handleChange (value) {
for (let i = 0; i < vdata.agentList.length; i++) {
if (value === vdata.agentList[i]['agentNo']) {
vdata.searchData['isvNo'] = vdata.agentList[i]['isvNo']
}
}
}
req.list(API_URL_AGENT_LIST, { 'pageSize': -1, 'state': 1 }).then(res => { // 服务商下拉选择列表
vdata.agentList = res.records
})
let isReset = ref(0) // 下拉搜索框是否重置
function onReset(){
isReset.value++ // 下拉搜索框重置
//重置搜索内容
dateRangePicker.value.returnSelectModel()
vdata.searchData = { queryDateRange: 'today' }
}
</script>
<style lang="less" scoped>
.order-list {
-webkit-text-size-adjust:none;
font-size: 12px;
display: flex;
flex-direction: column;
p {
white-space:nowrap;
span {
display: inline-block;
font-weight: 800;
height: 16px;
line-height: 16px;
width: 35px;
border-radius: 5px;
text-align: center;
margin-right: 2px;
}
}
}
</style>

View File

@@ -0,0 +1,399 @@
<template>
<page-header-wrapper>
<a-card>
<JeepaySearchForm :searchFunc="searchFunc" :resetFunc="onReset">
<a-form-item label="" class="table-search-item">
<JeepayDateRangePicker ref="dateRangePicker" v-model:value="vdata.searchData['queryDateRange']" customDateRangeType="dateTime" />
</a-form-item>
<jeepay-text-up v-model:value="vdata.searchData.mchExtNo" :placeholder="'商户名称/商户号'" />
<jeepay-text-up v-model:value="vdata.searchData.ifCode" :placeholder="'支付通道'" />
<jeepay-text-up v-model:value="vdata.searchData.isvNo" :placeholder="'渠道名称/渠道号'" />
<jeepay-text-up v-model:value="vdata.searchData.appid" :placeholder="'应用名称/应用ID'" />
<!-- <jeepay-text-up v-model:value="vdata.searchData.nameAndNo" :placeholder="'结算姓名/结算卡号'" />-->
<!-- <a-form-item label="" class="table-search-item">-->
<!-- <a-select v-model:value="vdata.searchData.ifCode" placeholder="支付通道">-->
<!-- <a-select-option v-for="item in vdata.payDefines" :key="item.ifCode" :value="item.ifCode">{{ item.ifName }}</a-select-option>-->
<!-- </a-select>-->
<!-- </a-form-item>-->
<a-form-item label="" class="table-search-item">
<a-select v-model:value="vdata.searchData.settleType" placeholder="结算类型">
<a-select-option value="">全部</a-select-option>
<a-select-option value="D0">D0</a-select-option>
<a-select-option value="D1">D1</a-select-option>
<a-select-option value="T1">T1</a-select-option>
<!-- <a-select-option value="4">定时结算</a-select-option>-->
</a-select>
</a-form-item>
<a-form-item label="" class="table-search-item">
<a-select v-model:value="vdata.searchData.state" placeholder="结算状态">
<a-select-option value="">全部</a-select-option>
<a-select-option value="-1">结算失败</a-select-option>
<a-select-option value="0">待结算</a-select-option>
<a-select-option value="1">结算中</a-select-option>
<a-select-option value="2">结算成功</a-select-option>
<a-select-option value="3">暂缓</a-select-option>
<a-select-option value="4">冻结</a-select-option>
<a-select-option value="5">退票</a-select-option>
<a-select-option value="98">待查看</a-select-option>
<a-select-option value="99">其他</a-select-option>
</a-select>
</a-form-item>
</JeepaySearchForm>
<!-- 列表渲染 -->
<!-- :statisticsIsShow="$access('ENT_ORDER_COUNT')"-->
<JeepayTable
ref="infoTable"
:initData="true"
:reqTableDataFunc="reqTableDataFunc"
:tableColumns="tableColumns"
:searchData="vdata.searchData"
rowKey="payOrderId"
:tableRowCrossColor="true"
:statisticsIsShow="true"
:tableExportFunc="tableExportFunc"
@btnLoadClose="vdata.btnLoading=false"
>
<template #statistics>
<div class="statistics-list">
<div v-for="(item, index) in orderCountList" :key="index" class="item">
<div v-if="item.type == 'line'" class="line" />
<div class="title">{{ item.title }}</div>
<div v-if="item.title" class="amount" :style="{color: item.textColor}">
<span class="amount-num">{{ item.content }}</span>
</div>
<div v-if="item.count >= 0" class="detail">
<span>{{ item.count + '笔' }}</span>
</div>
</div>
</div>
</template>
<template #headerCell="{ column }">
<template v-if="column.key === 'settleType'">
<Tooltip color="#3b4146">
<template #title>
<div style="color: #ffffff">提示内容</div>
</template>
<div style="cursor: pointer; width: 100%">
结算类型
<a-tooltip>
<template #title>
<p>T1工作日次日到账交易资金于周末和法定节假日次日的6点-12点自动结算至银行卡</p>
<p>D1自然日次日到账全年365天不分节假日的交易资金于自然日的次日6点-12点自动结算至银行卡</p>
<p>D0实时到账全年365天24小时不分节假日的交易资金笔笔实时秒到至银行卡更放心更快捷</p>
<p>定时结算在一天24个整点时辰根据入账需求选择结算范围可任意指定一个或多个结算时间点</p>
</template>
<question-circle-outlined style="padding-left: 10px"/>
</a-tooltip>
</div>
</Tooltip>
</template>
</template>
<template #bodyCell="{column,record}">
<template v-if="column.key === 'appid'">
<a-tooltip class="my-tooltip" overlayClassName="tooltip-box-name">
<template #title>
<span>应用名称{{record.appName}}</span><br>
<span>应用ID{{record.appid}}</span>
</template>
<div class="my-tooltip-title-box"> {{record.appName}}</div>
</a-tooltip>
</template>
<template v-if="column.key === 'agentName'">
<a-tooltip class="my-tooltip" overlayClassName="tooltip-box-name">
<template #title>
<span>服务商名称{{record.agentName}}</span><br>
<span>服务商号{{record.agentNo}}</span>
</template>
<div class="my-tooltip-title-box"> {{record.agentName}}</div>
</a-tooltip>
</template>
<template v-if="column.key === 'mchUserName'">
<a-tooltip class="my-tooltip" overlayClassName="tooltip-box-name">
<template #title>
<span>用户名称{{record.mchUserName}}</span><br>
<span>用户手机号{{record.mchUserPhone}}</span>
</template>
<div class="my-tooltip-title-box"> {{record.mchUserName}}</div>
</a-tooltip>
</template>
<template v-if="column.key === 'mchName'">
<a-tooltip class="my-tooltip" overlayClassName="tooltip-box-name">
<template #title>
<span>商户名称{{record.mchName}}</span><br>
<span>商户号{{record.mchExtNo}}</span>
</template>
<div class="my-tooltip-title-box"> {{record.mchName}}</div>
</a-tooltip>
</template>
<template v-if="column.key === 'isvNo'">
<a-tooltip class="my-tooltip" overlayClassName="tooltip-box-name">
<template #title>
<span>渠道名称{{record.isvName}}</span><br>
<span>渠道号{{record.isvNo}}</span>
</template>
<div class="my-tooltip-title-box"> {{record.isvName}}</div>
</a-tooltip>
</template>
<template v-if="column.key == 'state'">
<a-tag
:key="record.state"
:color="record.state === -1?'red':record.state === 1?'orange':record.state === 2?'green':record.state === 6?'':'volcano'"
>
{{ record.state === -1?'结算失败':record.state === 0?'待结算':record.state === 1?'结算中':record.state === 2?'结算成功':record.state === 3?'暂缓':record.state === 4?'冻结':record.state === 5?'退票':record.state === 98?'待查看':record.state === 99?'待查看':'--' }}
</a-tag>
<a-tooltip :title="record.errMsg" v-if="record.state == 3">
<info-circle-outlined style="color: #FFD080;margin-left: 5px"/>
</a-tooltip>
<a-tooltip :title="record.remark" v-if="record.state == 98 && record.settleType == 'D0'">
<question-circle-outlined style="padding-left: 5px"/>
</a-tooltip>
<a-tooltip v-if="record.state == -1" :title="record.remark">
<info-circle-outlined style="font-size: 16px; padding-left: 5px;color: #FF0000"/>
</a-tooltip>
<!-- <reload-outlined v-if="$access('ENT_SETTLE_SYNC') && record.state < 2" @click="getReload(record)" style="color: #1890ff;margin-left: 5px" />-->
</template>
<template v-if="column.key == 'accountName'">
<!-- 操作列插槽 -->
<!-- <a-tooltip >-->
<!-- <template #title>-->
<!-- 卡号-->
<!-- </template>-->
<!-- -->
<!-- </a-tooltip>-->
{{record.accountName}}<br>
{{record.accountNo}}
</template>
<template v-if="column.key == 'settleAmt'">
<!-- 操作列插槽 -->
<a-tooltip >
<template #title>
<div v-if="record.state == 1 || record.state == 0">
<p>预付金额数据同步中</p>
<p>交易手续费数据同步中</p>
<p>垫资手续费数据同步中</p>
<p>结算金额数据同步中</p>
</div>
<div v-else>
<p>预付金额{{(record.planAmt / 100).toFixed(2)}}</p>
<p>交易手续费{{(record.fee / 100).toFixed(2)}}</p>
<p>垫资手续费{{(record.cashFee / 100).toFixed(2)}}</p>
<p>结算金额{{(record.settleAmt / 100).toFixed(2)}}</p>
</div>
</template>
<b style="color: #1890ff">{{ (record.settleAmt / 100).toFixed(2)}} </b>
</a-tooltip>
</template>
<template v-if="column.key == 'transactionAmount'">
{{ (record.transactionAmount / 100).toFixed(2)}}
</template>
<template v-if="column.key == 'fee'">
{{ (record.fee / 100).toFixed(2)}}
</template>
<template v-if="column.key == 'cashFee'">
{{ (record.cashFee / 100).toFixed(2)}}
</template>
<template v-if="column.key == 'settleName'">
<!-- 操作列插槽 -->
--
</template>
<template v-if="column.key == 'op'">
<!-- 操作列插槽 -->
</template>
</template>
</JeepayTable>
</a-card>
</page-header-wrapper>
</template>
<script lang="ts" setup>
import {
API_URL_MCH_LIST,
API_URL_PAY_ORDER_LIST,
API_URL_PAYWAYS_LIST,
req,
$exportExcel,
exportExcelUrl,
$payOrderCount,
API_MCH_PAY_SETTLE_LOG, API_MCH_PAY_DEFINES, $settleOrderCount, $getPayOrderRefresh, $getSettTypeSync
} from '@/api/manage'
import {ref, onMounted, reactive, getCurrentInstance} from 'vue'
import fileDownload from 'js-file-download'
import { message } from 'ant-design-vue'
// 获取全局函数
const { $hasMemberEnt,$access } = getCurrentInstance()!.appContext.config.globalProperties
const tableColumns = reactive([
{ key: 'mchUserName', title: '用户名称', dataIndex: 'mchUserName'},
{ key: 'agentName', title: '服务商名称', dataIndex: 'agentName' },
{ key: 'mchName', title: '商户名称', dataIndex: 'mchName' },
{ key: 'ifName', title: '支付通道', dataIndex: 'ifName',},
{ key: 'isvNo', title: '所属渠道', dataIndex: 'isvNo',},
{ key: 'appid', title: '应用名称', dataIndex: 'appid' },
{ key: 'accountName', title: '结算账户',fixed: "left", dataIndex: 'accountName', align: 'center'},
// { key: 'transactionNumber', title: '成功交易笔数', dataIndex: 'transactionNumber', align: 'center'},
// { key: 'transactionAmount', title: '成功交易金额', dataIndex: 'transactionAmount', align: 'center'},
// { key: 'fee', title: '交易手续费', dataIndex: 'fee', align: 'center'},
// { key: 'cashFee', title: '垫资手续费', dataIndex: 'cashFee', align: 'center'},
{ key: 'settleAmt', title: '结算金额(元)', dataIndex: 'settleAmt', align: 'center' },
{ key: 'settleType', title: '结算类型', dataIndex: 'settleType', align: 'center'},
// { key: 'remark', title: '附言信息', dataIndex: 'remark' },
{ key: 'updatedAt', dataIndex: 'updatedAt', title: '结算日期' },
// { key: 'createdAt', dataIndex: 'createdAt', title: '结算日期' },
{ key: 'state', title: '结算状态',fixed: "right",},
])
const infoTable = ref()
const dateRangePicker = ref()
const vdata = reactive({
btnLoading: false,
tableColumns: tableColumns,
searchData: {queryDateRange: 'today'} as any,
visible: false,
detailData: {} as any,
payWayList: [] as any,
channelList:[] as any,
payDefines: [] as any,
orderKeyType: 'payOrderId'
})
onMounted(()=>{
if ($access('ENT_PAY_ORDER_SEARCH_PAY_WAY')) {
initPayWay()
}
})
let orderCountList:any = ref([]) // 数据统计数组
let countDetailList: any = ref([]) // 数据统计明细数组
// 数据统计
const getOrderCount = () => {
$settleOrderCount(vdata.searchData).then( res => {
orderCountList.value = [
{title: '成功交易金额',symbol: 'add', textColor: '#1A66FF', content: ((res.successAmount) / 100).toFixed(2), count: res.successAll},
{type: 'line'},
{title: '交易手续费',symbol: 'add',textColor: '#1A66FF', content: (res.feeAmount / 100).toFixed(2), count: res.feeAll},
{type: 'line'},
{title: '垫资手续费',symbol: 'add',textColor: '#1A66FF', content: (res.cashFeeAmount / 100).toFixed(2), count: res.cashFeeAll},
{type: 'line'},
{title: '结算金额', symbol: 'add',textColor: '#1A66FF', content: (res.allAmount / 100).toFixed(2), count: res.allSettle},
{type: 'line'},
{title: '待结算金额',symbol: 'add',textColor: '#1A66FF', content: (res.waitAmount / 100).toFixed(2), count: res.waitAll},
]
})
}
getOrderCount() // 进入页面时调用一次
getChannelList()
payFefines();
//通道
function payFefines() {
req.list(API_MCH_PAY_DEFINES,{ 'pageSize': -1 }).then(res => {
vdata.payDefines = res
})
}
// 请求table接口数据
function reqTableDataFunc(params){
return req.list(API_MCH_PAY_SETTLE_LOG, params)
}
function searchFunc(){ // 点击【查询】按钮点击事件
infoTable.value.refTable(true)
getOrderCount() // 数据统计函数
}
// 打开退款弹出框
function openFunc (record, recordId) {
if (record.refundState === 2) {
return message.error('订单无可退款金额')
}
}
function detailFunc(recordId) {
req.getById(API_MCH_PAY_SETTLE_LOG, recordId).then(res => {
vdata.detailData = res
})
vdata.visible = true
}
function onClose () {
vdata.visible = false
}
function initPayWay () {
req.list(API_URL_PAYWAYS_LIST, { 'pageSize': -1 }).then(res => { // 支付方式下拉列表
vdata.payWayList = res.records
})
}
function changeStr2ellipsis (orderNo, baseLength) {
const halfLengh = baseLength / 2
return orderNo.substring(0, halfLengh - 1) + '...' + orderNo.substring(orderNo.length - halfLengh, orderNo.length)
}
function tableExportFunc(){
return $exportExcel(exportExcelUrl.settleOrder as any, Object.assign({}, vdata.searchData, {'pageSize': -1})).then(res => {
fileDownload(res.data, '结算订单列表.xlsx')
}).catch ((error) =>{console.log(error)} )
}
function onReset(){
//重置搜索内容
dateRangePicker.value.returnSelectModel()
vdata.searchData = { queryDateRange: 'today' }
}
function orderKeyTypeChangeFunc() {
vdata.searchData.payOrderId = ''
vdata.searchData.mchOrderNo = ''
vdata.searchData.channelOrderNo = ''
vdata.searchData.platformMchOrderNo = ''
vdata.searchData.platformOrderNo = ''
}
function getChannelList(){
// req.list(API_URL_MCH_APP, { 'pageSize': -1 }).then(res => { // 支付方式下拉列表
// vdata.channelList = res.records
// })
}
function getReload(data) {
$getSettTypeSync(data.settleNo).then(res => {
message.success('同步成功')
infoTable.value.refTable(true)
})
}
</script>
<style lang="less" scoped>
.order-list {
-webkit-text-size-adjust:none;
font-size: 12px;
display: flex;
flex-direction: column;
p {
white-space:nowrap;
span {
display: inline-block;
font-weight: 800;
height: 16px;
line-height: 16px;
width: 35px;
border-radius: 5px;
text-align: center;
margin-right: 2px;
}
}
}
</style>