From cee2eca9c3e40b48c40a8fe80f938a777f03d463 Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期二, 10 六月 2025 17:57:11 +0800 Subject: [PATCH] 1 --- src/views/doctor/inspectCheck/index.vue | 111 +++++++++++++++++++++---------------------------------- 1 files changed, 43 insertions(+), 68 deletions(-) diff --git a/src/views/doctor/inspectCheck/index.vue b/src/views/doctor/inspectCheck/index.vue index 5ccb3fe..7a3a261 100644 --- a/src/views/doctor/inspectCheck/index.vue +++ b/src/views/doctor/inspectCheck/index.vue @@ -87,6 +87,8 @@ dicts: ["dict_tj_status"], data() { return { + isProcessing: false, // 闃叉姝诲惊鐜� + isDeselection: false, // 鏍囪鏄惁涓哄彇娑堥�変腑 infoList: {}, dis: false, code: null, @@ -170,76 +172,49 @@ return !row.brid ? "row-disabled" : ""; }, - handleSelectionChange(val) { - // console.log(val); - /* if (val.length > 1) { - let del_row = val.shift(); - this.$refs.tb.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑 - } - console.log(val, 999); */ +handleSelectionChange(val) { + this.selectedFirstTable = val; - if (val.length > 0) { - // const selectedRow = val[0]; - // console.log(val[0], 555); - - this.selectedFirstTable = val; - console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedFirstTable); - this.fetchRightTableData(val); - } else { - this.selectedFirstTable = null; - this.checkList = []; - } - - this.$nextTick(() => { - if (isDeselection) { - console.log('妫�娴嬪埌鍙栨秷閫変腑锛屾竻绌烘墍鏈夐�夋嫨'); - this.exaLists.forEach(row => { - if (!row.brid) { - console.warn(`鍚嶇О涓� ${row.name} 鐨勮娌℃湁鐢宠鍗曞彿锛岃烦杩囬�夋嫨`); - return; - } - this.$refs.firstTable.toggleRowSelection(row, false, false); - }); - this.checkList = []; - } else if (val.length > 0) { - const firstSelectedRow = val[0]; - let filterKey = firstSelectedRow.checkParts ? 'checkParts' : 'brid'; - let filterValue = firstSelectedRow.checkParts || firstSelectedRow.brid; - - const checkPartsMatches = this.exaLists.filter(row => row.checkParts === firstSelectedRow.checkParts); - if (firstSelectedRow.checkParts && checkPartsMatches.length <= 1) { - filterKey = 'brid'; - filterValue = firstSelectedRow.brid; - } - - console.log(`鎸� ${filterKey} 绛涢��: ${filterValue}`); - const selectedSet = new Set(this.exaLists - .filter(row => row[filterKey] === filterValue) - .map(item => item.tempId)); - console.log(`閫変腑鐨� ${filterKey} 闆嗗悎 (tempId):`, selectedSet); - - this.exaLists.forEach(row => { - if (!row.brid) { - console.warn(`鍚嶇О涓� ${row.name} 鐨勮娌℃湁鐢宠鍗曞彿锛岃烦杩囬�夋嫨`); - return; - } - const shouldSelect = selectedSet.has(row.tempId); - console.log(`琛� tempId: ${row.tempId}, ${filterKey}: ${row[filterKey]}锛屾槸鍚﹂�変腑: ${shouldSelect}`); - this.$refs.firstTable.toggleRowSelection(row, shouldSelect, false); - }); - - if (!this.isFetchingRightTableData) { - this.isFetchingRightTableData = true; - this.fetchRightTableData().finally(() => { - this.isFetchingRightTableData = false; - }); - } - } else { - console.log('鏃犻�変腑琛岋紝娓呯┖ checkList'); - this.checkList = []; - } + this.$nextTick(() => { + if (val.length === 0) { + console.log('鏃犻�変腑琛岋紝娓呯┖閫夋嫨鍜� checkList'); + this.checkList = []; + this.exaLists.forEach(row => { + this.$refs.firstTable && this.$refs.firstTable.toggleRowSelection(row, false); }); - }, + return; + } + + const firstSelectedRow = val[0]; + let filterKey = firstSelectedRow.checkParts ? 'checkParts' : 'brid'; + let filterValue = firstSelectedRow.checkParts || firstSelectedRow.brid; + + console.log(`鎸� ${filterKey} 绛涢��: ${filterValue}`); + const selectedSet = new Set( + this.exaLists + .filter(row => row[filterKey] === filterValue) + .map(item => item.tempId) + ); + console.log(`閫変腑鐨� ${filterKey} 闆嗗悎 (tempId):`, selectedSet); + + this.exaLists.forEach(row => { + if (!row.brid) { + console.warn(`鍚嶇О涓� ${row.name} 鐨勮娌℃湁鐢宠鍗曞彿锛岃烦杩囬�夋嫨`); + return; + } + const shouldSelect = selectedSet.has(row.tempId); + console.log(`琛� tempId: ${row.tempId}, ${filterKey}: ${row[filterKey]}, 鏄惁閫変腑: ${shouldSelect}`); + this.$refs.firstTable.toggleRowSelection(row, shouldSelect); + }); + + if (!this.isFetchingRightTableData) { + this.isFetchingRightTableData = true; + this.fetchRightTableData().finally(() => { + this.isFetchingRightTableData = false; + }); + } + }); +}, fetchRightTableData() { const code = this.queryParams.tjNum; -- Gitblit v1.8.0