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,10 +6,12 @@
* @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',
......@@ -17,18 +19,37 @@
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,44 +23,45 @@
// 获取客户详情单用户标签
// 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'
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
returnAll: true
})
}
// /router/datahub.api.user.addUserLabel/1.0.0
// 用户添加标签
export function addSingleClientTag (params){
params.method='scrm.api.datahub.user.addUserLabel'
//编辑用户标签(包含标签新增列表和删除列表)
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
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'
......@@ -70,9 +71,9 @@
data: params,
sign: true
})
}
export function syncCustomer(params){
params.method='entmicro.api.synchro.syncCustomer'
}
export function syncCustomer(params) {
params.method = 'entmicro.api.synchro.syncCustomer'
return http3({
url: '/rop-scrm-entmicro/router',
method: 'POST',
......@@ -80,8 +81,8 @@
sign: true
})
}
export function getTableDetail(params){
params.method='entmicro.api.customer.detail'
export function getTableDetail(params) {
params.method = 'entmicro.api.customer.detail'
// params.sessionId="mini-e72437ba-845e-4da3-9966-0b25684d6373-rop"
return http3({
......@@ -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,9 +75,9 @@
</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 }}
......@@ -84,12 +85,15 @@
</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>
<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,7 +143,8 @@
<div class="middlemsg">
<h3 class="pageSubTitle">客户分群</h3>
<div class="itembox">
<div class="item" v-for="(item, index) in titles" :key="index">
<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>
......@@ -144,7 +152,8 @@
<span class="person-text">人</span>
</p>
<img :src="item.url" alt="" />
</div>
</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;
var that = this
window.addEventListener('resize', () => {
that.isReload=false
that.isReload = false
that.$nextTick(() => {
that.isReload=true
});
that.isReload = true
})
})
},
computed: {
......@@ -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)
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!