From a9929166ee6f4def812519684a739336c7202531 Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期四, 12 六月 2025 16:53:07 +0800 Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb_region --- src/components/jianqianwenzhen/index.vue | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 43 insertions(+), 1 deletions(-) diff --git a/src/components/jianqianwenzhen/index.vue b/src/components/jianqianwenzhen/index.vue index 19172bc..00a748e 100644 --- a/src/components/jianqianwenzhen/index.vue +++ b/src/components/jianqianwenzhen/index.vue @@ -1270,6 +1270,48 @@ } }, 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); @@ -1293,7 +1335,7 @@ } else { this.$message.warning("璇峰厛閫夋嫨瑕佸垹闄ょ殑椤�"); } - }, + }, */ handlebingChange(selection) { this.bingshiall = []; this.bingshiall = selection; -- Gitblit v1.8.0