前端
<template>
<a-card :bordered="false" class="table-list">
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
:rowKey="(r,i)=>{return i}"
:columns="columns"
:scroll="{ x: true}"
:dataSource="dataSource"
:pagination="false"
:loading="loading"
class="j-table-force-nowrap"
@change="handleTableChange"
>
</a-table>
</div>
</a-card>
</template>
<script>
import moment from 'moment'
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {getAction} from '@/api/manage'
export default {
name: 'FirstCheckZpUnquList',
mixins: [JeecgListMixin, mixinDevice],
components: {},
data() {
return {
description: '',
columns: [
{
title: '组别',
dataIndex: 'teamName',
key: 'id',
width: 150,
fixed: 'left',
customRender: (value, row, index) => {
const obj = {
children: value,
attrs: {},
};
let i = index % 3
if (i === 0) {
obj.attrs.rowSpan = 3;
}
if (i === 1) {
obj.attrs.rowSpan = 0;
}
if (i === 2) {
obj.attrs.colSpan = 0;
}
return obj;
},
},
{
title: '项目',
dataIndex: 'project',
width: 200,
fixed: 'left',
},
{
title: '月份',
children: [
{
title: '1月',
dataIndex: 'one',
},
{
title: '2月',
dataIndex: 'two',
},
{
title: '3月',
dataIndex: 'three',
},
{
title: '4月',
dataIndex: 'four',
},
{
title: '5月',
dataIndex: 'five',
},
{
title: '6月',
dataIndex: 'six',
},
{
title: '7月',
dataIndex: 'seven',
},
{
title: '8月',
dataIndex: 'eight',
},
{
title: '9月',
dataIndex: 'nine',
},
{
title: '10月',
dataIndex: 'ten',
},
{
title: '11月',
dataIndex: 'eleven',
},
{
title: '12月',
dataIndex: 'twelve',
},
],
},
],
url: {
list: '/report/zpunqu/firstCheckUnqu',
exportXlsUrl: '/report/zpunqu/export',
},
}
},
methods: {},
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
后端
@Override
public List<FirstCheckZpUnqu> firstCheckZpUnqu() {
List<FirstCheckZpUnqu> firstCheckZpTaskVos = firstCheckZpTaskMapper.selectUnquBy();
List<FirstCheckZpUnqu> vos = new ArrayList<>();
for (int i = 0; i < firstCheckZpTaskVos.size(); i++) {
FirstCheckZpUnqu firstCheckZpUnqu = firstCheckZpTaskVos.get(i);
if (firstCheckZpUnqu.getMonths().equals("01")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.one(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.one(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.one(firstCheckZpUnqu.getPassRate())
.build());
}
if (firstCheckZpUnqu.getMonths().equals("02")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.two(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.two(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.two(firstCheckZpUnqu.getPassRate())
.build());
}
if (firstCheckZpUnqu.getMonths().equals("03")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.three(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.three(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.three(firstCheckZpUnqu.getPassRate())
.build());
}
if (firstCheckZpUnqu.getMonths().equals("04")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.four(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.four(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.four(firstCheckZpUnqu.getPassRate())
.build());
}
if (firstCheckZpUnqu.getMonths().equals("05")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.five(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.five(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.five(firstCheckZpUnqu.getPassRate())
.build());
}
if (firstCheckZpUnqu.getMonths().equals("06")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.six(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.six(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.six(firstCheckZpUnqu.getPassRate())
.build());
}
if (firstCheckZpUnqu.getMonths().equals("07")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.seven(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.seven(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.seven(firstCheckZpUnqu.getPassRate())
.build());
}
if (firstCheckZpUnqu.getMonths().equals("08")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.eight(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.eight(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.eight(firstCheckZpUnqu.getPassRate())
.build());
}
if (firstCheckZpUnqu.getMonths().equals("09")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.nine(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.nine(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.nine(firstCheckZpUnqu.getPassRate())
.build());
}
if (firstCheckZpUnqu.getMonths().equals("10")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.ten(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.ten(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.ten(firstCheckZpUnqu.getPassRate())
.build());
}
if (firstCheckZpUnqu.getMonths().equals("11")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.eleven(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.eleven(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.eleven(firstCheckZpUnqu.getPassRate())
.build());
}
if (firstCheckZpUnqu.getMonths().equals("12")) {
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检总次数")
.twelve(firstCheckZpUnqu.getSumFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检不合格次数")
.twelve(firstCheckZpUnqu.getUnquaFrequency())
.build());
vos.add(FirstCheckZpUnqu.builder()
.teamName(firstCheckZpUnqu.getTeamName())
.project("首检合格率")
.twelve(firstCheckZpUnqu.getPassRate())
.build());
}
}
return vos;
}