style 订单和交易记录页面优化

This commit is contained in:
DaxPay
2024-08-19 10:45:33 +08:00
parent b590bee978
commit 245bd209da
15 changed files with 109 additions and 63 deletions

View File

@@ -9,7 +9,7 @@
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-descriptions bordered title="" :column="{ md: 1, sm: 1, xs: 1 }">
<a-descriptions bordered title="" :column="1">
<a-descriptions-item label="主键">
{{ info.id }}
</a-descriptions-item>

View File

@@ -9,7 +9,7 @@
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-descriptions bordered title="" :column="{ md: 1, sm: 1, xs: 1 }">
<a-descriptions bordered title="" :column="1">
<a-descriptions-item label="主键">
{{ info.id }}
</a-descriptions-item>

View File

@@ -9,7 +9,7 @@
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-descriptions title="" :column="24" bordered>
<a-descriptions title="" :column="{ lg: 24, md: 1 }" bordered>
<a-descriptions-item label="标题" :span="8">
{{ order.title }}
</a-descriptions-item>

View File

@@ -9,7 +9,7 @@
@cancel="handleCancel"
>
<a-descriptions bordered>
<a-descriptions-item label="退款号" :span="2">
<a-descriptions-item label="退款号" :column="{ lg: 2, md: 1 }">
{{ order.refundNo }}
</a-descriptions-item>
<a-descriptions-item label="商户退款号" :span="2">

View File

