zouyu
2025-03-18 bc44c8e3c9d85691ce3fa73ef1300a6fae46e365
src/views/business/unPass/index.vue
@@ -33,7 +33,7 @@
}
</style>
<template>
  <div class="below-standard-main">
  <div class="below-standard-main bg-1">
    <div style="width: 100%; height: 100%">
      <div>
        <el-row class="title">
@@ -79,7 +79,8 @@
          :tableData="tableData"
          :column="column"
          :tableLoading="tableLoading"
          :height="'calc(100vh - 270px)'"
          :parentSpanMethod="spanMethod"
          :height="tableHeight+''"
          :page="page"
          @pagination="pagination"
        ></lims-table>
@@ -157,12 +158,39 @@
    this.entityCopy = this.HaveJson(this.entity);
    this.refreshTable();
  },
  created() {
    this.getTableHeight();
  },
  methods: {
    // 表格合并
    spanMethod({row,column,rowIndex,columnIndex}) {
      // 需要合并的列
      const needSpan = [1]
      if(needSpan.includes(columnIndex)) {
        // 如果是第一行 或者 当前行的值和上一行的值不一样 就要开始进行计算合并
        if(rowIndex == 0 || row.entrustCode != this.tableData[rowIndex -1 ].entrustCode) {
          // 向下找到和当前行不一样的行数
          let rowSpan = 1;
          while(rowIndex + rowSpan < this.tableData.length && row.entrustCode == this.tableData[rowIndex + rowSpan].entrustCode) {
            rowSpan++
          }
          return [rowSpan,1]
        }else {
          // 如果和上一行的值一样 就隐藏
          return [0,0]
        }
      }else{
        return [1,1]
      }
    },
    getTableHeight() {
      this.tableHeight = window.innerHeight - 50 - 46 - 60 - 80 - 30 - 30 - 32;
    },
    getData() {
      this.tableLoading = true;
      pageInsUnPass({
        current: this.page.current,
        limit: this.page.size,
        size: this.page.size,
        model: this.entity.model,
        sample: this.entity.sample,
      }).then((res) => {
@@ -171,8 +199,8 @@
        this.page.total = res.data.total;
      });
    },
    pagination({current,limit}) {
      this.page.current = current;
    pagination({page,limit}) {
      this.page.current = page;
      this.page.size = limit;
      this.getData();
    },