mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-03 19:07:02 +00:00
feat 支付宝增加限额和商户账号字段, 修改支付订单显示问题
This commit is contained in:
@@ -38,6 +38,10 @@ export interface AlipayConfig extends BaseEntity {
|
||||
appId?: string
|
||||
// 是否启用
|
||||
enable: boolean
|
||||
// 支付限额
|
||||
limitAmount: number
|
||||
// 商户账号ID
|
||||
alipayUserId?: string
|
||||
// 服务器异步通知页面路径
|
||||
notifyUrl?: string
|
||||
// 页面跳转同步通知页面路径
|
||||
|
@@ -27,6 +27,18 @@
|
||||
<a-form-item label="是否启用" name="enable">
|
||||
<a-switch checked-children="启用" un-checked-children="停用" v-model:checked="form.enable" />
|
||||
</a-form-item>
|
||||
<a-form-item name="alipayUserId">
|
||||
<template #label>
|
||||
<basic-title
|
||||
helpMessage=",是商家与支付宝签约后,商家获得的支付宝商家唯一识别码,以 2088 开头的 16 位数字组成,在开放平台中账户中心获取"
|
||||
>合作者身份ID
|
||||
</basic-title>
|
||||
</template>
|
||||
<a-input v-model:value="form.alipayUserId" placeholder="请输入合作者身份ID" />
|
||||
</a-form-item>
|
||||
<a-form-item label="单次支付限额(分)" name="limitAmount">
|
||||
<a-input-number :precision="0" :min="1" v-model:value="form.limitAmount" placeholder="请输入单次支付限额(分)" />
|
||||
</a-form-item>
|
||||
<a-form-item name="notifyUrl">
|
||||
<template #label>
|
||||
<basic-title helpMessage="此处为本网关接收通知的地址, 而不是客户系统接收通知所需的地址"> 异步通知地址 </basic-title>
|
||||
@@ -177,6 +189,7 @@
|
||||
let form = $ref({
|
||||
appId: '',
|
||||
enable: false,
|
||||
limitAmount: 20000,
|
||||
notifyUrl: '',
|
||||
returnUrl: '',
|
||||
serverUrl: '',
|
||||
@@ -197,6 +210,7 @@
|
||||
return {
|
||||
appId: [{ required: true, message: '请输入AppId' }],
|
||||
enable: [{ required: true, message: '请选择是否启用' }],
|
||||
limitAmount: [{ required: true, message: '请选择单次支付限额' }],
|
||||
notifyUrl: [{ required: true, message: '请输入异步通知页面地址' }],
|
||||
returnUrl: [{ required: true, message: '请输入同步通知页面地址' }],
|
||||
serverUrl: [{ required: true, message: '请输入请求网关地址' }],
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<vxe-column field="id" title="通道支付单ID" width="170" />
|
||||
<vxe-column field="channel" title="支付通道">
|
||||
<template #default="{ row }">
|
||||
{{ dictConvert('PayChannel', row.channel) }}
|
||||
{{ dictConvert('PayChannel', row.channel) }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="payWay" title="支付方式">
|
||||
@@ -18,13 +18,13 @@
|
||||
<vxe-column field="refundableBalance" title="可退款金额" />
|
||||
<vxe-column field="async" title="异步支付">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.async" style="color:green">是</span>
|
||||
<span v-else style="color:red">否</span>
|
||||
<span v-if="row.async" style="color: green">是</span>
|
||||
<span v-else style="color: red">否</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="status" title="支付状态">
|
||||
<template #default="{ row }">
|
||||
{{ dictConvert('PayStatus', row.status) }}
|
||||
{{ dictConvert('PayStatus', row.status) }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="payTime" title="支付时间" />
|
||||
@@ -95,36 +95,36 @@
|
||||
}
|
||||
|
||||
function cellStyle({ row, column }) {
|
||||
if (column.field == 'status') {
|
||||
if (row.status == 'success') {
|
||||
return { color: 'green' }
|
||||
}
|
||||
if (row.status == 'fail') {
|
||||
if (column.field == 'status') {
|
||||
if (row.status == 'success') {
|
||||
return { color: 'green' }
|
||||
}
|
||||
if (row.status == 'fail') {
|
||||
return { color: 'red' }
|
||||
}
|
||||
if (row.status == 'progress') {
|
||||
return { color: 'orange' }
|
||||
}
|
||||
if (row.status == 'close') {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
return { color: 'red' }
|
||||
}
|
||||
if (row.status == 'progress') {
|
||||
return { color: 'orange' }
|
||||
if (column.field == 'asyncPay') {
|
||||
if (row.asyncPay) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
}
|
||||
if (row.status == 'close') {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
return { color: 'red' }
|
||||
}
|
||||
if (column.field == 'asyncPay') {
|
||||
if (row.asyncPay) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
if (column.field == 'combinationPay') {
|
||||
if (row.combinationPay) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
}
|
||||
}
|
||||
if (column.field == 'combinationPayMode') {
|
||||
if (row.combinationPayMode) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
init,
|
||||
})
|
||||
|
@@ -28,8 +28,8 @@
|
||||
<vxe-column field="asyncPay" title="异步支付" width="120">
|
||||
<template #default="{ row }">{{ row.asyncPay ? '是' : '否' }}</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="combinationPayMode" title="组合支付" width="120">
|
||||
<template #default="{ row }">{{ row.combinationPayMode ? '是' : '否' }}</template>
|
||||
<vxe-column field="combinationPay" title="组合支付" width="120">
|
||||
<template #default="{ row }">{{ row.combinationPay ? '是' : '否' }}</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="asyncChannel" title="异步支付方式" width="160">
|
||||
<template #default="{ row }">{{ dictConvert('PayChannel', row.asyncChannel) || '无' }}</template>
|
||||
@@ -79,166 +79,166 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { $ref } from 'vue/macros'
|
||||
import { close, page, syncById } from './PayOrder.api'
|
||||
import useTablePage from '/@/hooks/bootx/useTablePage'
|
||||
import PayOrderInfo from './PayOrderInfo.vue'
|
||||
import RefundModel from './RefundModel.vue'
|
||||
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 { VxeTableInstance, VxeToolbarInstance, VxePager, VxeTable, VxeToolbar } from 'vxe-table'
|
||||
import ALink from '/@/components/Link/Link.vue'
|
||||
import { PayStatus } from '/@/enums/payment/PayStatus'
|
||||
import { LabeledValue } from 'ant-design-vue/lib/select'
|
||||
import PayChannelOrderList from './PayChannelOrderList.vue'
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { $ref } from 'vue/macros'
|
||||
import { close, page, syncById } from './PayOrder.api'
|
||||
import useTablePage from '/@/hooks/bootx/useTablePage'
|
||||
import PayOrderInfo from './PayOrderInfo.vue'
|
||||
import RefundModel from './RefundModel.vue'
|
||||
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 { VxeTableInstance, VxeToolbarInstance, VxePager, VxeTable, VxeToolbar } from 'vxe-table'
|
||||
import ALink from '/@/components/Link/Link.vue'
|
||||
import { PayStatus } from '/@/enums/payment/PayStatus'
|
||||
import { LabeledValue } from 'ant-design-vue/lib/select'
|
||||
import PayChannelOrderList from './PayChannelOrderList.vue'
|
||||
|
||||
// 使用hooks
|
||||
const { handleTableChange, pageQueryResHandel, sortChange, resetQueryParams, pagination, pages, sortParam, model, loading } =
|
||||
useTablePage(queryPage)
|
||||
const { notification, createMessage, createConfirm } = useMessage()
|
||||
const { dictConvert, dictDropDown } = useDict()
|
||||
// 使用hooks
|
||||
const { handleTableChange, pageQueryResHandel, sortChange, resetQueryParams, pagination, pages, sortParam, model, loading } =
|
||||
useTablePage(queryPage)
|
||||
const { notification, createMessage, createConfirm } = useMessage()
|
||||
const { dictConvert, dictDropDown } = useDict()
|
||||
|
||||
let cayChannelList = $ref<LabeledValue[]>([])
|
||||
let payStatusList = $ref<LabeledValue[]>([])
|
||||
let cayChannelList = $ref<LabeledValue[]>([])
|
||||
let payStatusList = $ref<LabeledValue[]>([])
|
||||
|
||||
// 查询条件
|
||||
const fields = computed(() => {
|
||||
return [
|
||||
{ field: 'id', type: STRING, name: '支付ID', placeholder: '请输入完整支付ID' },
|
||||
{ field: 'businessNo', type: STRING, name: '业务号', placeholder: '请输入业务号' },
|
||||
{ field: 'gatewayOrderNo', type: STRING, name: '网关订单号', placeholder: '请输入完整网关订单号' },
|
||||
{ field: 'title', type: STRING, name: '标题', placeholder: '请输入标题' },
|
||||
{ field: 'errorCode', name: '错误码', type: STRING },
|
||||
{ field: 'asyncChannel', name: '异步支付方式', type: LIST, selectList: cayChannelList },
|
||||
{ field: 'status', name: '支付状态', type: LIST, selectList: payStatusList },
|
||||
] as QueryField[]
|
||||
})
|
||||
|
||||
const xTable = $ref<VxeTableInstance>()
|
||||
const xToolbar = $ref<VxeToolbarInstance>()
|
||||
const payOrderInfo = $ref<any>()
|
||||
const payChannelOrderList = $ref<any>()
|
||||
const refundModel = $ref<any>()
|
||||
|
||||
onMounted(() => {
|
||||
initData()
|
||||
vxeBind()
|
||||
queryPage()
|
||||
})
|
||||
function vxeBind() {
|
||||
xTable?.connect(xToolbar as VxeToolbarInstance)
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
async function initData() {
|
||||
cayChannelList = await dictDropDown('AsyncChannel')
|
||||
payStatusList = await dictDropDown('PayStatus')
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
function queryPage() {
|
||||
loading.value = true
|
||||
page({
|
||||
...model.queryParam,
|
||||
...pages,
|
||||
...sortParam,
|
||||
}).then(({ data }) => {
|
||||
pageQueryResHandel(data)
|
||||
// 查询条件
|
||||
const fields = computed(() => {
|
||||
return [
|
||||
{ field: 'id', type: STRING, name: '支付ID', placeholder: '请输入完整支付ID' },
|
||||
{ field: 'businessNo', type: STRING, name: '业务号', placeholder: '请输入业务号' },
|
||||
{ field: 'gatewayOrderNo', type: STRING, name: '网关订单号', placeholder: '请输入完整网关订单号' },
|
||||
{ field: 'title', type: STRING, name: '标题', placeholder: '请输入标题' },
|
||||
{ field: 'errorCode', name: '错误码', type: STRING },
|
||||
{ field: 'asyncChannel', name: '异步支付方式', type: LIST, selectList: cayChannelList },
|
||||
{ field: 'status', name: '支付状态', type: LIST, selectList: payStatusList },
|
||||
] as QueryField[]
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看
|
||||
*/
|
||||
function show(record) {
|
||||
payOrderInfo.init(record.id)
|
||||
}
|
||||
/**
|
||||
* 查看
|
||||
*/
|
||||
function showChannel(record) {
|
||||
payChannelOrderList.init(record)
|
||||
}
|
||||
const xTable = $ref<VxeTableInstance>()
|
||||
const xToolbar = $ref<VxeToolbarInstance>()
|
||||
const payOrderInfo = $ref<any>()
|
||||
const payChannelOrderList = $ref<any>()
|
||||
const refundModel = $ref<any>()
|
||||
|
||||
/**
|
||||
* 同步信息
|
||||
*/
|
||||
function sync(record) {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '警告',
|
||||
content: '是否同步支付信息',
|
||||
onOk: () => {
|
||||
loading.value = true
|
||||
syncById(record.id).then(({ data }) => {
|
||||
// TODO 后期可以根据返回结果进行相应的处理
|
||||
createMessage.success('同步成功')
|
||||
console.log(data)
|
||||
queryPage()
|
||||
})
|
||||
},
|
||||
onMounted(() => {
|
||||
initData()
|
||||
vxeBind()
|
||||
queryPage()
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 关闭支付
|
||||
*/
|
||||
function closeOrder(record) {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '警告',
|
||||
content: '是否关闭支付订单',
|
||||
onOk: () => {
|
||||
close(record.id).then(() => {
|
||||
createMessage.success('关闭成功')
|
||||
queryPage()
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 退款
|
||||
*/
|
||||
function refund(record) {
|
||||
refundModel.init(record.id)
|
||||
}
|
||||
function vxeBind() {
|
||||
xTable?.connect(xToolbar as VxeToolbarInstance)
|
||||
}
|
||||
|
||||
function cellStyle({ row, column }) {
|
||||
if (column.field == 'status') {
|
||||
if (row.status == 'success') {
|
||||
return { color: 'green' }
|
||||
}
|
||||
if (row.status == 'fail') {
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
async function initData() {
|
||||
cayChannelList = await dictDropDown('AsyncChannel')
|
||||
payStatusList = await dictDropDown('PayStatus')
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
function queryPage() {
|
||||
loading.value = true
|
||||
page({
|
||||
...model.queryParam,
|
||||
...pages,
|
||||
...sortParam,
|
||||
}).then(({ data }) => {
|
||||
pageQueryResHandel(data)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看
|
||||
*/
|
||||
function show(record) {
|
||||
payOrderInfo.init(record.id)
|
||||
}
|
||||
/**
|
||||
* 查看
|
||||
*/
|
||||
function showChannel(record) {
|
||||
payChannelOrderList.init(record)
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步信息
|
||||
*/
|
||||
function sync(record) {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '警告',
|
||||
content: '是否同步支付信息',
|
||||
onOk: () => {
|
||||
loading.value = true
|
||||
syncById(record.id).then(({ data }) => {
|
||||
// TODO 后期可以根据返回结果进行相应的处理
|
||||
createMessage.success('同步成功')
|
||||
console.log(data)
|
||||
queryPage()
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 关闭支付
|
||||
*/
|
||||
function closeOrder(record) {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '警告',
|
||||
content: '是否关闭支付订单',
|
||||
onOk: () => {
|
||||
close(record.id).then(() => {
|
||||
createMessage.success('关闭成功')
|
||||
queryPage()
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 退款
|
||||
*/
|
||||
function refund(record) {
|
||||
refundModel.init(record.id)
|
||||
}
|
||||
|
||||
function cellStyle({ row, column }) {
|
||||
if (column.field == 'status') {
|
||||
if (row.status == 'success') {
|
||||
return { color: 'green' }
|
||||
}
|
||||
if (row.status == 'fail') {
|
||||
return { color: 'red' }
|
||||
}
|
||||
if (row.status == 'progress') {
|
||||
return { color: 'orange' }
|
||||
}
|
||||
if (row.status == 'close') {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
return { color: 'red' }
|
||||
}
|
||||
if (row.status == 'progress') {
|
||||
return { color: 'orange' }
|
||||
if (column.field == 'asyncPay') {
|
||||
if (row.asyncPay) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
}
|
||||
if (row.status == 'close') {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
return { color: 'red' }
|
||||
}
|
||||
if (column.field == 'asyncPay') {
|
||||
if (row.asyncPay) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
if (column.field == 'combinationPay') {
|
||||
if (row.combinationPay) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
}
|
||||
}
|
||||
if (column.field == 'combinationPayMode') {
|
||||
if (row.combinationPayMode) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
|
@@ -23,7 +23,7 @@
|
||||
>
|
||||
<vxe-column type="seq" title="序号" width="60" />
|
||||
<vxe-column field="id" title="退款ID" width="220" />
|
||||
<vxe-column field="refundTime" title="退款时间" sortable width="180"/>
|
||||
<vxe-column field="refundTime" title="退款时间" sortable width="180" />
|
||||
<vxe-column field="title" title="原支付标题" width="160" />
|
||||
<vxe-column field="paymentId" title="原支付ID" width="220">
|
||||
<template #default="{ row }">
|
||||
@@ -33,17 +33,17 @@
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="businessNo" title="原业务号" :visible="false" />
|
||||
<vxe-column field="amount" title="退款金额(分)" sortable width="140" />
|
||||
<vxe-column field="amount" title="退款金额(分)" sortable width="140" />
|
||||
<vxe-column field="refundableBalance" title="剩余可退金额(分)" sortable width="160" />
|
||||
<vxe-column field="async" title="包含异步通道" width="120">
|
||||
<template #default="{ row }">
|
||||
{{ row.asyncPay ? '是' : '否' }}
|
||||
{{ row.asyncPay ? '是' : '否' }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="gatewayOrderNo" title="支付网关订单号" :visible="false" width="220" />
|
||||
<vxe-column field="refundStatus" title="状态" width="80">
|
||||
<template #default="{ row }">
|
||||
{{ dictConvert('RefundStatus', row.status) }}
|
||||
{{ dictConvert('RefundStatus', row.status) }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="reason" title="原因" width="160" />
|
||||
@@ -217,36 +217,36 @@
|
||||
}
|
||||
|
||||
function cellStyle({ row, column }) {
|
||||
if (column.field == 'refundStatus') {
|
||||
if (row.status == 'success') {
|
||||
return { color: 'green' }
|
||||
}
|
||||
if (row.status == 'fail') {
|
||||
if (column.field == 'refundStatus') {
|
||||
if (row.status == 'success') {
|
||||
return { color: 'green' }
|
||||
}
|
||||
if (row.status == 'fail') {
|
||||
return { color: 'red' }
|
||||
}
|
||||
if (row.status == 'progress') {
|
||||
return { color: 'orange' }
|
||||
}
|
||||
if (row.status == 'close') {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
return { color: 'red' }
|
||||
}
|
||||
if (row.status == 'progress') {
|
||||
return { color: 'orange' }
|
||||
if (column.field == 'async') {
|
||||
if (row.asyncPay) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
}
|
||||
if (row.status == 'close') {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
return { color: 'red' }
|
||||
}
|
||||
if (column.field == 'async') {
|
||||
if (row.asyncPay) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
if (column.field == 'combinationPay') {
|
||||
if (row.combinationPay) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
}
|
||||
}
|
||||
if (column.field == 'combinationPayMode') {
|
||||
if (row.combinationPayMode) {
|
||||
return { color: 'green' }
|
||||
} else {
|
||||
return { color: 'gray' }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
|
Reference in New Issue
Block a user