| | |
| | | </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" /> --> |
| | |
| | | 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); // 默认选中第一行 |
| | |
| | | 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); |
| | |
| | | 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) { |