From c1cf70d01a5b11075170cfc6278a213833d1f799 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期二, 10 六月 2025 16:55:57 +0800
Subject: [PATCH] 1

---
 src/components/jianqianwenzhen/index.vue |   44 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/src/components/jianqianwenzhen/index.vue b/src/components/jianqianwenzhen/index.vue
index eb496c5..082bc96 100644
--- a/src/components/jianqianwenzhen/index.vue
+++ b/src/components/jianqianwenzhen/index.vue
@@ -1164,7 +1164,6 @@
       this.$forceUpdate(); // 寮哄埗鍒锋柊锛堝鏋滈渶瑕侊級
     },
 
-
     async delezz() {
       if (!this.selectedZhiyezz?.length) {
         this.$message.warning("璇峰厛閫夋嫨瑕佸垹闄ょ殑椤�");
@@ -1358,6 +1357,47 @@
     },
 
     delemembers() {
+      if (!this.bingshiall || this.bingshiall.length === 0) {
+        this.$message.warning("璇峰厛閫夋嫨瑕佸垹闄ょ殑椤�");
+        return;
+      }
+
+      // 鍖哄垎鏂板椤瑰拰鏁版嵁搴撻」
+      const localItems = this.bingshiall.filter((item) => !item.diseaseId); // 鏂板鐨�
+      const dbItems = this.bingshiall.filter((item) => item.diseaseId); // 鏁版嵁搴撳凡鏈夌殑
+
+      // 鍏堝垹闄ゆ柊澧炵殑锛堟湰鍦扮洿鎺ュ垹锛�
+      if (localItems.length > 0) {
+        this.form.tjAskHistorysList = this.form.tjAskHistorysList.filter(
+          (item) => !localItems.includes(item)
+        );
+      }
+
+      if (dbItems.length === 0) {
+        // 鍙湁鏂板椤癸紝鏃犻渶璋冪敤鎺ュ彛锛岀洿鎺ユ竻绌洪�変腑锛岄��鍑�
+        this.bingshiall = [];
+        this.$forceUpdate();
+        return;
+      }
+
+      // 璋冩帴鍙e垹闄ゆ暟鎹簱椤�
+      const historyId = dbItems.map((item) => item.diseaseId);
+      removeAskHistorys(historyId)
+        .then((res) => {
+          this.$message.success("鍒犻櫎鎴愬姛");
+          // 鎺ュ彛鎴愬姛鍚庡垹闄ゆ暟鎹簱椤�
+          this.form.tjAskHistorysList = this.form.tjAskHistorysList.filter(
+            (item) =>
+              !dbItems.some((selected) => selected.diseaseId === item.diseaseId)
+          );
+          this.bingshiall = [];
+          this.$forceUpdate();
+        })
+        .catch(() => {
+          this.$message.warning("鍒犻櫎澶辫触");
+        });
+    },
+    /*  delemembers() {
       if (this.bingshiall && this.bingshiall.length > 0) {
         const historyId = this.bingshiall.map((item) => item.diseaseId);
 
@@ -1381,7 +1421,7 @@
       } else {
         this.$message.warning("璇峰厛閫夋嫨瑕佸垹闄ょ殑椤�");
       }
-    },
+    }, */
 
     handlebingChange(selection) {
       this.bingshiall = [];

--
Gitblit v1.8.0