This commit is contained in:
ctw committed 2025-01-24 09:44:43 +08:00
commit 67fd7bfd09
6 files changed
+107 -21

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ export function putObj(obj?: Object) {
export function recover(params?: Object) { export function recover(params?: Object) {
return request({ return request({
url: "/wallet-recharge-import/recover", url: "/wallet/wallet-recharge-import/recover",
method: "get", method: "get",
params, params,
}) })
+26 -4
View File
@@ -40,6 +40,8 @@
: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"
@@ -64,12 +66,17 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="walletTypeUniqueCode" width="200" label="充值金额"> <el-table-column prop="wallet_biz" width="200" label="交易类型">
<template #default="{ row }">
<dict-tag :options="wallet_biz" :value="row.bizType" />
</template>
</el-table-column>
<el-table-column prop="price" width="200" align="center" label="充值金额">
<template #default="{ row }"> <template #default="{ row }">
<div class="color-success">{{ displayPrice(row.price) }}</div> <div class="color-success">{{ displayPrice(row.price) }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="walletTypeUniqueCode" width="200" label="饭卡余额"> <el-table-column prop="balance" width="200" align="center" label="饭卡余额">
<template #default="{ row }"> <template #default="{ row }">
<div class="color-primary">{{ displayPrice(row.balance) }}</div> <div class="color-primary">{{ displayPrice(row.balance) }}</div>
</template> </template>
@@ -90,7 +97,6 @@
</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>
<!-- 编辑、新增 --> <!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" /> <form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
</div> </div>
@@ -106,7 +112,7 @@ import { displayPrice } from "/@/utils/formatMoney"
// 引入组件 // 引入组件
const FormDialog = defineAsyncComponent(() => import("./form.vue")) const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典 // 定义查询字典
const { wallet_type } = useDict("wallet_type") const { wallet_type, wallet_biz } = useDict("wallet_type", "wallet_biz")
// 定义变量内容 // 定义变量内容
const formDialogRef = ref() const formDialogRef = ref()
// 搜索变量 // 搜索变量
@@ -134,6 +140,22 @@ const resetQuery = () => {
getDataList() getDataList()
} }
const getSummaries = (param: any) => {
const { columns, data } = param
const totalColumns = ["price", "balance"]
const totalRow = Array.from({ length: columns.length })
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)
totalRow[index] = displayPrice(total)
}
})
return totalRow
}
// 导出excel // 导出excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile( downBlobFile(
+21 -3
View File
@@ -50,6 +50,8 @@
: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"
@@ -76,17 +78,17 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cardNumber" width="150" label="饭卡卡号" /> <el-table-column prop="cardNumber" width="150" label="饭卡卡号" />
<el-table-column prop="balance" width="100" label="余额"> <el-table-column prop="balance" align="center" width="100" label="余额">
<template #default="{ row }"> <template #default="{ row }">
<div class="color-primary">{{ displayPrice(row.balance) }}</div> <div class="color-primary">{{ displayPrice(row.balance) }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="totalExpense" width="100" label="累计支出"> <el-table-column prop="totalExpense" align="center" width="100" label="累计支出">
<template #default="{ row }"> <template #default="{ row }">
<div class="color-danger">{{ displayPrice(row.totalExpense) }}</div> <div class="color-danger">{{ displayPrice(row.totalExpense) }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="totalRecharge" width="100" label="累计充值"> <el-table-column prop="totalRecharge" align="center" width="100" label="累计充值">
<template #default="{ row }"> <template #default="{ row }">
<div class="color-success">{{ displayPrice(row.totalRecharge) }}</div> <div class="color-success">{{ displayPrice(row.totalRecharge) }}</div>
</template> </template>
@@ -175,6 +177,22 @@ const exportExcel = () => {
) )
} }
const getSummaries = (param: any) => {
const { columns, data } = param
const totalColumns = ["balance", "totalExpense", "totalRecharge"]
const totalRow = Array.from({ length: columns.length })
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)
totalRow[index] = displayPrice(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)
@@ -109,19 +109,16 @@
<div class="color-success">{{ displayPrice(row.price) }}</div> <div class="color-success">{{ displayPrice(row.price) }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="200"> <el-table-column v-auths="['wallet_walletRechargeImport_recover']" label="操作" width="200">
<template #default="{ row }"> <template #default="{ row }">
<!-- <el-button <el-button
v-if="false" v-auth="'wallet_walletRechargeImport_recover'"
icon="delete" icon="RefreshRight"
text text
type="primary" type="primary"
v-auth="'wallet_walletRechargeApply_del'" @click="handleRecover(row.id)"
@click="handleDelete([row.id])" >恢复</el-button
> >
删除</el-button
> -->
<el-button icon="RefreshRight" text type="primary" @click="handleRecover(row.id)">恢复</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -150,6 +147,9 @@ const selectObjs = ref([]) as any
const multiple = ref(true) const multiple = ref(true)
// 表格变量 // 表格变量
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
pagination: {
pageSizes: [1, 10, 20, 50, 100, 200, 500, 1000, 2000],
},
queryForm: {}, queryForm: {},
pageList: walletRechargeImportApi.pageJoin, pageList: walletRechargeImportApi.pageJoin,
}) })
+25 -2
View File
@@ -40,6 +40,8 @@
: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"
@@ -64,7 +66,12 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="walletTypeUniqueCode" width="200" label="退款金额"> <el-table-column prop="wallet_biz" width="200" label="交易类型">
<template #default="{ row }">
<dict-tag :options="wallet_biz" :value="row.bizType" />
</template>
</el-table-column>
<el-table-column prop="price" align="center" width="200" label="退款金额">
<template #default="{ row }"> <template #default="{ row }">
<div class="color-success">{{ displayPrice(row.price) }}</div> <div class="color-success">{{ displayPrice(row.price) }}</div>
</template> </template>
@@ -113,7 +120,7 @@ import { displayPrice } from "/@/utils/formatMoney"
// 引入组件 // 引入组件
const FormDialog = defineAsyncComponent(() => import("./form.vue")) const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典 // 定义查询字典
const { wallet_type } = useDict("wallet_type") const { wallet_type, wallet_biz } = useDict("wallet_type", "wallet_biz")
// 定义变量内容 // 定义变量内容
const formDialogRef = ref() const formDialogRef = ref()
// 搜索变量 // 搜索变量
@@ -160,6 +167,22 @@ const exportExcel = () => {
) )
} }
const getSummaries = (param: any) => {
const { columns, data } = param
const totalColumns = ["price"]
const totalRow = Array.from({ length: columns.length })
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)
totalRow[index] = displayPrice(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)
+25 -2
View File
@@ -40,6 +40,8 @@
: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"
@@ -64,7 +66,12 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="walletTypeUniqueCode" width="200" label="消费金额"> <el-table-column prop="wallet_biz" width="200" label="交易类型">
<template #default="{ row }">
<dict-tag :options="wallet_biz" :value="row.bizType" />
</template>
</el-table-column>
<el-table-column prop="price" align="center" width="200" label="消费金额">
<template #default="{ row }"> <template #default="{ row }">
<div class="color-danger">{{ displayPrice(row.price) }}</div> <div class="color-danger">{{ displayPrice(row.price) }}</div>
</template> </template>
@@ -114,7 +121,7 @@ const { push } = useRouter()
// 引入组件 // 引入组件
const FormDialog = defineAsyncComponent(() => import("./form.vue")) const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典 // 定义查询字典
const { wallet_type } = useDict("wallet_type") const { wallet_type, wallet_biz } = useDict("wallet_type", "wallet_biz")
// 定义变量内容 // 定义变量内容
const formDialogRef = ref() const formDialogRef = ref()
// 搜索变量 // 搜索变量
@@ -161,6 +168,22 @@ const selectionChangHandle = (objs: { id: string }[]) => {
multiple.value = !objs.length multiple.value = !objs.length
} }
const getSummaries = (param: any) => {
const { columns, data } = param
const totalColumns = ["price"]
const totalRow = Array.from({ length: columns.length })
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)
totalRow[index] = displayPrice(total)
}
})
return totalRow
}
// 删除操作 // 删除操作
const handleDelete = async (ids: string[]) => { const handleDelete = async (ids: string[]) => {
try { try {