feat(BD列表): 操作新增换绑BDLeader的功能

This commit is contained in:
hzj 2026-01-21 15:17:30 +08:00
parent 2c0d9350ac
commit aeba174363
3 changed files with 573 additions and 207 deletions

View File

@ -1,116 +1,125 @@
import request from '@/utils/request' import request from "@/utils/request";
// BD列表 // BD列表
export function pageRoomBDInfo(params) { export function pageRoomBDInfo(params) {
return request({ return request({
url: '/team/bd/page', url: "/team/bd/page",
method: 'get', method: "get",
params params
}) });
} }
// BD代理列表 // BD代理列表
export function pageRoomTeamBDInfo(params) { export function pageRoomTeamBDInfo(params) {
return request({ return request({
url: '/team/bd/member/page', url: "/team/bd/member/page",
method: 'get', method: "get",
params params
}) });
} }
// 删除BD // 删除BD
export function deleteBD(id) { export function deleteBD(id) {
return request({ return request({
url: '/team/bd/del', url: "/team/bd/del",
method: 'get', method: "get",
params: { id } params: { id }
}) });
} }
// 删除BD中的代理成员 // 删除BD中的代理成员
export function deleteBDMember(id) { export function deleteBDMember(id) {
return request({ return request({
url: '/team/bd/member/del', url: "/team/bd/member/del",
method: 'get', method: "get",
params: { id } params: { id }
}) });
} }
// 添加BD // 添加BD
export function addBD(data) { export function addBD(data) {
return request({ return request({
url: '/team/bd/add', url: "/team/bd/add",
method: 'post', method: "post",
data data
}) });
} }
// 修改BD // 修改BD
export function updateBD(data) { export function updateBD(data) {
return request({ return request({
url: '/team/bd/update', url: "/team/bd/update",
method: 'post', method: "post",
data data
}) });
} }
// 根据bdID获得bd信息 // 根据bdID获得bd信息
export function getBdById(id) { export function getBdById(id) {
return request({ return request({
url: '/bd/' + id, url: "/bd/" + id,
method: 'get' method: "get"
}) });
}
// 换绑BD Leader
export function bingdBDLeader(data) {
return request({
url: "/team/bd/change-bd-leader",
method: "post",
data
});
} }
// BD Lead 列表 // BD Lead 列表
export function pageBdLead(params) { export function pageBdLead(params) {
return request({ return request({
url: '/team/bd/leader/page', url: "/team/bd/leader/page",
method: 'get', method: "get",
params params
}) });
} }
// 删除BD Lead // 删除BD Lead
export function deleteBdLead(id) { export function deleteBdLead(id) {
return request({ return request({
url: '/team/bd/leader/del', url: "/team/bd/leader/del",
method: 'get', method: "get",
params: { id } params: { id }
}) });
} }
// 添加BD Lead // 添加BD Lead
export function addBdLead(data) { export function addBdLead(data) {
return request({ return request({
url: '/team/bd/leader/add', url: "/team/bd/leader/add",
method: 'post', method: "post",
data data
}) });
} }
// 编辑BD Lead // 编辑BD Lead
export function updateBDLead(data) { export function updateBDLead(data) {
return request({ return request({
url: '/team/bd/leader/update', url: "/team/bd/leader/update",
method: 'post', method: "post",
data data
}) });
} }
// BD Lead添加子级BD // BD Lead添加子级BD
export function leadBindBd(data) { export function leadBindBd(data) {
return request({ return request({
url: '/team/bd/leader/bind/bd', url: "/team/bd/leader/bind/bd",
method: 'post', method: "post",
data data
}) });
} }
// BD工作统计 // BD工作统计
export function pageWorkStatistics(params) { export function pageWorkStatistics(params) {
return request({ return request({
url: '/team/bd/work/statistics', url: "/team/bd/work/statistics",
method: 'get', method: "get",
params params
}) });
} }

View File

