|
|
@@ -337,6 +337,15 @@
|
|
|
v-hasPermi="['qw:externalContactInfo:updateTalk']"
|
|
|
>批量更改交流状态</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ size="mini"
|
|
|
+ @click="addLobsterTag"
|
|
|
+ v-hasPermi="['qw:externalContact:addTag']"
|
|
|
+ >批量增加龙虾标签</el-button>
|
|
|
+ </el-col>
|
|
|
<!-- <el-col :span="1.5">-->
|
|
|
<!-- <el-button-->
|
|
|
<!-- type="primary"-->
|
|
|
@@ -401,6 +410,22 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="龙虾标签" align="center" width="200px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="scope.row.lobsterTagNames && scope.row.lobsterTagNames.length">
|
|
|
+ <el-tag
|
|
|
+ v-for="name in scope.row.lobsterTagNames"
|
|
|
+ :key="name"
|
|
|
+ type="warning"
|
|
|
+ size="small"
|
|
|
+ style="margin: 2px;"
|
|
|
+ >
|
|
|
+ {{ name }}
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ <span v-else style="color: #c0c4cc;">-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="流失风险" align="center" prop="attritionLevel">
|
|
|
<template slot-scope="scope">
|
|
|
<el-tag v-if="scope.row.attritionLevel == null" type="info">未分析</el-tag>
|
|
|
@@ -744,6 +769,40 @@
|
|
|
<el-button @click="addTagCancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="批量增加龙虾标签" :visible.sync="lobsterTagOpen" width="700px" append-to-body>
|
|
|
+ <div v-loading="lobsterTagLoading">
|
|
|
+ <el-alert
|
|
|
+ title="龙虾标签来源于已启用的标签-模板绑定关系"
|
|
|
+ type="info"
|
|
|
+ :closable="false"
|
|
|
+ show-icon
|
|
|
+ style="margin-bottom: 16px"
|
|
|
+ />
|
|
|
+ <el-table
|
|
|
+ :data="lobsterTagList"
|
|
|
+ ref="lobsterTagTable"
|
|
|
+ @selection-change="handleLobsterTagSelect"
|
|
|
+ max-height="400"
|
|
|
+ border
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column prop="tagCode" label="标签编码" width="150" />
|
|
|
+ <el-table-column prop="tagName" label="标签名称" min-width="150" />
|
|
|
+ <el-table-column prop="templateName" label="绑定模板" min-width="180" show-overflow-tooltip />
|
|
|
+ <el-table-column prop="priority" label="优先级" width="100" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag :type="row.priority >= 50 ? 'danger' : row.priority >= 30 ? 'warning' : 'info'" size="mini">
|
|
|
+ {{ row.priority }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" :disabled="lobsterSelectedTags.length === 0" @click="submitLobsterTag">确 定 (已选{{ lobsterSelectedTags.length }})</el-button>
|
|
|
+ <el-button @click="lobsterTagOpen = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog title="批量添加客户备注" :visible.sync="notesOpen.open" width="800px" append-to-body>
|
|
|
<el-card>
|
|
|
<el-row>
|
|
|
@@ -1030,6 +1089,7 @@ import selectUser from "@/views/qw/externalContact/selectUser.vue";
|
|
|
import collection from "@/views/qw/externalContact/collection.vue";
|
|
|
import info from "@/views/qw/externalContact/info.vue";
|
|
|
import { editTalk } from "@/api/qw/externalContactInfo";
|
|
|
+import { tagBindingApi } from '@/api/company/tagBinding'
|
|
|
import PaginationMore from "../../../components/PaginationMore/index.vue";
|
|
|
import userDetails from '@/views/store/components/userDetails.vue';
|
|
|
import {courseList, videoList} from "@/api/course/courseRedPacketLog";
|
|
|
@@ -1122,6 +1182,11 @@ export default {
|
|
|
exportLoading: false,
|
|
|
tagOpen:false,
|
|
|
tagDelOpen:false,
|
|
|
+ // 龙虾标签弹窗
|
|
|
+ lobsterTagOpen: false,
|
|
|
+ lobsterTagLoading: false,
|
|
|
+ lobsterTagList: [],
|
|
|
+ lobsterSelectedTags: [],
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
isBindActiveName:"all",
|
|
|
@@ -1541,6 +1606,18 @@ export default {
|
|
|
this.externalContactList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
+ // 加载龙虾标签
|
|
|
+ if (this.externalContactList && this.externalContactList.length) {
|
|
|
+ const userIds = this.externalContactList.map(u => u.id);
|
|
|
+ tagBindingApi.getLobsterTags(userIds).then(res => {
|
|
|
+ const tagMap = res.data || {};
|
|
|
+ this.externalContactList.forEach(row => {
|
|
|
+ const tagData = tagMap[row.id];
|
|
|
+ const tagList = tagData ? (Array.isArray(tagData) ? tagData : [tagData]) : [];
|
|
|
+ this.$set(row, 'lobsterTagNames', tagList.map(tag => tag.tag_name));
|
|
|
+ });
|
|
|
+ }).catch(() => {});
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
bindMiniCustomerId(row){
|
|
|
@@ -2390,6 +2467,54 @@ export default {
|
|
|
this.msgSuccess("成功");
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
+ addLobsterTag() {
|
|
|
+ if (this.ids == null || this.ids.length === 0) {
|
|
|
+ return this.$message('请勾选需要添加龙虾标签的客户');
|
|
|
+ }
|
|
|
+ this.lobsterTagLoading = true;
|
|
|
+ this.lobsterTagOpen = true;
|
|
|
+ this.lobsterSelectedTags = [];
|
|
|
+ tagBindingApi.getListByStatus({ status: 1 }).then(res => {
|
|
|
+ this.lobsterTagList = res.data || [];
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.error('获取龙虾标签列表失败');
|
|
|
+ }).finally(() => {
|
|
|
+ this.lobsterTagLoading = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.lobsterTagTable) {
|
|
|
+ this.$refs.lobsterTagTable.clearSelection();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleLobsterTagSelect(selection) {
|
|
|
+ this.lobsterSelectedTags = selection;
|
|
|
+ },
|
|
|
+ submitLobsterTag() {
|
|
|
+ if (this.lobsterSelectedTags.length === 0) {
|
|
|
+ return this.$message('请选择龙虾标签');
|
|
|
+ }
|
|
|
+ const tagCodes = this.lobsterSelectedTags.map(t => t.tagCode);
|
|
|
+ const tagNames = this.lobsterSelectedTags.map(t => t.tagName);
|
|
|
+ this.$confirm(
|
|
|
+ '将为 ' + this.ids.length + ' 个客户添加以下标签:' + tagNames.join('、') + ',是否确认?',
|
|
|
+ '提示',
|
|
|
+ { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
|
|
|
+ ).then(() => {
|
|
|
+ tagBindingApi.batchBindLobsterTag({
|
|
|
+ userIds: this.ids,
|
|
|
+ tagCodes: tagCodes,
|
|
|
+ qwCorpId: this.queryParams.corpId
|
|
|
+ }).then(res => {
|
|
|
+ this.$message.success('龙虾标签添加任务已提交');
|
|
|
+ this.lobsterTagOpen = false;
|
|
|
+ this.lobsterSelectedTags = [];
|
|
|
+ this.getList();
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.error('龙虾标签添加失败');
|
|
|
+ });
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
const { qwUserName, ...queryParams } = this.queryParams;
|
|
|
@@ -2602,4 +2727,4 @@ export default {
|
|
|
border-radius: 1px;
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|