|
@@ -293,6 +293,15 @@
|
|
|
v-hasPermi="['qw:externalContact:myAddTag']"
|
|
v-hasPermi="['qw:externalContact:myAddTag']"
|
|
|
>批量添加标签</el-button>
|
|
>批量添加标签</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ plain
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="addUserTagFilter"
|
|
|
|
|
+ v-hasPermi="['qw:externalContact:myAddTag']"
|
|
|
|
|
+ >批量添加标签(筛选条件)</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
@@ -301,6 +310,15 @@
|
|
|
@click="delUserTag"
|
|
@click="delUserTag"
|
|
|
v-hasPermi="['qw:externalContact:myDelTag']"
|
|
v-hasPermi="['qw:externalContact:myDelTag']"
|
|
|
>批量移除标签</el-button>
|
|
>批量移除标签</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ plain
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="delUserTagFilter"
|
|
|
|
|
+ v-hasPermi="['qw:externalContact:myDelTag']"
|
|
|
|
|
+ >批量移除标签(筛选条件)</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
<el-button
|
|
@@ -341,6 +359,12 @@
|
|
|
<el-table v-loading="loading" :data="externalContactList" @selection-change="handleSelectionChange" border>
|
|
<el-table v-loading="loading" :data="externalContactList" @selection-change="handleSelectionChange" border>
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="企微客户ID" align="center" prop="id"/>
|
|
<el-table-column label="企微客户ID" align="center" prop="id"/>
|
|
|
|
|
+ <el-table-column label="用户id" align="center" prop="fsUserId" width="100px">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="scope.row.fsUserId">{{ scope.row.fsUserId }}</span>
|
|
|
|
|
+ <span v-else>未绑定</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="企微客户头像" align="center" prop="avatar" width="100px">
|
|
<el-table-column label="企微客户头像" align="center" prop="avatar" width="100px">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-popover
|
|
<el-popover
|
|
@@ -1241,7 +1265,9 @@ export default {
|
|
|
|
|
|
|
|
addTagForm:{
|
|
addTagForm:{
|
|
|
userIds:[],
|
|
userIds:[],
|
|
|
- tagIds:[]
|
|
|
|
|
|
|
+ tagIds:[],
|
|
|
|
|
+ filter: false,
|
|
|
|
|
+ addType: 0,
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
myQwCompanyList:[],
|
|
myQwCompanyList:[],
|
|
@@ -1338,6 +1364,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
tagTotal:0,
|
|
tagTotal:0,
|
|
|
|
|
+ tagFilter:false,
|
|
|
|
|
|
|
|
//标签
|
|
//标签
|
|
|
changeTagDialog:{
|
|
changeTagDialog:{
|
|
@@ -1894,9 +1921,32 @@ export default {
|
|
|
}, 200);
|
|
}, 200);
|
|
|
|
|
|
|
|
this.tagOpen = true;
|
|
this.tagOpen = true;
|
|
|
|
|
+ this.tagFilter = false;
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ addUserTagFilter(){
|
|
|
|
|
+
|
|
|
|
|
+ if(this.externalContactList.length == 0){
|
|
|
|
|
+ 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;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 200);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ this.tagOpen = true;
|
|
|
|
|
+ this.tagFilter = true;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
delUserTag(){
|
|
delUserTag(){
|
|
|
|
|
|
|
|
if(this.ids==null||this.ids==""){
|
|
if(this.ids==null||this.ids==""){
|
|
@@ -1914,7 +1964,28 @@ export default {
|
|
|
}, 200);
|
|
}, 200);
|
|
|
|
|
|
|
|
this.tagDelOpen = true;
|
|
this.tagDelOpen = true;
|
|
|
|
|
+ this.tagFilter = false;
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ delUserTagFilter(){
|
|
|
|
|
+
|
|
|
|
|
+ if(this.externalContactList.length == 0){
|
|
|
|
|
+ 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;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 200);
|
|
|
|
|
|
|
|
|
|
+ this.tagDelOpen = true;
|
|
|
|
|
+ this.tagFilter = true;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
//重新获取页面数据
|
|
//重新获取页面数据
|
|
@@ -1958,6 +2029,8 @@ export default {
|
|
|
this.tagOpen = false;
|
|
this.tagOpen = false;
|
|
|
|
|
|
|
|
this.addTagForm={
|
|
this.addTagForm={
|
|
|
|
|
+ filter: false,
|
|
|
|
|
+ addType: 0,
|
|
|
userIds:[],
|
|
userIds:[],
|
|
|
tagIds:[]
|
|
tagIds:[]
|
|
|
};
|
|
};
|
|
@@ -1967,12 +2040,14 @@ export default {
|
|
|
this.tagDelOpen = false;
|
|
this.tagDelOpen = false;
|
|
|
|
|
|
|
|
this.addTagForm={
|
|
this.addTagForm={
|
|
|
|
|
+ filter: false,
|
|
|
|
|
+ addType: 0,
|
|
|
userIds:[],
|
|
userIds:[],
|
|
|
tagIds:[]
|
|
tagIds:[]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
addTagSubmitForm(){
|
|
addTagSubmitForm(){
|
|
|
-
|
|
|
|
|
|
|
+ this.addTagForm.tagIds = [];
|
|
|
for (let i = 0; i < this.tagGroupList.length; i++) {
|
|
for (let i = 0; i < this.tagGroupList.length; i++) {
|
|
|
for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
|
|
for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
|
|
|
if(this.tagGroupList[i].tag[x].isSelected==true){
|
|
if(this.tagGroupList[i].tag[x].isSelected==true){
|
|
@@ -1985,10 +2060,6 @@ export default {
|
|
|
return this.$message('请选择标签');
|
|
return this.$message('请选择标签');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.addTagForm.corpId=this.queryParams.corpId
|
|
|
|
|
- this.addTagForm.userIds=this.ids;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
let loadingRock = this.$loading({
|
|
let loadingRock = this.$loading({
|
|
|
lock: true,
|
|
lock: true,
|
|
|
text: '正在执行中请稍后~~请不要刷新页面!!',
|
|
text: '正在执行中请稍后~~请不要刷新页面!!',
|
|
@@ -1996,22 +2067,86 @@ export default {
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ const runAdd = (userIds) => {
|
|
|
|
|
+ this.addTagForm.corpId=this.queryParams.corpId
|
|
|
|
|
+ this.addTagForm.filter = this.tagFilter;
|
|
|
|
|
+ this.addTagForm.userIds = userIds;
|
|
|
|
|
|
|
|
- addTag(this.addTagForm).then(response => {
|
|
|
|
|
- this.msgSuccess(response.msg);
|
|
|
|
|
- this.tagOpen = false;
|
|
|
|
|
- loadingRock.close();
|
|
|
|
|
- this.addTagForm={
|
|
|
|
|
- userIds:[],
|
|
|
|
|
- tagIds:[]
|
|
|
|
|
- };
|
|
|
|
|
- this.getList()
|
|
|
|
|
- }).finally(res=>{
|
|
|
|
|
- loadingRock.close();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.queryParams));
|
|
|
|
|
+ if(obj.tagIds && typeof obj.tagIds === 'string') {
|
|
|
|
|
+ obj.tagIds = obj.tagIds.split(",");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(obj.outTagIds && typeof obj.outTagIds === 'string') {
|
|
|
|
|
+ obj.outTagIds = obj.outTagIds.split(",");
|
|
|
|
|
+ }
|
|
|
|
|
+ this.addTagForm.param = obj;
|
|
|
|
|
+
|
|
|
|
|
+ addTag(this.addTagForm).then(response => {
|
|
|
|
|
+ this.msgSuccess(response.msg);
|
|
|
|
|
+ this.tagOpen = false;
|
|
|
|
|
+ this.addTagForm={
|
|
|
|
|
+ filter: false,
|
|
|
|
|
+ addType: 0,
|
|
|
|
|
+ userIds:[],
|
|
|
|
|
+ tagIds:[]
|
|
|
|
|
+ };
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ }).finally(()=>{
|
|
|
|
|
+ loadingRock.close();
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
|
|
+ if (this.tagFilter) {
|
|
|
|
|
+ this.fetchAllContactIdsByCurrentFilter().then(ids => {
|
|
|
|
|
+ if (!ids || !ids.length) {
|
|
|
|
|
+ this.$message.warning('当前筛选条件下没有可处理的客户');
|
|
|
|
|
+ loadingRock.close();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ runAdd(ids);
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ loadingRock.close();
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (this.ids == null || this.ids === '' || (Array.isArray(this.ids) && this.ids.length === 0)) {
|
|
|
|
|
+ this.$message('请选择需要添加标签的客户');
|
|
|
|
|
+ loadingRock.close();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ runAdd(this.ids);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 按当前筛选条件分页拉取全部企微客户主键 id,供批量添加、移除标签传入 userIds */
|
|
|
|
|
+ fetchAllContactIdsByCurrentFilter() {
|
|
|
|
|
+ const obj = JSON.parse(JSON.stringify(this.queryParams));
|
|
|
|
|
+ if (obj.tagIds && typeof obj.tagIds === 'string') {
|
|
|
|
|
+ obj.tagIds = obj.tagIds.split(',');
|
|
|
|
|
+ }
|
|
|
|
|
+ if (obj.outTagIds && typeof obj.outTagIds === 'string') {
|
|
|
|
|
+ obj.outTagIds = obj.outTagIds.split(',');
|
|
|
|
|
+ }
|
|
|
|
|
+ const pageSize = 500;
|
|
|
|
|
+ const allIds = [];
|
|
|
|
|
+ const fetchNext = (pageNum) => {
|
|
|
|
|
+ return myList({ ...obj, pageNum, pageSize }).then(res => {
|
|
|
|
|
+ const rows = res.rows || [];
|
|
|
|
|
+ const total = res.total != null ? res.total : 0;
|
|
|
|
|
+ rows.forEach(r => {
|
|
|
|
|
+ if (r.id != null) {
|
|
|
|
|
+ allIds.push(r.id);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ if (allIds.length >= total || rows.length < pageSize) {
|
|
|
|
|
+ return allIds;
|
|
|
|
|
+ }
|
|
|
|
|
+ return fetchNext(pageNum + 1);
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ return fetchNext(1);
|
|
|
},
|
|
},
|
|
|
tagDelSubmitForm(){
|
|
tagDelSubmitForm(){
|
|
|
|
|
+ this.addTagForm.tagIds = [];
|
|
|
for (let i = 0; i < this.tagGroupList.length; i++) {
|
|
for (let i = 0; i < this.tagGroupList.length; i++) {
|
|
|
for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
|
|
for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
|
|
|
if(this.tagGroupList[i].tag[x].isSelected==true){
|
|
if(this.tagGroupList[i].tag[x].isSelected==true){
|
|
@@ -2023,8 +2158,6 @@ export default {
|
|
|
if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
|
|
if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
|
|
|
return this.$message('请选择标签');
|
|
return this.$message('请选择标签');
|
|
|
}
|
|
}
|
|
|
- this.addTagForm.corpId=this.queryParams.corpId
|
|
|
|
|
- this.addTagForm.userIds=this.ids;
|
|
|
|
|
|
|
|
|
|
let loadingRock = this.$loading({
|
|
let loadingRock = this.$loading({
|
|
|
lock: true,
|
|
lock: true,
|
|
@@ -2033,19 +2166,54 @@ export default {
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ const runDel = (userIds) => {
|
|
|
|
|
+ this.addTagForm.corpId=this.queryParams.corpId
|
|
|
|
|
+ this.addTagForm.filter = this.tagFilter;
|
|
|
|
|
+ this.addTagForm.userIds = userIds;
|
|
|
|
|
|
|
|
- delTag(this.addTagForm).then(response => {
|
|
|
|
|
- this.msgSuccess(response.msg);
|
|
|
|
|
- this.tagDelOpen = false;
|
|
|
|
|
- loadingRock.close();
|
|
|
|
|
- this.addTagForm={
|
|
|
|
|
- userIds:[],
|
|
|
|
|
- tagIds:[]
|
|
|
|
|
- };
|
|
|
|
|
- this.getList()
|
|
|
|
|
- }).finally(res=>{
|
|
|
|
|
- loadingRock.close();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.queryParams));
|
|
|
|
|
+ if(obj.tagIds && typeof obj.tagIds === 'string') {
|
|
|
|
|
+ obj.tagIds = obj.tagIds.split(",");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(obj.outTagIds && typeof obj.outTagIds === 'string') {
|
|
|
|
|
+ obj.outTagIds = obj.outTagIds.split(",");
|
|
|
|
|
+ }
|
|
|
|
|
+ this.addTagForm.param = obj;
|
|
|
|
|
+
|
|
|
|
|
+ delTag(this.addTagForm).then(response => {
|
|
|
|
|
+ this.msgSuccess(response.msg);
|
|
|
|
|
+ this.tagDelOpen = false;
|
|
|
|
|
+ this.addTagForm={
|
|
|
|
|
+ filter: false,
|
|
|
|
|
+ addType: 0,
|
|
|
|
|
+ userIds:[],
|
|
|
|
|
+ tagIds:[]
|
|
|
|
|
+ };
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ }).finally(()=>{
|
|
|
|
|
+ loadingRock.close();
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ if (this.tagFilter) {
|
|
|
|
|
+ this.fetchAllContactIdsByCurrentFilter().then(ids => {
|
|
|
|
|
+ if (!ids || !ids.length) {
|
|
|
|
|
+ this.$message.warning('当前筛选条件下没有可处理的客户');
|
|
|
|
|
+ loadingRock.close();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ runDel(ids);
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ loadingRock.close();
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (this.ids == null || this.ids === '' || (Array.isArray(this.ids) && this.ids.length === 0)) {
|
|
|
|
|
+ this.$message('请选择需要移除标签的客户');
|
|
|
|
|
+ loadingRock.close();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ runDel(this.ids);
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 表单重置
|
|
// 表单重置
|