Browse Source

增加次数修改时选中交互

admin_version1.0_2025_06_26
zq 2 weeks ago
parent
commit
f3a17bc858
  1. 37
      src/views/AddNewTreatment.vue

37
src/views/AddNewTreatment.vue

@ -262,7 +262,6 @@ export default {
// //
this.$refs.multipleTable.$refs.guiptable.clearSelection(); this.$refs.multipleTable.$refs.guiptable.clearSelection();
this.selectedRows = [];// this.selectedRows = [];//
// console.log(this.selectedRows, this.sortedProjectRows, 'sortedProjectList==');
// //
this.sortedProjectList.forEach(row => { this.sortedProjectList.forEach(row => {
if (this.sortedProjectRows.some(selected => selected.id === row.id)) { if (this.sortedProjectRows.some(selected => selected.id === row.id)) {
@ -294,7 +293,7 @@ export default {
depart_id: this.depart_id, depart_id: this.depart_id,
doctor_id: this.doctor_id doctor_id: this.doctor_id
}).then(response => { }).then(response => {
if (response.code == 0) { if (response.code == 0 && response.data.list) {
this.projectTagData = response.data.classify; this.projectTagData = response.data.classify;
this.projectList = Object.values(response.data.list).map(item => ({ this.projectList = Object.values(response.data.list).map(item => ({
...item, ...item,
@ -310,17 +309,6 @@ export default {
}, },
inputBlur(val) { inputBlur(val) {
// //
// this.$http('POST', '/supernew/ajax_get_type_batch_list', {
// projectSearchId: this.projectSearchId,
// search: this.projectSearchName
// }).then(response => {
// if (response.code == 0) {
// this.dialogVisible = false;
// }
// }).catch(error => {
// console.error(error, 'error')
// })
console.log(val, '----搜索'); console.log(val, '----搜索');
}, },
updateSelectionState() { updateSelectionState() {
@ -333,6 +321,7 @@ export default {
this.selectAll = allSelected; this.selectAll = allSelected;
this.isIndeterminate = !noneSelected && !allSelected; this.isIndeterminate = !noneSelected && !allSelected;
console.log(this.sortedProjectRows,'sortedProjectRows==');
this.selectedCount = this.sortedProjectRows.length; this.selectedCount = this.sortedProjectRows.length;
}, },
@ -346,8 +335,10 @@ export default {
this.sortedProjectRows.splice(index, 1) this.sortedProjectRows.splice(index, 1)
} }
} else { } else {
console.log('zoudaolezheli ');
this.sortedProjectRows.push(row) this.sortedProjectRows.push(row)
} }
this.updateSelectionState()
}, },
handleSelectAll(selection) { handleSelectAll(selection) {
console.log('全选/取消全选:', selection); console.log('全选/取消全选:', selection);
@ -364,17 +355,7 @@ export default {
); );
// //
// console.log(preservedSelections,currentViewIds,rows,'=currentViewIds===');
this.selectedRows = [...preservedSelections, ...rows]; this.selectedRows = [...preservedSelections, ...rows];
// console.log(this.selectedRows, 'selectedRows===');
// let arr = [...new Set([...this.selectedRows, ...this.sortedProjectRows])]
// console.log(arr,'arr,22');
// this.selectedRows.forEach(row => {
// if (!this.sortedProjectRows.some(selected => selected.id === row.id)) {
// this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(row, true);
// }
// });
// if(this.)
this.updateSelectionState(); this.updateSelectionState();
}, },
@ -402,12 +383,6 @@ export default {
this.sortedProjectRows = this.sortedProjectRows.filter(r => r.id !== row.id); this.sortedProjectRows = this.sortedProjectRows.filter(r => r.id !== row.id);
}); });
} }
// console.log(':', {
// selectedRows: this.selectedRows,
// sortedProjectRows: this.sortedProjectRows
// });
// //
this.$nextTick(() => { this.$nextTick(() => {
this.setSelectedRows(); this.setSelectedRows();
@ -418,7 +393,6 @@ export default {
// //
selectTag(id) { selectTag(id) {
this.projectSearchId = id === 'all' ? 'all' : id; this.projectSearchId = id === 'all' ? 'all' : id;
// this.setSelectedRows();
this.updateSelectionState(); this.updateSelectionState();
}, },
// / // /
@ -438,6 +412,9 @@ export default {
if (!this.selectedRows.includes(row)) { if (!this.selectedRows.includes(row)) {
this.selectedRows.push(row); this.selectedRows.push(row);
} }
if (!this.sortedProjectRows.includes(row)) {
this.sortedProjectRows.push(row);
}
// //
this.updateSelectionState(); this.updateSelectionState();
}, },

Loading…
Cancel
Save