@ -0,0 +1,122 @@
<template>
<div class="bind-team-drawer">
<el-drawer
title="绑定BDLeader"
:visible="true"
:before-close="handleClose"
:close-on-press-escape="false"
:wrapper-closable="false"
:modal-append-to-body="true"
:append-to-body="true"
custom-class="drawer-auto-layout"
>
<div class="bind-team">
<!-- 输入表单 -->
<div class="drawer-form">
<el-form
ref="form"
:model="form"
:rules="formRules"
label-width="100px"
>
<el-form-item prop="newAccount" label="BD Leader">
<!-- 输入框 -->
<el-input
v-model="form.newAccount"
:sys-origin="sysOrigin"
placeholder="请输入账号或靓号"
/>
</el-form-item>
</el-form>
</div>
<!-- 尾部 -->
<div class="drawer-footer">
<el-button @click="handleClose()">关闭</el-button>
<el-button
type="primary"
:disabled="submitLoading"
:loading="submitLoading"
@click="submitForm"
>保存</el-button
>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
import { deepClone } from "@/utils";
import { bingdBDLeader } from "@/api/room-anchor";
export default {
name: "BindTeam",
props: {
row: {
type: Object,
require: false,
default: () => {}
}
},
data() {
const commonRules = [
{ required: true, message: "必填字段不可为空", trigger: "blur" }
];
return {
submitLoading: false,
sysOrigin: "",
form: {
newAccount: "",
bdId: ""
},
formRules: {
newAccount: commonRules
}
};
},
computed: {
textOptTitle() {
return "绑定代理";
}
},
watch: {
row: {
handler(newVal) {
const _newData = deepClone(newVal);
this.sysOrigin = _newData.userProfile.originSys;
this.form.bdId = _newData.id;
},
immediate: true
}
},
methods: {
handleClose() {
if (this.submitLoading) {
this.$opsMessage.warn("正在提交!");
return;
}
this.$emit("close");
},
submitForm() {
const that = this;
that.$refs.form.validate(valid => {
if (!valid) {
console.error("error submit!!");
return false;
}
that.submitLoading = true;
bingdBDLeader(that.form)
.then(res => {
that.submitLoading = false;
that.$opsMessage.success();
this.$emit("success");
})
.catch(er => {
that.submitLoading = false;
});
});
}
}
};
</script>

View File

