| | |
| | | </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" /> --> |
| | |
| | | proName: null, |
| | | }, |
| | | startTime: "", |
| | | tableKey : "", |
| | | tableKey: "", |
| | | pickerOptions: { |
| | | shortcuts: [ |
| | | { |
| | |
| | | }, |
| | | /** 查询体检采样管理列表 */ |
| | | /** 查询体检采样管理列表 */ |
| | | getList() { |
| | | this.queryParams.compId = this.CheckBox.drugManufacturerId; |
| | | this.loading1 = true; |
| | | this.queryParams.isSignFor = this.tjStatus; |
| | | getList() { |
| | | this.queryParams.compId = this.CheckBox.drugManufacturerId; |
| | | this.loading1 = true; |
| | | this.queryParams.isSignFor = this.tjStatus; |
| | | |
| | | if (this.createTimeList) { |
| | | this.queryParams.beginTime = this.createTimeList[0]; |
| | | this.queryParams.endTime = this.createTimeList[1]; |
| | | } else { |
| | | this.queryParams.beginTime = null; |
| | | this.queryParams.endTime = null; |
| | | } |
| | | |
| | | getList(this.queryParams).then((response) => { |
| | | this.loading1 = false; |
| | | if (response.data && response.data.list && response.data.list.length > 0) { |
| | | this.samplingList = response.data.list; |
| | | this.total = response.data.total; |
| | | // 移除默认选中第一行的逻辑 |
| | | // this.$nextTick(() => { |
| | | // this.$refs.tb.toggleRowSelection(this.samplingList[0], true); // 默认选中第一行 |
| | | // this.fetchData(this.samplingList[0].tjNumber); // 刷新右侧表格 |
| | | // }); |
| | | } else { |
| | | this.samplingList = []; |
| | | this.tableList = []; |
| | | this.selectList = []; // 清空 selectList |
| | | this.ids = []; // 清空 ids |
| | | if (this.$refs.tab1) { |
| | | this.$refs.tab1.clearSelection(); // 清空右侧表格选中状态 |
| | | if (this.createTimeList) { |
| | | this.queryParams.beginTime = this.createTimeList[0]; |
| | | this.queryParams.endTime = this.createTimeList[1]; |
| | | } else { |
| | | this.queryParams.beginTime = null; |
| | | this.queryParams.endTime = null; |
| | | } |
| | | } |
| | | this.loading1 = false; |
| | | }); |
| | | }, |
| | | |
| | | getList(this.queryParams).then((response) => { |
| | | this.loading1 = false; |
| | | if (response.data && response.data.list && response.data.list.length > 0) { |
| | | this.samplingList = response.data.list; |
| | | this.total = response.data.total; |
| | | // 移除默认选中第一行的逻辑 |
| | | // this.$nextTick(() => { |
| | | // this.$refs.tb.toggleRowSelection(this.samplingList[0], true); // 默认选中第一行 |
| | | // this.fetchData(this.samplingList[0].tjNumber); // 刷新右侧表格 |
| | | // }); |
| | | } else { |
| | | this.samplingList = []; |
| | | this.tableList = []; |
| | | this.selectList = []; // 清空 selectList |
| | | this.ids = []; // 清空 ids |
| | | if (this.$refs.tab1) { |
| | | this.$refs.tab1.clearSelection(); // 清空右侧表格选中状态 |
| | | } |
| | | } |
| | | this.loading1 = false; |
| | | }); |
| | | }, |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | |
| | | // 调试日志 |
| | | console.log(`当前选中数量: ${selectedCount}`); |
| | | console.log(`是否禁用选择: ${this.disableSelections}`); |
| | | |
| | | }, |
| | | |
| | | getRowKey(row) { |
| | |
| | | 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); |
| | |
| | | }); |
| | | }, |
| | | // 单选按钮 |
| | | // 单选按钮 |
| | | radioChange(value) { |
| | | this.loading = true; |
| | | this.queryParams.isSignFor = value; |
| | | getList(this.queryParams).then((response) => { |
| | | if (response.data) { |
| | | if (response.data.list == null) { |
| | | this.samplingList = []; |
| | | this.tableList = []; |
| | | this.loading = false; |
| | | } else { |
| | | this.samplingList = response.data.list; |
| | | this.loading = false; |
| | | // 移除默认选中第一行的逻辑 |
| | | // if (this.samplingList.length != 0) { |
| | | // this.$nextTick(() => { |
| | | // this.$refs.tb.toggleRowSelection(this.samplingList[0], true); |
| | | // }); |
| | | // } else { |
| | | // this.$refs.tb.clearSelection(); |
| | | // } |
| | | } |
| | | this.total = response.data.total; |
| | | this.loading = false; |
| | | } else { |
| | | this.samplingList = []; |
| | | this.tableList = []; |
| | | this.loading = false; |
| | | } |
| | | }); |
| | | }, |
| | | // 单选按钮 |
| | | radioChange(value) { |
| | | this.loading = true; |
| | | this.queryParams.isSignFor = value; |
| | | getList(this.queryParams).then((response) => { |
| | | if (response.data) { |
| | | if (response.data.list == null) { |
| | | this.samplingList = []; |
| | | this.tableList = []; |
| | | this.loading = false; |
| | | } else { |
| | | this.samplingList = response.data.list; |
| | | this.loading = false; |
| | | // 移除默认选中第一行的逻辑 |
| | | // if (this.samplingList.length != 0) { |
| | | // this.$nextTick(() => { |
| | | // this.$refs.tb.toggleRowSelection(this.samplingList[0], true); |
| | | // }); |
| | | // } else { |
| | | // this.$refs.tb.clearSelection(); |
| | | // } |
| | | } |
| | | this.total = response.data.total; |
| | | this.loading = false; |
| | | } else { |
| | | this.samplingList = []; |
| | | this.tableList = []; |
| | | this.loading = false; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 默认接受四个值 { 当前行的值, 当前列的值, 行的下标, 列的下标 } |
| | | objectSpanMethod({ row, column, rowIndex, columnIndex }) { |