feat:部门交易金额导出
This commit is contained in:
1 parent
abdaa1a557
commit
ec29b18fca
1 file changed
+62
-36
@@ -3,20 +3,10 @@
|
|||||||
<div class="layout-padding-auto layout-padding-view">
|
<div class="layout-padding-auto layout-padding-view">
|
||||||
<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="4">
|
|
||||||
<el-form-item class="w100" label="饭卡类型" prop="walletTypeId">
|
|
||||||
<select-wallet-type v-model="state.queryForm.walletTypeId" placeholder="饭卡类型" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-form-item class="w100" label="审核状态" prop="processStatus">
|
|
||||||
<dict-select v-model="state.queryForm.processStatus" dict-code="check_status" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item class="w100" label="审核时间" prop="processTimeList">
|
<el-form-item class="w100" label="时间" prop="createTimeList">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="state.queryForm.processTimeList"
|
v-model="state.queryForm.createTimeList"
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
/>
|
/>
|
||||||
@@ -30,6 +20,19 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</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_dept'"
|
||||||
|
@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"
|
||||||
@@ -43,35 +46,41 @@
|
|||||||
>
|
>
|
||||||
<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="80" />
|
<el-table-column type="index" label="#" width="80" />
|
||||||
<el-table-column width="200" label="用户">
|
<el-table-column prop="deptName" min-width="150" label="部门" />
|
||||||
|
<el-table-column prop="walletPrice" label="充值金额" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="flex flex-row items-center justify-center">
|
<div :class="{ 'color-success': row.walletPrice != 0 }">{{ displayPrice(row.walletPrice) }}</div>
|
||||||
<preview-image width="50px" height="50px" :src="row.userAvatar" />
|
</template>
|
||||||
<div class="flex flex-col ml-2 items-start cursor-pointer hover:underline hover:text-blue-500">
|
</el-table-column>
|
||||||
<span> {{ row.username }} </span>
|
<el-table-column prop="walletCount" label="充值次数" align="center">
|
||||||
<span> {{ row.userMobile }} </span>
|
<template #default="{ row }">
|
||||||
<span> {{ row.userDeptName }} </span>
|
<div :class="{ 'color-success': row.walletCount != 0 }">{{ row.walletCount }}次</div>
|
||||||
</div>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="orderPayPrice" label="消费金额" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div :class="{ 'color-primary': row.orderPayPrice != 0 }">{{ displayPrice(row.orderPayPrice) }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="orderPayCount" label="消费次数" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div :class="{ 'color-primary': row.orderPayCount != 0 }">{{ row.orderPayCount }}次</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="orderRefundPrice" label="退款金额" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div :class="{ 'color-danger': row.orderRefundPrice != 0 }">
|
||||||
|
{{ displayPrice(row.orderRefundPrice) }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="importTime" label="充值月" />
|
<el-table-column prop="orderRefundCont" label="退款次数" align="center">
|
||||||
<el-table-column prop="processTime" label="审核时间" align="center" />
|
|
||||||
<el-table-column prop="beforePrice" label="操作前的金额" align="center">
|
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="color-primary">{{ displayPrice(row.beforePrice) }}</div>
|
<div :class="{ 'color-danger': row.orderRefundCont != 0 }">{{ row.orderRefundCont }}次</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="price" label="操作金额" align="center">
|
<el-table-column v-if="false" label="操作" width="300"> </el-table-column>
|
||||||
<template #default="{ row }">
|
|
||||||
<div class="color-success">{{ displayPrice(row.price) }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column v-if="false" label="操作" width="300">
|
|
||||||
<template #default="{ row }"> </template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -90,6 +99,7 @@ const selectObjs = ref([]) as any
|
|||||||
const multiple = ref(true)
|
const multiple = ref(true)
|
||||||
// 表格变量
|
// 表格变量
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
|
isPage: false,
|
||||||
queryForm: {},
|
queryForm: {},
|
||||||
pageList: hardTotalApi.pageListDept,
|
pageList: hardTotalApi.pageListDept,
|
||||||
})
|
})
|
||||||
@@ -98,17 +108,33 @@ 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("/hard/hard-total/export-dept", Object.assign(state.queryForm), "部门交易记录导出.xlsx")
|
||||||
|
}
|
||||||
|
|
||||||
const getSummaries = (param: any) => {
|
const getSummaries = (param: any) => {
|
||||||
const { columns, data } = param
|
const { columns, data } = param
|
||||||
const totalColumns = ["beforePrice", "price"]
|
const totalColumns = [
|
||||||
|
"walletPrice",
|
||||||
|
"walletCount",
|
||||||
|
"orderPayPrice",
|
||||||
|
"orderPayCount",
|
||||||
|
"orderRefundPrice",
|
||||||
|
"orderRefundCont",
|
||||||
|
]
|
||||||
const totalRow = Array.from({ length: columns.length })
|
const totalRow = Array.from({ length: columns.length })
|
||||||
columns.forEach((i: any, index: number) => {
|
columns.forEach((i: any, index: number) => {
|
||||||
if (totalColumns.includes(i.property)) {
|
if (totalColumns.includes(i.property)) {
|
||||||
const total = data
|
const total = data
|
||||||
.filter((v: any) => v[i.property] != null)
|
.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)
|
.reduce((pren: number, next: number) => pren + next, 0)
|
||||||
totalRow[index] = displayPrice(total)
|
if (i.property.includes("Price")) {
|
||||||
|
totalRow[index] = displayPrice(total)
|
||||||
|
} else {
|
||||||
|
totalRow[index] = total + "次"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return totalRow
|
return totalRow
|
||||||
|
|||||||
Reference in new issue
Block a user