@ -1,8 +1,10 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 有操作权限 -->
<div v-if="isQueryPermissions"> <div v-if="isQueryPermissions">
<!-- 搜索栏 -->
<div class="filter-container"> <div class="filter-container">
<!-- 系统 -->
<el-select <el-select
v-model="listQuery.sysOrigin" v-model="listQuery.sysOrigin"
placeholder="系统" placeholder="系统"
@ -16,16 +18,32 @@
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
> >
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span> <span style="float: left;">
<sys-origin-icon :icon="item.value" :desc="item.value"
/></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span> <span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option> </el-option>
</el-select> </el-select>
<!-- BD用户ID -->
<div class="filter-item"> <div class="filter-item">
<account-input v-model="listQuery.userId" :sys-origin="listQuery.sysOrigin" placeholder="BD用户ID" /> <account-input
v-model="listQuery.userId"
:sys-origin="listQuery.sysOrigin"
placeholder="BD用户ID"
/>
</div> </div>
<!-- BD Lead用户ID -->
<div class="filter-item"> <div class="filter-item">
<account-input v-model="listQuery.bdLeadUserId" :sys-origin="listQuery.sysOrigin" placeholder="BD Lead用户ID" /> <account-input
v-model="listQuery.bdLeadUserId"
:sys-origin="listQuery.sysOrigin"
placeholder="BD Lead用户ID"
/>
</div> </div>
<!-- 区域 -->
<div class="filter-item" style="width: 120px;"> <div class="filter-item" style="width: 120px;">
<select-system-region <select-system-region
ref="regionSelectPolicy" ref="regionSelectPolicy"
@ -36,9 +54,16 @@
@change="handleSearch" @change="handleSearch"
/> />
</div> </div>
<!-- 成员数量 -->
<div class="filter-item"> <div class="filter-item">
<el-input v-model="listQuery.memberQuantityRange" placeholder="开始~结束成员数量" /> <el-input
v-model="listQuery.memberQuantityRange"
placeholder="开始~结束成员数量"
/>
</div> </div>
<!-- 后台成员 -->
<el-select <el-select
v-if="backUserConditionVisible" v-if="backUserConditionVisible"
v-model="listQuery.createUser" v-model="listQuery.createUser"
@ -57,6 +82,8 @@
:value="item.id" :value="item.id"
/> />
</el-select> </el-select>
<!-- 搜索按钮 -->
<el-button <el-button
:loading="searchLoading" :loading="searchLoading"
:disabled="searchDisabled" :disabled="searchDisabled"
@ -68,6 +95,7 @@
搜索 搜索
</el-button> </el-button>
<!-- 新增BD 按钮 -->
<el-button <el-button
v-if="buttonPermissions.includes('bd:list:add')" v-if="buttonPermissions.includes('bd:list:add')"
class="filter-item" class="filter-item"
@ -78,6 +106,8 @@
新增BD 新增BD
</el-button> </el-button>
</div> </div>
<!-- 表单 -->
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="list" :data="list"
@ -86,57 +116,158 @@
highlight-current-row highlight-current-row
@cell-mouse-enter="handleMouseEnter" @cell-mouse-enter="handleMouseEnter"
> >
<!-- 排序 -->
<el-table-column type="index" width="50" label="No" /> <el-table-column type="index" width="50" label="No" />
<!-- 系统 -->
<!-- <el-table-column prop="sysOrigin" label="系统" align="center" min-width="60"> <!-- <el-table-column prop="sysOrigin" label="系统" align="center" min-width="60">
<template slot-scope="scope"> <template slot-scope="scope">
<sys-origin-icon :icon="scope.row.sysOrigin" :desc="scope.row.sysOrigin" /> <sys-origin-icon :icon="scope.row.sysOrigin" :desc="scope.row.sysOrigin" />
</template> </template>
</el-table-column> </el-table-column>
--> -->
<!-- 用户信息 -->
<el-table-column label="用户" align="center" min-width="190"> <el-table-column label="用户" align="center" min-width="190">
<template slot-scope="scope"> <template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.userProfile" :query-details="true" /> <user-table-exhibit
:user-profile="scope.row.userProfile"
:query-details="true"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="regionName" label="区域" align="center" min-width="60" />
<el-table-column prop="agentCount" label="团队数量" align="center" min-width="100"> <!-- 区域 -->
<el-table-column
prop="regionName"
label="区域"
align="center"
min-width="60"
/>
<!-- 成员数量 -->
<el-table-column
prop="agentCount"
label="团队数量"
align="center"
min-width="100"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-button v-if="scope.row.agentCount > 0" type="text" @click.native="clickTeamMember(scope.row)">{{ scope.row.agentCount }}</el-button> <!-- 展示团队成员 -->
<el-button
v-if="scope.row.agentCount > 0"
type="text"
@click.native="clickTeamMember(scope.row)"
>{{ scope.row.agentCount }}</el-button
>
<span v-else>0</span> <span v-else>0</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<!-- BD Leader -->
<el-table-column label="BD Leader" align="center" min-width="190"> <el-table-column label="BD Leader" align="center" min-width="190">
<template slot-scope="scope"> <template slot-scope="scope">
<user-table-exhibit :user-profile="scope.row.bdLeadUserProfile" :query-details="true" /> <user-table-exhibit
:user-profile="scope.row.bdLeadUserProfile"
:query-details="true"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="buttonPermissions.includes('bd:list:edit')" prop="contact" label="联系方式" align="center" min-width="100" />
<el-table-column prop="createUserName" label="创建人" align="center" min-width="100" /> <!-- 联系方式 -->
<el-table-column prop="updateUserName" label="修改人" align="center" min-width="100" /> <el-table-column
<el-table-column prop="createTime" label="创建时间" align="center" width="160"> v-if="buttonPermissions.includes('bd:list:edit')"
prop="contact"
label="联系方式"
align="center"
min-width="100"
/>
<!-- 创建人 -->
<el-table-column
prop="createUserName"
label="创建人"
align="center"
min-width="100"
/>
<!-- 修改人 -->
<el-table-column
prop="updateUserName"
label="修改人"
align="center"
min-width="100"
/>
<!-- 创建时间 -->
<el-table-column
prop="createTime"
label="创建时间"
align="center"
width="160"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.createTime | dateFormat }} {{ scope.row.createTime | dateFormat }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="showOperationCol" fixed="right" label="操作" align="center" width="80">
<!-- 操作列表 -->
<el-table-column
v-if="showOperationCol"
fixed="right"
label="操作"
align="center"
width="80"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-dropdown> <el-dropdown>
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<i class="el-icon-more" /> <i class="el-icon-more" />
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="buttonPermissions.includes('bd:list:add:member')" @click.native="clickTeam(scope.row, scope.$index)">新增代理</el-dropdown-item> <!-- 新增代理 -->
<el-dropdown-item v-if="buttonPermissions.includes('bd:list:add:bind')" @click.native="clickBindTeam(scope.row, scope.$index)">绑定代理</el-dropdown-item> <el-dropdown-item
<el-dropdown-item v-if="buttonPermissions.includes('bd:list:edit')" @click.native="clickEdit(scope.row, scope.$index)">编辑</el-dropdown-item> v-if="buttonPermissions.includes('bd:list:add:member')"
<el-dropdown-item v-if="buttonPermissions.includes('bd:list:del')" @click.native="handlBDDel(scope.row.id, scope.$index)">删除</el-dropdown-item> @click.native="clickTeam(scope.row, scope.$index)"
>新增代理</el-dropdown-item
>
<!-- 绑定代理 -->
<el-dropdown-item
v-if="buttonPermissions.includes('bd:list:add:bind')"
@click.native="clickBindTeam(scope.row, scope.$index)"
>绑定代理</el-dropdown-item
>
<!-- 编辑 -->
<el-dropdown-item
v-if="buttonPermissions.includes('bd:list:edit')"
@click.native="clickEdit(scope.row, scope.$index)"
>编辑</el-dropdown-item
>
<!-- 删除 -->
<el-dropdown-item
v-if="buttonPermissions.includes('bd:list:del')"
@click.native="handlBDDel(scope.row.id, scope.$index)"
>删除</el-dropdown-item
>
<!-- 换绑BD Leader -->
<el-dropdown-item
v-if="buttonPermissions.includes('bd:list:edit')"
@click.native="changeBinding(scope.row, scope.$index)"
>换绑BD Leader</el-dropdown-item
>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 -->
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
@ -145,65 +276,93 @@
@pagination="renderData" @pagination="renderData"
/> />
<!-- 团队成员组件 -->
<team-member <team-member
v-if="teamMemberVisible" v-if="teamMemberVisible"
:query="teamMemberQuery" :query="teamMemberQuery"
@close="teamMemberVisible=false;teamMemberQuery={}" @close="
teamMemberVisible = false;
teamMemberQuery = {};
"
/> />
<!-- 新增/编辑BD 组件 -->
<add-bd <add-bd
v-if="addBdVisible" v-if="addBdVisible"
:row="thisRow" :row="thisRow"
@success="addBdSuccess" @success="addBdSuccess"
@close="addBdVisible=false;" @close="addBdVisible = false"
/> />
<!-- 新增代理组件 -->
<team-create <team-create
v-if="teamCreateVisible" v-if="teamCreateVisible"
:sys-origin="listQuery.sysOrigin" :sys-origin="listQuery.sysOrigin"
:bd-ops="bdOps" :bd-ops="bdOps"
@success="teamCreateSuccess" @success="teamCreateSuccess"
@close="teamCreateVisible=false" @close="teamCreateVisible = false"
/> />
<!-- 绑定代理组件 -->
<bind-team <bind-team
v-if="teamBindDrawerVisible" v-if="teamBindDrawerVisible"
:row="thatRow" :row="thatRow"
@success="teamBindSuccess" @success="teamBindSuccess"
@close="teamBindDrawerVisible=false" @close="teamBindDrawerVisible = false"
/> />
</div> <!-- 绑定BDLeader 组件 -->
<div v-else v-loading.lock="listLoading" element-loading-background="#FFFFFF" element-loading-text="权限验证中..." style="text-align: center;"> <bind-bd-leader
抱歉您无权查看请联系管理员开通查看权限 运营管理/主播中心/bd:(list:query:all/bd:list:query:self) v-if="BDLeaderBindDrawerVisible"
:row="thatRow"
@success="BDLeaderBindSuccess"
@close="BDLeaderBindDrawerVisible = false"
/>
</div> </div>
<!-- 无权限 提示 -->
<div
v-else
v-loading.lock="listLoading"
element-loading-background="#FFFFFF"
element-loading-text="权限验证中..."
style="text-align: center;"
>
抱歉您无权查看请联系管理员开通查看权限
运营管理/主播中心/bd:(list:query:all/bd:list:query:self)
</div>
</div> </div>
</template> </template>
<script> <script>
import Pagination from '@/components/Pagination' import { mapGetters } from "vuex";
import { copyText } from '@/utils' import { copyText } from "@/utils";
import { pageRoomBDInfo, deleteBD } from '@/api/room-anchor'
import { mapGetters } from 'vuex' import { pageRoomBDInfo, deleteBD } from "@/api/room-anchor";
import TeamMember from './team-member' import { listMembers } from "@/api/team";
import { listMembers } from '@/api/team'
import AddBd from './add-bd' import Pagination from "@/components/Pagination";
import TeamCreate from './../components/TeamCreate' import TeamMember from "./team-member";
import BindTeam from './bind-team' import AddBd from "./add-bd";
import TeamCreate from "./../components/TeamCreate";
import BindTeam from "./bind-team";
import bindBdLeader from "./bind-bd-leader";
export default { export default {
name: 'BusinessDevelopment', name: "BusinessDevelopment",
components: { components: {
Pagination, Pagination,
TeamMember, TeamMember,
AddBd, AddBd,
TeamCreate, TeamCreate,
BindTeam BindTeam,
bindBdLeader
}, },
data() { data() {
return { return {
teamBindDrawerVisible: false, teamBindDrawerVisible: false,
BDLeaderBindDrawerVisible: false,
thatRow: {},
bdOps: {}, bdOps: {},
teamCreateVisible: false, teamCreateVisible: false,
thisRow: {}, thisRow: {},
@ -214,8 +373,8 @@ export default {
teamMemberQuery: {}, teamMemberQuery: {},
teamMemberVisible: false, teamMemberVisible: false,
addBdVisible: false, addBdVisible: false,
textOptTitle: '', textOptTitle: "",
thatSelectedUserId: '', thatSelectedUserId: "",
submitLoading: false, submitLoading: false,
list: [], list: [],
members: [], members: [],
@ -223,231 +382,308 @@ export default {
listQuery: { listQuery: {
cursor: 1, cursor: 1,
limit: 20, limit: 20,
userId: '', userId: "",
bdLeadUserId: '', bdLeadUserId: "",
sysOrigin: 'HALAR', sysOrigin: "HALAR",
createUser: '', createUser: "",
region: '', region: "",
memberQuantityRange: '' memberQuantityRange: ""
}, },
listLoading: false, listLoading: false,
listMembersLoading: false, listMembersLoading: false,
searchLoading: false, searchLoading: false,
backUserConditionVisible: false backUserConditionVisible: false
} };
}, },
computed: { computed: {
...mapGetters(['uid', 'buttonPermissions', 'permissionsSysOriginPlatforms', 'permissionsFirstSysOrigin']), ...mapGetters([
"uid",
"buttonPermissions",
"permissionsSysOriginPlatforms",
"permissionsFirstSysOrigin"
]),
//
showOperationCol() { showOperationCol() {
return this.buttonPermissions.includes('bd:list:edit') || return (
this.buttonPermissions.includes('bd:list:add:bind') || this.buttonPermissions.includes("bd:list:edit") ||
this.buttonPermissions.includes('bd:list:del') || this.buttonPermissions.includes("bd:list:add:bind") ||
this.buttonPermissions.includes('bd:list:add:member') this.buttonPermissions.includes("bd:list:del") ||
this.buttonPermissions.includes("bd:list:add:member")
);
}, },
//
isQueryPermissions() { isQueryPermissions() {
return this.buttonPermissions.includes('bd:list:query:all') || this.buttonPermissions.includes('bd:list:query:self') return (
this.buttonPermissions.includes("bd:list:query:all") ||
this.buttonPermissions.includes("bd:list:query:self")
);
} }
}, },
watch: { watch: {
buttonPermissions: { buttonPermissions: {
handler(newVal) { handler(newVal) {
this.backUserConditionVisible = newVal.includes('bd:list:query:all') this.backUserConditionVisible = newVal.includes("bd:list:query:all");
if (newVal.includes('bd:list:query:self')) { if (newVal.includes("bd:list:query:self")) {
if (newVal.includes('bd:list:query:all')) { if (newVal.includes("bd:list:query:all")) {
return return;
} }
this.listQuery.createUser = this.uid this.listQuery.createUser = this.uid;
this.renderData(true) this.renderData(true);
return return;
} }
}, },
immediate: true immediate: true
} }
}, },
created() { created() {
const that = this const that = this;
const querySystem = this.permissionsSysOriginPlatforms[0] const querySystem = this.permissionsSysOriginPlatforms[0];
if (!querySystem) { if (!querySystem) {
return return;
} }
that.loadMembers() that.loadMembers();
that.listQuery.sysOrigin = querySystem.value that.listQuery.sysOrigin = querySystem.value;
that.renderData(true) that.renderData(true);
}, },
methods: { methods: {
//
renderData(isReset) { renderData(isReset) {
const that = this const that = this;
if (isReset === true) { if (isReset === true) {
that.listQuery.cursor = 1 that.listQuery.cursor = 1;
that.list = [] that.list = [];
} }
if (that.listLoading === true && isReset === true) { if (that.listLoading === true && isReset === true) {
return return;
} }
that.listLoading = true that.listLoading = true;
that.searchDisabled = true that.searchDisabled = true;
pageRoomBDInfo(that.listQuery).then(res => { pageRoomBDInfo(that.listQuery)
const { body } = res .then(res => {
that.total = body.total || 0 const { body } = res;
that.list = body.records that.total = body.total || 0;
that.listLoading = false that.list = body.records;
that.searchLoading = false that.listLoading = false;
that.searchDisabled = false that.searchLoading = false;
}).catch(er => { that.searchDisabled = false;
that.listLoading = false })
that.searchLoading = false .catch(er => {
that.searchDisabled = false that.listLoading = false;
}) that.searchLoading = false;
that.searchDisabled = false;
});
}, },
//
loadMembers() { loadMembers() {
const that = this const that = this;
that.listMembersLoading = true that.listMembersLoading = true;
listMembers().then(res => { listMembers()
const { body } = res .then(res => {
that.members = body const { body } = res;
that.listMembersLoading = false that.members = body;
that.searchLoading = false that.listMembersLoading = false;
}).catch(er => { that.searchLoading = false;
that.listMembersLoading = false })
that.searchLoading = false .catch(er => {
}) that.listMembersLoading = false;
that.searchLoading = false;
});
}, },
//
handleSearch() { handleSearch() {
const that = this const that = this;
that.searchLoading = true that.searchLoading = true;
that.renderData(true) that.renderData(true);
}, },
// BD
handleCreate() { handleCreate() {
this.textOptTitle = '新增BD' this.textOptTitle = "新增BD";
this.thisRow = {} this.thisRow = {}; // BD
this.thisRow.sysOrigin = this.listQuery.sysOrigin this.thisRow.sysOrigin = this.listQuery.sysOrigin;
this.addBdVisible = true this.addBdVisible = true;
}, },
//
clickTeam(row, _index) { clickTeam(row, _index) {
this.teamCreateVisible = true this.teamCreateVisible = true;
this.thisRowIndex = _index this.thisRowIndex = _index;
this.bdOps = { this.bdOps = {
userId: row.userProfile.id, userId: row.userProfile.id,
region: row.region, region: row.region,
contact: row.contact contact: row.contact
} };
}, },
//
clickBindTeam(row, _index) { clickBindTeam(row, _index) {
this.thatRow = row this.thatRow = row;
this.thisRowIndex = _index this.thisRowIndex = _index;
this.teamBindDrawerVisible = true this.teamBindDrawerVisible = true;
}, },
// BDLeader
changeBinding(row, _index) {
this.thatRow = row;
this.thisRowIndex = _index;
this.BDLeaderBindDrawerVisible = true;
},
//
clickTeamMember(row) { clickTeamMember(row) {
this.teamMemberVisible = true this.teamMemberVisible = true;
this.teamMemberQuery = { this.teamMemberQuery = {
userId: row.userId userId: row.userId
} };
}, },
//
teamBindSuccess() { teamBindSuccess() {
this.list[this.thisRowIndex].agentCount = Number(this.list[this.thisRowIndex].agentCount) + 1 this.list[this.thisRowIndex].agentCount =
this.teamBindDrawerVisible = false Number(this.list[this.thisRowIndex].agentCount) + 1;
this.teamBindDrawerVisible = false;
}, },
// BDLeader
BDLeaderBindSuccess() {
this.$opsMessage.success();
this.BDLeaderBindDrawerVisible = false;
this.handleSearch();
},
// /BD
addBdSuccess(form) { addBdSuccess(form) {
this.$opsMessage.success() this.$opsMessage.success();
this.addBdVisible = false this.addBdVisible = false;
this.renderData(!!(form.id)) this.renderData(!!form.id);
}, },
accountHandleSuccess(data) { accountHandleSuccess(data) {
this.$message({ this.$message({
message: 'Successful', message: "Successful",
type: 'success' type: "success"
}) });
// this.renderData() // this.renderData()
}, },
handleLiveClick(row) { handleLiveClick(row) {
window.open(row.liveUrl) window.open(row.liveUrl);
}, },
copyTextContent(text) { copyTextContent(text) {
const that = this const that = this;
copyText(text).then(() => { copyText(text)
that.$message({ .then(() => {
message: '复制成功', that.$message({
type: 'success' message: "复制成功",
type: "success"
});
}) })
}).catch(() => { .catch(() => {
that.$message({ that.$message({
message: '复制失败', message: "复制失败",
type: 'error' type: "error"
}) });
}) });
}, },
originText(row) { originText(row) {
const texts = [] const texts = [];
if (row.originPlatform) { if (row.originPlatform) {
texts.push(row.originPlatform) texts.push(row.originPlatform);
} }
if (row.originPhoneModel) { if (row.originPhoneModel) {
texts.push(row.originPhoneModel) texts.push(row.originPhoneModel);
} }
return texts.join('') return texts.join("");
}, },
// BD
handleClose() { handleClose() {
this.addBdVisible = false this.addBdVisible = false;
}, },
//
teamCreateSuccess() { teamCreateSuccess() {
this.$opsMessage.success() this.$opsMessage.success();
this.teamCreateVisible = false this.teamCreateVisible = false;
this.list[this.thisRowIndex].agentCount = Number(this.list[this.thisRowIndex].agentCount) + 1 this.list[this.thisRowIndex].agentCount =
Number(this.list[this.thisRowIndex].agentCount) + 1;
}, },
// BD
clickEdit(row, _index) { clickEdit(row, _index) {
const that = this const that = this;
that.thisRow = row that.thisRow = row;
that.thisRowIndex = _index that.thisRowIndex = _index;
that.textOptTitle = '编辑BD' that.textOptTitle = "编辑BD";
that.addBdVisible = true that.addBdVisible = true;
}, },
// BD
handlBDDel(id, _index) { handlBDDel(id, _index) {
const that = this const that = this;
this.$confirm('您确定要删除吗(将无法恢复, 解散当前团队成员)?', '温馨提示', { this.$confirm(
confirmButtonText: '确定', "您确定要删除吗(将无法恢复, 解散当前团队成员)?",
cancelButtonText: '取消' "温馨提示",
}).then(() => { {
deleteBD(id).then(res => { confirmButtonText: "确定",
that.$opsMessage.success() cancelButtonText: "取消"
that.list.splice(_index, 1) }
}).catch(er => { )
that.$opsMessage.success() .then(() => {
deleteBD(id)
.then(res => {
that.$opsMessage.success();
that.list.splice(_index, 1);
})
.catch(er => {
that.$opsMessage.success();
});
}) })
}).catch(() => {}) .catch(() => {});
}, },
toPlatformSvgIconKey(row) { toPlatformSvgIconKey(row) {
if (row.cellphoneNumber) { if (row.cellphoneNumber) {
return 'phone' return "phone";
} }
if (row.facebookId) { if (row.facebookId) {
return 'facebook' return "facebook";
} }
if (row.googleId) { if (row.googleId) {
return 'google' return "google";
} }
if (row.appleId) { if (row.appleId) {
return 'apple' return "apple";
} }
if (row.snapchatId) { if (row.snapchatId) {
return 'snapchat' return "snapchat";
} }
return '' return "";
}, },
renderDataSuccess() { renderDataSuccess() {
this.$message({ this.$message({
message: 'Successful', message: "Successful",
type: 'success' type: "success"
}) });
this.renderData() this.renderData();
}, },
//
handleMouseEnter(row) { handleMouseEnter(row) {
this.thisRow = row this.thisRow = row;
this.thatSelectedUserId = row.userId this.thatSelectedUserId = row.userId;
} }
} }
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.this-level { .this-level {
@ -457,5 +693,4 @@ export default {
width: 150px; width: 150px;
} }
} }
</style> </style>