Sfoglia il codice sorgente

查询标签不是标签组

xw 3 settimane fa
parent
commit
2f3ea118c7

+ 21 - 8
src/views/qw/externalContact/index.vue

@@ -743,7 +743,7 @@
     <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
       <div>搜索标签:
         <el-input v-model="queryTagParams.name" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="getPageListTagGroup()">搜索</el-button>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(queryTagParams.name)">搜索</el-button>
         <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
       </div>
       <el-form ref="form" :model="addTagForm"  label-width="80px">
@@ -1564,15 +1564,28 @@ export default {
       if(this.ids==null||this.ids==""){
         return  this.$message('请选择需要移除标签的客户');
       }
-      this.getPageListTagGroup();
 
-      setTimeout(() => {
-        for (let i = 0; i < this.tagGroupList.length; i++) {
-          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
-            this.tagGroupList[i].tag[x].isSelected=false;
+      // 重置查询参数
+      this.queryTagParams.name = null;
+      this.queryTagParams.pageNum = 1;
+      this.queryTagParams.corpId = this.queryParams.corpId;
+      
+      // 使用 searchTags 接口获取包含具体标签的数据
+      searchTags(this.queryTagParams).then(response => {
+        this.tagGroupList = response.rows;
+        this.tagTotal = response.total;
+
+        // 数据加载完成后再初始化选中状态
+        setTimeout(() => {
+          for (let i = 0; i < this.tagGroupList.length; i++) {
+            if (this.tagGroupList[i].tag) {
+              for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+                this.tagGroupList[i].tag[x].isSelected = false;
+              }
+            }
           }
-        }
-      }, 200);
+        }, 100);
+      });
 
       this.tagDelOpen = true;
 

+ 38 - 17
src/views/qw/externalContact/myExternalContact.vue

@@ -1761,16 +1761,26 @@ export default {
         return  this.$message('请选择需要添加标签的客户');
       }
 
-      this.getPageListTagGroup();
-
-      setTimeout(() => {
-
-        for (let i = 0; i < this.tagGroupList.length; i++) {
-          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
-            this.tagGroupList[i].tag[x].isSelected=false;
+      // 重置查询参数
+      this.queryTagParams.name = null;
+      this.queryTagParams.pageNum = 1;
+      
+      this.queryTagParams.corpId = this.queryParams.corpId;
+      allListTagGroup(this.queryTagParams).then(response => {
+        this.tagGroupList = response.rows;
+        this.tagTotal = response.total;
+        
+        // 数据加载完成后,初始化选中状态
+        setTimeout(() => {
+          for (let i = 0; i < this.tagGroupList.length; i++) {
+            if (this.tagGroupList[i].tag) {
+              for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+                this.tagGroupList[i].tag[x].isSelected = false;
+              }
+            }
           }
-        }
-      }, 200);
+        }, 100);
+      });
 
       this.tagOpen = true;
 
@@ -1782,15 +1792,26 @@ export default {
         return  this.$message('请选择需要移除标签的客户');
       }
 
-      this.getPageListTagGroup();
-
-      setTimeout(() => {
-        for (let i = 0; i < this.tagGroupList.length; i++) {
-          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
-            this.tagGroupList[i].tag[x].isSelected=false;
+      // 重置查询参数
+      this.queryTagParams.name = null;
+      this.queryTagParams.pageNum = 1;
+      
+      this.queryTagParams.corpId = this.queryParams.corpId;
+      allListTagGroup(this.queryTagParams).then(response => {
+        this.tagGroupList = response.rows;
+        this.tagTotal = response.total;
+        
+        // 数据加载完成后,初始化选中状态
+        setTimeout(() => {
+          for (let i = 0; i < this.tagGroupList.length; i++) {
+            if (this.tagGroupList[i].tag) {
+              for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+                this.tagGroupList[i].tag[x].isSelected = false;
+              }
+            }
           }
-        }
-      }, 200);
+        }, 100);
+      });
 
       this.tagDelOpen = true;