feat 微信支付宝流水记录

This commit is contained in:
xxm1995
2024-02-20 17:05:55 +08:00
parent 899aafd696
commit 5dd2a8a3ec
10 changed files with 476 additions and 8 deletions

View File

@@ -0,0 +1,41 @@
import { defHttp } from '/@/utils/http/axios'
import { Result, PageResult } from '/#/axios'
import { BaseEntity } from '/#/web'
/**
* 分页
*/
export function page(params) {
return defHttp.get<Result<PageResult<AlipayRecord>>>({
url: '/alipay/record/page',
params,
})
}
/**
* 获取详情
*/
export function get(id) {
return defHttp.get<Result<AlipayRecord>>({
url: '/alipay/record/findById',
params: { id },
})
}
/**
* 记录
*/
export interface AlipayRecord extends BaseEntity {
// 标题
title?: string
// 业务类型
type?: string
// 金额
amount?: string
// 交易订单号
orderId?: string
// 交易订单号
gatewayOrderNo?: string
// 终端ip
ip?: string
}

View File

@@ -0,0 +1,87 @@
<template>
<basic-modal
title="查看"
v-bind="$attrs"
:loading="confirmLoading"
:width="modalWidth"
:visible="visible"
:mask-closable="showable"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-descriptions bordered title="" :column="{ md: 1, sm: 1, xs: 1 }">
<a-descriptions-item label="标题">
{{ alipayRecord.title }}
</a-descriptions-item>
<a-descriptions-item label="金额(分)">
{{ alipayRecord.amount }}
</a-descriptions-item>
<a-descriptions-item label="本地订单号">
{{ alipayRecord.orderId }}
</a-descriptions-item>
<a-descriptions-item label="网关订单号">
{{ alipayRecord.gatewayOrderNo }}
</a-descriptions-item>
<a-descriptions-item label="业务类型">
<a-tag>{{ dictConvert('AlipayRecordType', alipayRecord.type) }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="记录时间">
{{ alipayRecord.createTime }}
</a-descriptions-item>
</a-descriptions>
</a-spin>
<template #footer>
<a-button key="cancel" @click="handleCancel">取消</a-button>
</template>
</basic-modal>
</template>
<script setup lang="ts">
import { get, AlipayRecord } from './AlipayRecord.api'
import { $ref } from 'vue/macros'
import { BasicModal } from '/@/components/Modal'
import useFormEdit from '/@/hooks/bootx/useFormEdit'
import { useDict } from '/@/hooks/bootx/useDict'
const {
initFormEditType,
handleCancel,
search,
labelCol,
wrapperCol,
modalWidth,
title,
confirmLoading,
visible,
editable,
showable,
formEditType,
} = useFormEdit()
const { dictConvert } = useDict()
let loading = $ref(false)
let alipayRecord = $ref<AlipayRecord>({})
/**
* 入口
*/
function init(record: AlipayRecord) {
visible.value = true
alipayRecord = record
initData(record.id as string)
}
/**
* 初始化数据
*/
async function initData(alipayId) {
loading = true
const { data } = await get(alipayId)
loading = false
alipayRecord = data
}
defineExpose({ init })
</script>
<style scoped lang="less"></style>

View File

@@ -0,0 +1,110 @@
<template>
<div>
<div class="m-3 p-3 pt-5 bg-white">
<b-query :query-params="model.queryParam" :fields="fields" @query="queryPage" @reset="resetQueryParams" />
</div>
<div class="m-3 p-3 bg-white">
<vxe-toolbar ref="xToolbar" custom :refresh="{ queryMethod: queryPage }" />
<vxe-table
row-id="id"
ref="xTable"
:data="pagination.records"
:loading="loading"
:sort-config="{ remote: true, trigger: 'cell' }"
@sort-change="sortChange"
>
<vxe-column type="seq" title="序号" width="60" />
<vxe-column field="title" title="标题" />
<vxe-column field="type" title="类型">
<template #default="{ row }">
<a-tag>{{ dictConvert('AlipayRecordType', row.type) }}</a-tag>
</template>
</vxe-column>
<vxe-column field="amount" title="金额" />
<vxe-column field="orderId" title="本地订单ID" width="170" />
<vxe-column field="orderId" title="网关订单号" width="170" />
<vxe-column field="createTime" title="记录时间" sortable />
<vxe-column fixed="right" width="50" :showOverflow="false" title="操作">
<template #default="{ row }">
<a-link @click="show(row)">查看</a-link>
</template>
</vxe-column>
</vxe-table>
<vxe-pager
size="medium"
:loading="loading"
:current-page="pagination.current"
:page-size="pagination.size"
:total="pagination.total"
@page-change="handleTableChange"
/>
<alipay-record-info ref="alipayRecordInfo" />
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted } from 'vue'
import { $ref } from 'vue/macros'
import { page } from './AlipayRecord.api'
import useTablePage from '/@/hooks/bootx/useTablePage'
import { VxeTable, VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
import { useMessage } from '/@/hooks/web/useMessage'
import { useDict } from '/@/hooks/bootx/useDict'
import AlipayRecordInfo from './AlipayRecordInfo.vue'
import ALink from '/@/components/Link/Link.vue'
import BQuery from '/@/components/Bootx/Query/BQuery.vue'
import { STRING } from '/@/components/Bootx/Query/Query'
// 使用hooks
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, sortChange, sortParam, pages, model, loading } =
useTablePage(queryPage)
const { notification, createMessage, createConfirm } = useMessage()
const { dictConvert, dictDropDown } = useDict()
let alipayRecordInfo = $ref<any>()
const xTable = $ref<VxeTableInstance>()
const xToolbar = $ref<VxeToolbarInstance>()
const fields = [
{ field: 'title', type: STRING, name: '标题', placeholder: '请输入标题' },
{ field: 'orderId', type: STRING, name: '本地订单ID', placeholder: '请输入完整本地订单ID' },
{ field: 'gatewayOrderNo', type: STRING, name: '网关订单号', placeholder: '请输入完整网关订单号' },
]
onMounted(() => {
vxeBind()
queryPage()
})
/**
* 绑定
*/
function vxeBind() {
xTable?.connect(xToolbar as VxeToolbarInstance)
}
/**
* 查看
*/
function show(record) {
alipayRecordInfo.init(record)
}
/**
* 分页查询
*/
function queryPage() {
loading.value = true
page({
...model.queryParam,
...pages,
...sortParam,
}).then(({ data }) => {
pageQueryResHandel(data)
})
return Promise.resolve()
}
</script>
<style scoped lang="less"></style>

