feat:统计增加购买次数

This commit is contained in:
dzc committed 2025-07-08 20:05:55 +08:00
1 parent ee4b17ce18
commit a0cbb1d0a5
3 files changed
+31 -45

No files matched your search

+24 -40
View File
@@ -1,16 +1,9 @@
<template> <template>
<div class="layout-padding"> <div class="layout-padding">
<div class="layout-padding-auto layout-padding-view"> <div class="layout-padding-auto layout-padding-view">
<DraggableDepTree <DraggableDepTree ref="draggableDepTreeRef" placeholder="请输入部门名称" :show-expand="true"
ref="draggableDepTreeRef" @getSelectNode="handleGetSelectNode" switch-inactive-text="包含" switch-active-text="不包含"
placeholder="请输入部门名称" :defaultTreeWidth="20" :nodeClickable="false">
:show-expand="true"
@getSelectNode="handleGetSelectNode"
switch-inactive-text="包含"
switch-active-text="不包含"
:defaultTreeWidth="20"
:nodeClickable="false"
>
<template #default> <template #default>
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList"> <el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-row> <el-row>
@@ -18,41 +11,30 @@
<dict-select v-model="state.queryForm.hourType" dict-code="daily_menu" /> <dict-select v-model="state.queryForm.hourType" dict-code="daily_menu" />
</el-form-item> </el-form-item>
<el-form-item style="width: 250px" label="食堂" prop="merchantId"> <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>
<el-form-item style="width: 450px" label="创建时间" prop="createTimeList"> <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-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-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
<el-row> <el-row>
<div class="mb8" style="width: 100%"> <div class="mb8" style="width: 100%">
<right-toolbar <right-toolbar :search="false" v-model:showSearch="showSearch"
:search="false" :export="'wallet_walletTransaction_export'" @exportExcel="exportExcel" class="ml10 mr20"
v-model:showSearch="showSearch" style="float: right" @queryTable="getDataList"></right-toolbar>
:export="'wallet_walletTransaction_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
</div> </div>
</el-row> </el-row>
<el-table <el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
:data="state.dataList" :header-cell-style="tableStyle.headerCellStyle" :summary-method="getSummaries"
v-loading="state.loading" :show-summary="true" @selection-change="selectionChangHandle" @sort-change="sortChangeHandle">
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="selection" width="80" align="center" />
<el-table-column type="index" label="#" width="50" /> <el-table-column type="index" label="#" width="50" />
<el-table-column label="用餐时间" align="center" prop="createTime"> <el-table-column label="用餐时间" align="center" prop="createTime">
@@ -65,6 +47,11 @@
<dict-tag :options="daily_menu" :value="row.hourType" /> <dict-tag :options="daily_menu" :value="row.hourType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="购买次数" align="center" prop="payCount">
<template #default="{ row }">
<span class="color-primary"> {{ row.timeCount || 0 }}次 </span>
</template>
</el-table-column>
<el-table-column label="售出商品数量" align="center" prop="payCount"> <el-table-column label="售出商品数量" align="center" prop="payCount">
<template #default="{ row }"> <template #default="{ row }">
<span class="color-success"> {{ row.payCount || 0 }}份 </span> <span class="color-success"> {{ row.payCount || 0 }}份 </span>
@@ -78,18 +65,15 @@
<el-table-column fixed="right" label="操作" width="200"> <el-table-column fixed="right" label="操作" width="200">
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button icon="Tickets" text type="primary"
icon="Tickets" @click="productTotalTableRef.openDialog(parseTime(row.createTime, '{y}-{m}-{d}'), row.hourType)">
text
type="primary"
@click="productTotalTableRef.openDialog(parseTime(row.createTime, '{y}-{m}-{d}'), row.hourType)"
>
菜品详情 菜品详情
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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> </template>
</DraggableDepTree> </DraggableDepTree>
</div> </div>
@@ -71,7 +71,7 @@
<dict-tag :options="check_status" :value="row.processStatus" /> <dict-tag :options="check_status" :value="row.processStatus" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" label="发票状态" width="100"> <el-table-column prop="status" label="发票状态" width="120">
<template #default="{ row }"> <template #default="{ row }">
<dict-tag :options="recharge_invoice_status" :value="row.status" /> <dict-tag :options="recharge_invoice_status" :value="row.status" />
</template> </template>
@@ -96,10 +96,11 @@
:disabled="loading"> :disabled="loading">
作废 作废
</el-button> </el-button>
<el-button v-if="!receiptData.processStatus" type="primary" :disabled="loading" <el-button v-if="!receiptData.processStatus && !['6'].includes(receiptData.status)" type="primary"
@click="applyStamp">申请审批</el-button> :disabled="loading" @click="applyStamp">申请审批</el-button>
<el-button v-if="receiptData.processStatus == undefined" v-auth="'wallet_walletRechargeApply_receiptSave'" <el-button v-if="receiptData.processStatus == undefined && !['6'].includes(receiptData.status)"
type="primary" @click="saveReceipt" :disabled="loading">保存</el-button> v-auth="'wallet_walletRechargeApply_receiptSave'" type="primary" @click="saveReceipt"
:disabled="loading">保存</el-button>
<el-button v-if="receiptData.stampPicUrl" type="warning" @click="handlePrint" <el-button v-if="receiptData.stampPicUrl" type="warning" @click="handlePrint"
:disabled="loading">打印</el-button> :disabled="loading">打印</el-button>
</template> </template>
@@ -131,6 +132,7 @@ interface ReceiptData {
picUrl: string picUrl: string
stampPicUrl: string stampPicUrl: string
processStatus: string | null processStatus: string | null
status?: string
} }
const emit = defineEmits(["refresh"]) const emit = defineEmits(["refresh"])