From b50269f0806d3a4a1c863b503da0ac75ef51af49 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期二, 12 八月 2025 09:49:36 +0800
Subject: [PATCH] q“

---
 src/views/doctor/check/index.vue |   66 ++++++++++++++++++++++----------
 1 files changed, 45 insertions(+), 21 deletions(-)

diff --git a/src/views/doctor/check/index.vue b/src/views/doctor/check/index.vue
index a35f190..0f9fc61 100644
--- a/src/views/doctor/check/index.vue
+++ b/src/views/doctor/check/index.vue
@@ -682,7 +682,7 @@
         </el-tab-pane>
       </el-tabs>
       <span slot="footer" class="dialog-footer">
-        <el-button @click="taocan = false">鍙� 娑�</el-button>
+        <el-button @click="quzxiao">鍙� 娑�</el-button>
         <el-button type="primary" @click="queding">纭� 瀹�</el-button>
       </span>
     </el-dialog>
@@ -1330,21 +1330,42 @@
 
     bzxz() {
       this.taocan = true;
-      var deptAdviceList1 =[]
-      let data = { proId: this.proId, tjNum: this.tableAll.tjNumber };
-      getAdviceByTjNumAndPro(data).then((res) => {
-        if (res.data) {
-          this.deptAdviceList3 = res.data;
-          this.proParentList.xiaoJieIds.forEach(item => {
-            this.deptAdviceList3.forEach((items) => {
-              if (item == items.id) {
-                deptAdviceList1.push(items)
-              }
-            });
-          })
-           this.deptAdviceList1 = [
-            ...new Set(deptAdviceList1),
-          ];
+      var deptAdviceList1 = []
+      // let data = { proId: this.proId, tjNum: this.tableAll.tjNumber };
+      // getAdviceByTjNumAndPro(data).then((res) => {
+        // if (res.data) {
+        //   this.deptAdviceList3 = res.data;
+          if (this.proParentList.xiaoJieIds.length != 0) {
+            if (this.vaids.length != 0) {
+              const result = this.vaids.reduce((acc, item) => {
+                const matches = this.deptAdviceList.filter(items => {
+                  return item == items.id;  // 鎴� === 鏍规嵁闇�姹�
+                });
+                return acc.concat(matches);
+              }, []);
+              deptAdviceList1 = result;
+
+              return this.deptAdviceList1 = [
+                ...new Set(deptAdviceList1),
+              ];
+            } else {
+              this.proParentList.xiaoJieIds.forEach(item => {
+                this.deptAdviceList.forEach((items) => {
+                  if (item == items.id) {
+                    deptAdviceList1.push(items)
+                  }
+                });
+              })
+              return this.deptAdviceList1 = [
+                ...new Set(deptAdviceList1),
+              ];
+            }
+
+
+          } else if (this.proParentList.xiaoJieIds == null) {
+            this.deptAdviceList1 = []
+          }
+
           // this.deptAdviceList1 = [
           //   ...new Set(this.deptAdviceList2.concat(this.deptAdviceList3)),
           // ];
@@ -1352,8 +1373,8 @@
           //   this.idss.push(items.id);
           //   this.remakes += items.advice + ",";
           // });
-        }
-      });
+      //   }
+      // });
     },
 
     result() {
@@ -1412,8 +1433,8 @@
       //   ...new Set(this.deptAdviceList2),
       // ];
       this.deptAdviceList1 = [...new Set(
-  this.deptAdviceList2.map(item => JSON.stringify(item))
-)].map(str => JSON.parse(str));
+        this.deptAdviceList2.map(item => JSON.stringify(item))
+      )].map(str => JSON.parse(str));
       // if( this.deptAdviceList1.length == 0){
       //   this.deptAdviceList1 = selection
       // }else{
@@ -1421,7 +1442,10 @@
       // }
 
     },
-
+    quzxiao() {
+      this.taocan = false;
+      this.deptAdviceList1 = []
+    },
     queding() {
       if (this.proParentList.xiaoJie.length != 0) {
         this.remakes = "";

--
Gitblit v1.8.0