qx
qx
2025-04-11 514146014586aa8b98d667edbaf0d6897186173d
src/views/sampling/sampling/index.vue
@@ -105,8 +105,9 @@
      </div>
      <div style="width: 50%">
        <!-- v-if="this.rightTabShow" -->
        <el-table :key="tableKey" :row-key="getRowKey" v-if="tableList.length > 0" v-loading="loading" :data="tableList" @selection-change="handleChange"
          :span-method="objectSpanMethod" ref="tab1" :row-class-name="tableRowClassName" border height="520px">
        <el-table :key="tableKey" :row-key="getRowKey" v-if="tableList.length > 0" v-loading="loading" :data="tableList"
          @selection-change="handleChange" :span-method="objectSpanMethod" ref="tab1"
          :row-class-name="tableRowClassName" border height="520px">
          <el-table-column type="selection" width="40" align="center" />
          <!--  :selectable="selectEnable" -->
          <!-- <el-table-column label="是否签收" align="center" prop="isSignFor" /> -->
@@ -552,6 +553,14 @@
    if (response.data && response.data.list && response.data.list.length > 0) {
      this.samplingList = response.data.list;
      this.total = response.data.total;
          this.$nextTick(() => {
            if (this.$refs.tb) {
              const headerCheckbox = this.$refs.tb.$el.querySelector('.el-table__header .el-checkbox');
              if (headerCheckbox) headerCheckbox.style.display = 'none';
            }
          });
      // 移除默认选中第一行的逻辑
      // this.$nextTick(() => {
      //   this.$refs.tb.toggleRowSelection(this.samplingList[0], true); // 默认选中第一行
@@ -679,6 +688,8 @@
                if (this.$refs.tab1) {
                  this.$refs.tab1.doLayout(); // 修改为正确的 ref 名称
                  this.$refs.tab1.clearSelection(); // 清空选中状态
                  const headerCheckbox = this.$refs.tab1.$el.querySelector('.el-table__header .el-checkbox');
                  if (headerCheckbox) headerCheckbox.style.display = 'inline';
                }
              });
              resolve(this.tableList);
@@ -1016,6 +1027,14 @@
        this.loading = false;
      } else {
        this.samplingList = response.data.list;
            this.$nextTick(() => {
            if (this.$refs.tb) {
              const headerCheckbox = this.$refs.tb.$el.querySelector('.el-table__header .el-checkbox');
              if (headerCheckbox) headerCheckbox.style.display = 'none';
            }
          });
        this.loading = false;
        // 移除默认选中第一行的逻辑
        // if (this.samplingList.length != 0) {