From 5b8422f9155c08f5a26840d7896bb0434d9013e7 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期四, 17 四月 2025 17:38:00 +0800
Subject: [PATCH] qx

---
 src/views/hosp/project/index.vue |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/views/hosp/project/index.vue b/src/views/hosp/project/index.vue
index 0ee06f4..1726610 100644
--- a/src/views/hosp/project/index.vue
+++ b/src/views/hosp/project/index.vue
@@ -9,7 +9,7 @@
         <div class="scrollable-container">
           <div class="content">
             <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false"
-              :filter-node-method="filterNode" ref="tree" node-key="id" :default-expanded-keys="treeId"
+              :filter-node-method="filterNode" ref="tree1" node-key="id" :default-expanded-keys="treeId"
               highlight-current @node-click="handleNodeClick" :render-content="renderContent" v-loading="loadings" />
           </div>
         </div>
@@ -549,7 +549,7 @@
           const lastId = newVal[newVal.length - 1] || "532";
           const node = this.findNodeById(this.deptOptions, lastId);
           if (node) {
-            this.$refs.tree.setCurrentKey(lastId);
+            this.$refs.tree1.setCurrentKey(lastId);
             const nodeElement = document.querySelector(`.el-tree-node[data-key="${lastId}"] .el-tree-node__content`);
             if (nodeElement) {
               nodeElement.click();
@@ -587,7 +587,7 @@
   },
   methods: {
     debounceFilter: debounce(function (val) {
-      this.$refs.tree.filter(val);
+      this.$refs.tree1.filter(val);
     }, 300),
     precomputePinyin() {
       const traverse = (nodes) => {
@@ -836,7 +836,7 @@
     handleNodeClick(date) {
 
       this.treeDate = date;
-      console.log(this.treeDate)
+      this.xiugaiList ={}
       this.xiugais = date.qf === "0";
       let proId = date.id;
       getInfoByProId(proId).then((response) => {
@@ -871,6 +871,11 @@
       let data = { proId: this.queryParams.proId };
       getAllChildListById(data).then(() => {
         this.loading = false;
+      });
+      this.deptName = "";
+      // 鎵嬪姩璋冪敤杩囨护鏂规硶锛堥渶绛夊緟 DOM 鏇存柊锛�
+      this.$nextTick(() => {
+        this.$refs.tree1.filter(this.deptName);
       });
     },
     handleClose() {
@@ -910,7 +915,7 @@
     resetQuery() {
       this.resetForm("queryForm");
       this.queryParams.proId = undefined;
-      this.$refs.tree.setCurrentKey(null);
+      this.$refs.tree1.setCurrentKey(null);
       this.handleQuery();
     },
     flexColumnWidth(column) {
@@ -981,6 +986,7 @@
       }
     },
     handleUpdate1() {
+      this.form ={}
       this.form = this.xiugaiList;
       this.form.proStatus = this.form.proStatus.toString();
       this.proParent = true;
@@ -993,6 +999,7 @@
           project.children = this.handleTree(response.data.list, "proId");
           this.key = response.data.key;
           this.projectOptions.push(project);
+          console.log( this.projectOptions,11111)
         }
       });
       this.open = true;
@@ -1067,6 +1074,11 @@
           }
         }
       });
+      this.deptName = "";
+      // 鎵嬪姩璋冪敤杩囨护鏂规硶锛堥渶绛夊緟 DOM 鏇存柊锛�
+      this.$nextTick(() => {
+        this.$refs.tree1.filter(this.deptName);
+      });
     },
     processSubmission(isUpdate, isY) {
       if (isUpdate) {

--
Gitblit v1.8.0