feat:统计

This commit is contained in:
dzc committed 2025-08-01 20:48:53 +08:00
1 parent 29423ee49f
commit 18f947caa1
6 files changed
+130 -22

No files matched your search

+7 -3
View File
@@ -17,11 +17,15 @@ export const list = () => {
})
}
export const pageList = (params?: Object) => {
export const pageList = (query: any) => {
return request({
url: "/admin/user/page",
method: "get",
params,
method: "post",
params: {
current: query.current,
size: query.size,
},
data: query,
})
}
+105
View File
@@ -0,0 +1,105 @@
<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">
<el-row>
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-form-item style="width: 250px" label="用餐时间段" prop="hourType">
<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' }" />
</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-form-item>
<el-form-item>
<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-form>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
@sort-change="sortChangeHandle" @expand-change="tableExpandChange">
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
v-bind="state.pagination" />
</DraggableDepTree>
</div>
</div>
</template>
<script setup lang="ts" name="canteen-dept-total">
import { BasicTableProps, useTable } from "/@/hooks/table"
import * as hardTotalApi from "/@/api/hard/hard-total"
// 搜索变量
const queryRef = ref()
const showSearch = ref(true)
const productTotalTableRef = ref()
// 多选变量
const selectObjs = ref([]) as any
const multiple = ref(true)
const draggableDepTreeRef = ref() // 树组件ref引用
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: hardTotalApi.canteenProudctTotal,
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, postDownBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
// 清空搜索条件
queryRef.value?.resetFields()
// 清空多选
selectObjs.value = []
state.queryForm.deptId = ""
state.queryForm.userDeptIds = []
draggableDepTreeRef.value.resetData()
getDataList()
}
// 点击table展开行
const tableExpandChange = async (e: any) => {
try {
console.log(e);
} catch (error: any) {
console.error(error);
}
}
// 多选事件
const selectionChangHandle = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id)
multiple.value = !objs.length
}
// 搜索
const doSearch = () => {
productTotalTableRef.value.updateQueryParams(state.queryForm)
getDataList()
}
// 树节点选择时
const handleGetSelectNode = (curClickedNode: any, checkedTreeNodes: any, isDeepTree: any) => {
state.queryForm.deptId = curClickedNode.id
state.queryForm.userDeptIds = checkedTreeNodes.map((item: any) => item.id)
state.queryForm.isInclude = !isDeepTree
getDataList()
}
</script>
<style lang="scss" scoped></style>
+14 -15
View File
@@ -40,34 +40,33 @@
<el-table-column type="expand" width="50">
<template #default="{ row }">
<div class="mx-10">
<el-table class="my-2" :data="getTableChildrenMap(row.uniqueCode)" border
<div class="ml-[50px] my-2">
<el-table :data="getTableChildrenMap(row.uniqueCode)" border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle">
<el-table-column type="index" label="#" width="50" />
<el-table-column prop="userDeptName" align="center" label="部门" width="150" />
<el-table-column label="用餐时间段" min-width="100" align="center" prop="hourType">
<el-table-column label="用餐时间段" width="100" align="center" prop="hourType">
<template #default="{ row }">
<dict-tag :options="daily_menu" :value="row.hourType" />
</template>
</el-table-column>
<el-table-column label="交易人数" min-width="100" align="center"
prop="payUserCount">
<el-table-column label="交易人数" width="150" align="center" prop="payUserCount">
<template #default="{ row }">
<span class="color-primary"> {{ row.payUserCount || 0 }}次 </span>
<span class="color-primary"> {{ row.payUserCount || 0 }}人 </span>
</template>
</el-table-column>
<el-table-column label="交易次数" min-width="100" align="center" prop="timeCount">
<el-table-column label="交易次数" width="150" align="center" prop="timeCount">
<template #default="{ row }">
<span class="color-primary"> {{ row.timeCount || 0 }}次 </span>
</template>
</el-table-column>
<el-table-column label="售出商品数量" min-width="150" align="center" prop="payCount">
<el-table-column label="售出商品数量" width="150" align="center" prop="payCount">
<template #default="{ row }">
<span class="color-success"> {{ row.payCount || 0 }}份 </span>
</template>
</el-table-column>
<el-table-column label="总价" min-width="100" prop="totalPrice" align="center">
<el-table-column label="总价" width="150" prop="totalPrice" align="center">
<template #default="{ row }">
<span>{{ displayPrice(row.totalPrice) }}</span>
</template>
@@ -83,27 +82,27 @@
<span>{{ parseTime(row.createTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="用餐时间段" min-width="100" align="center" prop="hourType">
<el-table-column label="用餐时间段" width="100" align="center" prop="hourType">
<template #default="{ row }">
<dict-tag :options="daily_menu" :value="row.hourType" />
</template>
</el-table-column>
<el-table-column label="交易人数" min-width="100" align="center" prop="payUserCount">
<el-table-column label="交易人数" width="150" align="center" prop="payUserCount">
<template #default="{ row }">
<span class="color-primary"> {{ row.payUserCount || 0 }}次 </span>
<span class="color-primary"> {{ row.payUserCount || 0 }}人 </span>
</template>
</el-table-column>
<el-table-column label="交易次数" min-width="100" align="center" prop="timeCount">
<el-table-column label="交易次数" width="150" align="center" prop="timeCount">
<template #default="{ row }">
<span class="color-primary"> {{ row.timeCount || 0 }}次 </span>
</template>
</el-table-column>
<el-table-column label="售出商品数量" min-width="150" align="center" prop="payCount">
<el-table-column label="售出商品数量" width="150" align="center" prop="payCount">
<template #default="{ row }">
<span class="color-success"> {{ row.payCount || 0 }}份 </span>
</template>
</el-table-column>
<el-table-column label="总价" min-width="100" prop="totalPrice" align="center">
<el-table-column label="总价" width="150" prop="totalPrice" align="center">
<template #default="{ row }">
<span>{{ displayPrice(row.totalPrice) }}</span>
</template>
@@ -71,7 +71,7 @@
<dict-tag :options="check_status" :value="row.processStatus" />
</template>
</el-table-column>
<el-table-column prop="status" label="发票状态" width="120">
<el-table-column prop="status" label="发票状态" width="200">
<template #default="{ row }">
<dict-tag :options="recharge_invoice_status" :value="row.status" />
</template>
@@ -89,9 +89,9 @@
<template #footer>
<el-button @click="handleClose" :disabled="loading">关闭</el-button>
<el-button v-if="['2', '3'].includes(receiptData.processStatus!) && !['6'].includes(receiptData.status!)"
v-auth="'wallet_walletRechargeApply_back'" type="primary" plain @click="backInvoice"
:disabled="loading">
<!-- ['2', '3'].includes(receiptData.processStatus!) && !['6'].includes(receiptData.status!) -->
<el-button v-if="['2', '3'].includes(receiptData.processStatus!)" v-auth="'wallet_walletRechargeApply_back'"
type="primary" plain @click="backInvoice" :disabled="loading">
作废
</el-button>
<el-button v-if="!receiptData.processStatus && !['6'].includes(receiptData.status!)" type="primary"