报表页面与后端格式

在这里插入图片描述

前端

<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;
    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值