8/10 车位信息-车辆信息,

This commit is contained in:
Zy
2026-08-11 08:10:43 +08:00
parent 1c11add746
commit 0717bb489b
6 changed files with 85 additions and 81 deletions

View File

@@ -10,15 +10,14 @@
clearable
v-model="SearchTime"
@change="
(val) => {
(val: string[]) => {
if (!val) {
queryParams.startDate = '';
queryParams.endDate = '';
return;
}
SearchTime = val;
const days = val;
const [star, end] = days.map((item) => item.split(' ')[0]);
const [star, end] = val.map((item) => item.split(' ')[0]);
queryParams.startDate = star + ' 00:00:00';
queryParams.endDate = end + ' 23:59:59';
}
@@ -38,7 +37,7 @@
<el-button @click="handleExport" v-has-permi="['water:topupRecord:export']" type="warning">导出统计</el-button>
</div>
</template>
<el-table v-loading="loading" border :data="topupRecordList">
<el-table :span-method="handleSpanMethod" v-loading="loading" border :data="topupRecordList">
<el-table-column label="充值时间" align="center" prop="rechargeTime">
<template #default="scope">
<span v-if="scope.row.rechargeTime">{{ scope.row.rechargeTime }}</span>
@@ -92,12 +91,31 @@
</template>
<script setup lang="ts">
import { getTopupRecordByDate, type TopupRecordList } from '@/api/system/SdbTopupRecord/index';
import { getTopupRecordByDate, type TopupRecordList } from '@/api/system/SdbTopupRecord';
import { checkPermi } from '@/utils/permission';
import { sum } from '@/utils/money';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const topupRecordList = ref<TopupRecordList[]>([]);
function handleSpanMethod({ rowIndex, columnIndex }) {
if (rowIndex === topupRecordList.value.length - 1) {
const rowspan = 7;
if (columnIndex === 0) {
return [1, rowspan];
}
if (columnIndex < rowspan) {
return [0, 0];
}
if (columnIndex === 8) {
return [0, 0];
}
if (columnIndex === 7) {
return [1, 2];
}
}
return [1, 1];
}
const loading = ref(false);
const total = ref(0);
@@ -121,9 +139,18 @@ const getList = async () => {
loading.value = true;
const res = await getTopupRecordByDate(queryParams.value);
topupRecordList.value = res.rows;
topupRecordList.value[topupRecordList.value.length - 1].rechargeTime = '合计';
total.value = res.total;
loading.value = false;
totalMoney.value = sum(topupRecordList.value.map((item) => item.rechargeAmount));
totalMoney.value = sum(
topupRecordList.value.map((item) => {
if (item.id) {
return item.rechargeAmount;
} else {
return 0;
}
})
);
};
onMounted(() => {