8/7 应收欠费汇总表,应收欠费明细表
This commit is contained in:
241
src/views/system/report/aging.vue
Normal file
241
src/views/system/report/aging.vue
Normal file
@@ -0,0 +1,241 @@
|
||||
<template>
|
||||
<div class="p-2 h-full flex flex-col">
|
||||
<pageHeader></pageHeader>
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" @submit.prevent="handleQuery" :inline="true">
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<el-form-item label-width="100" label="截至应收账期" prop="villageId">
|
||||
<el-date-picker
|
||||
v-model="queryTime"
|
||||
type="daterange"
|
||||
@update:model-value="handleQueryTime"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM"
|
||||
value-format="YYYY-MM"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="小区" prop="villageId">
|
||||
<el-select v-model="queryParams.villageId" placeholder="请选择">
|
||||
<el-option v-for="item in villageList" :key="item.villageId" :label="item.villageName" :value="item.villageId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="房屋类型" prop="houseUseTypeId">
|
||||
<el-select v-model="queryParams.houseUseTypeId" placeholder="请选择">
|
||||
<el-option v-for="item in houseUseList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="账龄区间" prop="agingRange">
|
||||
<el-select :multiple="true" v-model="queryParams.agingRange" placeholder="请选择">
|
||||
<el-option v-for="item in [...com_report_age_list]" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="flex-1">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="5">
|
||||
<span>账龄分析汇总表</span>
|
||||
</el-col>
|
||||
<el-col :span="18"></el-col>
|
||||
<el-col :span="1">
|
||||
<el-button type="primary" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table :span-method="arraySpanMethod" v-loading="loading" border :data="AgingList">
|
||||
<el-table-column label="截至应收账期" align="center" prop="cutoffPeriod" />
|
||||
<el-table-column label="小区项目" align="center" prop="villageName" />
|
||||
<el-table-column label="房屋类型" align="center" prop="houseTypeName" />
|
||||
<el-table-column label="≤6个月" align="center" prop="amountLe6" />
|
||||
<el-table-column label="6个月-12个月" align="center" prop="amountM6To12" />
|
||||
<el-table-column label="1年-2年" align="center" prop="amountY1To2" />
|
||||
<el-table-column label="2年-3年" align="center" prop="amountY2To3" />
|
||||
<el-table-column label="3年-4年" align="center" prop="amountY3To4" />
|
||||
<el-table-column label="4年-5年" align="center" prop="amountY4To5" />
|
||||
<el-table-column label="5年以上" align="center" prop="amountOver5" />
|
||||
<el-table-column label="合计" align="center" prop="totalAmount" />
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Arrears" lang="ts">
|
||||
import pagination from '@/components/Pagination/index.vue';
|
||||
import pageHeader from '@/components/Pageheader/index.vue';
|
||||
import { listHouseUseType } from '@/api/system/houseUse';
|
||||
import { getCommunitylistAPI } from '@/api/system/community';
|
||||
import { getAgingList } from '@/api/system/report/aging';
|
||||
import { AgingSummary } from '@/api/system/report/aging/type';
|
||||
import type { TableColumnCtx } from 'element-plus';
|
||||
import { exportToExcel } from '@/utils/xlsx';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_report_age_list } = toRefs<any>(proxy?.useDict('com_report_age_list'));
|
||||
const AgingList = ref<AgingSummary[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
const queryTime = ref([]);
|
||||
function handleQueryTime(val: string[]) {
|
||||
queryParams.value.periodBegin = val[0];
|
||||
queryParams.value.periodEnd = val[1];
|
||||
}
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
periodBegin: '',
|
||||
periodEnd: '',
|
||||
villageId: '-1',
|
||||
houseUseTypeId: '-1',
|
||||
agingRange: []
|
||||
}
|
||||
});
|
||||
interface SpanMethodProps {
|
||||
row: AgingSummary;
|
||||
column: TableColumnCtx<AgingSummary>;
|
||||
rowIndex: number;
|
||||
columnIndex: number;
|
||||
}
|
||||
|
||||
const arraySpanMethod = ({ rowIndex, columnIndex }: SpanMethodProps) => {
|
||||
if (rowIndex === AgingList.value.length - 1) {
|
||||
if (columnIndex === 0) {
|
||||
return { rowspan: 1, colspan: 3 };
|
||||
}
|
||||
if (columnIndex === 1) {
|
||||
return { rowspan: 0, colspan: 0 };
|
||||
}
|
||||
if (columnIndex === 2) {
|
||||
return { rowspan: 0, colspan: 0 };
|
||||
}
|
||||
}
|
||||
// 普通行不合并
|
||||
return { rowspan: 1, colspan: 1 };
|
||||
};
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
|
||||
const houseUseList = ref([]);
|
||||
function handleQueryHouseUse() {
|
||||
listHouseUseType().then((res) => {
|
||||
houseUseList.value = [
|
||||
{
|
||||
id: '-1',
|
||||
name: '全部类型'
|
||||
},
|
||||
...res.rows
|
||||
];
|
||||
});
|
||||
}
|
||||
// 查询小区
|
||||
const villageList = ref([]);
|
||||
function getAllVillage() {
|
||||
getCommunitylistAPI().then((res) => {
|
||||
villageList.value = [
|
||||
{
|
||||
villageId: '-1',
|
||||
villageName: '全部小区'
|
||||
},
|
||||
...res.rows
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const search = { ...queryParams.value };
|
||||
// 移除空字符串字段
|
||||
Object.keys(search).forEach((key) => {
|
||||
if (search[key] === '-1') {
|
||||
search[key] = undefined;
|
||||
}
|
||||
});
|
||||
getAgingList(search)
|
||||
.then((res) => {
|
||||
AgingList.value = [...res.rows, res.summary];
|
||||
total.value = res.total;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 导出Excel */
|
||||
const handleExport = () => {
|
||||
if (AgingList.value.length === 0) {
|
||||
proxy?.$modal.msgWarning('没有可导出的数据');
|
||||
return;
|
||||
}
|
||||
// 显示加载提示
|
||||
loading.value = true;
|
||||
// 使用 setTimeout 让出主线程,避免阻塞UI
|
||||
setTimeout(() => {
|
||||
try {
|
||||
const columns: { label: string; prop: string }[] = [
|
||||
{ label: '截至应收账期', prop: 'cutoffPeriod' },
|
||||
{ label: '小区项目', prop: 'villageName' },
|
||||
{ label: '房屋类型', prop: 'houseTypeName' },
|
||||
{ label: '≤6个月', prop: 'amountLe6' },
|
||||
{ label: '6个月-12个月', prop: 'amountM6To12' },
|
||||
{ label: '1年-2年', prop: 'amountY1To2' },
|
||||
{ label: '2年-3年', prop: 'amountY2To3' },
|
||||
{ label: '3年-4年', prop: 'amountY3To4' },
|
||||
{ label: '4年-5年', prop: 'amountY4To5' },
|
||||
{ label: '5年以上', prop: 'amountOver5' },
|
||||
{ label: '合计', prop: 'totalAmount' }
|
||||
];
|
||||
const mergeColumns = [0, 1, 2];
|
||||
exportToExcel(AgingList.value, columns, `账龄分析汇总_${new Date().getTime()}`, mergeColumns);
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('导出失败,请重试');
|
||||
console.error('导出错误:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}, 100);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
handleQueryHouseUse();
|
||||
getAllVillage();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-table {
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
</style>
|
||||
223
src/views/system/report/agingDetailed.vue
Normal file
223
src/views/system/report/agingDetailed.vue
Normal file
@@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<div class="p-2 h-full flex flex-col">
|
||||
<pageHeader></pageHeader>
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" @submit.prevent="handleQuery" :inline="true">
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<el-form-item label="小区" prop="villageId">
|
||||
<el-select v-model="queryParams.villageId" placeholder="请选择">
|
||||
<el-option v-for="item in villageList" :key="item.villageId" :label="item.villageName" :value="item.villageId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="楼栋" prop="villageId">
|
||||
<el-select v-model="queryParams.villageId" placeholder="请选择">
|
||||
<el-option v-for="item in villageList" :key="item.villageId" :label="item.villageName" :value="item.villageId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="房号" prop="villageId">
|
||||
<el-select v-model="queryParams.villageId" placeholder="请选择">
|
||||
<el-option v-for="item in villageList" :key="item.villageId" :label="item.villageName" :value="item.villageId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="欠费月数" prop="villageId">
|
||||
<el-select v-model="queryParams.villageId" placeholder="请选择">
|
||||
<el-option v-for="item in villageList" :key="item.villageId" :label="item.villageName" :value="item.villageId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="账龄区间" prop="agingRange">
|
||||
<el-select :multiple="true" v-model="queryParams.agingRange" placeholder="请选择">
|
||||
<el-option v-for="item in [...com_report_age_list]" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="flex-1">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="5">
|
||||
<span>账龄分析汇总表</span>
|
||||
</el-col>
|
||||
<el-col :span="18"></el-col>
|
||||
<el-col :span="1">
|
||||
<el-button type="primary" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table :span-method="arraySpanMethod" v-loading="loading" border :data="AgingList">
|
||||
<el-table-column label="截至应收账期" align="center" prop="cutoffPeriod" />
|
||||
<el-table-column label="小区项目" align="center" prop="villageName" />
|
||||
<el-table-column label="楼栋" align="center" prop="villageName" />
|
||||
<el-table-column label="客户名称" align="center" prop="villageName" />
|
||||
<el-table-column label="房号编号" align="center" prop="villageName" />
|
||||
<el-table-column label="欠费月数" align="center" prop="houseTypeName" />
|
||||
<el-table-column label="≤6个月" align="center" prop="amountLe6" />
|
||||
<el-table-column label="6个月-12个月" align="center" prop="amountM6To12" />
|
||||
<el-table-column label="1年-2年" align="center" prop="amountY1To2" />
|
||||
<el-table-column label="2年-3年" align="center" prop="amountY2To3" />
|
||||
<el-table-column label="3年-4年" align="center" prop="amountY3To4" />
|
||||
<el-table-column label="4年-5年" align="center" prop="amountY4To5" />
|
||||
<el-table-column label="5年以上" align="center" prop="amountOver5" />
|
||||
<el-table-column label="合计" align="center" prop="totalAmount" />
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Arrears" lang="ts">
|
||||
import pagination from '@/components/Pagination/index.vue';
|
||||
import pageHeader from '@/components/Pageheader/index.vue';
|
||||
import { listHouseUseType } from '@/api/system/houseUse';
|
||||
import { getCommunitylistAPI } from '@/api/system/community';
|
||||
import { getAgingDetail, getAgingList } from '@/api/system/report/aging';
|
||||
import { AgingSummary } from '@/api/system/report/aging/type';
|
||||
import type { TableColumnCtx } from 'element-plus';
|
||||
import { exportToExcel } from '@/utils/xlsx';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_report_age_list } = toRefs<any>(proxy?.useDict('com_report_age_list'));
|
||||
const AgingList = ref<AgingSummary[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
periodBegin: '',
|
||||
periodEnd: '',
|
||||
villageId: '-1',
|
||||
houseUseTypeId: '-1',
|
||||
agingRange: []
|
||||
}
|
||||
});
|
||||
interface SpanMethodProps {
|
||||
row: AgingSummary;
|
||||
column: TableColumnCtx<AgingSummary>;
|
||||
rowIndex: number;
|
||||
columnIndex: number;
|
||||
}
|
||||
|
||||
const arraySpanMethod = ({ rowIndex, columnIndex }: SpanMethodProps) => {
|
||||
if (rowIndex === AgingList.value.length - 1) {
|
||||
const rowspan = 6;
|
||||
if (columnIndex === 0) {
|
||||
return { rowspan: 1, colspan: rowspan };
|
||||
}
|
||||
if (columnIndex <= rowspan) {
|
||||
return { rowspan: 0, colspan: 0 };
|
||||
}
|
||||
}
|
||||
// 普通行不合并
|
||||
return { rowspan: 1, colspan: 1 };
|
||||
};
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
|
||||
// 查询小区
|
||||
const villageList = ref([]);
|
||||
function getAllVillage() {
|
||||
getCommunitylistAPI().then((res) => {
|
||||
villageList.value = [
|
||||
{
|
||||
villageId: '-1',
|
||||
villageName: '全部小区'
|
||||
},
|
||||
...res.rows
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const search = { ...queryParams.value };
|
||||
// 移除空字符串字段
|
||||
Object.keys(search).forEach((key) => {
|
||||
if (search[key] === '-1') {
|
||||
search[key] = undefined;
|
||||
}
|
||||
});
|
||||
getAgingList(search)
|
||||
.then((res) => {
|
||||
AgingList.value = [...res.rows, res.summary];
|
||||
total.value = res.total;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 导出Excel */
|
||||
const handleExport = () => {
|
||||
if (AgingList.value.length === 0) {
|
||||
proxy?.$modal.msgWarning('没有可导出的数据');
|
||||
return;
|
||||
}
|
||||
// 显示加载提示
|
||||
loading.value = true;
|
||||
// 使用 setTimeout 让出主线程,避免阻塞UI
|
||||
setTimeout(() => {
|
||||
try {
|
||||
const columns: { label: string; prop: string }[] = [
|
||||
{ label: '截至应收账期', prop: 'cutoffPeriod' },
|
||||
{ label: '小区项目', prop: 'villageName' },
|
||||
{ label: '房屋类型', prop: 'houseTypeName' },
|
||||
{ label: '≤6个月', prop: 'amountLe6' },
|
||||
{ label: '6个月-12个月', prop: 'amountM6To12' },
|
||||
{ label: '1年-2年', prop: 'amountY1To2' },
|
||||
{ label: '2年-3年', prop: 'amountY2To3' },
|
||||
{ label: '3年-4年', prop: 'amountY3To4' },
|
||||
{ label: '4年-5年', prop: 'amountY4To5' },
|
||||
{ label: '5年以上', prop: 'amountOver5' },
|
||||
{ label: '合计', prop: 'totalAmount' }
|
||||
];
|
||||
const mergeColumns = [0, 1, 2];
|
||||
exportToExcel(AgingList.value, columns, `账龄分析汇总_${new Date().getTime()}`, mergeColumns);
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('导出失败,请重试');
|
||||
console.error('导出错误:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}, 100);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
handleQueryHouseUse();
|
||||
getAllVillage();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-table {
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
</style>
|
||||
372
src/views/system/report/arrears.vue
Normal file
372
src/views/system/report/arrears.vue
Normal file
@@ -0,0 +1,372 @@
|
||||
<template>
|
||||
<div class="p-2 h-full flex flex-col">
|
||||
<pageHeader></pageHeader>
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" @submit.prevent="handleQuery" :inline="true">
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<el-form-item label="小区" prop="villageId">
|
||||
<el-select @change="handleVillageChange" v-model="queryParams.villageId" placeholder="请选择">
|
||||
<el-option v-for="item in villageList" :key="item.villageId" :label="item.villageName" :value="item.villageId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="收费项目" prop="chargeItemId">
|
||||
<el-select v-model="queryParams.chargeItemId" placeholder="请选择">
|
||||
<el-option v-for="item in chargeItemList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="房屋类型" prop="houseUseId">
|
||||
<el-select v-model="queryParams.houseUseId" placeholder="请选择">
|
||||
<el-option v-for="item in houseUseList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="flex-1">
|
||||
<template #header>
|
||||
<el-row :gutter="10" style="margin-bottom: 30px">
|
||||
<el-col :span="5">
|
||||
<div class="flex items-center">
|
||||
<div style="width: 200px; font-size: 15px; margin-right: 10px">应收欠费汇总列表</div>
|
||||
<el-select @change="handleViewTypeChange" v-model="queryParams.viewType" placeholder="请选择视图类型">
|
||||
<el-option label="维度1(按收费类型)" :value="1" />
|
||||
<el-option label="维度2(按房屋类型)" :value="2" />
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="18"></el-col>
|
||||
<el-col :span="1">
|
||||
<el-button type="primary" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table
|
||||
:key="queryParams.viewType"
|
||||
:row-class-name="handleRowClass"
|
||||
:span-method="mergeSpanMethod"
|
||||
v-loading="loading"
|
||||
border
|
||||
:data="ArrearsList"
|
||||
>
|
||||
<el-table-column label="小区" align="center" prop="villageName" />
|
||||
<template v-if="queryParams.viewType === 1">
|
||||
<el-table-column label="收费项目" align="center" prop="chargeItemName" />
|
||||
<el-table-column v-for="(item, index) in houseTypeKeys" :key="index" :label="item" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.houseTypeAmounts?.[item] || '---' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-if="queryParams.viewType === 2">
|
||||
<el-table-column label="房屋类型" align="center" prop="houseTypeName" />
|
||||
<el-table-column v-for="(item, index) in houseTypeKeys2" :key="index" :label="item" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.chargeItemAmounts?.[item] || '---' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="金额" align="center" prop="totalAmount" />
|
||||
</el-table>
|
||||
<!-- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />-->
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Arrears" lang="ts">
|
||||
// import pagination from '@/components/Pagination/index.vue';
|
||||
import pageHeader from '@/components/Pageheader/index.vue';
|
||||
import { getArrearsList } from '@/api/system/report/arrears/arrears';
|
||||
// import { ArrearsQuery } from '@/api/system/residentReviewProcess/type';
|
||||
import { listHouseUseType } from '@/api/system/houseUse';
|
||||
import { listChargeItem } from '@/api/system/SdbChargeItem';
|
||||
import { getCommunitylistAPI } from '@/api/system/community';
|
||||
import { ArrearsVO } from '@/api/system/report/arrears/type';
|
||||
import { exportToExcel } from '@/utils/xlsx';
|
||||
import { ref } from 'vue';
|
||||
import { listChargeType } from '@/api/system/ChargeType';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const ArrearsList = ref<ArrearsVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
viewType: 1,
|
||||
villageId: '-1',
|
||||
chargeItemId: '-1',
|
||||
houseUseId: '-1'
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
|
||||
// 查询 房屋类型╬╬╬╬╬2╬>
|
||||
const houseUseList = ref([]);
|
||||
function handleQueryHouseUse() {
|
||||
listHouseUseType().then((res) => {
|
||||
houseUseList.value = [
|
||||
{
|
||||
id: '-1',
|
||||
name: '全部类型'
|
||||
},
|
||||
...res.rows
|
||||
];
|
||||
});
|
||||
}
|
||||
// 收费项目
|
||||
|
||||
// 查询小区
|
||||
const villageList = ref([]);
|
||||
function getAllVillage() {
|
||||
getCommunitylistAPI().then((res) => {
|
||||
villageList.value = [
|
||||
{
|
||||
villageId: '-1',
|
||||
villageName: '全部小区'
|
||||
},
|
||||
...res.rows
|
||||
];
|
||||
});
|
||||
}
|
||||
// 改变小区
|
||||
function handleVillageChange(val: string) {
|
||||
queryParams.value.villageId = val;
|
||||
queryParams.value.chargeItemId = '-1';
|
||||
}
|
||||
const chargeItemList = ref([]);
|
||||
listChargeType().then((res) => {
|
||||
chargeItemList.value = [
|
||||
{
|
||||
id: '-1',
|
||||
name: '全部项目'
|
||||
},
|
||||
...res.rows
|
||||
];
|
||||
});
|
||||
|
||||
function handleViewTypeChange(val: number) {
|
||||
queryParams.value.viewType = val;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 查询电抄记录列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const search = { ...queryParams.value };
|
||||
// 移除空字符串字段
|
||||
Object.keys(search).forEach((key) => {
|
||||
if (search[key] === '-1') {
|
||||
search[key] = undefined;
|
||||
}
|
||||
});
|
||||
getArrearsList(search)
|
||||
.then((res) => {
|
||||
ArrearsList.value = res.data;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
// 提取全表所有房型,统一所有行列(使用缓存优化)
|
||||
const houseTypeKeys = computed(() => {
|
||||
const keys = new Set();
|
||||
const list = ArrearsList.value;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const amounts = list[i].houseTypeAmounts;
|
||||
if (amounts) {
|
||||
Object.keys(amounts).forEach((k) => keys.add(k));
|
||||
}
|
||||
}
|
||||
return [...keys] as string[];
|
||||
});
|
||||
const houseTypeKeys2 = computed(() => {
|
||||
const keys = new Set();
|
||||
const list = ArrearsList.value;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const amounts = list[i].chargeItemAmounts;
|
||||
if (amounts) {
|
||||
Object.keys(amounts).forEach((k) => keys.add(k));
|
||||
}
|
||||
}
|
||||
return [...keys] as string[];
|
||||
});
|
||||
|
||||
function handleRowClass({ row }) {
|
||||
if (queryParams.value.viewType === 1) {
|
||||
if (row.chargeItemName === '合计') {
|
||||
// 示例1:收费项目等于物业费的行加深色
|
||||
return 'bg-dark';
|
||||
}
|
||||
return '';
|
||||
} else {
|
||||
if (row.houseTypeName === '合计') {
|
||||
// 示例1:收费项目等于物业费的行加深色
|
||||
return 'bg-dark';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
const mergeSpanMethod = ({ row, columnIndex, rowIndex }) => {
|
||||
const lastRowIndex = ArrearsList.value.length - 1;
|
||||
if (rowIndex === lastRowIndex) {
|
||||
if (columnIndex === 0) {
|
||||
return { rowspan: 1, colspan: 2 };
|
||||
}
|
||||
if (columnIndex === 1) {
|
||||
return { rowspan: 0, colspan: 0 };
|
||||
}
|
||||
}
|
||||
|
||||
if (columnIndex === 0) {
|
||||
if (rowIndex > 0 && row.villageName === ArrearsList.value[rowIndex - 1].villageName) {
|
||||
return { rowspan: 0, colspan: 0 };
|
||||
}
|
||||
let rowspan = 1;
|
||||
for (let i = rowIndex + 1; i < ArrearsList.value.length; i++) {
|
||||
if (ArrearsList.value[i].villageName === row.villageName) {
|
||||
rowspan++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return { rowspan, colspan: 1 };
|
||||
}
|
||||
|
||||
// 普通行不合并
|
||||
return { rowspan: 1, colspan: 1 };
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 导出Excel */
|
||||
const handleExport = () => {
|
||||
if (ArrearsList.value.length === 0) {
|
||||
proxy?.$modal.msgWarning('没有可导出的数据');
|
||||
return;
|
||||
}
|
||||
|
||||
// 显示加载提示
|
||||
loading.value = true;
|
||||
// 使用 setTimeout 让出主线程,避免阻塞UI
|
||||
setTimeout(() => {
|
||||
try {
|
||||
const columns: { label: string; prop: string }[] = [{ label: '小区', prop: 'villageName' }];
|
||||
if (queryParams.value.viewType === 1) {
|
||||
columns.push({ label: '收费项目', prop: 'chargeItemName' });
|
||||
houseTypeKeys.value.forEach((type) => {
|
||||
columns.push({ label: type, prop: `houseTypeAmounts[${type}]` });
|
||||
});
|
||||
} else if (queryParams.value.viewType === 2) {
|
||||
columns.push({ label: '房屋类型', prop: 'houseTypeName' });
|
||||
houseTypeKeys2.value.forEach((type) => {
|
||||
columns.push({ label: type, prop: `chargeItemAmounts[${type}]` });
|
||||
});
|
||||
}
|
||||
columns.push({ label: '金额', prop: 'totalAmount' });
|
||||
const processedData = ArrearsList.value.map((row) => {
|
||||
const obj: any = {
|
||||
villageName: row.villageName,
|
||||
totalAmount: row.totalAmount
|
||||
};
|
||||
if (queryParams.value.viewType === 1) {
|
||||
obj.chargeItemName = row.chargeItemName;
|
||||
houseTypeKeys.value.forEach((type) => {
|
||||
obj[`houseTypeAmounts[${type}]`] = row.houseTypeAmounts?.[type] || 0;
|
||||
});
|
||||
} else if (queryParams.value.viewType === 2) {
|
||||
obj.houseTypeName = row.houseTypeName;
|
||||
houseTypeKeys2.value.forEach((type) => {
|
||||
obj[`chargeItemAmounts[${type}]`] = row.chargeItemAmounts?.[type] || 0;
|
||||
});
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
console.log(processedData, columns);
|
||||
const mergeSpanMethod = ({ row, columnIndex, rowIndex }) => {
|
||||
const lastRowIndex = ArrearsList.value.length - 1;
|
||||
if (rowIndex === lastRowIndex) {
|
||||
if (columnIndex === 0) {
|
||||
return { rowspan: 1, colspan: 2 };
|
||||
}
|
||||
if (columnIndex === 1) {
|
||||
return { rowspan: 0, colspan: 0 };
|
||||
}
|
||||
}
|
||||
|
||||
if (columnIndex === 0) {
|
||||
if (rowIndex > 0 && row.villageName === ArrearsList.value[rowIndex - 1].villageName) {
|
||||
return { rowspan: 0, colspan: 0 };
|
||||
}
|
||||
let rowspan = 1;
|
||||
for (let i = rowIndex + 1; i < ArrearsList.value.length; i++) {
|
||||
if (ArrearsList.value[i].villageName === row.villageName) {
|
||||
rowspan++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return { rowspan, colspan: 1 };
|
||||
}
|
||||
|
||||
// 普通行不合并
|
||||
return { rowspan: 1, colspan: 1 };
|
||||
};
|
||||
exportToExcel(processedData, columns, `应收欠费汇总_${new Date().getTime()}`, mergeSpanMethod);
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('导出失败,请重试');
|
||||
console.error('导出错误:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}, 100);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
handleQueryHouseUse();
|
||||
getAllVillage();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-table {
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
|
||||
/* 深度穿透修改表格行背景 */
|
||||
:deep(.bg-dark td) {
|
||||
background-color: #e8f4ff !important;
|
||||
}
|
||||
/* hover 悬浮保留深色 */
|
||||
:deep(.bg-dark:hover td) {
|
||||
background-color: #d0e4fb !important;
|
||||
}
|
||||
</style>
|
||||
356
src/views/system/report/detailed.vue
Normal file
356
src/views/system/report/detailed.vue
Normal file
@@ -0,0 +1,356 @@
|
||||
<template>
|
||||
<div class="p-2 h-full flex flex-col">
|
||||
<pageHeader></pageHeader>
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" @submit.prevent="handleQuery" :inline="true">
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
<el-form-item label="应收账期" prop="villageId">
|
||||
<el-date-picker
|
||||
v-model="queryTime"
|
||||
type="daterange"
|
||||
@update:model-value="handleQueryTime"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域" prop="chargeItemId">
|
||||
<el-select @change="handleVillageChange" v-model="queryParams.villageId" placeholder="请选择">
|
||||
<el-option v-for="item in villageList" :key="item.villageId" :label="item.villageName" :value="item.villageId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="房号" prop="houseNo">
|
||||
<el-input v-model.trim="queryParams.houseNo" placeholder="请输入房号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="欠费月数" prop="month">
|
||||
<el-select v-model="queryParams.month" placeholder="请选择">
|
||||
<el-option v-for="item in MonthList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="flex-1">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="5">
|
||||
<span>应收欠费明细表</span>
|
||||
</el-col>
|
||||
<el-col :span="15"></el-col>
|
||||
<el-col :span="3">
|
||||
<el-button type="primary" @click="handleExport">导出本页</el-button>
|
||||
<el-button type="primary" @click="handleExportAll">导出全部</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table :span-method="mergeSpanMethod" v-loading="loading" border :data="ArrearsDetailList">
|
||||
<el-table-column label="序号" width="80" align="center" prop="serialNumber" />
|
||||
<el-table-column label="区域" align="center" prop="area" />
|
||||
<el-table-column label="房号" align="center" prop="houseNo" />
|
||||
<el-table-column label="客户" align="center" prop="customerName" />
|
||||
<el-table-column label="联系电话" align="center" prop="phone" />
|
||||
<el-table-column label="欠费月数" width="80" align="center" prop="arrearsMonths" />
|
||||
<el-table-column label="应收账期" align="center" prop="billPeriod" />
|
||||
<el-table-column label="欠费项目" align="center">
|
||||
<template #default>
|
||||
<template v-for="(item, index) in dynamicColumns" :key="index">
|
||||
<el-table-column :label="item" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.chargeItemAmounts?.[item] || 0 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="金额合计" align="center" prop="totalAmount">
|
||||
<template #default="scope">
|
||||
<span style="color: red">{{ scope.row.totalAmount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
账龄
|
||||
<script setup name="Arrears" lang="ts">
|
||||
import pagination from '@/components/Pagination/index.vue';
|
||||
import pageHeader from '@/components/Pageheader/index.vue';
|
||||
import { getArrearsDetails } from '@/api/system/report/arrears/arrears';
|
||||
import { listChargeItem } from '@/api/system/SdbChargeItem';
|
||||
import { getCommunitylistAPI } from '@/api/system/community';
|
||||
import { OwnerArrearsDetailVo } from '@/api/system/report/arrears/type';
|
||||
import { getVillageTree } from '@/api/system/house';
|
||||
import { validator } from '@/utils/Reg';
|
||||
import { ColumnConfig, exportToExcel } from '@/utils/xlsx';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const ArrearsDetailList = ref<OwnerArrearsDetailVo[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const queryTime = ref([]);
|
||||
function handleQueryTime(val: string[]) {
|
||||
queryParams.value.startTime = val[0];
|
||||
queryParams.value.endTime = val[1];
|
||||
}
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
villageId: '-1',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
houseNo: '',
|
||||
month: '-1'
|
||||
},
|
||||
rule: [
|
||||
{
|
||||
validator: (_: any, value: string, callback: (arg0?: Error) => any) => {
|
||||
if (value === '' || value === undefined || value === null) {
|
||||
return callback();
|
||||
}
|
||||
if (!validator(value, 'fullFilterReg')) {
|
||||
return callback(new Error('请输入正确的房号'));
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
|
||||
// 查询小区
|
||||
const villageList = ref([]);
|
||||
function getAllVillage() {
|
||||
getCommunitylistAPI().then((res) => {
|
||||
villageList.value = [
|
||||
{
|
||||
villageId: '-1',
|
||||
villageName: '全部区域'
|
||||
},
|
||||
...res.rows
|
||||
];
|
||||
});
|
||||
}
|
||||
// 区域改变时,查询收费项目
|
||||
function handleVillageChange(val: string) {
|
||||
queryParams.value.villageId = val;
|
||||
queryParams.value.houseNo = '-1';
|
||||
}
|
||||
// 月份
|
||||
const MonthList = ref([]);
|
||||
function getMonthList() {
|
||||
const arr = Array.from({ length: 12 }).fill((i) => {
|
||||
return {
|
||||
id: `${i + 1}`,
|
||||
name: `${i + 1}月`
|
||||
};
|
||||
});
|
||||
MonthList.value = [];
|
||||
MonthList.value = [
|
||||
{
|
||||
id: '-1',
|
||||
name: '全部月数'
|
||||
},
|
||||
...arr
|
||||
];
|
||||
}
|
||||
// 动态列名列表▐╬ .3╬
|
||||
const dynamicColumns = ref<string[]>([]);
|
||||
|
||||
// 在获取数据后更新动态列
|
||||
const updateDynamicColumns = (list: any[]) => {
|
||||
const columns = new Set<string>();
|
||||
list.forEach((row) => {
|
||||
if (row.chargeItemAmounts) {
|
||||
Object.keys(row.chargeItemAmounts).forEach((key) => columns.add(key));
|
||||
}
|
||||
});
|
||||
return Array.from(columns);
|
||||
};
|
||||
|
||||
/** 查询电抄记录列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const search = { ...queryParams.value };
|
||||
// 移除空字符串字段
|
||||
Object.keys(search).forEach((key) => {
|
||||
if (search[key] === '-1') {
|
||||
search[key] = undefined;
|
||||
}
|
||||
});
|
||||
getArrearsDetails(search)
|
||||
.then((res) => {
|
||||
ArrearsDetailList.value = res.rows;
|
||||
total.value = res.total;
|
||||
dynamicColumns.value = updateDynamicColumns(res.rows);
|
||||
|
||||
ArrearsDetailList.value[ArrearsDetailList.value.length - 1].serialNumber = '合计';
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
/** 导出Excel */
|
||||
const handleExport = () => {
|
||||
if (ArrearsDetailList.value.length === 0) {
|
||||
proxy?.$modal.msgWarning('没有可导出的数据');
|
||||
return;
|
||||
}
|
||||
// 显示加载提示
|
||||
loading.value = true;
|
||||
// 使用 setTimeout 让出主线程,避免阻塞UI
|
||||
setTimeout(() => {
|
||||
try {
|
||||
const columns: ColumnConfig[] = [
|
||||
{ label: '序号', prop: 'serialNumber' },
|
||||
{ label: '区域', prop: 'area' },
|
||||
{ label: '房号', prop: 'houseNo' },
|
||||
{ label: '客户', prop: 'customerName' },
|
||||
{ label: '联系方式', prop: 'phone' },
|
||||
{ label: '欠费月数', prop: 'arrearsMonths' },
|
||||
{ label: '应收账期', prop: 'billPeriod' },
|
||||
{
|
||||
label: '欠费项目',
|
||||
children: [
|
||||
...dynamicColumns.value.map((item) => {
|
||||
return { label: item, prop: `chargeItemAmounts.${item}` };
|
||||
})
|
||||
]
|
||||
}
|
||||
];
|
||||
exportToExcel(ArrearsDetailList.value, columns, `应收欠费明细表_${new Date().getTime()}`, mergeSpanMethod);
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('导出失败,请重试');
|
||||
console.error('导出错误:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}, 100);
|
||||
};
|
||||
|
||||
const handleExportAll = () => {
|
||||
loading.value = true;
|
||||
let reportAllList: OwnerArrearsDetailVo[] = [];
|
||||
// 移除空字符串字段
|
||||
getArrearsDetails()
|
||||
.then((res) => {
|
||||
reportAllList = res.rows;
|
||||
total.value = res.total;
|
||||
reportAllList[reportAllList.length - 1].serialNumber = '合计';
|
||||
if (reportAllList.length === 0) {
|
||||
proxy?.$modal.msgWarning('没有可导出的数据');
|
||||
return;
|
||||
}
|
||||
// 显示加载提示
|
||||
const list = updateDynamicColumns(res.rows);
|
||||
loading.value = true;
|
||||
// 使用 setTimeout 让出主线程,避免阻塞UI
|
||||
setTimeout(() => {
|
||||
try {
|
||||
const columns: ColumnConfig[] = [
|
||||
{ label: '序号', prop: 'serialNumber' },
|
||||
{ label: '区域', prop: 'area' },
|
||||
{ label: '房号', prop: 'houseNo' },
|
||||
{ label: '客户', prop: 'customerName' },
|
||||
{ label: '联系方式', prop: 'phone' },
|
||||
{ label: '欠费月数', prop: 'arrearsMonths' },
|
||||
{ label: '应收账期', prop: 'billPeriod' },
|
||||
{
|
||||
label: '欠费项目',
|
||||
children: [
|
||||
...list.map((item) => {
|
||||
return { label: item, prop: `chargeItemAmounts.${item}` };
|
||||
})
|
||||
]
|
||||
}
|
||||
];
|
||||
const mergeSpanMethod2 = ({ columnIndex, rowIndex }) => {
|
||||
if (rowIndex === reportAllList.length - 1) {
|
||||
const rowspan = 6;
|
||||
if (columnIndex === 0) {
|
||||
return { rowspan: 1, colspan: 1 };
|
||||
}
|
||||
if (columnIndex === 1) {
|
||||
return { rowspan: 1, colspan: rowspan };
|
||||
}
|
||||
if (columnIndex < rowspan + 1) {
|
||||
return { rowspan: 0, colspan: 0 };
|
||||
}
|
||||
}
|
||||
// 普通行不合并
|
||||
return { rowspan: 1, colspan: 1 };
|
||||
};
|
||||
exportToExcel(reportAllList, columns, `应收欠费明细表_${new Date().getTime()}`, mergeSpanMethod2);
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('导出失败,请重试');
|
||||
console.error('导出错误:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}, 100);
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
const mergeSpanMethod = ({ columnIndex, rowIndex }) => {
|
||||
if (rowIndex === ArrearsDetailList.value.length - 1) {
|
||||
const rowspan = 6;
|
||||
if (columnIndex === 0) {
|
||||
return { rowspan: 1, colspan: 1 };
|
||||
}
|
||||
if (columnIndex === 1) {
|
||||
return { rowspan: 1, colspan: rowspan };
|
||||
}
|
||||
if (columnIndex < rowspan + 1) {
|
||||
return { rowspan: 0, colspan: 0 };
|
||||
}
|
||||
}
|
||||
// 普通行不合并
|
||||
return { rowspan: 1, colspan: 1 };
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getMonthList();
|
||||
getAllVillage();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-table {
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user