feat:流水错误修改
build / task (16.x, npm, macOS-latest) (push) Canceled after 0s
build / task (16.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, npm, windows-latest) (push) Canceled after 0s
build / task (16.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (16.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (16.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (16.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, yarn, windows-latest) (push) Canceled after 0s
build / task (18.x, npm, macOS-latest) (push) Canceled after 0s
build / task (18.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, npm, windows-latest) (push) Canceled after 0s
build / task (18.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (18.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (18.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (18.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, yarn, windows-latest) (push) Canceled after 0s
build / task (20.x, npm, macOS-latest) (push) Canceled after 0s
build / task (20.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, npm, windows-latest) (push) Canceled after 0s
build / task (20.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (20.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (20.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (20.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, yarn, windows-latest) (push) Canceled after 0s

This commit is contained in:
dzc committed 2026-10-22 19:22:28 +08:00
1 parent aaeb519bbc
commit 3e3bd02583
6 files changed
+176 -65

No files matched your search

+17 -18
View File
@@ -16,9 +16,13 @@
<select-wallet-type multiple v-model="state.queryForm.walletTypeIdList"
placeholder="请选择钱包类型" />
</el-form-item>
<el-form-item style="width: 400px" label="时间" prop="createTimeList">
<el-form-item style="width: 400px" label="交易时间" prop="createTimeList">
<template #label>
<statistics-table-header label="交易时间" :tip="transactionTimeTip" />
</template>
<el-date-picker v-model="state.queryForm.createTimeList"
value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange"
start-placeholder="开始时间(含)" end-placeholder="结束时间(不含)" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn")
@@ -209,7 +213,6 @@ import { submitDepartmentExport as submitBatchExport } from "/@/api/hard/hard-to
import { BasicTableProps, useTable } from "/@/hooks/table"
import { displayPrice } from "/@/utils/formatMoney"
import { useDict } from "/@/hooks/dict"
import * as hardTotalApi from "/@/api/hard/hard-total"
import dayjs from "dayjs"
@@ -221,8 +224,7 @@ const selectObjs = ref([]) as any
const multiple = ref(true)
const draggableDepTreeRef = ref() // 树组件ref引用
/** 部门列说明每行数据的统计范围。 */
const departmentHeaderTip = "每行显示一个部门,后面的金额和次数都是该部门在查询时间内的数据。"
const transactionTimeTip = "按钱包流水的交易时间统计,包含开始时间,不包含结束时间。例如,统计 9 月可选择 9 月 1 日 00:00:00 到 10 月 1 日 00:00:00。"
/** 批量充值金额说明批量入账金额的计算方式。 */
const batchRechargeAmountHeaderTip = "通过批量充值给该部门人员增加的金额合计。"
/** 批量充值次数说明按人员入账记录计次。 */
@@ -243,18 +245,15 @@ const singleDeductionCountHeaderTip = "单次扣减产生的扣款记录数,
const returnCanteenAmountHeaderTip = "批量退还余额时,退回该部门人员各自所属食堂的金额合计。"
/** 退还食堂次数说明按人员退还记录计次。 */
const returnCanteenCountHeaderTip = "批量退还余额产生的记录数;同一次操作涉及多人时,每个人的退还记录各算 1 次。"
/** 流水金额说明支付订单原始金额的统计范围。 */
const payAmountHeaderTip = "查询时间内创建且已支付的订单金额合计;退款金额另行显示,不会从这里扣除。"
/** 流水次数说明已支付订单的计次方式。 */
const payCountHeaderTip = "查询时间内创建且已支付的订单数量,同一笔订单算 1 次。"
/** 退款金额说明按退款完成时间统计。 */
const refundAmountHeaderTip = "查询时间内已经完成退款的金额合计,按退款完成时间统计。"
/** 退款次数说明按已完成退款记录计次。 */
const refundCountHeaderTip = "查询时间内已经完成的退款记录数;一笔订单有多次退款时,每次完成的退款各算 1 次。"
/** 支付和退款都按钱包流水的交易时间统计。 */
const payAmountHeaderTip = "所选交易时间内的钱包支付流水金额合计;退款金额单独显示,不会从这里扣除。"
const payCountHeaderTip = "所选交易时间内的钱包支付流水记录数,每条流水算 1 次;同一订单使用多个钱包支付时分别计次。"
const refundAmountHeaderTip = "所选交易时间内的钱包退款流水金额合计,包含非订单退款。"
const refundCountHeaderTip = "所选交易时间内的钱包退款流水记录数,每条流水算 1 次,包含非订单退款。"
/** 消费净金额说明支付与退款的相减关系。 */
const netAmountHeaderTip = "流水金额减去退款金额。订单按创建时间统计,退款按完成时间统计;只选到退款的时间段时,结果可能为负数。"
/** 消费净次数说明支付订单与退款记录的相减关系。 */
const netCountHeaderTip = "流水次数减去退款次数。退款次数按退款记录计算,一笔订单多次退款会分别扣减。"
const netAmountHeaderTip = "流水金额减去退款金额。支付和退款分别按各自钱包流水的交易时间统计,结果可能为负数。"
/** 消费净次数说明支付流水与退款流水的相减关系。 */
const netCountHeaderTip = "钱包支付流水次数减去钱包退款流水次数,每条流水分别计次,结果可能为负数。"
const defaultCreateTimeList = [
dayjs().subtract(3, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"),
@@ -270,7 +269,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, tableStyle } = useTable(state)
const { getDataList, sortChangeHandle, tableStyle } = useTable(state)
// 导出excel
/** 当前页面只声明原导出场景,进度及重复提交由公共 hook 管理。 */
@@ -281,7 +280,7 @@ const { exportProgressRef, exportTaskConfig, submitExport, handleExportSuccess,
const exportExcel = () => submitExport({ ...state.queryForm })
const cellClassName = ({ row, column, rowIndex }: any) => {
const cellClassName = ({ column }: any) => {
if (column.property) {
if (column.property.includes("Count")) {
return 'success-cell'
@@ -5,7 +5,11 @@
@selection-change="selectionChangHandle" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="80" align="center" />
<el-table-column type="index" label="#" width="50" />
<el-table-column label="商户" width="200" align="center" prop="merchantName" />
<el-table-column label="商户" width="200" align="center" prop="merchantName">
<template #default="{ row }">
{{ row.merchantName || (row.merchantId == null ? "未归属商户" : row.merchantId) }}
</template>
</el-table-column>
<el-table-column label="流水金额" min-width="120" align="center" prop="totalPayPrice">
<template #header>
<statistics-table-header label="流水金额" :tip="payAmountHeaderTip" />
@@ -76,15 +80,23 @@
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="220">
<template #default="{ row }">
<el-tooltip class="box-item" effect="dark" content="只有合作商家能结账" placement="top">
<el-button icon="Tickets" text :disabled="row.merchantType != 2" type="primary"
@click="doCheckout(row)">
商户结账
</el-button>
<el-tooltip class="box-item" effect="dark"
:content="row.merchantId == null ? '未归属商户的流水仅参与统计,不能结账' : '只有合作商家能结账'" placement="top">
<span>
<el-button icon="Tickets" text :disabled="row.merchantId == null || row.merchantType != 2" type="primary"
@click="doCheckout(row)">
商户结账
</el-button>
</span>
</el-tooltip>
<el-tooltip effect="dark" content="未归属商户的流水计入汇总导出,不能按商户单独导出"
:disabled="row.merchantId != null" placement="top">
<span>
<el-button icon="Tickets" type="primary" text :disabled="row.merchantId == null" @click="exportMchExcel(row)">
导出商户流水
</el-button>
</span>
</el-tooltip>
<el-button icon="Tickets" type="primary" text @click="exportMchExcel(row)">
导出商户流水
</el-button>
</template>
</el-table-column>
</el-table>
@@ -99,18 +111,15 @@ import * as hardTotalApi from "/@/api/hard/hard-total"
const { push } = useRouter()
/** 流水金额说明已支付订单原始金额的统计方式。 */
const payAmountHeaderTip = "所选时间内完成支付的订单金额合计;退款金额另行显示,不会从这里扣除。"
/** 流水次数说明已支付订单的计次方式。 */
const payCountHeaderTip = "所选时间内完成支付的订单数量,同一笔订单算 1 次。"
/** 退款金额说明按退款完成时间统计。 */
const refundAmountHeaderTip = "所选时间内已经完成退款的金额合计,按退款完成时间统计。"
/** 退款次数说明按已完成退款记录计次。 */
const refundCountHeaderTip = "所选时间内已经完成的退款记录数;一笔订单有多次退款时,每次完成的退款各算 1 次。"
/** 支付和退款都按钱包流水的交易时间统计。 */
const payAmountHeaderTip = "所选交易时间内的钱包支付流水金额合计;退款金额单独显示,不会从这里扣除。"
const payCountHeaderTip = "所选交易时间内的钱包支付流水记录数,每条流水算 1 次;同一订单使用多个钱包支付时分别计次。"
const refundAmountHeaderTip = "所选交易时间内的钱包退款流水金额合计,包含非订单退款;未归属商户的流水也计入合计。"
const refundCountHeaderTip = "所选交易时间内的钱包退款流水记录数,每条流水算 1 次,包含非订单退款。"
/** 消费净金额说明支付与退款的相减关系。 */
const netAmountHeaderTip = "流水金额减去退款金额。付款和退款分别按完成时间统计;只选到退款的时间段时,结果可能为负数。"
/** 消费净次数说明支付订单与退款记录的相减关系。 */
const netCountHeaderTip = "流水次数减去退款次数。退款次数按退款记录计算,一笔订单多次退款会分别扣减。"
const netAmountHeaderTip = "流水金额减去退款金额。支付和退款分别按各自钱包流水的交易时间统计,结果可能为负数。"
/** 消费净次数说明支付流水与退款流水的相减关系。 */
const netCountHeaderTip = "钱包支付流水次数减去钱包退款流水次数,每条流水分别计次,结果可能为负数。"
const state: BasicTableProps = reactive<BasicTableProps>({
createdIsNeed: false,
@@ -120,17 +129,19 @@ const state: BasicTableProps = reactive<BasicTableProps>({
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, postDownBlobFile, tableStyle } = useTable(state)
const { getDataList, sortChangeHandle, postDownBlobFile, tableStyle } = useTable(state)
// 多选变量
const selectObjs = ref([]) as any
const multiple = ref(true)
const doCheckout = (row: any) => {
if (row.merchantId == null || row.merchantType != 2) return
push({ path: "/mch/mch-checkout/index", query: { mchId: row.merchantId } })
}
const exportMchExcel = (row: any) => {
if (row.merchantId == null) return
postDownBlobFile("/hard/hard-total/export-mch-cs", { ...state.queryForm, merchantId: row.merchantId }, "商户流水.xlsx")
}
@@ -149,7 +160,7 @@ const getSummaries = (param: any) => {
if (totalColumns.includes(i.property)) {
const total = data
.filter((v: any) => v[i.property] != null)
.map((v: any) => v[i.property])
.map((v: any) => Number(v[i.property]))
.reduce((pren: number, next: number) => pren + next, 0)
if (i.property.includes("Price")) {
totalRow[index] = displayPrice(total)
@@ -176,4 +187,4 @@ defineExpose({
doSearch,
doCancel
})
</script>
</script>
@@ -7,7 +7,7 @@
<el-table-column type="index" label="#" width="50" />
<el-table-column label="商户" width="200" align="center" prop="merchantName">
<template #default="{ row }">
{{ row.merchantName || row.merchantId }}
{{ row.merchantName || (row.merchantId == null ? "未归属商户" : row.merchantId) }}
</template>
</el-table-column>
<el-table-column label="月份" width="100" align="center" prop="day" />
@@ -90,18 +90,15 @@ import { displayPrice } from "/@/utils/formatMoney"
import * as hardTotalApi from "/@/api/hard/hard-total"
/** 流水金额说明已支付订单原始金额的统计方式。 */
const payAmountHeaderTip = "所选月份内完成支付的订单金额合计;退款金额另行显示,不会从这里扣除。"
/** 流水次数说明已支付订单的计次方式。 */
const payCountHeaderTip = "所选月份内完成支付的订单数量,同一笔订单算 1 次。"
/** 退款金额说明按退款完成时间统计。 */
const refundAmountHeaderTip = "所选月份内已经完成退款的金额合计,按退款完成时间归属月份。"
/** 退款次数说明按已完成退款记录计次。 */
const refundCountHeaderTip = "所选月份内已经完成的退款记录数;一笔订单有多次退款时,每次完成的退款各算 1 次。"
/** 支付和退款都按钱包流水的交易时间归属月份。 */
const payAmountHeaderTip = "所选月份内的钱包支付流水金额合计;退款金额单独显示,不会从这里扣除。"
const payCountHeaderTip = "所选月份内的钱包支付流水记录数,每条流水算 1 次;同一订单使用多个钱包支付时分别计次。"
const refundAmountHeaderTip = "所选月份内的钱包退款流水金额合计,包含非订单退款;未归属商户的流水也计入合计。"
const refundCountHeaderTip = "所选月份内的钱包退款流水记录数,每条流水算 1 次,包含非订单退款。"
/** 消费净金额说明支付与退款的相减关系。 */
const netAmountHeaderTip = "流水金额减去退款金额。付款按支付月份、退款按退款完成月份统计;只选到退款的月份时,结果可能为负数。"
/** 消费净次数说明支付订单与退款记录的相减关系。 */
const netCountHeaderTip = "流水次数减去退款次数。退款次数按退款记录计算,一笔订单多次退款会分别扣减。"
const netAmountHeaderTip = "流水金额减去退款金额。支付和退款分别按各自钱包流水的交易时间归属月份,结果可能为负数。"
/** 消费净次数说明支付流水与退款流水的相减关系。 */
const netCountHeaderTip = "钱包支付流水次数减去钱包退款流水次数,每条流水分别计次,结果可能为负数。"
const state: BasicTableProps = reactive<BasicTableProps>({
createdIsNeed: false,
@@ -114,7 +111,7 @@ const selectObjs = ref([]) as any
const multiple = ref(true)
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, postDownBlobFile, tableStyle } = useTable(state)
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, tableStyle } = useTable(state)
// 多选事件
const selectionChangHandle = (objs: { id: string }[]) => {
@@ -126,12 +123,12 @@ const getSummaries = (param: any) => {
const { columns, data } = param
const totalColumns = ["totalPayPrice", "totalPayCount", "totalRefundPrice", "totalRefundCount", "totalProfitPrice", "totalProfitCount", "mchPlatformRankePrice"]
const totalRow = Array.from({ length: columns.length })
totalRow[0] = "合计"
totalRow[0] = "本页合计"
columns.forEach((i: any, index: number) => {
if (totalColumns.includes(i.property)) {
const total = data
.filter((v: any) => v[i.property] != null)
.map((v: any) => v[i.property])
.map((v: any) => Number(v[i.property]))
.reduce((pren: number, next: number) => pren + next, 0)
if (i.property.includes("Price")) {
totalRow[index] = displayPrice(total)
@@ -158,4 +155,4 @@ defineExpose({
doSearch,
doCancel
})
</script>
</script>
+15 -6
View File
@@ -26,12 +26,15 @@
<el-form-item style="width: 250px" label="商户" prop="merchantId">
<select-mch v-model="state.queryForm.merchantId" :apiParams="{ parentIsNull: false }" />
</el-form-item>
<el-form-item v-if="activeTab === 'MCH'" style="width: 450px" label="创建时间(天)"
<el-form-item v-if="activeTab === 'MCH'" style="width: 450px" label="交易时间"
prop="payTimeList">
<template #label>
<statistics-table-header label="交易时间" :tip="transactionTimeTip" />
</template>
<el-date-picker v-model="state.queryForm.payTimeList" value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange" />
type="datetimerange" start-placeholder="开始时间(含)" end-placeholder="结束时间(不含)" />
</el-form-item>
<el-form-item v-if="activeTab === 'MONTH'" style="width: 450px" label="创建时间(年)"
<el-form-item v-if="activeTab === 'MONTH'" style="width: 450px" label="交易年份"
prop="payTimeYearStr">
<el-date-picker value-format="YYYY" v-model="state.queryForm.payTimeYearStr"
type="year" />
@@ -100,6 +103,7 @@ const tabPane = ref([
}
])
const activeTab = ref("MCH")
const transactionTimeTip = "按钱包流水的交易时间统计,包含开始时间,不包含结束时间。例如,统计 9 月可选择 9 月 1 日 00:00:00 到 10 月 1 日 00:00:00。"
const defaultCreateTimeList = [
dayjs().subtract(3, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"),
@@ -134,17 +138,22 @@ const { exportProgressRef, exportTaskConfig, submitExport, handleExportSuccess,
})
const exportExcel = () => {
normalizeTimeQuery()
exportTaskConfig.redisKey = activeTab.value === "MONTH" ? "hard:export:merchant-month" : "hard:export:merchant"
return submitExport({ ...state.queryForm })
}
const search = () => {
const normalizeTimeQuery = () => {
if (activeTab.value === "MCH") {
state.queryForm.payTimeYearStr = ""
}
if (activeTab.value === "MONTH") {
state.queryForm.createTimeList = []
state.queryForm.payTimeList = []
}
}
const search = () => {
normalizeTimeQuery()
switch (activeTab.value) {
case "MCH":
hardShByDayRef.value?.doSearch(state.queryForm)
@@ -157,7 +166,7 @@ const search = () => {
const cancel = () => {
state.queryForm = { ...defaultQueryForm }
console.log("state.queryForm:", state.queryForm);
normalizeTimeQuery()
switch (activeTab.value) {
case "MCH":