Commit 8f02eae3fc0e281bd1cacda0cad5ee10e7214fc1

Authored by 庹加林
1 parent e274c08f

feat(web-payment): 新增三方交易流水查询功能

apps/web-payment/src/api/report.ts 0 → 100644
  1 +import { requestClient } from '#/api/request';
  2 +
  3 +export async function getPayRecordList(data: any) {
  4 + return requestClient.post<any>(
  5 + '/onlinePayment/report/listDetail/loadData',
  6 + data,
  7 + { responseReturn: 'body' },
  8 + );
  9 +}
apps/web-payment/src/router/routes/core.ts
@@ -52,6 +52,14 @@ const coreRoutes: RouteRecordRaw[] = [ @@ -52,6 +52,14 @@ const coreRoutes: RouteRecordRaw[] = [
52 title: '支付成功', 52 title: '支付成功',
53 }, 53 },
54 }, 54 },
  55 + {
  56 + name: 'ThirdPayRecord',
  57 + path: '/report/thirdPayRecord',
  58 + component: () => import('#/views/report/thirdPayRecord/index.vue'),
  59 + meta: {
  60 + title: '三方交易流水查询',
  61 + },
  62 + },
55 ]; 63 ];
56 64
57 export { coreRoutes, fallbackNotFoundRoute }; 65 export { coreRoutes, fallbackNotFoundRoute };
apps/web-payment/src/views/report/thirdPayRecord/index.vue 0 → 100644
  1 +<script lang="ts" setup>
  2 +import type { VbenFormProps } from '#/adapter/form';
  3 +import type { VxeGridProps } from '#/adapter/vxe-table';
  4 +
  5 +import dayjs from 'dayjs';
  6 +
  7 +import { useVbenVxeGrid } from '#/adapter/vxe-table';
  8 +import { getPayRecordList } from '#/api/report';
  9 +
  10 +const formOptions: VbenFormProps = {
  11 + // 默认展开
  12 + collapsed: false,
  13 + schema: [
  14 + {
  15 + component: 'Input',
  16 + fieldName: 'customerName',
  17 + label: '客户',
  18 + componentProps: {
  19 + placeholder: '请输入客户名称',
  20 + clearable: true,
  21 + },
  22 + },
  23 + {
  24 + component: 'Input',
  25 + fieldName: 'paymentId',
  26 + label: '交易订单号',
  27 + componentProps: {
  28 + placeholder: '请输入交易订单号',
  29 + clearable: true,
  30 + },
  31 + },
  32 + {
  33 + component: 'Input',
  34 + fieldName: 'serialNo',
  35 + label: '业务单号',
  36 + componentProps: {
  37 + placeholder: '请输入业务单号',
  38 + clearable: true,
  39 + },
  40 + },
  41 + {
  42 + component: 'Select',
  43 + componentProps: {
  44 + multiple: true,
  45 + options: [
  46 + { value: 10, label: '微信支付' },
  47 + { value: 11, label: '支付宝支付' },
  48 + { value: 19, label: '园区卡支付' },
  49 + { value: 20, label: '工商银行' },
  50 + { value: 21, label: '农业银行' },
  51 + { value: 22, label: '中国银行' },
  52 + { value: 23, label: '建设银行' },
  53 + { value: 24, label: '交通银行' },
  54 + { value: 25, label: '中信银行' },
  55 + { value: 27, label: '招商银行' },
  56 + { value: 28, label: '盛京银行' },
  57 + { value: 29, label: '农商银行' },
  58 + { value: 30, label: '杭州银行' },
  59 + ],
  60 + },
  61 + fieldName: 'channelIdList',
  62 + label: '支付通道',
  63 + },
  64 + {
  65 + component: 'Select',
  66 + componentProps: {
  67 + multiple: true,
  68 + options: [
  69 + { value: 0, label: '未知方式' },
  70 + { value: 10, label: '微信支付' },
  71 + { value: 11, label: '支付宝支付' },
  72 + { value: 12, label: '银联支付' },
  73 + { value: 13, label: '掌银支付' },
  74 + { value: 19, label: '园区卡支付' },
  75 + { value: 20, label: '银行卡支付' },
  76 + ],
  77 + },
  78 + fieldName: 'outPayTypeList',
  79 + label: '支付方式',
  80 + },
  81 + {
  82 + component: 'Select',
  83 + componentProps: {
  84 + multiple: true,
  85 + options: [
  86 + { value: 10, label: '交易' },
  87 + { value: 20, label: '退款' },
  88 + ],
  89 + },
  90 + fieldName: 'tradeTypeList',
  91 + label: '交易类型',
  92 + },
  93 + {
  94 + component: 'Select',
  95 + componentProps: {
  96 + multiple: true,
  97 + options: [{ value: 10, label: '大润发' }],
  98 + },
  99 + fieldName: 'sourceList',
  100 + label: '来源',
  101 + },
  102 + {
  103 + component: 'Select',
  104 + componentProps: {
  105 + multiple: true,
  106 + options: [
  107 + { value: 1, label: '待处理' },
  108 + { value: 4, label: '交易成功' },
  109 + { value: 5, label: '交易退款' },
  110 + { value: 6, label: '交易失败' },
  111 + { value: 7, label: '交易关闭' },
  112 + ],
  113 + },
  114 + fieldName: 'stateList',
  115 + label: '支付状态',
  116 + },
  117 + {
  118 + component: 'DatePicker',
  119 + fieldName: 'createTime',
  120 + label: '创建时间',
  121 + componentProps: {
  122 + type: 'daterange',
  123 + // clearable: false,
  124 + },
  125 + defaultValue: [
  126 + dayjs().format('YYYY-MM-DD'),
  127 + dayjs().format('YYYY-MM-DD'),
  128 + ],
  129 + },
  130 + {
  131 + component: 'DatePicker',
  132 + fieldName: 'payTime',
  133 + label: '支付时间',
  134 + componentProps: {
  135 + type: 'daterange',
  136 + // clearable: false,
  137 + },
  138 + },
  139 + ],
  140 + // 控制表单是否显示折叠按钮
  141 + showCollapseButton: true,
  142 + submitButtonOptions: {
  143 + content: '查询',
  144 + },
  145 + // 是否在字段值改变时提交表单
  146 + submitOnChange: false,
  147 + // 按下回车时是否提交表单
  148 + submitOnEnter: false,
  149 + wrapperClass:
  150 + 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4',
  151 +};
  152 +
  153 +const gridOptions: VxeGridProps = {
  154 + checkboxConfig: {
  155 + highlight: true,
  156 + labelField: 'name',
  157 + },
  158 + columns: [
  159 + { field: 'paymentId', title: '交易订单号', width: 160 },
  160 + { field: 'serialNo', title: '业务单号', width: 160 },
  161 + // { field: 'customerCode', title: '客户编号' },
  162 + { field: 'customerName', title: '客户名称' },
  163 + { field: 'channelName', title: '支付通道' },
  164 + { field: 'outPayTypeName', title: '支付方式' },
  165 + { field: 'tradeTypeName', title: '支付类型' },
  166 + { field: 'goods', title: '商品', width: 160 },
  167 + { field: 'mchName', title: '商户名称', width: 160 },
  168 + { field: 'amountText', title: '交易金额' },
  169 + { field: 'payTime', title: '支付时间', width: 160 },
  170 + { field: 'createdTime', title: '创建时间', width: 160 },
  171 + { field: 'modifiedTime', title: '修改时间', width: 160 },
  172 + { field: 'stateName', title: '状态' },
  173 + { field: 'sourceName', title: '来源' },
  174 + { field: 'description', title: '说明' },
  175 + ],
  176 + keepSource: true,
  177 + border: true,
  178 + proxyConfig: {
  179 + ajax: {
  180 + query: async ({ page }, formValues) => {
  181 + try {
  182 + const res = await getPayRecordList({
  183 + mchId: 1001,
  184 + pageNo: page.currentPage,
  185 + pageSize: page.pageSize,
  186 + startTime: formValues.createTime
  187 + ? `${dayjs(formValues.createTime[0]).format('YYYY-MM-DD')} 00:00:00`
  188 + : '',
  189 + endTime: formValues.createTime
  190 + ? `${dayjs(formValues.createTime[1]).format('YYYY-MM-DD')} 23:59:59`
  191 + : '',
  192 + startPayTime: formValues.payTime
  193 + ? `${dayjs(formValues.payTime[0]).format('YYYY-MM-DD')} 00:00:00`
  194 + : '',
  195 + endPayTime: formValues.payTime
  196 + ? `${dayjs(formValues.payTime[1]).format('YYYY-MM-DD')} 23:59:59`
  197 + : '',
  198 + ...formValues,
  199 + });
  200 + return {
  201 + items: res.data,
  202 + total: res.total,
  203 + };
  204 + } catch (error) {
  205 + console.warn(error);
  206 + }
  207 + },
  208 + },
  209 + },
  210 +};
  211 +
  212 +const [Grid] = useVbenVxeGrid({ formOptions, gridOptions });
  213 +</script>
  214 +
  215 +<template>
  216 + <div class="vp-raw w-full">
  217 + <Grid />
  218 + </div>
  219 +</template>
vben-admin.code-workspace
1 { 1 {
2 "folders": [ 2 "folders": [
3 { 3 {
4 - "name": "@vben/backend-mock",  
5 - "path": "apps/backend-mock",  
6 - },  
7 - {  
8 - "name": "@vben/web-antd",  
9 - "path": "apps/web-antd",  
10 - },  
11 - {  
12 "name": "@vben/web-payment", 4 "name": "@vben/web-payment",
13 "path": "apps/web-payment", 5 "path": "apps/web-payment",
14 }, 6 },
15 { 7 {
16 - "name": "@vben/web-naive",  
17 - "path": "apps/web-naive",  
18 - },  
19 - {  
20 - "name": "@vben/web-tdesign",  
21 - "path": "apps/web-tdesign",  
22 - },  
23 - {  
24 "name": "@vben/docs", 8 "name": "@vben/docs",
25 "path": "docs", 9 "path": "docs",
26 }, 10 },