@@ -1,6 +1,6 @@
import { defHttp } from '@/utils/http/axios'
import { PageResult, Result } from '#/axios'
import { MchEntity} from '#/web'
import { MchEntity } from '#/web'
import { TransferStatusEnum } from '@/enums/daxpay/TradeStatusEnum'
/**
@@ -26,10 +26,10 @@ export function get(id) {
/**
* 获取单条
*/
export function getByBizTransferNo(bizTransferNo) {
export function findByTransferNo(transferNo) {
return defHttp.get<Result<TransferOrder>>({
url: '/order/transfer/findByBizTransferNo',
params: { bizTransferNo },
url: '/order/transfer/findByTransferNo',
params: { transferNo },
})
}

View File

@@ -1,6 +1,6 @@
<template>
<basic-modal
title="退款订单"
title="转账订单"
v-bind="$attrs"
:loading="confirmLoading"
:width="1200"
@@ -8,7 +8,7 @@
:mask-closable="showable"
@cancel="handleCancel"
>
<a-descriptions bordered :column="4">
<a-descriptions bordered :column="{ lg: 4, md: 1 }">
<a-descriptions-item label="转账号" :span="2">
{{ order.transferNo }}
</a-descriptions-item>
@@ -72,7 +72,7 @@
<script lang="ts" setup>
import useFormEdit from '@/hooks/bootx/useFormEdit'
import { getByBizTransferNo, TransferOrder } from './TransferOrder.api'
import { findByTransferNo, TransferOrder } from './TransferOrder.api'
import { BasicModal } from '@/components/Modal'
import { useDict } from '@/hooks/bootx/useDict'
import { ref } from 'vue'
@@ -83,10 +83,10 @@
const order = ref<TransferOrder>({})
// 入口
async function init(bizTransferNo) {
async function init(transferNo) {
visible.value = true
confirmLoading.value = true
getByBizTransferNo(bizTransferNo).then(({ data }) => {
findByTransferNo(transferNo).then(({ data }) => {
order.value = data
confirmLoading.value = false
})

View File

@@ -265,7 +265,7 @@
* 查看
*/
function show(record) {
transferOrderInfo.value.init(record.bizTransferNo)
transferOrderInfo.value.init(record.transferNo)
}
</script>

View File

@@ -9,7 +9,7 @@
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-descriptions bordered title="">
<a-descriptions bordered title="" :column="{ lg: 2, md: 1 }">
<a-descriptions-item label="平台交易号" :span="2">
{{ form.tradeNo }}
</a-descriptions-item>
@@ -19,7 +19,7 @@
<a-descriptions-item label="支付通道" :span="2">
<a-tag>{{ dictConvert('channel', form.channel) || '无' }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="回调类型" :span="2">
<a-descriptions-item label="交易类型" :span="2">
<a-tag>{{ dictConvert('trade_type', form.callbackType) || '无' }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="处理状态" :span="2">
@@ -31,6 +31,12 @@
<a-descriptions-item label="提示消息" v-if="form.errorMsg" :span="4">
{{ form.errorMsg }}
</a-descriptions-item>
<a-descriptions-item label="商户号" :span="2">
{{ form.mchNo }}
</a-descriptions-item>
<a-descriptions-item label="应用AppId" :span="2">
{{ form.appId }}
</a-descriptions-item>
<a-descriptions-item label="通知消息" :span="4">
<json-preview :data="JSON.parse(form.notifyInfo || '{}')" />
</a-descriptions-item>

View File

@@ -22,19 +22,20 @@
@sort-change="sortChange"
>
<vxe-column type="seq" title="序号" width="60" />
<vxe-column field="orderId" title="订单号" :min-width="230">
<vxe-column field="tradeNo" title="交易号" :min-width="230">
<template #default="{ row }">
<a @click="showOrder(row)">
{{ row.tradeNo }}
</a>
</template>
</vxe-column>
<vxe-column field="outTradeNo" title="通道交易号" :min-width="230" />
<vxe-column field="channel" title="支付通道" :min-width="100">
<template #default="{ row }">
<a-tag>{{ dictConvert('channel', row.channel) || '无' }}</a-tag>
</template>
</vxe-column>
<vxe-column field="callbackType" title="回调类型" :min-width="100">
<vxe-column field="callbackType" title="交易类型" :min-width="100">
<template #default="{ row }">
<a-tag>{{ dictConvert('trade_type', row.callbackType) || '无' }}</a-tag>
</template>
@@ -45,7 +46,7 @@
</template>
</vxe-column>
<vxe-column field="msg" title="提示信息" :min-width="250" />
<vxe-column field="createTime" title="通知时间" sortable :min-width="100" />
<vxe-column field="createTime" title="通知时间" sortable :min-width="170" />
<vxe-column fixed="right" width="60" :showOverflow="false" title="操作">
<template #default="{ row }">
<span>
@@ -66,6 +67,7 @@
<CallbackRecordInfo ref="callbackRecordInfo" />
<PayOrderInfo ref="payOrderInfo" />
<RefundOrderInfo ref="refundOrderInfo" />
<TransferOrderInfo ref="transferOrderInfo" />
</div>
</div>
</template>
@@ -82,6 +84,8 @@
import { LabeledValue } from 'ant-design-vue/lib/select'
import PayOrderInfo from '@/views/daxpay/admin/order/pay/PayOrderInfo.vue'
import RefundOrderInfo from '@/views/daxpay/admin/order/refund/RefundOrderInfo.vue'
import TransferOrderInfo from '@/views/daxpay/admin/order/transfer/TransferOrderInfo.vue'
import { TradeTypeEnum } from '@/enums/daxpay/PaymentEnum'
// 使用hooks
const {
@@ -97,27 +101,35 @@
} = useTablePage(queryPage)
const { dictConvert, dictDropDown } = useDict()
let asyncPayChannelList = ref<LabeledValue[]>([])
let PayCallbackStatusList = ref<LabeledValue[]>([])
let channelList = ref<LabeledValue[]>([])
let callbackTypeList = ref<LabeledValue[]>([])
let callbackStatusList = ref<LabeledValue[]>([])
// 查询条件
const fields = computed(() => {
return [
{ field: 'tradeNo', type: STRING, name: '平台交易号', placeholder: '请输入平台交易号' },
{ field: 'tradeNo', type: STRING, name: '交易号', placeholder: '请输入平台交易号' },
{ field: 'outTradeNo', type: STRING, name: '通道交易号', placeholder: '请输入通道交易号' },
{
field: 'channel',
type: LIST,
name: '支付通道',
placeholder: '请选择支付通道',
selectList: asyncPayChannelList.value,
selectList: channelList.value,
},
{
field: 'callbackType',
type: LIST,
name: '交易类型',
placeholder: '请选择交易类型',
selectList: callbackTypeList.value,
},
{
field: 'status',
type: LIST,
name: '处理状态',
placeholder: '请选择消息处理状态',
selectList: PayCallbackStatusList.value,
selectList: callbackStatusList.value,
},
] as QueryField[]
})
@@ -127,6 +139,7 @@
const callbackRecordInfo = ref<any>()
const payOrderInfo = ref<any>()
const refundOrderInfo = ref<any>()
const transferOrderInfo = ref<any>()
onMounted(() => {
initData()
@@ -141,8 +154,9 @@
* 初始化
*/
async function initData() {
asyncPayChannelList.value = await dictDropDown('AsyncPayChannel')
PayCallbackStatusList.value = await dictDropDown('PayCallbackStatus')
channelList.value = await dictDropDown('channel')
callbackTypeList.value = await dictDropDown('trade_type')
callbackStatusList.value = await dictDropDown('callback_status')
}
/**
@@ -170,10 +184,12 @@
* 查看订单单信息
*/
function showOrder(record: TradeCallbackRecord) {
if (record.callbackType === 'pay') {
if (record.callbackType === TradeTypeEnum.PAY) {
payOrderInfo.value.init(record.tradeNo)
} else {
} else if (record.callbackType === TradeTypeEnum.REFUND) {
refundOrderInfo.value.init(record.tradeNo)
} else if (record.callbackType === TradeTypeEnum.TRANSFER) {
transferOrderInfo.value.init(record.tradeNo)
}
}
</script>

View File

@@ -3,13 +3,13 @@
title="查看"
v-bind="$attrs"
:loading="confirmLoading"
:width="modalWidth"
:width="1200"
:open="visible"
:mask-closable="showable"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-descriptions bordered title="" :column="{ md: 1, sm: 1, xs: 1 }">
<a-descriptions bordered title="" :column="{ lg: 2, md: 1 }">
<a-descriptions-item label="订单号">
{{ record.orderNo }}
</a-descriptions-item>
@@ -17,13 +17,13 @@
{{ record.bizOrderNo }}
</a-descriptions-item>
<a-descriptions-item label="支付通道">
{{ dictConvert('PayChannel', record.channel) }}
{{ dictConvert('channel', record.channel) }}
</a-descriptions-item>
<a-descriptions-item label="关闭类型">
{{ dictConvert('PayCloseType', record.closeType) }}
<a-tag>{{ dictConvert('close_type', record.closeType) }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="是否关闭成功">
{{ record.closed ? '' : '' }}
<a-tag>{{ record.closed ? '成功' : '失败' }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="错误编码" v-if="record.errorCode">
{{ record.errorMsg }}
@@ -37,6 +37,12 @@
<a-descriptions-item label="关闭时间">
{{ record.createTime }}
</a-descriptions-item>
<a-descriptions-item label="商户号">
{{ record.mchNo }}
</a-descriptions-item>
<a-descriptions-item label="应用AppId">
{{ record.appId }}
</a-descriptions-item>
</a-descriptions>
</a-spin>
<template #footer>
@@ -52,7 +58,7 @@
import { useDict } from '@/hooks/bootx/useDict'
import { ref } from 'vue'
const { handleCancel, modalWidth, confirmLoading, visible, showable } = useFormEdit()
const { handleCancel, confirmLoading, visible, showable } = useFormEdit()
const { dictConvert } = useDict()
// 表单

View File

@@ -31,7 +31,7 @@
<vxe-column field="bizOrderNo" title="商户订单号" :min-width="180" />
<vxe-column field="closeType" title="关闭类型" :min-width="80">
<template #default="{ row }">
{{ dictConvert('PayCloseType', row.closeType) }}
<a-tag>{{ dictConvert('close_type', row.closeType) }}</a-tag>
</template>
</vxe-column>
<vxe-column field="closed" title="关闭状态" :min-width="80">
@@ -42,7 +42,7 @@
</vxe-column>
<vxe-column field="channel" title="支付通道" :min-width="100">
<template #default="{ row }">
{{ dictConvert('PayChannel', row.channel) }}
{{ dictConvert('channel', row.channel) }}
</template>
</vxe-column>
<vxe-column field="errorMsg" title="错误消息" :min-width="180" />

View File

@@ -1,6 +1,6 @@
<template>
<basic-modal
title="查看同步信息"
title="查看交易流水"
v-bind="$attrs"
:loading="confirmLoading"
:width="1200"
@@ -9,31 +9,37 @@
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-descriptions title="" bordered>
<a-descriptions :column="{ lg: 2, md: 1 }" title="" bordered>
<a-descriptions-item label="标题" :span="2">
{{ record.title }}
</a-descriptions-item>
<a-descriptions-item label="交易金额(元)" :span="2">
<a-descriptions-item label="流水类型">
<a-tag>{{ dictConvert('trade_type', record.type) || '无' }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="交易金额(元)">
{{ record.amount || '无' }}
</a-descriptions-item>
<a-descriptions-item label="平台交易号" :span="4">
<a-descriptions-item label="平台交易号" :span="2">
{{ record.tradeNo }}
</a-descriptions-item>
<a-descriptions-item label="商户交易号" :span="4">
<a-descriptions-item label="商户交易号" :span="2">
{{ record.bizTradeNo }}
</a-descriptions-item>
<a-descriptions-item label="通道交易号" :span="4">
<a-descriptions-item label="通道交易号" :span="2">
{{ record.outTradeNo || '无' }}
</a-descriptions-item>
<a-descriptions-item label="流水类型" :span="2">
<a-tag>{{ dictConvert('TradeFlowRecordType', record.type) || '无' }}</a-tag>
<a-descriptions-item label="交易通道">
<a-tag> {{ dictConvert('channel', record.channel) }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="交易通道" :span="2">
<a-tag> {{ dictConvert('PayChannel', record.channel) }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="同步时间" :span="2">
<a-descriptions-item label="创建时间">
{{ record.createTime }}
</a-descriptions-item>
<a-descriptions-item label="商户号">
{{ record.mchNo }}
</a-descriptions-item>
<a-descriptions-item label="应用AppId">
{{ record.appId }}
</a-descriptions-item>
</a-descriptions>
</a-spin>
<template #footer>

View File

@@ -12,11 +12,12 @@
<div class="m-3 p-3 bg-white">
<vxe-toolbar ref="xToolbar" custom :refresh="{ queryMethod: queryPage }">
<template #buttons>
<span style="font-size: 18px"
>收入金额: {{ totalAmount.incomeAmount ? totalAmount.incomeAmount : 0 }}</span
<span style="font-size: 18px">收入金额: {{ totalAmount.incomeAmount }}</span>
<span style="font-size: 18px; margin-left: 50px"
>退款金额: {{ totalAmount.refundAmount }}</span
>
<span style="font-size: 18px; margin-left: 50px"
>支出金额: {{ totalAmount.outlayAmount ? totalAmount.outlayAmount : 0 }}</span
>转账金额: {{ totalAmount.transferAmount }}</span
>
</template>
</vxe-toolbar>
@@ -37,12 +38,12 @@
</vxe-column>
<vxe-column field="type" title="流水类型" :min-width="120">
<template #default="{ row }">
<a-tag>{{ dictConvert('TradeFlowRecordType', row.type) || '无' }}</a-tag>
<a-tag>{{ dictConvert('trade_type', row.type) || '无' }}</a-tag>
</template>
</vxe-column>
<vxe-column field="channel" title="交易通道" :min-width="100">
<vxe-column field="channel" title="交易通道" :min-width="150">
<template #default="{ row }">
<a-tag>{{ dictConvert('AsyncPayChannel', row.channel) || '无' }}</a-tag>
<a-tag>{{ dictConvert('channel', row.channel) || '无' }}</a-tag>
</template>
</vxe-column>
<vxe-column field="tradeNo" title="平台交易号" :min-width="230">
@@ -76,12 +77,13 @@
<TradeFlowRecordInfo ref="tradeFlowRecordInfo" />
<PayOrderInfo ref="payOrderInfo" />
<RefundOrderInfo ref="refundOrderInfo" />
<TransferOrderInfo ref="transferOrderInfo" />
</div>
</template>
<script lang="ts" setup>
import { computed, onMounted, ref } from 'vue'
import { page } from './TradeFlowRecord.api'
import { page, TradeFlowRecord } from './TradeFlowRecord.api'
import useTablePage from '@/hooks/bootx/useTablePage'
import { VxeTable, VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
import BQuery from '@/components/Bootx/Query/BQuery.vue'
@@ -90,8 +92,10 @@
import { LabeledValue } from 'ant-design-vue/lib/select'
import PayOrderInfo from '@/views/daxpay/admin/order/pay/PayOrderInfo.vue'
import RefundOrderInfo from '@/views/daxpay/admin/order/refund/RefundOrderInfo.vue'
import TransferOrderInfo from '@/views/daxpay/admin/order/transfer/TransferOrderInfo.vue'
import ALink from '@/components/Link/Link.vue'
import TradeFlowRecordInfo from './TradeFlowRecordInfo.vue'
import { TradeTypeEnum } from '@/enums/daxpay/PaymentEnum'
// 使用hooks
const {
@@ -136,10 +140,12 @@
const xToolbar = ref<VxeToolbarInstance>()
const payOrderInfo = ref<any>()
const refundOrderInfo = ref<any>()
const transferOrderInfo = ref<any>()
const tradeFlowRecordInfo = ref<any>()
const totalAmount = ref({
incomeAmount: 0.0,
outlayAmount: 0.0,
refundAmount: 0.0,
transferAmount: 0.0,
})
onMounted(() => {
@@ -182,11 +188,13 @@
/**
* 查看支付单信息
*/
function showOrder(record) {
if (record.type === 'pay') {
function showOrder(record: TradeFlowRecord) {
if (record.type === TradeTypeEnum.PAY) {
payOrderInfo.value.init(record.tradeNo)
} else if (record.type === 'refund') {
} else if (record.type === TradeTypeEnum.REFUND) {
refundOrderInfo.value.init(record.tradeNo)
} else if (record.type === TradeTypeEnum.TRANSFER) {
transferOrderInfo.value.init(record.tradeNo)
}
}
</script>

View File

@@ -8,7 +8,7 @@
:mask-closable="showable"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-spin :column="{ lg: 4, md: 1 }" :spinning="confirmLoading">
<a-descriptions title="" bordered>
<a-descriptions-item label="平台交易号" :span="4">
{{ form.tradeNo }}
@@ -40,6 +40,12 @@
<a-descriptions-item label="错误信息" v-if="form.errorMsg" :span="2">
{{ form.errorMsg }}
</a-descriptions-item>
<a-descriptions-item label="商户号" :span="2">
{{ form.mchNo }}
</a-descriptions-item>
<a-descriptions-item label="应用AppId" :span="2">
{{ form.appId }}
</a-descriptions-item>
<a-descriptions-item label="同步消息" :span="4">
<json-preview :data="XEUtils.toStringJSON(form.syncInfo || '{}')" />
</a-descriptions-item>

View File

@@ -22,7 +22,6 @@
</vxe-column>
<vxe-column field="bizTradeNo" title="商户交易号" :min-width="230" />
<vxe-column field="outTradeNo" title="通道交易号" :min-width="250" />
<vxe-column field="outTradeStatus" title="通道状态" :min-width="150" />
<vxe-column field="type" title="同步类型" :min-width="120">
<template #default="{ row }">
<a-tag>{{ dictConvert('trade_type', row.tradeType) }}</a-tag>
@@ -33,6 +32,7 @@
<a-tag>{{ dictConvert('channel', row.channel) }}</a-tag>
</template>
</vxe-column>
<vxe-column field="outTradeStatus" title="通道状态" :min-width="150" />
<vxe-column field="repairOrder" title="是否调整" width="170">
<template #default="{ row }">
<a-tag v-if="row.adjust" color="green"> 已调整 </a-tag>
@@ -71,7 +71,6 @@
import useTablePage from '@/hooks/bootx/useTablePage'
import { VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
import BQuery from '@/components/Bootx/Query/BQuery.vue'
import { useMessage } from '@/hooks/web/useMessage'
import { LIST, QueryField, STRING } from '@/components/Bootx/Query/Query'
import { useDict } from '@/hooks/bootx/useDict'
import { TradeTypeEnum } from '@/enums/daxpay/PaymentEnum'
@@ -92,7 +91,6 @@
model,
loading,
} = useTablePage(queryPage)
const { notification, createMessage, createConfirm } = useMessage()
const { dictConvert, dictDropDown } = useDict()
let syncStatusList = ref<LabeledValue[]>([])