| | |
| | | piliangList: [], |
| | | msg: "", |
| | | getNumbr: null, |
| | | valueUrl: "ws://127.0.0.1:6789/websocket", |
| | | valueUrl: "ws://127.0.0.1/websocket", |
| | | webSocket: null, |
| | | list: [], |
| | | selectList: [], |
| | |
| | | return ""; // 如果 applicationTime 无效,返回空字符串 |
| | | }, |
| | | /** 查询体检采样管理列表 */ |
| | | 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; |
| | | 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(); // 清空右侧表格选中状态 |
| | | } |
| | | |
| | | 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; |
| | | }); |
| | | }, |
| | | } |
| | | this.loading1 = false; |
| | | }); |
| | | }, |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | |
| | | }, |
| | | /** 重置按钮操作 */ |
| | | resetQuery() { |
| | | this.createTimeList = []; |
| | | this.handleQuery(); |
| | | this.createTimeList = []; // 清空日期范围 |
| | | this.queryParams.tjNumber = null; // 清空体检号 |
| | | this.queryParams.name = null; // 清空姓名 |
| | | this.queryParams.tjCompName = null; // 清空单位名称 |
| | | this.selectList = []; // 清空右侧选中项 |
| | | this.selectedRows = []; // 清空左侧选中项 |
| | | this.tableList = []; // 清空右侧表格数据 |
| | | this.ids = []; // 清空选中的 ID |
| | | this.$refs.tb.clearSelection(); // 清空左侧表格选中状态 |
| | | if (this.$refs.tab1) { |
| | | this.$refs.tab1.clearSelection(); // 清空右侧表格选中状态 |
| | | } |
| | | this.handleQuery(); // 重新查询 |
| | | }, |
| | | |
| | | handleSelectionChange(selection) { |
| | |
| | | if (response.data) { |
| | | this.tableList = response.data; |
| | | this.$nextTick(() => { |
| | | this.$refs.elTable.doLayout(); // 通过 ref 调用表格方法 |
| | | if (this.$refs.tab1) { |
| | | this.$refs.tab1.clearSelection(); // 清空之前的选中状态 |
| | | this.$refs.tab1.doLayout(); // 修改为正确的 ref 名称 |
| | | this.$refs.tab1.clearSelection(); // 清空选中状态 |
| | | } |
| | | }); |
| | | resolve(this.tableList); |
| | |
| | | }; |
| | | websocket.onopen = () => { |
| | | this.websocket = websocket; |
| | | console.log(this.selectList, "this.selectList") |
| | | this.dayinData = this.selectList.map((item) => ({ |
| | | jyxh: item.jyxh, |
| | | proName: item.proName, |
| | |
| | | cardId: item.cardId, |
| | | tjTime: item.createTime, |
| | | })); |
| | | |
| | | |
| | | // 连接设备 |
| | | this.jsonObj = { |
| | | type: "3", |
| | |
| | | }, |
| | | }; |
| | | var jStr = JSON.stringify(this.jsonObj); |
| | | console.log(jStr, "jStr"); |
| | | |
| | | this.websocket.send(jStr); |
| | | this.$refs.tab1.clearSelection(); // 清除右侧表格的选中状态 |
| | | this.selectList = []; // 清空 selectList |
| | | this.ids = []; // 清空 ids |
| | | this.jsonObj = {}; |
| | | // this.dialogVisible = false; |
| | | }; |
| | |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.buda(); // 打印条码 |
| | | this.$refs.tab1.clearSelection(); // 清除右侧表格的选中状态 |
| | | this.selectList = []; // 清空 selectList |
| | | this.ids = []; // 清空 ids |
| | | |
| | | this.getList(); // 刷新左侧表格 |
| | | console.log("采样后 - selectList:", this.selectList, "qiehuan:", this.qiehuan); |
| | | } else { |
| | |
| | | }); |
| | | }, |
| | | // 单选按钮 |
| | | 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 }) { |