View File

@@ -28,9 +28,6 @@
<a-descriptions-item label="业务类型">
<a-tag>{{ dictConvert('VoucherRecordType', voucherRecord.type) }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="备注">
{{ voucherRecord.remark }}
</a-descriptions-item>
<a-descriptions-item label="导入时间">
{{ voucherRecord.createTime }}
</a-descriptions-item>

View File

@@ -18,7 +18,6 @@
</vxe-column>
<vxe-column field="amount" title="金额" />
<vxe-column field="orderId" title="订单号" />
<vxe-column field="remark" title="备注" />
<vxe-column field="createTime" title="创建时间" sortable />
<vxe-column fixed="right" width="50" :showOverflow="false" title="操作">
<template #default="{ row }">

View File

@@ -28,9 +28,6 @@
<a-descriptions-item label="业务类型">
<a-tag>{{ dictConvert('WalletRecordType', walletRecord.type) }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="备注">
{{ walletRecord.remark }}
</a-descriptions-item>
<a-descriptions-item label="记录时间">
{{ walletRecord.createTime }}
</a-descriptions-item>

View File

@@ -18,7 +18,6 @@
</vxe-column>
<vxe-column field="amount" title="金额" />
<vxe-column field="orderId" title="订单号" />
<vxe-column field="remark" title="备注" />
<vxe-column field="createTime" title="记录时间" sortable />
<vxe-column fixed="right" width="50" :showOverflow="false" title="操作">
<template #default="{ row }">

View File

@@ -0,0 +1,41 @@
import { defHttp } from '/@/utils/http/axios'
import { Result, PageResult } from '/#/axios'
import { BaseEntity } from '/#/web'
/**
* 分页
*/
export function page(params) {
return defHttp.get<Result<PageResult<WechatPayRecord>>>({
url: '/alipay/record/page',
params,
})
}
/**
* 获取详情
*/
export function get(id) {
return defHttp.get<Result<WechatPayRecord>>({
url: '/alipay/record/findById',
params: { id },
})
}
/**
* 记录
*/
export interface WechatPayRecord extends BaseEntity {
// 标题
title?: string
// 业务类型
type?: string
// 金额
amount?: string
// 交易订单号
orderId?: string
// 交易订单号
gatewayOrderNo?: string
// 终端ip
ip?: string
}

View File

@@ -0,0 +1,87 @@
<template>
<basic-modal
title="查看"
v-bind="$attrs"
:loading="confirmLoading"
:width="modalWidth"
:visible="visible"
:mask-closable="showable"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-descriptions bordered title="" :column="{ md: 1, sm: 1, xs: 1 }">
<a-descriptions-item label="标题">
{{ wechatPayRecord.title }}
</a-descriptions-item>
<a-descriptions-item label="金额(分)">
{{ wechatPayRecord.amount }}
</a-descriptions-item>
<a-descriptions-item label="本地订单号">
{{ wechatPayRecord.orderId }}
</a-descriptions-item>
<a-descriptions-item label="网关订单号">
{{ wechatPayRecord.gatewayOrderNo }}
</a-descriptions-item>
<a-descriptions-item label="业务类型">
<a-tag>{{ dictConvert('WechatPayRecordType', wechatPayRecord.type) }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="记录时间">
{{ wechatPayRecord.createTime }}
</a-descriptions-item>
</a-descriptions>
</a-spin>
<template #footer>
<a-button key="cancel" @click="handleCancel">取消</a-button>
</template>
</basic-modal>
</template>
<script setup lang="ts">
import { get, WechatPayRecord } from './WechatPayRecord.api'
import { $ref } from 'vue/macros'
import { BasicModal } from '/@/components/Modal'
import useFormEdit from '/@/hooks/bootx/useFormEdit'
import { useDict } from '/@/hooks/bootx/useDict'
const {
initFormEditType,
handleCancel,
search,
labelCol,
wrapperCol,
modalWidth,
title,
confirmLoading,
visible,
editable,
showable,
formEditType,
} = useFormEdit()
const { dictConvert } = useDict()
let loading = $ref(false)
let wechatPayRecord = $ref<WechatPayRecord>({})
/**
* 入口
*/
function init(record: WechatPayRecord) {
visible.value = true
wechatPayRecord = record
initData(record.id as string)
}
/**
* 初始化数据
*/
async function initData(wechatPayId) {
loading = true
const { data } = await get(wechatPayId)
loading = false
wechatPayRecord = data
}
defineExpose({ init })
</script>
<style scoped lang="less"></style>

View File

@@ -0,0 +1,110 @@
<template>
<div>
<div class="m-3 p-3 pt-5 bg-white">
<b-query :query-params="model.queryParam" :fields="fields" @query="queryPage" @reset="resetQueryParams" />
</div>
<div class="m-3 p-3 bg-white">
<vxe-toolbar ref="xToolbar" custom :refresh="{ queryMethod: queryPage }" />
<vxe-table
row-id="id"
ref="xTable"
:data="pagination.records"
:loading="loading"
:sort-config="{ remote: true, trigger: 'cell' }"
@sort-change="sortChange"
>
<vxe-column type="seq" title="序号" width="60" />
<vxe-column field="title" title="标题" />
<vxe-column field="type" title="类型">
<template #default="{ row }">
<a-tag>{{ dictConvert('WechatPayRecordType', row.type) }}</a-tag>
</template>
</vxe-column>
<vxe-column field="amount" title="金额" />
<vxe-column field="orderId" title="本地订单ID" width="170" />
<vxe-column field="orderId" title="网关订单号" width="170" />
<vxe-column field="createTime" title="记录时间" sortable />
<vxe-column fixed="right" width="50" :showOverflow="false" title="操作">
<template #default="{ row }">
<a-link @click="show(row)">查看</a-link>
</template>
</vxe-column>
</vxe-table>
<vxe-pager
size="medium"
:loading="loading"
:current-page="pagination.current"
:page-size="pagination.size"
:total="pagination.total"
@page-change="handleTableChange"
/>
<wechatPay-record-info ref="wechatPayRecordInfo" />
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted } from 'vue'
import { $ref } from 'vue/macros'
import { page, WechatPayRecord } from './WechatPayRecord.api'
import useTablePage from '/@/hooks/bootx/useTablePage'
import { VxeTable, VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
import { useMessage } from '/@/hooks/web/useMessage'
import { useDict } from '/@/hooks/bootx/useDict'
import WechatPayRecordInfo from './WechatPayRecordInfo.vue'
import ALink from '/@/components/Link/Link.vue'
import BQuery from '/@/components/Bootx/Query/BQuery.vue'
import { STRING } from '/@/components/Bootx/Query/Query'
// 使用hooks
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, sortChange, sortParam, pages, model, loading } =
useTablePage(queryPage)
const { notification, createMessage, createConfirm } = useMessage()
const { dictConvert, dictDropDown } = useDict()
let wechatPayRecordInfo = $ref<any>()
const xTable = $ref<VxeTableInstance>()
const xToolbar = $ref<VxeToolbarInstance>()
const fields = [
{ field: 'title', type: STRING, name: '标题', placeholder: '请输入标题' },
{ field: 'orderId', type: STRING, name: '本地订单ID', placeholder: '请输入完整本地订单ID' },
{ field: 'gatewayOrderNo', type: STRING, name: '网关订单号', placeholder: '请输入完整网关订单号' },
]
onMounted(() => {
vxeBind()
queryPage()
})
/**
* 绑定
*/
function vxeBind() {
xTable?.connect(xToolbar as VxeToolbarInstance)
}
/**
* 查看
*/
function show(record) {
wechatPayRecordInfo.init(record)
}
/**
* 分页查询
*/
function queryPage() {
loading.value = true
page({
...model.queryParam,
...pages,
...sortParam,
}).then(({ data }) => {
pageQueryResHandel(data)
})
return Promise.resolve()
}
</script>
<style scoped lang="less"></style>