设备交易记录、商户交易记录
This commit is contained in:
1 parent
4919f9a5cf
commit
d14c139e7d
3 files changed
+138
-2
No files matched your search
@@ -62,6 +62,7 @@
|
|||||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||||
import * as userFaceApi from "/@/api/admin/userFace"
|
import * as userFaceApi from "/@/api/admin/userFace"
|
||||||
import { useMessage } from "/@/hooks/message"
|
import { useMessage } from "/@/hooks/message"
|
||||||
|
import { auth } from "/@/utils/authFunction"
|
||||||
|
|
||||||
// 定义刷新表格emit
|
// 定义刷新表格emit
|
||||||
const emit = defineEmits(["refresh"])
|
const emit = defineEmits(["refresh"])
|
||||||
@@ -83,8 +84,15 @@ const formData = ref<any>({
|
|||||||
})
|
})
|
||||||
const detailId = ref<any>(null)
|
const detailId = ref<any>(null)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (auth("userFace_sysUserFace_view")) {
|
||||||
|
getDataList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// 定义表格查询、后台调用的API
|
// 定义表格查询、后台调用的API
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
|
createdIsNeed: false,
|
||||||
queryForm: {
|
queryForm: {
|
||||||
deptId: "",
|
deptId: "",
|
||||||
username: "",
|
username: "",
|
||||||
|
|||||||
@@ -14,17 +14,55 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<el-row>
|
||||||
|
<div class="mb8" style="width: 100%">
|
||||||
|
<right-toolbar
|
||||||
|
:search="false"
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
:export="'hard_hardTotal_export_sb'"
|
||||||
|
@exportExcel="exportExcel"
|
||||||
|
class="ml10 mr20"
|
||||||
|
style="float: right"
|
||||||
|
@queryTable="getDataList"
|
||||||
|
></right-toolbar>
|
||||||
|
</div>
|
||||||
|
</el-row>
|
||||||
<el-table
|
<el-table
|
||||||
:data="state.dataList"
|
:data="state.dataList"
|
||||||
v-loading="state.loading"
|
v-loading="state.loading"
|
||||||
border
|
border
|
||||||
:cell-style="tableStyle.cellStyle"
|
:cell-style="tableStyle.cellStyle"
|
||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
|
:summary-method="getSummaries"
|
||||||
|
show-summary
|
||||||
@selection-change="selectionChangHandle"
|
@selection-change="selectionChangHandle"
|
||||||
@sort-change="sortChangeHandle"
|
@sort-change="sortChangeHandle"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="40" align="center" />
|
<el-table-column type="selection" width="40" align="center" />
|
||||||
<el-table-column type="index" label="#" width="50" />
|
<el-table-column type="index" label="#" width="50" />
|
||||||
|
<el-table-column label="设备" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div class="flex flex-row items-center justify-center">
|
||||||
|
<div class="mr-2">{{ row.hardName }}</div>
|
||||||
|
<dict-tag :options="hard_type" :value="row.hardType" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商户" align="center" prop="merchantName" />
|
||||||
|
<el-table-column label="总消费金额" align="center" prop="totalPayPrice">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span class="color-success">
|
||||||
|
{{ displayPrice(row.totalPayPrice) }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="总消费次数" align="center" prop="totalPayCount">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span class="color-primary">
|
||||||
|
{{ row.totalPayCount }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</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" />
|
||||||
</div>
|
</div>
|
||||||
@@ -34,14 +72,20 @@
|
|||||||
<script setup lang="ts" name="hard-sb">
|
<script setup lang="ts" name="hard-sb">
|
||||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||||
import * as hardTotalApi from "/@/api/hard/hard-total"
|
import * as hardTotalApi from "/@/api/hard/hard-total"
|
||||||
|
import { displayPrice } from "/@/utils/formatMoney"
|
||||||
|
import { useDict } from "/@/hooks/dict"
|
||||||
|
|
||||||
// 搜索变量
|
// 搜索变量
|
||||||
const queryRef = ref()
|
const queryRef = ref()
|
||||||
|
const showSearch = ref(true)
|
||||||
|
|
||||||
// 多选变量
|
// 多选变量
|
||||||
const selectObjs = ref([]) as any
|
const selectObjs = ref([]) as any
|
||||||
const multiple = ref(true)
|
const multiple = ref(true)
|
||||||
|
|
||||||
|
// 定义查询字典
|
||||||
|
const { hard_type } = useDict("hard_type")
|
||||||
|
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {},
|
queryForm: {},
|
||||||
pageList: hardTotalApi.pageListSb,
|
pageList: hardTotalApi.pageListSb,
|
||||||
@@ -51,6 +95,32 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
|||||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||||
useTable(state)
|
useTable(state)
|
||||||
|
|
||||||
|
// 导出excel
|
||||||
|
const exportExcel = () => {
|
||||||
|
downBlobFile("/wallet/hard-total/export-sb", Object.assign(state.queryForm), "设备交易记录.xlsx")
|
||||||
|
}
|
||||||
|
|
||||||
|
const getSummaries = (param: any) => {
|
||||||
|
const { columns, data } = param
|
||||||
|
const totalColumns = ["totalPayPrice", "totalPayCount"]
|
||||||
|
const totalRow = Array.from({ length: columns.length })
|
||||||
|
totalRow[2] = "合计"
|
||||||
|
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])
|
||||||
|
.reduce((pren: number, next: number) => pren + next, 0)
|
||||||
|
if (i.property.includes("Price")) {
|
||||||
|
totalRow[index] = displayPrice(total)
|
||||||
|
} else {
|
||||||
|
totalRow[index] = total
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return totalRow
|
||||||
|
}
|
||||||
|
|
||||||
// 清空搜索条件
|
// 清空搜索条件
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
// 清空搜索条件
|
// 清空搜索条件
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
<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 :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
<el-form-item class="w100" label="创建时间" prop="payTimeList">
|
<el-form-item class="w100" label="创建时间" prop="createTimeList">
|
||||||
<el-date-picker v-model="state.queryForm.payTimeList" 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-col>
|
</el-col>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -14,10 +14,25 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</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>
|
||||||
|
</div>
|
||||||
|
</el-row>
|
||||||
<el-table
|
<el-table
|
||||||
:data="state.dataList"
|
:data="state.dataList"
|
||||||
v-loading="state.loading"
|
v-loading="state.loading"
|
||||||
border
|
border
|
||||||
|
:summary-method="getSummaries"
|
||||||
|
show-summary
|
||||||
:cell-style="tableStyle.cellStyle"
|
:cell-style="tableStyle.cellStyle"
|
||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
@selection-change="selectionChangHandle"
|
@selection-change="selectionChangHandle"
|
||||||
@@ -25,6 +40,21 @@
|
|||||||
>
|
>
|
||||||
<el-table-column type="selection" width="40" align="center" />
|
<el-table-column type="selection" width="40" 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="merchantName" />
|
||||||
|
<el-table-column label="总消费金额" align="center" prop="totalPayPrice">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span class="color-success">
|
||||||
|
{{ displayPrice(row.totalPayPrice) }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="总消费次数" align="center" prop="totalPayCount">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span class="color-primary">
|
||||||
|
{{ row.totalPayCount }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</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" />
|
||||||
</div>
|
</div>
|
||||||
@@ -33,10 +63,12 @@
|
|||||||
|
|
||||||
<script setup lang="ts" name="hard-sb">
|
<script setup lang="ts" name="hard-sb">
|
||||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||||
|
import { displayPrice } from "/@/utils/formatMoney"
|
||||||
import * as hardTotalApi from "/@/api/hard/hard-total"
|
import * as hardTotalApi from "/@/api/hard/hard-total"
|
||||||
|
|
||||||
// 搜索变量
|
// 搜索变量
|
||||||
const queryRef = ref()
|
const queryRef = ref()
|
||||||
|
const showSearch = ref(true)
|
||||||
|
|
||||||
// 多选变量
|
// 多选变量
|
||||||
const selectObjs = ref([]) as any
|
const selectObjs = ref([]) as any
|
||||||
@@ -60,6 +92,32 @@ const resetQuery = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 导出excel
|
||||||
|
const exportExcel = () => {
|
||||||
|
downBlobFile("/wallet/hard-total/export-cs", Object.assign(state.queryForm), "商户交易记录.xlsx")
|
||||||
|
}
|
||||||
|
|
||||||
|
const getSummaries = (param: any) => {
|
||||||
|
const { columns, data } = param
|
||||||
|
const totalColumns = ["totalPayPrice", "totalPayCount"]
|
||||||
|
const totalRow = Array.from({ length: columns.length })
|
||||||
|
totalRow[2] = "合计"
|
||||||
|
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])
|
||||||
|
.reduce((pren: number, next: number) => pren + next, 0)
|
||||||
|
if (i.property.includes("Price")) {
|
||||||
|
totalRow[index] = displayPrice(total)
|
||||||
|
} else {
|
||||||
|
totalRow[index] = total
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return totalRow
|
||||||
|
}
|
||||||
|
|
||||||
// 多选事件
|
// 多选事件
|
||||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||||
selectObjs.value = objs.map(({ id }) => id)
|
selectObjs.value = objs.map(({ id }) => id)
|
||||||
|
|||||||
Reference in new issue
Block a user