修复交易次数统计错误

This commit is contained in:
weiwei committed 2025-07-31 16:55:47 +08:00
1 parent df66245d23
commit a6f7e80615
1 file changed
+42 -21
+42 -21
View File
@@ -1,9 +1,16 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<DraggableDepTree ref="draggableDepTreeRef" placeholder="请输入部门名称" :show-expand="true"
@getSelectNode="handleGetSelectNode" switch-inactive-text="包含" switch-active-text="不包含"
:defaultTreeWidth="20" :nodeClickable="false">
<DraggableDepTree
ref="draggableDepTreeRef"
placeholder="请输入部门名称"
:show-expand="true"
@getSelectNode="handleGetSelectNode"
switch-inactive-text="包含"
switch-active-text="不包含"
:defaultTreeWidth="20"
:nodeClickable="false"
>
<template #default>
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-row>
@@ -11,30 +18,41 @@
<dict-select v-model="state.queryForm.hourType" dict-code="daily_menu" />
</el-form-item>
<el-form-item style="width: 250px" label="食堂" prop="merchantId">
<select-mch v-model="state.queryForm.merchantId"
:apiParams="{ parentIsNull: false, types: '1' }" />
<select-mch v-model="state.queryForm.merchantId" :apiParams="{ parentIsNull: false, types: '1' }" />
</el-form-item>
<el-form-item style="width: 450px" label="创建时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD"
type="daterange" />
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="doSearch">{{ $t("common.queryBtn")
}}</el-button>
<el-button icon="Search" type="primary" @click="doSearch">{{ $t("common.queryBtn") }}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-row>
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<right-toolbar :search="false" v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'" @exportExcel="exportExcel" class="ml10 mr20"
style="float: right" @queryTable="getDataList"></right-toolbar>
<right-toolbar
:search="false"
v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" :summary-method="getSummaries"
:show-summary="true" @selection-change="selectionChangHandle" @sort-change="sortChangeHandle">
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
:summary-method="getSummaries"
:show-summary="true"
@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="用餐时间" align="center" prop="createTime">
@@ -47,7 +65,7 @@
<dict-tag :options="daily_menu" :value="row.hourType" />
</template>
</el-table-column>
<el-table-column label="购买次数" align="center" prop="payCount">
<el-table-column label="交易次数" align="center" prop="timeCount">
<template #default="{ row }">
<span class="color-primary"> {{ row.timeCount || 0 }}次 </span>
</template>
@@ -65,15 +83,18 @@
<el-table-column fixed="right" label="操作" width="200">
<template #default="{ row }">
<el-button icon="Tickets" text type="primary"
@click="productTotalTableRef.openDialog(parseTime(row.createTime, '{y}-{m}-{d}'), row.hourType)">
<el-button
icon="Tickets"
text
type="primary"
@click="productTotalTableRef.openDialog(parseTime(row.createTime, '{y}-{m}-{d}'), row.hourType)"
>
菜品详情
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
v-bind="state.pagination" />
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</template>
</DraggableDepTree>
</div>
@@ -117,7 +138,7 @@ const exportExcel = () => {
const getSummaries = (param: any) => {
const { columns, data } = param
const totalColumns = ["payCount", "totalPrice"]
const totalColumns = ["timeCount", "payCount", "totalPrice"]
const totalRow = Array.from({ length: columns.length })
totalRow[0] = "合计"
columns.forEach((i: any, index: number) => {