feat:对账以wallet_transaction表为准

This commit is contained in:
dzc committed 2026-09-30 16:36:04 +08:00
1 parent cb2e95562a
commit 69a28cce40
5 files changed
+185 -7

No files matched your search

@@ -0,0 +1,31 @@
<template>
<span class="inline-flex items-center gap-1">
<span>{{ label }}</span>
<el-tooltip placement="top" effect="dark">
<template #content>
<div class="max-w-[360px] leading-5">{{ tip }}</div>
</template>
<el-icon class="cursor-help text-[var(--el-color-info)]" tabindex="0" :aria-label="`${label}计算说明`">
<InfoFilled />
</el-icon>
</el-tooltip>
</span>
</template>
<script setup lang="ts" name="statistics-table-header">
import { InfoFilled } from "@element-plus/icons-vue"
/** 统计表头展示内容和计算口径提示。 */
defineProps({
/** 统计列展示名称。 */
label: {
type: String,
required: true,
},
/** 鼠标悬停或键盘聚焦信息图标时展示的计算口径。 */
tip: {
type: String,
required: true,
},
})
</script>
+2
View File
@@ -19,6 +19,7 @@ import PreviewText from "/@/components/PreviewText/index.vue"
import PreviewXml from "/@/components/PreviewXml/index.vue"
import DraggableDepTree from "/@/components/DraggableDepTree/index.vue"
import DraggableDepMchTree from "/@/components/DraggableDepMchTree/index.vue"
import StatisticsTableHeader from "/@/components/StatisticsTableHeader/index.vue"
import SearchPanel from "/@/components/SearchPanel/index.vue"
import UserInfoCell from "/@/components/UserInfoCell/index.vue"
import UserIdentityInfo from "/@/components/UserIdentityInfo/index.vue"
@@ -90,6 +91,7 @@ export default {
app.component("PreviewXml", PreviewXml)
app.component("DraggableDepTree", DraggableDepTree)
app.component("DraggableDepMchTree", DraggableDepMchTree)
app.component("StatisticsTableHeader", StatisticsTableHeader)
app.component("SearchPanel", SearchPanel)
app.component("UserInfoCell", UserInfoCell)
app.component("UserIdentityInfo", UserIdentityInfo)
+90 -7
View File
@@ -42,47 +42,71 @@
<el-table-column type="index" label="#" width="80" />
<el-table-column prop="deptName" min-width="150" label="部门" />
<el-table-column prop="walletPrice" label="批量充值金额" align="center" min-width="110">
<template #header>
<statistics-table-header label="批量充值金额" :tip="batchRechargeAmountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.walletPrice != 0 }">{{ displayPrice(row.walletPrice)
}}</div>
</template>
</el-table-column>
<el-table-column prop="walletCount" label="批量充值次数" align="center" min-width="110">
<template #header>
<statistics-table-header label="批量充值次数" :tip="batchRechargeCountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.walletCount != 0 }">{{ row.walletCount }}次</div>
</template>
</el-table-column>
<el-table-column prop="walletOncePrice" label="单次充值金额" align="center" min-width="110">
<template #header>
<statistics-table-header label="单次充值金额" :tip="singleRechargeAmountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.walletOncePrice != 0 }">{{
displayPrice(row.walletOncePrice) }}</div>
</template>
</el-table-column>
<el-table-column prop="walletOnceCount" label="单次充值次数" align="center" min-width="110">
<template #header>
<statistics-table-header label="单次充值次数" :tip="singleRechargeCountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.walletOnceCount != 0 }">{{ row.walletOnceCount }}次
</div>
</template>
</el-table-column>
<el-table-column prop="walletReducePrice" label="批量扣减金额" align="center" min-width="110">
<template #header>
<statistics-table-header label="批量扣减金额" :tip="batchDeductionAmountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.walletReducePrice != 0 }">{{
displayPrice(row.walletReducePrice) }}</div>
</template>
</el-table-column>
<el-table-column prop="walletReduceCount" label="批量扣减次数" align="center" min-width="110">
<template #header>
<statistics-table-header label="批量扣减次数" :tip="batchDeductionCountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.walletReduceCount != 0 }">{{ row.walletReduceCount
}}次</div>
</template>
</el-table-column>
<el-table-column prop="walletOnceReducePrice" label="单次扣减金额" align="center" min-width="110">
<template #header>
<statistics-table-header label="单次扣减金额" :tip="singleDeductionAmountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.walletOnceReducePrice != 0 }">{{
displayPrice(row.walletOnceReducePrice) }}</div>
</template>
</el-table-column>
<el-table-column prop="walletOnceReduceCount" label="单次扣减次数" align="center" min-width="110">
<template #header>
<statistics-table-header label="单次扣减次数" :tip="singleDeductionCountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.walletOnceReduceCount != 0 }">{{
row.walletOnceReduceCount }}次</div>
@@ -91,6 +115,9 @@
<!-- start 批量退换食堂 start -->
<el-table-column prop="walletReturnCanteenPrice" label="批量退还各自食堂金额" align="center"
min-width="170">
<template #header>
<statistics-table-header label="批量退还各自食堂金额" :tip="returnCanteenAmountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.walletReturnCanteenPrice != 0 }">{{
displayPrice(row.walletReturnCanteenPrice) }}</div>
@@ -98,6 +125,9 @@
</el-table-column>
<el-table-column prop="walletReturnCanteenCount" label="批量退还各自食堂次数" align="center"
min-width="170">
<template #header>
<statistics-table-header label="批量退还各自食堂次数" :tip="returnCanteenCountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.walletReturnCanteenCount != 0 }">{{
row.walletReturnCanteenCount }}次</div>
@@ -105,39 +135,57 @@
</el-table-column>
<!-- end 批量退换食堂 end -->
<el-table-column prop="orderPayPrice" label="流水金额" align="center" min-width="90">
<el-table-column prop="orderPayPrice" label="流水金额" align="center" min-width="110">
<template #header>
<statistics-table-header label="流水金额" :tip="payAmountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-primary': row.orderPayPrice != 0 }">{{
displayPrice(row.orderPayPrice) }}</div>
</template>
</el-table-column>
<el-table-column prop="orderPayCount" label="流水次数" align="center" min-width="90">
<el-table-column prop="orderPayCount" label="流水次数" align="center" min-width="110">
<template #header>
<statistics-table-header label="流水次数" :tip="payCountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-primary': row.orderPayCount != 0 }">{{ row.orderPayCount }}次</div>
</template>
</el-table-column>
<el-table-column prop="orderRefundPrice" label="退款金额" align="center" min-width="90">
<el-table-column prop="orderRefundPrice" label="退款金额" align="center" min-width="110">
<template #header>
<statistics-table-header label="退款金额" :tip="refundAmountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-danger': row.orderRefundPrice != 0 }">
{{ displayPrice(row.orderRefundPrice) }}
</div>
</template>
</el-table-column>
<el-table-column prop="orderRefundCont" label="退款次数" align="center" min-width="90">
<el-table-column prop="orderRefundCont" label="退款次数" align="center" min-width="110">
<template #header>
<statistics-table-header label="退款次数" :tip="refundCountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-danger': row.orderRefundCont != 0 }">
{{ row.orderRefundCont }}次
</div>
</template>
</el-table-column>
<el-table-column prop="orderProfitPrice" label="消费净金额" align="center" min-width="120">
<el-table-column prop="orderProfitPrice" label="消费净金额" align="center" min-width="140">
<template #header>
<statistics-table-header label="消费净金额" :tip="netAmountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.orderProfitPrice != 0 }">
{{ displayPrice(row.orderProfitPrice) }}
</div>
</template>
</el-table-column>
<el-table-column prop="orderProfitCont" label="消费净次数" align="center" min-width="120">
<el-table-column prop="orderProfitCont" label="消费净次数" align="center" min-width="140">
<template #header>
<statistics-table-header label="消费净次数" :tip="netCountHeaderTip" />
</template>
<template #default="{ row }">
<div :class="{ 'color-success': row.orderProfitCont != 0 }">
{{ row.orderProfitCont }}次
@@ -167,6 +215,41 @@ const selectObjs = ref([]) as any
const multiple = ref(true)
const draggableDepTreeRef = ref() // 树组件ref引用
/** 部门列说明每行数据的统计范围。 */
const departmentHeaderTip = "每行显示一个部门,后面的金额和次数都是该部门在查询时间内的数据。"
/** 批量充值金额说明批量入账金额的计算方式。 */
const batchRechargeAmountHeaderTip = "通过批量充值给该部门人员增加的金额合计。"
/** 批量充值次数说明按人员入账记录计次。 */
const batchRechargeCountHeaderTip = "批量充值产生的入账记录数。一次批量操作涉及多人时,每个人的入账各算 1 次。"
/** 单次充值金额说明逐人充值金额的计算方式。 */
const singleRechargeAmountHeaderTip = "通过单次充值给该部门人员增加的金额合计。"
/** 单次充值次数说明逐人入账记录的计算方式。 */
const singleRechargeCountHeaderTip = "单次充值产生的入账记录数,每次成功增加余额算 1 次。"
/** 批量扣减金额说明批量扣款金额的计算方式。 */
const batchDeductionAmountHeaderTip = "通过批量扣减从该部门人员账户扣除的金额合计。"
/** 批量扣减次数说明按人员扣款记录计次。 */
const batchDeductionCountHeaderTip = "批量扣减产生的扣款记录数。一次批量操作涉及多人时,每个人的扣款各算 1 次。"
/** 单次扣减金额说明逐人扣款金额的计算方式。 */
const singleDeductionAmountHeaderTip = "通过单次扣减从该部门人员账户扣除的金额合计。"
/** 单次扣减次数说明逐人扣款记录的计算方式。 */
const singleDeductionCountHeaderTip = "单次扣减产生的扣款记录数,每次成功扣减余额算 1 次。"
/** 退还食堂金额说明余额退回原食堂的计算方式。 */
const returnCanteenAmountHeaderTip = "批量退还余额时,退回该部门人员各自所属食堂的金额合计。"
/** 退还食堂次数说明按人员退还记录计次。 */
const returnCanteenCountHeaderTip = "批量退还余额产生的记录数;同一次操作涉及多人时,每个人的退还记录各算 1 次。"
/** 流水金额说明支付订单原始金额的统计范围。 */
const payAmountHeaderTip = "查询时间内创建且已支付的订单金额合计;退款金额另行显示,不会从这里扣除。"
/** 流水次数说明已支付订单的计次方式。 */
const payCountHeaderTip = "查询时间内创建且已支付的订单数量,同一笔订单算 1 次。"
/** 退款金额说明按退款完成时间统计。 */
const refundAmountHeaderTip = "查询时间内已经完成退款的金额合计,按退款完成时间统计。"
/** 退款次数说明按已完成退款记录计次。 */
const refundCountHeaderTip = "查询时间内已经完成的退款记录数;一笔订单有多次退款时,每次完成的退款各算 1 次。"
/** 消费净金额说明支付与退款的相减关系。 */
const netAmountHeaderTip = "流水金额减去退款金额。订单按创建时间统计,退款按完成时间统计;只选到退款的时间段时,结果可能为负数。"
/** 消费净次数说明支付订单与退款记录的相减关系。 */
const netCountHeaderTip = "流水次数减去退款次数。退款次数按退款记录计算,一笔订单多次退款会分别扣减。"
const defaultCreateTimeList = [
dayjs().subtract(3, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"),
dayjs().hour(23).minute(23).second(23).format("YYYY-MM-DD HH:mm:ss"),
@@ -272,4 +355,4 @@ const handleGetSelectNode = (curClickedNode: any, checkedTreeNodes: any, isDeepT
.el-table .success-cell {
background: var(--el-color-success-light-9);
}
</style>
</style>
@@ -7,6 +7,9 @@
<el-table-column type="index" label="#" width="50" />
<el-table-column label="商户" width="200" align="center" prop="merchantName" />
<el-table-column label="流水金额" min-width="120" align="center" prop="totalPayPrice">
<template #header>
<statistics-table-header label="流水金额" :tip="payAmountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-success">
{{ displayPrice(row.totalPayPrice) }}
@@ -14,6 +17,9 @@
</template>
</el-table-column>
<el-table-column label="流水次数" min-width="120" align="center" prop="totalPayCount">
<template #header>
<statistics-table-header label="流水次数" :tip="payCountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-primary">
{{ row.totalPayCount || 0 }}
@@ -21,6 +27,9 @@
</template>
</el-table-column>
<el-table-column label="退款金额" min-width="120" align="center" prop="totalRefundPrice">
<template #header>
<statistics-table-header label="退款金额" :tip="refundAmountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-danger">
{{ displayPrice(row.totalRefundPrice) }}
@@ -28,6 +37,9 @@
</template>
</el-table-column>
<el-table-column label="退款次数" min-width="120" align="center" prop="totalRefundCount">
<template #header>
<statistics-table-header label="退款次数" :tip="refundCountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-danger">
{{ row.totalRefundCount || 0 }}
@@ -35,6 +47,9 @@
</template>
</el-table-column>
<el-table-column label="消费净金额" min-width="120" align="center" prop="totalProfitPrice" min-min-width="120">
<template #header>
<statistics-table-header label="消费净金额" :tip="netAmountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-success">
{{ displayPrice(row.totalProfitPrice) }}
@@ -42,6 +57,9 @@
</template>
</el-table-column>
<el-table-column label="消费净次数" min-width="120" align="center" prop="totalProfitCount" min-min-width="120">
<template #header>
<statistics-table-header label="消费净次数" :tip="netCountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-success">
{{ row.totalProfitCount || 0 }}
@@ -81,6 +99,19 @@ import * as hardTotalApi from "/@/api/hard/hard-total"
const { push } = useRouter()
/** 流水金额说明已支付订单原始金额的统计方式。 */
const payAmountHeaderTip = "所选时间内完成支付的订单金额合计;退款金额另行显示,不会从这里扣除。"
/** 流水次数说明已支付订单的计次方式。 */
const payCountHeaderTip = "所选时间内完成支付的订单数量,同一笔订单算 1 次。"
/** 退款金额说明按退款完成时间统计。 */
const refundAmountHeaderTip = "所选时间内已经完成退款的金额合计,按退款完成时间统计。"
/** 退款次数说明按已完成退款记录计次。 */
const refundCountHeaderTip = "所选时间内已经完成的退款记录数;一笔订单有多次退款时,每次完成的退款各算 1 次。"
/** 消费净金额说明支付与退款的相减关系。 */
const netAmountHeaderTip = "流水金额减去退款金额。付款和退款分别按完成时间统计;只选到退款的时间段时,结果可能为负数。"
/** 消费净次数说明支付订单与退款记录的相减关系。 */
const netCountHeaderTip = "流水次数减去退款次数。退款次数按退款记录计算,一笔订单多次退款会分别扣减。"
const state: BasicTableProps = reactive<BasicTableProps>({
createdIsNeed: false,
isPage: false,
@@ -12,6 +12,9 @@
</el-table-column>
<el-table-column label="月份" width="100" align="center" prop="day" />
<el-table-column label="流水金额" min-width="120" align="center" prop="totalPayPrice">
<template #header>
<statistics-table-header label="流水金额" :tip="payAmountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-success">
{{ displayPrice(row.totalPayPrice) }}
@@ -19,6 +22,9 @@
</template>
</el-table-column>
<el-table-column label="流水次数" min-width="120" align="center" prop="totalPayCount">
<template #header>
<statistics-table-header label="流水次数" :tip="payCountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-primary">
{{ row.totalPayCount || 0 }}
@@ -26,6 +32,9 @@
</template>
</el-table-column>
<el-table-column label="退款金额" min-width="120" align="center" prop="totalRefundPrice">
<template #header>
<statistics-table-header label="退款金额" :tip="refundAmountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-danger">
{{ displayPrice(row.totalRefundPrice) }}
@@ -33,6 +42,9 @@
</template>
</el-table-column>
<el-table-column label="退款次数" min-width="120" align="center" prop="totalRefundCount">
<template #header>
<statistics-table-header label="退款次数" :tip="refundCountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-danger">
{{ row.totalRefundCount || 0 }}
@@ -40,6 +52,9 @@
</template>
</el-table-column>
<el-table-column label="消费净金额" min-width="120" align="center" prop="totalProfitPrice" min-min-width="120">
<template #header>
<statistics-table-header label="消费净金额" :tip="netAmountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-success">
{{ displayPrice(row.totalProfitPrice) }}
@@ -47,6 +62,9 @@
</template>
</el-table-column>
<el-table-column label="消费净次数" min-width="120" align="center" prop="totalProfitCount" min-min-width="120">
<template #header>
<statistics-table-header label="消费净次数" :tip="netCountHeaderTip" />
</template>
<template #default="{ row }">
<span class="color-success">
{{ row.totalProfitCount || 0 }}
@@ -72,6 +90,19 @@ import { displayPrice } from "/@/utils/formatMoney"
import * as hardTotalApi from "/@/api/hard/hard-total"
/** 流水金额说明已支付订单原始金额的统计方式。 */
const payAmountHeaderTip = "所选月份内完成支付的订单金额合计;退款金额另行显示,不会从这里扣除。"
/** 流水次数说明已支付订单的计次方式。 */
const payCountHeaderTip = "所选月份内完成支付的订单数量,同一笔订单算 1 次。"
/** 退款金额说明按退款完成时间统计。 */
const refundAmountHeaderTip = "所选月份内已经完成退款的金额合计,按退款完成时间归属月份。"
/** 退款次数说明按已完成退款记录计次。 */
const refundCountHeaderTip = "所选月份内已经完成的退款记录数;一笔订单有多次退款时,每次完成的退款各算 1 次。"
/** 消费净金额说明支付与退款的相减关系。 */
const netAmountHeaderTip = "流水金额减去退款金额。付款按支付月份、退款按退款完成月份统计;只选到退款的月份时,结果可能为负数。"
/** 消费净次数说明支付订单与退款记录的相减关系。 */
const netCountHeaderTip = "流水次数减去退款次数。退款次数按退款记录计算,一笔订单多次退款会分别扣减。"
const state: BasicTableProps = reactive<BasicTableProps>({
createdIsNeed: false,
queryForm: {},