From 7cb859e976abde3df874760c1cf509566d9427ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=9C=E6=96=B9=E7=99=BD?= <457776125@qq.com> Date: Mon, 10 Apr 2023 22:29:50 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E9=87=8D=E6=9E=84=E3=80=91Vue3=20?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0=EF=BC=9A[=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E7=AE=A1=E7=90=86=20->=20=E5=BA=94=E7=94=A8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF][=E6=94=AF=E4=BB=98=E7=AE=A1=E7=90=86=20->=20?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E8=AE=A2=E5=8D=95][=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20->=20=E9=80=80=E6=AC=BE=E8=AE=A2=E5=8D=95]?= =?UTF-8?q?=20=E4=BD=BF=E7=94=A8=20Element=20Plus=20=E5=8E=9F=E7=94=9F?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/constants.ts | 4 + src/views/pay/app/AppForm.vue | 158 ++++++++ src/views/pay/app/app.data.ts | 71 ---- src/views/pay/app/index.vue | 584 +++++++++++++++++++++------- src/views/pay/order/index.vue | 406 ++++++++++++++++--- src/views/pay/order/order.data.ts | 152 -------- src/views/pay/order/orderForm.vue | 152 ++++++++ src/views/pay/refund/index.vue | 394 ++++++++++++++++--- src/views/pay/refund/refund.data.ts | 173 -------- src/views/pay/refund/refundForm.vue | 154 ++++++++ 10 files changed, 1610 insertions(+), 638 deletions(-) create mode 100644 src/views/pay/app/AppForm.vue delete mode 100644 src/views/pay/app/app.data.ts delete mode 100644 src/views/pay/order/order.data.ts create mode 100644 src/views/pay/order/orderForm.vue delete mode 100644 src/views/pay/refund/refund.data.ts create mode 100644 src/views/pay/refund/refundForm.vue diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 901c04e9..5cda391f 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -114,6 +114,10 @@ export const PayChannelEnum = { ALIPAY_QR: { code: 'alipay_qr', name: '支付宝扫码支付' + }, + ALIPAY_BAR: { + code: 'alipay_bar', + name: '支付宝条码支付' } } diff --git a/src/views/pay/app/AppForm.vue b/src/views/pay/app/AppForm.vue new file mode 100644 index 00000000..cacf49b2 --- /dev/null +++ b/src/views/pay/app/AppForm.vue @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + {{ dict.label }} + + + + + + + + + + + + + + + 确 定 + 取 消 + + + + diff --git a/src/views/pay/app/app.data.ts b/src/views/pay/app/app.data.ts deleted file mode 100644 index 30f14180..00000000 --- a/src/views/pay/app/app.data.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 - -// 表单校验 -export const rules = reactive({ - name: [required], - status: [required], - payNotifyUrl: [required], - refundNotifyUrl: [required], - merchantId: [required] -}) - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'seq', - primaryTitle: '编号', - action: true, - columns: [ - { - title: '应用名', - field: 'name', - isSearch: true - }, - { - title: '商户名称', - field: 'payMerchant', - isSearch: true - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: '支付结果的回调地址', - field: 'payNotifyUrl', - isSearch: true - }, - { - title: '退款结果的回调地址', - field: 'refundNotifyUrl', - isSearch: true - }, - { - title: '商户名称', - field: 'merchantName', - isSearch: true - }, - { - title: '备注', - field: 'remark', - isTable: false, - isSearch: true - }, - { - title: t('common.createTime'), - field: 'createTime', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/pay/app/index.vue b/src/views/pay/app/index.vue index 77b78170..0c510b8f 100644 --- a/src/views/pay/app/index.vue +++ b/src/views/pay/app/index.vue @@ -1,155 +1,475 @@ + - - - - - + + + + + + + + + + + + + + + + + + + 搜索 + + + + 重置 + + - - - - - - - - - - - - + plain + @click="openForm('create')" + v-hasPermi="['system:tenant:create']" + > + + 新增 + + + + 导出 + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + 编辑 + + + 删除 + + + + + + + + + + - diff --git a/src/views/pay/order/index.vue b/src/views/pay/order/index.vue index 21b8cca4..f70801d3 100644 --- a/src/views/pay/order/index.vue +++ b/src/views/pay/order/index.vue @@ -1,79 +1,359 @@ - - - - - + + { + queryParams.merchantId = null + } + " + filterable + remote + reserve-keyword + placeholder="请选择所属商户" + @change="handleGetAppListByMerchantId" + :remote-method="handleGetMerchantListByName" + :loading="merchantLoading" + > + + + + + + + + + + { + queryParams.channelCode = null + } + " + > + + + + + - - + + - - - - + + + + + + + + + + + + + + + + + - - + + + + + 搜索 + + + + 重置 + + + + 导出 + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + 商户 + {{ scope.row.merchantOrderId }} + + + 支付 + {{ scope.row.channelOrderNo }} + + + + + + ¥{{ parseFloat(scope.row.amount / 100).toFixed(2) }} + + + + + ¥{{ parseFloat(scope.row.channelFeeAmount / 100).toFixed(2) }} + + + + + ¥{{ parseFloat(scope.row.refundAmount / 100).toFixed(2) }} + + + + + + + + + + + + + + + + + 查看详情 + + + + + + + + + + + - + + diff --git a/src/views/pay/order/order.data.ts b/src/views/pay/order/order.data.ts deleted file mode 100644 index 7b993088..00000000 --- a/src/views/pay/order/order.data.ts +++ /dev/null @@ -1,152 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 - -// 表单校验 -export const rules = reactive({ - merchantId: [required], - appId: [required], - merchantOrderId: [required], - subject: [required], - body: [required], - notifyUrl: [required], - notifyStatus: [required], - amount: [required], - status: [required], - userIp: [required], - expireTime: [required], - refundStatus: [required], - refundTimes: [required], - refundAmount: [required] -}) -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'seq', - primaryTitle: '岗位编号', - action: true, - columns: [ - { - title: '商户编号', - field: 'merchantId', - isSearch: true - }, - { - title: '应用编号', - field: 'appId', - isSearch: true - }, - { - title: '渠道编号', - field: 'channelId' - }, - { - title: '渠道编码', - field: 'channelCode', - isSearch: true - }, - { - title: '渠道订单号', - field: 'merchantOrderId', - isSearch: true - }, - { - title: '商品标题', - field: 'subject' - }, - { - title: '商品描述', - field: 'body' - }, - { - title: '异步通知地址', - field: 'notifyUrl' - }, - { - title: '回调状态', - field: 'notifyStatus', - dictType: DICT_TYPE.PAY_ORDER_NOTIFY_STATUS, - dictClass: 'number' - }, - { - title: '支付金额', - field: 'amount', - isSearch: true - }, - { - title: '渠道手续费', - field: 'channelFeeRate', - isSearch: true - }, - { - title: '渠道手续金额', - field: 'channelFeeAmount', - isSearch: true - }, - { - title: '支付状态', - field: 'status', - dictType: DICT_TYPE.PAY_ORDER_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: '用户 IP', - field: 'userIp' - }, - { - title: '订单失效时间', - field: 'expireTime', - formatter: 'formatDate' - }, - { - title: '支付时间', - field: 'successTime', - formatter: 'formatDate' - }, - { - title: '支付通知时间', - field: 'notifyTime', - formatter: 'formatDate' - }, - { - title: '拓展编号', - field: 'successExtensionId' - }, - { - title: '退款状态', - field: 'refundStatus', - dictType: DICT_TYPE.PAY_ORDER_REFUND_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: '退款次数', - field: 'refundTimes' - }, - { - title: '退款总金额', - field: 'refundAmount' - }, - { - title: '渠道用户编号', - field: 'channelUserId' - }, - { - title: '渠道订单号', - field: 'channelOrderNo' - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/pay/order/orderForm.vue b/src/views/pay/order/orderForm.vue new file mode 100644 index 00000000..f9625085 --- /dev/null +++ b/src/views/pay/order/orderForm.vue @@ -0,0 +1,152 @@ + + + + {{ orderDetail.merchantName }} + {{ orderDetail.appName }} + {{ orderDetail.subject }} + + + + + {{ orderDetail.merchantOrderId }} + + + {{ orderDetail.channelOrderNo }} + + + + {{ orderDetail.payOrderExtension.no }} + + + + {{ parseFloat(orderDetail.amount / 100, 2) }} + + + {{ parseFloat(orderDetail.channelFeeAmount / 100, 2) }} + + + + {{ parseFloat(orderDetail.channelFeeRate / 100, 2) }}% + + + + + + + + {{ orderDetail.notifyUrl }} + + {{ formatDate(orderDetail.createTime) }} + + + {{ formatDate(orderDetail.successTime) }} + + + {{ formatDate(orderDetail.expireTime) }} + + + {{ formatDate(orderDetail.notifyTime) }} + + + + + {{ orderDetail.channelCodeName }} + + {{ orderDetail.userIp }} + + + + {{ orderDetail.refundTimes }} + + + {{ parseFloat(orderDetail.refundAmount / 100, 2) }} + + + + + + + {{ orderDetail.body }} + + + {{ orderDetail.payOrderExtension.channelNotifyData }} + + + + + + diff --git a/src/views/pay/refund/index.vue b/src/views/pay/refund/index.vue index ec8bf12c..b8a949e7 100644 --- a/src/views/pay/refund/index.vue +++ b/src/views/pay/refund/index.vue @@ -1,59 +1,359 @@ - - - - - + + + { + queryParams.merchantId = null + } + " + filterable + remote + reserve-keyword + placeholder="请选择所属商户" + @change="handleGetAppListByMerchantId" + :remote-method="handleGetMerchantListByName" + :loading="merchantLoading" + > + + + + + + + + + + { + queryParams.channelCode = null + } + " + > + + + + + + + + + + - - - - + + + + + + + + + + + + - - + + + + + 搜索 + + + + 重置 + + + + 导出 + + + - - - - - - - {{ t('dialog.close') }} - - + + + + + + + + + + + 退款 + {{ scope.row.merchantRefundNo }} + + + 交易 + {{ scope.row.merchantOrderId }} + + + + + + + 交易 + {{ scope.row.tradeNo }} + + + 渠道 + {{ scope.row.channelOrderNo }} + + + + + + ¥{{ parseFloat(scope.row.payAmount / 100).toFixed(2) }} + + + + + ¥{{ parseFloat(scope.row.refundAmount / 100).toFixed(2) }} + + + + + + + + + + + + + + + + + + + + + + + 查看详情 + + + + + + + + + + - + + diff --git a/src/views/pay/refund/refund.data.ts b/src/views/pay/refund/refund.data.ts deleted file mode 100644 index 456f441d..00000000 --- a/src/views/pay/refund/refund.data.ts +++ /dev/null @@ -1,173 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'seq', - primaryTitle: '序号', - action: true, - columns: [ - { - title: '商户编号', - field: 'merchantId', - isSearch: true - }, - { - title: '应用编号', - field: 'appId', - isSearch: true - }, - { - title: '渠道编号', - field: 'channelId', - isSearch: true - }, - { - title: '渠道编码', - field: 'channelCode', - dictType: DICT_TYPE.PAY_CHANNEL_CODE_TYPE, - dictClass: 'number', - isSearch: true - }, - { - title: '支付订单编号', - field: 'orderId', - isSearch: true - }, - { - title: '交易订单号', - field: 'tradeNo', - isSearch: true - }, - { - title: '商户订单号', - field: 'merchantOrderId', - isSearch: true - }, - { - title: '商户退款单号', - field: 'merchantRefundNo', - isSearch: true - }, - { - title: '回调地址', - field: 'notifyUrl', - isSearch: true - }, - { - title: '回调状态', - field: 'notifyStatus', - dictType: DICT_TYPE.PAY_ORDER_NOTIFY_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: '退款类型', - field: 'type', - dictType: DICT_TYPE.PAY_REFUND_ORDER_TYPE, - dictClass: 'number', - isSearch: true - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.PAY_REFUND_ORDER_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: '支付金额', - field: 'payAmount', - formatter: 'formatAmount', - isSearch: true - }, - { - title: '退款金额', - field: 'refundAmount', - formatter: 'formatAmount', - isSearch: true - }, - { - title: '退款原因', - field: 'reason', - isSearch: true - }, - { - title: '用户IP', - field: 'userIp', - isSearch: true - }, - { - title: '渠道订单号', - field: 'channelOrderNo', - isSearch: true - }, - { - title: '渠道退款单号', - field: 'channelRefundNo', - isSearch: true - }, - { - title: '渠道调用报错时', - field: 'channelErrorCode' - }, - { - title: '渠道调用报错时', - field: 'channelErrorMsg' - }, - { - title: '支付渠道的额外参数', - field: 'channelExtras' - }, - { - title: '退款失效时间', - field: 'expireTime', - formatter: 'formatDate', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: '退款成功时间', - field: 'successTime', - formatter: 'formatDate', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: '退款通知时间', - field: 'notifyTime', - formatter: 'formatDate', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/pay/refund/refundForm.vue b/src/views/pay/refund/refundForm.vue new file mode 100644 index 00000000..cc9d8726 --- /dev/null +++ b/src/views/pay/refund/refundForm.vue @@ -0,0 +1,154 @@ + + + + {{ refundDetail.merchantName }} + {{ refundDetail.appName }} + {{ refundDetail.subject }} + + + + + {{ refundDetail.merchantRefundNo }} + + {{ refundDetail.merchantOrderId }} + + {{ refundDetail.tradeNo }} + + + + + {{ parseFloat(refundDetail.payAmount / 100).toFixed(2) }} + + + + {{ parseFloat(refundDetail.refundAmount / 100).toFixed(2) }} + + + + + + + + + {{ formatDate(refundDetail.createTime) }} + + {{ formatDate(refundDetail.successTime) }} + + {{ formatDate(refundDetail.expireTime) }} + + {{ formatDate(refundDetail.updateTime) }} + + + + + + {{ refundDetail.channelCodeName }} + + + {{ refundDetail.userIp }} + + {{ refundDetail.notifyUrl }} + + + + {{ formatDate(refundDetail.notifyTime) }} + + + + + {{ refundDetail.channelOrderNo }} + + {{ refundDetail.channelRefundNo }} + + {{ refundDetail.channelErrorCode }} + + {{ refundDetail.channelErrorMsg }} + + + + + {{ refundDetail.channelExtras }} + + {{ refundDetail.reason }} + + + + + +
+ 商户 + {{ scope.row.merchantOrderId }} +
+ 支付 + {{ scope.row.channelOrderNo }} +
+ 退款 + {{ scope.row.merchantRefundNo }} +
+ 交易 + {{ scope.row.merchantOrderId }} +
+ 交易 + {{ scope.row.tradeNo }} +
+ 渠道 + {{ scope.row.channelOrderNo }} +