Commit 11b14ac5 by 王志慧

人群管理,设置标签

1 parent 8651272b
......@@ -26,7 +26,7 @@
</div>
<img src="./assets/logo.png" alt="" srcset="" />
</div> -->
<keep-alive exclude="clientDetail,clientGroupDetail,tagsManage,clientDataOverview,guestGroup,guestGroupAdd,guestGroupDetail">
<keep-alive exclude="clientDetail,clientGroupDetail,tagsManage,clientDataOverview,guestGroup,guestGroupAdd,guestGroupDetail,group">
<router-view></router-view>
</keep-alive>
</div>
......
......@@ -6,29 +6,50 @@
* @param {*} params
* @returns
*/
import { http3 } from '@/main'
import { http3 } from '@/main'
const url = 'http://192.168.3.193:8395/rop-scrm-entmicro/router'
//获取数据概览上方的数据 /rop-scrm-datahub
export function getDataOverview(params){
params.method='entmicro.api.Customer.customer.view.data'
export function getDataOverview(params) {
params.method = 'entmicro.api.Customer.customer.view.data'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//获取数据概览下方柱状图的数据
export function getDataOverviewBarMap(params){
params.method='entmicro.api.customer.view.chart'
}
//获取数据概览下方柱状图的数据
export function getDataOverviewBarMap(params) {
params.method = 'entmicro.api.customer.view.chart'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
}
//客户分群列表接口
export function getCustomerList(params) {
params.method = 'entmicro.api.customer.cluster.page'
return http3({
url:'/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//客户分群列表导出
export function customerClusterListExport(params) {
params.method = 'entmicro.api.customer.customerClusterListExport'
return http3({
url:'/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
......@@ -6,9 +6,9 @@
* @param {*} params
* @returns
*/
import { http,http2,http3 } from '@/main'
//const commonUrl='&format=json&appKey=48e5e13229b82c1b4e6e8c96151f0637&v=1.0.*×tamp=1654487354&source=sub-client-custom&sign=sdf9787dfs87987sf9879sdf87sdf'
import { http, http3 } from '@/main'
// const url = 'http://192.168.3.181:9636/rop-scrm-datahub/router'
//const commonUrl='&format=json&appKey=48e5e13229b82c1b4e6e8c96151f0637&v=1.0.*×tamp=1654487354&source=sub-client-custom&sign=sdf9787dfs87987sf9879sdf87sdf'
//获取客户列表内容
// const GETCLIENTTABLELIST = params => {
// return http({
......@@ -23,66 +23,67 @@
// 获取客户详情单用户标签
// params.method='datahub.api.label.querylabeltree'
export function getSingleClientTag(params){
params.method='scrm.api.datahub.user.getuserlabel'
export function getSingleClientTag(params) {
params.method = 'scrm.api.datahub.user.getuserlabel'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
}
export function getAllTagTree (params){
export function getAllTagTree(params) {
// params.method='scrm.api.datahub.label.querylabeltree'
params.method='scrm.api.datahub.labelgroup.queryLabelTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// /router/datahub.api.user.addUserLabel/1.0.0
// 用户添加标签
export function addSingleClientTag (params){
params.method='scrm.api.datahub.user.addUserLabel'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
//编辑用户标签(包含标签新增列表和删除列表)
export function addSingleClientTag(params) {
params.method = 'scrm.api.datahub.user.editUserLabel'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export function getTableList (params){
params.method='entmicro.api.customer.page'
export function getTableList(params) {
params.method = 'entmicro.api.customer.page'
// params.sessionId="mini-e72437ba-845e-4da3-9966-0b25684d6373-rop"
// params.timestamp=new Date().getTime()
// +'?method=org.ore.api.customer.page'
// +'?method=org.ore.api.customer.page'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export function syncCustomer(params){
params.method='entmicro.api.synchro.syncCustomer'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export function getTableDetail(params){
params.method='entmicro.api.customer.detail'
export function syncCustomer(params) {
params.method = 'entmicro.api.synchro.syncCustomer'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export function getTableDetail(params) {
params.method = 'entmicro.api.customer.detail'
// params.sessionId="mini-e72437ba-845e-4da3-9966-0b25684d6373-rop"
return http3({
url: '/rop-scrm-entmicro/router',
......@@ -90,24 +91,24 @@
data: params,
sign: true
})
}
}
/*获取来源字典的
*/
export function getDictionaryFun(params){
params.method='entmicro.api.common.dictdata.list'
/*获取来源字典的
*/
export function getDictionaryFun(params) {
params.method = 'entmicro.api.common.dictdata.list'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
}
// entmicro.api.customer.list.export
//客户信息管理导出
export function clientManageExportApi(params){
params.method=`entmicro.api.customer.customerListExport`
export function clientManageExportApi(params) {
params.method = `entmicro.api.customer.customerListExport`
return http3({
url: '/rop-scrm-entmicro/router',
method: 'GET',
......
......@@ -38,4 +38,42 @@ background: transparent !important;
color: $btnBlue;
font-size: 16px;
}
.white-hide{
box-sizing: border-box;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.color-6{
color:#666666;
}
.color-3{
color:#333333;
}
.color-71{
color: #717171;
}
.color-58{
color: #5850ff;
}
.flex-start{
align-items: flex-start;
display: flex;
}
.flex{
display:flex;
align-items: center;
flex-wrap: wrap;
}
.flex-between{
display:flex;
align-items: center;
justify-content: space-between;
}
.font-20{
font-size: 20px;
}
.font-14{
font-size: 14px;
}
\ No newline at end of file
......@@ -18,6 +18,12 @@ const staticRoutes = Object.freeze([
meta: {}
},
{
name: 'clientDataOverview',
path: "/clientDataOverview/group/:id",
component: resolve => require([`@/views/clientDataOverview/group.vue`], resolve),
meta: {}
},
{
name: 'clientManage',
path: "/clientManage/index",
component: resolve => require([`@/views/clientManage/index.vue`], resolve),
......
......@@ -14,7 +14,7 @@ let router = null
let instance = null
// http:调的是新版标签的接口,http2:调的是客户相关接口;http3:企微授权那边的接口 目前导出接口都测试的:http3
export async function bootstrap({ name, id, history, common, messenger, globalState,routerBase }) {
const { response, request,request2,request3, sign, secret, sign_common, request_common } = await fetchConfig(globalState.configSwitch)//globalState.configSwitch
const { response, request,request2,request3, request4,sign, secret, sign_common, request_common } = await fetchConfig(globalState.configSwitch)//globalState.configSwitch
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
......@@ -22,6 +22,7 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http3 = new common.Http({ response, request: request3, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$http4 = new common.Http({ response, request: request4, sign, secret, alert: message.error, headers: { token: 'scrm-base-e2d4f962-4ca3-4044-83e7-01ba314d8e3d-rop' } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: "mini-14eda653-4284-4165-bb85-325bb82a516d-rop" } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
......
<template>
<div class="scrm-sub-client-container">
<div class="head-container">
<div class="head-container-title color-3 font-20">人群名称</div>
<div class="head-container-content color-6 font-14">{{ describe }}</div>
<div class="reminder font-14 color-3">企业标签 | 自动更新</div>
<div class="back color-58 font-14" @click="goBack">返回人群管理</div>
</div>
<div class="main-container">
<div class="main-container-head flex-between">
<div class="main-container-head-title color-3 font-20">
全部客户
<span class="main-container-head-number font-14">{{ totalCount }}个</span>
</div>
<div class="export font-14 color-6" @click="handleExport()">导出</div>
</div>
<GLTable ref="groupRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="customerNickName" class="flex-center" slot-scope="scope">
<el-tooltip effect="dark" :content="scope.scope.customerNickName" placement="top">
<span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerNickName }}</span>
</el-tooltip>
<span :class="[scope.scope.type == 1 ? 'pure-blue-text' : '', scope.scope.type == 2 ? 'pure-yello-text' : '']">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : '' }}</span>
</span>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<GLButton type="text" @click="handleDetail(scope.scope)" fn="魔方导入结果">详情</GLButton>
</div>
</GLTable>
</div>
</div>
</template>
<script>
import { getCustomerList, customerClusterListExport } from '@/api/modules/clientDataOverview'
export default {
name: 'group',
data() {
return {
getListApi: getCustomerList,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableSearchForm: {},
id: this.$route.params.id ? this.$route.params.id : '',
totalCount: 0,
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '客户姓名',
prop: 'customerName',
minWidth: 100
},
{
label: '昵称',
prop: 'customerNickName',
minWidth: 100,
addHtml: 'customerNickName'
},
{
label: '手机号',
prop: 'customerPhone',
minWidth: 110
},
{
label: '车牌号',
prop: 'carNumber',
width: 100
},
{
label: '车架号(后6位)',
prop: 'carVin',
// addHtml: 'standNo',
minWidth: 120
},
{
label: '车系',
prop: 'audi',
width: 160,
line: 2
},
{
label: '跟进员工',
prop: 'followStaff',
// addHtml: 'followStaff',
minWidth: 120
},
{
label: '是否加企微', //1. 加入,0.未加入
prop: 'isJoinName',
width: 100
},
{
label: '添加时间',
prop: 'addTime',
width: 98
}
]
},
describeData: ['潜在意向客户数', '潜在意向客户&已加企微客户数', '潜在意向客户&未加企微客户数', '基盘客户数', '基盘客户&已加企微客户数', '基盘客户&未加企微客户数', '新车客户数', '车险待续保客户数', '新车待首保客户数', '沉默客户数']
}
},
created() {
let { id } = this
this.init(id)
},
computed: {
describe() {
let id = this.id - 1
return this.describeData[id]
}
},
methods: {
init(id) {
this.tableSearchForm = {
crowdId: id
}
this.getTotalCount()
},
//获取全部客户数
getTotalCount() {
getCustomerList({
...this.tableSearchForm,
pageSize: 10,
pageNum: 1
}).then(res => {
console.log('res', res)
this.totalCount = res.count
})
},
//导出
handleExport() {
var params = {
tagLists: [{ groupId: `${this.id}` }],
pageSize: 10,
pageNum: 1
}
customerClusterListExport(params).then(res => {
this.$Utils.exportFn(res)
})
},
goBack() {
this.$router.replace({ path: '/clientDataOverview/index' })
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
.scrm-sub-client-container {
.head-container {
position: relative;
margin-bottom: 10px;
width: 100%;
height: 112px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
padding: 20px;
box-sizing: border-box;
&-title {
font-weight: 500;
line-height: 20px;
letter-spacing: 1px;
margin-bottom: 10px;
}
&-content {
font-weight: 400;
line-height: 20px;
width: calc(100% - 156px);
}
.reminder {
position: absolute;
font-weight: 400;
line-height: 20px;
right: 20px;
top: 20px;
}
.back {
font-weight: 400;
line-height: 22px;
padding: 5px 16px;
border-radius: 4px;
border: 1px solid $btnBlue;
position: absolute;
right: 20px;
bottom: 20px;
color: $btnBlue;
}
}
.main-container {
width: 100%;
height: 100%;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
padding: 20px;
box-sizing: border-box;
.main-container-head {
margin-bottom: 20px;
&-title {
font-weight: 500;
line-height: 20px;
letter-spacing: 1px;
}
&-number {
color: $btnBlue;
margin-left: 6px;
font-weight: 400;
line-height: 20px;
}
.export {
font-weight: 400;
padding: 6px 23px;
line-height: 20px;
background: #ffffff;
border-radius: 4px;
border: 1px solid rgba(105, 105, 105, 0.3);
}
}
}
.pure-blue-text {
color: #61cc43;
}
.pure-yello-text {
color: #fb8f28;
}
}
</style>
\ No newline at end of file
......@@ -19,7 +19,7 @@
<div class="topmsg">
<div class="leftPieEcharts">
<span class="title">客户总数</span>
<span class="subtitle" v-if="accountLevel==4">门店的所有客户数,包括企微客户,导入和外部系统接入客户,并根据手机号码识别同一客户后合并去重</span>
<span class="subtitle" v-if="accountLevel == 4">门店的所有客户数,包括企微客户,导入和外部系统接入客户,并根据手机号码识别同一客户后合并去重</span>
<span class="subtitle" v-else>企业的所有客户数,包括企业客户和旗下所有门店客户,并根据手机号码识别同一客户后合并去重</span>
<span class="clientTotal">
<!-- 可以动态跑数字 -->
......@@ -47,7 +47,7 @@
</div>
<div class="itembox">
<div class="no-buy">
<div class="no-buy-total item">
<GLButton class="no-buy-total item" @click="goto(1)" fn="人群客户列表" mode="div">
<span>潜在意向客户数</span>
<span>无购车且无其他交易行为的所有客户</span>
<span v-if="!isEmptyObj">
......@@ -63,10 +63,11 @@
<!-- <i class="vertical-line"></i> -->
<no-data :type="'hasText'" v-if="isEmptyObj"></no-data>
</div>
</GLButton>
<el-divider direction="vertical"></el-divider>
<div class="rightWrap">
<div class="inCompanyWechatNum item smallWrap">
<GLButton class="inCompanyWechatNum item smallWrap" @click="goto(2)" fn="人群客户列表" mode="div">
<span>已加企微客户数</span>
<span>
{{ (topDataObj.purposeCustomerAddCount || 0) | overThousandFilter }}
......@@ -74,22 +75,25 @@
</span>
<span>在潜在意向客户中,已加企微的客户</span>
<!-- <i class="horizontal-line"></i> -->
</div>
</GLButton>
<el-divider></el-divider>
<div class="outCompanyWechatNum item smallWrap">
<GLButton class="outCompanyWechatNum item smallWrap" @click="goto(3)" fn="人群客户列表" mode="div">
<span>未加企微客户数</span>
<span>
{{ (topDataObj.purposeCustomerNAddCount || 0) | overThousandFilter }}
<span class="person-text">人</span>
</span>
<span>在潜在意向客户中,未加企微的客户</span>
<!-- &nbsp;&nbsp;&gt;&gt;-->
<button class="btn" @click="toGuideCompanyWechat" v-if="accountLevel==4">引流企微 <i class="el-icon-d-arrow-right"></i></button>
</div>
<!-- &nbsp;&nbsp;&gt;&gt;-->
<button class="btn" @click="toGuideCompanyWechat" v-if="accountLevel == 4">
引流企微
<i class="el-icon-d-arrow-right"></i>
</button>
</GLButton>
</div>
</div>
<div class="buy">
<div class="buy-total item">
<GLButton class="buy-total item" @click="goto(4)" fn="人群客户列表" mode="div">
<!-- <span>购买(存档)客户数</span> -->
<span>基盘客户数</span>
<span>有购车或其他交易行为的所有客户</span>
......@@ -106,10 +110,10 @@
<no-data :type="'hasText'" v-if="isEmptyObj"></no-data>
<!-- <i class="vertical-line"></i> -->
</div>
</GLButton>
<el-divider direction="vertical"></el-divider>
<div class="rightWrap">
<div class="inCompanyWechatNum item smallWrap">
<GLButton class="inCompanyWechatNum item smallWrap" @click="goto(5)" fn="人群客户列表" mode="div">
<span>已加企微客户数</span>
<span>
{{ (topDataObj.purchaseCustomerAddCount || 0) | overThousandFilter }}
......@@ -118,17 +122,20 @@
<span>在基盘客户中,已加企微的客户</span>
<!-- <button class="btn">企微魔方&gt;&gt;</button> -->
<!-- <i class="horizontal-line"></i> -->
</div>
</GLButton>
<el-divider></el-divider>
<div class="outCompanyWechatNum item smallWrap">
<GLButton class="outCompanyWechatNum item smallWrap" @click="goto(6)" fn="人群客户列表" mode="div">
<span>未加企微客户数</span>
<span>
{{ (topDataObj.purchaseCustomerNAddCount || 0) | overThousandFilter }}
<span class="person-text">人</span>
</span>
<span>在基盘客户中,未加企微的客户</span>
<button class="btn" @click="toGuideCompanyWechat" v-if="accountLevel==4" >引流企微 <i class="el-icon-d-arrow-right"></i></button>
</div>
<button class="btn" @click="toGuideCompanyWechat" v-if="accountLevel == 4">
引流企微
<i class="el-icon-d-arrow-right"></i>
</button>
</GLButton>
</div>
</div>
</div>
......@@ -136,15 +143,17 @@
<div class="middlemsg">
<h3 class="pageSubTitle">客户分群</h3>
<div class="itembox">
<div class="item" v-for="(item, index) in titles" :key="index">
<p>{{ item.name }}</p>
<p>{{ item.subName }}</p>
<p>
{{ item.num | overThousandFilter }}
<span class="person-text">人</span>
</p>
<img :src="item.url" alt="" />
</div>
<template v-for="(item, index) in titles">
<GLButton class="item" @click="goto(item.id)" fn="人群客户列表" mode="div" :key="index">
<p>{{ item.name }}</p>
<p>{{ item.subName }}</p>
<p>
{{ item.num | overThousandFilter }}
<span class="person-text">人</span>
</p>
<img :src="item.url" alt="" />
</GLButton>
</template>
</div>
</div>
<h3 class="pageSubTitle">客户增长趋势</h3>
......@@ -211,8 +220,8 @@ export default {
},
data() {
return {
isCloseShowNumTag:false,
isReload:true,
isCloseShowNumTag: false,
isReload: true,
isShowModal: false,
isHasCustomerCountBanner: false,
topDataObj: {
......@@ -235,25 +244,29 @@ export default {
name: '新车客户数',
subName: '购车时间3个月的客户',
num: 0,
url: url1
url: url1,
id:7,
},
{
name: '车险待续保客户数',
subName: '近一个月内车险即将到期的客户',
num: 0,
url: url2
url: url2,
id:8,
},
{
name: '新车待首保客户数',
subName: '购车时间5~7个月内,且无保养记录的客户',
num: 0,
url: url3
url: url3,
id:9
},
{
name: '沉默客户数',
subName: '超过180天未到店的客户',
num: 0,
url: url4
url: url4,
id:10
}
],
isNoBuyUp: 0, //默认环比为增
......@@ -267,18 +280,18 @@ export default {
thirtyDayStorage: {},
dialogVisible: false,
//只有门店可以引流企微
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
accountLevel: 0 //1,2,3,4工厂,省代,市代,门店
}
},
mounted() {
document.body.style.overflow = 'hidden'
var that =this;
window.addEventListener('resize', () => {
that.isReload=false
that.$nextTick(() => {
that.isReload=true
});
var that = this
window.addEventListener('resize', () => {
that.isReload = false
that.$nextTick(() => {
that.isReload = true
})
})
},
computed: {
......@@ -301,7 +314,7 @@ export default {
}
},
async created() {
if (window.__POWERED_BY_QIANKUN__) {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.accountLevel = this.$globalState.session.accountLevel
}
......@@ -312,7 +325,6 @@ export default {
//先看登录次数,首次进来为true,不管客户总数是否为0,都显示banner;
//不是首次进来,登录次数为2,客户总数大于0,不显示banner,小于0,继续显示banner;
this.getDataOverviewBarMapFun()
},
methods: {
......@@ -427,11 +439,11 @@ export default {
this.isBuyUp = res.purchaseUp
//先看登录次数,首次进来为true,不管客户总数是否为0,都显示banner;
//不是首次进来,登录次数为2,客户总数大于0,不显示banner,小于等于0,继续显示banner;
console.log(this.accountLevel,this.isShowModal,this.topDataObj.customerCount,'myData')
if(this.isShowModal && this.accountLevel!==4){
this.isShowModal=false; //关掉引导层
console.log(this.accountLevel, this.isShowModal, this.topDataObj.customerCount, 'myData')
if (this.isShowModal && this.accountLevel !== 4) {
this.isShowModal = false //关掉引导层
}
if (this.isShowModal && this.accountLevel==4) {
if (this.isShowModal && this.accountLevel == 4) {
this.isHasCustomerCountBanner = true
this.$nextTick(() => {
$('img[usemap]').rwdImageMaps()
......@@ -442,7 +454,7 @@ export default {
}, 1000)
} else if (!this.isShowModal && this.topDataObj.customerCount > 0) {
this.isHasCustomerCountBanner = false
} else if (!this.isShowModal && this.topDataObj.customerCount <= 0 && this.accountLevel==4) {
} else if (!this.isShowModal && this.topDataObj.customerCount <= 0 && this.accountLevel == 4) {
this.isHasCustomerCountBanner = true
this.$nextTick(() => {
$('img[usemap]').rwdImageMaps()
......@@ -486,7 +498,7 @@ export default {
},
clickThirty() {
this.timeGap = 30
this.isCloseShowNumTag=true
this.isCloseShowNumTag = true
if (Object.keys(this.thirtyDayStorage).length == 0) {
this.getDataOverviewBarMapFun(30) //第一次点击30天,获取数据
} else {
......@@ -496,7 +508,7 @@ export default {
},
clickSeven() {
this.timeGap = 7
this.isCloseShowNumTag=false
this.isCloseShowNumTag = false
if (Object.keys(this.sevenDayStorage).length == 0) {
this.getDataOverviewBarMapFun() //重新掉一遍接口
} else {
......@@ -508,6 +520,10 @@ export default {
this.isShowModal = false
// 允许页面滚动:
document.body.style.overflow = 'visible'
},
//跳转到人群客户列表
goto(id) {
this.$router.push('/clientDataOverview/group/'+id)
}
}
}
......@@ -729,7 +745,7 @@ export default {
}
.itembox {
width: calc(100% - 372px);
.item {
// border: 1px solid rgba(121, 121, 121, 1);
height: 119px;
......
......@@ -48,7 +48,7 @@
<span>类型</span>
<span class="ellipsis-1">{{ leftPanelInfo.type == 1 ? '微信用户' : leftPanelInfo.type == 2 ? '企微用户' : '' }}</span>
</p>
<p v-if="leftPanelInfo.isJoin == 1">
<p>
<span>是否加企微</span>
<!-- 1-是,2-否 -->
<span>{{ leftPanelInfo.isJoin == 1 ? '是' : leftPanelInfo.isJoin == 0 ? '否' : '' }}</span>
......@@ -160,7 +160,32 @@
</div>
<basic-dialog class="tags" :title="tagsDialogTitle" :width="'712px'" :btnLoading="sloading" :isShowThirdBtn="true" @btnEvent="goNewTag" :isVisible="tagsVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<slot>
<p class="dialogSubTitle">企业标签</p>
<p class="hint-text">
<span class="color-6">说明:</span>
仅支持企业标签<span v-if="merchantModel==1">和自店标签</span>进行人工维护和设置
</p>
<p class="hint-text mg10">系统标签通过大数据算法进行自动更新,不支持人工维护和编辑</p>
<div class="labels-wrap" v-for="(group, index) in allTagsList" :key="index">
<template v-if="(merchantModel == 2 && group.labelType != '自店标签')||merchantModel == 1">
<div class="label-wrap">
<div class="label-group-name color-3">{{ group.labelType }}</div>
<div class="labels" v-for="(labels, ids) in group.children" :key="ids">
<div class="label-name white-hide color-71">{{ labels.labelGroup.name }}</div>
<div class="label-value flex">
<template v-for="(label, i) in labels.labelList">
<div :class="['label', 'color-6', 'white-hide', label.checked ? 'isChecked' : '']" :style="{ width: label.name.length > 10 ? '145px' : auto }" :key="label.id" @click="choose(index, ids, i)">
{{ label.name }}
<template v-if="label.checked">
<img src="@/assets/clientDetail/select-icon.png" class="select-icon" alt />
</template>
</div>
</template>
</div>
</div>
</div>
</template>
</div>
<!-- <p class="dialogSubTitle">企业标签</p>
<div class="companyRowData" v-for="(item, index) in companyTagsList" :key="index">
<span :title="item.labelGroup.name">{{ item.labelGroup.name }}</span>
<div class="tagsBox">
......@@ -176,7 +201,7 @@
<span v-for="(m, n) in xItem.labelList" :key="n" class="ellipsis-1" :class="{ activeTag: m.checked }" :title="m.name" @click="checkNewTag(m.checked, n, xItem.labelList, m.original)">{{ m.name }}</span>
</div>
</div>
</template>
</template> -->
<!-- 这里btn-behind插槽莫名失效了,原因:??? -->
<!-- <el-button slot="behind" @click="goNewTag">没找到需要的标签,创建新标签</el-button> -->
......@@ -411,6 +436,7 @@ export default {
this.accountLevel = this.$globalState.session.accountLevel
this.userType = this.$globalState.session.userType
}
this.id = this.$route.query.id ? this.$route.query.id : ''
this.getPageDetail()
//舍弃调用小龙的获取单用户标签的接口
// this.getSingleClientTag(this.$route.query.id, this.merchantId)
......@@ -470,7 +496,7 @@ export default {
getSingleClientTag(oneId = 14120314541863, merchantId = 10001001) {
let param = {
'req.oneId': oneId,
'req.merchantId': merchantId,
'req.merchantIdsStr': merchantId,
'req.edition': this.merchantModel
}
getSingleClientTag(param)
......@@ -524,7 +550,7 @@ export default {
console.log(pType, scope)
switch (pType) {
case 'create':
this.tagsDialogTitle = '添加标签'
this.tagsDialogTitle = '设置标签'
this.getAllTags()
// this.handleClose();
break
......@@ -537,37 +563,38 @@ export default {
getAllTagTree({ 'labelTreeReq.shopId': this.merchantId, 'labelTreeReq.edition': this.merchantModel, 'labelTreeReq.pageNum': 1, 'labelTreeReq.pageSize': 3000 })
.then(res => {
if (res.code == 0) {
console.log(res.data.labelTreeRets, '标签树')
let companyArr = res.data.labelTreeRets.filter(item => item.labelType == '企业标签')
companyArr.forEach(item =>
item.labelList.forEach(ele => {
ele.checked = false
ele.original = false
})
)
let ownShopArr = res.data.labelTreeRets.filter(ele => ele.labelType == '自店标签')
ownShopArr.forEach(item =>
item.labelList.forEach(ele => {
let allTagsList = [
{
labelType: '',
children: []
},
{
labelType: '',
children: []
}
]
res.data.labelTreeRets.forEach(labels => {
labels.labelList.forEach(ele => {
ele.checked = false
ele.original = false
})
)
console.log(companyArr, ownShopArr, '企业标签自店标签')
this.companyTagsList = companyArr
this.ownShopTagsList = ownShopArr
this.allTagsList = [...this.companyTagsList, ...this.ownShopTagsList]
this.allTagsList.forEach(item =>
item.labelList.forEach(ele => {
for (let i = 0; i < this.labelIdList.length; i++) {
if (ele.id == this.labelIdList[i]) {
this.labelIdList.forEach(id => {
if (id == ele.id) {
ele.checked = true
ele.original = true
ele.old = 1
}
}
})
})
)
if (labels.labelType == '企业标签') {
allTagsList[0].labelType = '企业标签'
allTagsList[0].children.push(labels)
} else {
allTagsList[1].labelType = '自店标签'
allTagsList[1].children.push(labels)
}
})
this.allTagsList = allTagsList
// console.log(this.allTagsList, ' this.allTagsList')
} else {
this.$message.error(res.message)
}
......@@ -578,54 +605,58 @@ export default {
this.handleClose()
},
handleConfirm() {
//后台要求循环掉接口
//满足条件进行提交
this.sloading = true
this.submitTagsList.forEach((item, index) => {
let param = {
'req.OneId': this.$route.query.id,
'req.labelGroupId': item.labelGroup.id,
'req.edition': this.merchantModel,
'req.merchantId': this.merchantId,
'req.uuId': this.userid,
'req.staffId': this.staffId
// 'req.labelIdList': item.labelList.map(ele => ele.id)
}
var ids = item.labelList.map(ele => ele.id)
param['req.labelIdList'] = ids
console.log(param, '参数')
addSingleClientTag(param)
.then(res => {
if (res.data.code == 0) {
if (index == this.submitTagsList.length - 1) {
this.sloading = false
this.$message.success('添加成功')
this.handleClose()
// this.getSingleClientTag(this.$route.query.id, this.merchantId)
this.getPageDetail() //刷新当前页面
}
} else {
this.sloading = false
this.$message.error(res.data.message)
let labelIdAddList = [] // 新增的标签
let labelIdDelList = [] //取消的标签
this.allTagsList.forEach(labels => {
labels.children.forEach(ele => {
ele.labelList.forEach(tag => {
if (tag.old == '1' && !tag.checked) {
labelIdDelList.push(tag.id)
}
if (!tag.old && tag.checked) {
labelIdAddList.push(tag.id)
}
})
.catch(err => {
})
})
let param = {
'req.OneId': this.id,
'req.merchantId': this.merchantId,
'req.uuId': this.userid,
'req.staffId': this.staffId,
'req.labelIdAddList': labelIdAddList,
'req.labelIdDelList': labelIdDelList
}
addSingleClientTag(param)
.then(res => {
console.log(param)
if (res.data.code == 0) {
this.sloading = false
console.error(err, '错误捕获')
})
.finally(() => {
this.$message.success('添加成功')
this.handleClose()
// this.getSingleClientTag(this.id, this.merchantId)
this.getPageDetail() //刷新当前页面
} else {
this.sloading = false
})
})
this.$message.error(res.data.message)
}
})
.catch(err => {
this.sloading = false
console.error(err, '错误捕获')
})
.finally(() => {
this.sloading = false
})
},
handleClose() {
if (this.tagsVisible) {
this.companyTagsList = []
this.ownShopTagsList = []
}
console.log('进来')
// this.roleForm.tagsList = [] //取消时清空新增标签
// if (this.tagsVisible) {
// this.companyTagsList = []
// this.ownShopTagsList = []
// }
// console.log('进来')
this.tagsVisible = !this.tagsVisible
},
checkNewTag(checked, j, arr, original = false) {
......@@ -659,6 +690,9 @@ export default {
console.log('选中', _arr)
this.submitTagsList = _arr
},
choose(index1, index2, index3) {
this.allTagsList[index1].children[index2].labelList[index3].checked = !this.allTagsList[index1].children[index2].labelList[index3].checked
}
}
}
......@@ -894,66 +928,120 @@ export default {
/deep/.app-dialog {
.el-dialog__body {
.container {
padding: 20px 72px 20px 68px;
padding: 32px 74px;
}
}
}
.dialogSubTitle {
margin-bottom: 10px;
height: 20px;
// .dialogSubTitle {
// margin-bottom: 10px;
// height: 20px;
// font-size: 14px;
// font-weight: 500;
// color: #717171;
// line-height: 20px;
// &:not(:first-child) {
// margin-top: 20px;
// }
// }
// .companyRowData,
// .ownShopRowData {
// display: flex;
// // margin-top: 10px;
// > span {
// margin-right: 10px;
// min-width: 82px;
// height: 20px;
// font-size: 14px;
// font-weight: 400;
// color: #717171;
// line-height: 20px;
// text-align: right;
// max-width: 82px;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
// word-break: break-all;
// }
// .tagsBox {
// display: flex;
// flex-wrap: wrap;
// justify-content: flex-start;
// > span {
// display: inline-block;
// margin-right: 10px;
// margin-bottom: 10px;
// padding: 0 10px;
// box-sizing: border-box;
// min-width: 82px;
// height: 26px;
// line-height: 26px;
// border-radius: 4px;
// border: 1px solid #e8e8ea;
// text-align: center;
// font-size: 14px;
// font-weight: 400;
// color: #666666;
// max-width: 245px;
// cursor: pointer;
// background: #fafbfe;
// }
// .activeTag {
// border: 1px solid $btnBlue;
// color: $btnBlue;
// }
// }
// }
.hint-text {
font-size: 12px;
font-weight: 400;
color: #333333;
line-height: 18px;
}
.mg10 {
margin-left: 38px;
}
.labels-wrap {
font-size: 14px;
font-weight: 500;
color: #717171;
color: #333333;
line-height: 20px;
&:not(:first-child) {
.label-group-name {
margin-bottom: 15px;
margin-top: 20px;
font-weight: 500;
}
}
.companyRowData,
.ownShopRowData {
display: flex;
// margin-top: 10px;
> span {
margin-right: 10px;
min-width: 82px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #717171;
line-height: 20px;
text-align: right;
max-width: 82px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.tagsBox {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
> span {
display: inline-block;
.labels {
margin-bottom: 10px;
.label-name {
box-sizing: border-box;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-right: 10px;
margin-bottom: 10px;
padding: 0 10px;
box-sizing: border-box;
min-width: 82px;
}
.label {
height: 26px;
line-height: 26px;
background: #fafbfe;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 26px;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #666666;
max-width: 245px;
cursor: pointer;
background: #fafbfe;
margin-right: 10px;
margin-bottom: 10px;
position: relative;
padding: 0 16px;
box-sizing: border-box;
}
.activeTag {
border: 1px solid $btnBlue;
color: $btnBlue;
.isChecked {
border: 1px solid #5850ff !important;
.select-icon {
width: 16px;
height: 16px;
position: absolute;
top: 0;
right: 0;
}
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!