Commit 16f225c6 by xinla

客户详情

1 parent 572fc8fe
import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/group'
export function getDetail(chatId) {
return request({
url: service + `/chat/chatDetail/${chatId}`,
method: 'get'
})
}
/**
* 客户群列表
* @param {*} data
......@@ -24,10 +31,10 @@ export function getList(params) {
/**
* 群成员列表
* @param {*} params
* @param {*} params
* {
"groupId": "群id",
"memberName": "成员名称",
"chatId": "群id",
"name": "成员名称",
"pageNum": "",
"pageSize": ""
}
......@@ -60,8 +67,8 @@ export function sync() {
}
]
}
* @param {*} data
* @returns
* @param {*} data
* @returns
*/
export function makeGroupTag(data) {
return request({
......
import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/customer'
let getway = window.CONFIG.services.wecom
const service = getway + '/customer'
/**
* 客户列表
......@@ -165,7 +166,6 @@ export function jobExtends(data) {
* delFlag: 1 用户是否流失 0 未流失,1流失
*/
export function getDetail(params) {
params.delFlag = 1
return request({
url: service + '/findWeCustomerBaseInfo',
params
......@@ -178,12 +178,12 @@ export function getDetail(params) {
* externalUserid 是 当前客户id
* delFlag: 1 用户是否流失 0 未流失,1流失
*/
export function getSummary(externalUserid) {
export function getSummary({ externalUserid, delFlag }) {
return request({
url: service + '/findWeCustomerInfoSummary',
params: {
externalUserid,
delFlag: 1
delFlag
}
})
}
......@@ -195,13 +195,13 @@ export function getSummary(externalUserid) {
* delFlag: 1 用户是否流失 0 未流失,1流失
* @returns
*/
export function getCustomerInfoByUserId(externalUserid, userId) {
export function getCustomerInfoByUserId({ externalUserid, userId, delFlag }) {
return request({
url: service + '/findWeCustomerInfoByUserId',
params: {
externalUserid,
userId,
delFlag: 1
delFlag
}
})
}
......@@ -222,3 +222,14 @@ export function getFollowUpRecord(params) {
params
})
}
/**
* 客户轨迹同步/同步指定客户个人朋友圈互动数据
* @param {*} userIds 指定员工id,多个用逗号隔开
* @returns
*/
export function syncTrack(userIds) {
return request({
url: getway + `/moments/synchMomentsInteracte`
})
}
......@@ -14,7 +14,7 @@ const service = axios.create({
})
// request拦截器
service.interceptors.request.use(
config => {
(config) => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
if (getToken() && !isToken) {
......@@ -22,7 +22,7 @@ service.interceptors.request.use(
}
return config
},
error => {
(error) => {
console.log(error)
Promise.reject(error)
}
......@@ -30,7 +30,7 @@ service.interceptors.request.use(
// 响应拦截器
service.interceptors.response.use(
res => {
(res) => {
// 未设置状态码则默认成功状态
const code = res.data.code || 200
// 获取错误信息
......@@ -69,7 +69,7 @@ service.interceptors.response.use(
return Promise.reject()
}
},
error => {
(error) => {
console.log('err' + error)
let { message, response, config } = error
if (message == 'Network Error') {
......
......@@ -47,7 +47,7 @@ export default {
* externalUserid 是 当前客户id
*/
getSummary() {
getSummary(this.$route.query.externalUserid).then(({ data }) => {
getSummary(this.$route.query).then(({ data }) => {
// {
// 'companyTags':[{ //企业标签
// 'userName':'',//添加人
......@@ -74,7 +74,7 @@ export default {
*客户画像单个跟进人
*/
getCustomerInfoByUserId() {
getCustomerInfoByUserId(this.$route.query.externalUserid, this.userId).then(({ data }) => {
getCustomerInfoByUserId(this.$route.query).then(({ data }) => {
this.portrayalSum = data
})
},
......@@ -86,9 +86,7 @@ export default {
this.active = type
},
sync() {
this.openTrack = ['0']
this.active = '0'
this.$refs['record'][0].$forceUpdate()
this.$refs['record'][this.active].sync()
}
}
}
......@@ -211,7 +209,7 @@ export default {
<div class="right">
<el-card>
<div slot="header">
<span class="card-title">客户轨迹</span>
<span class="card-title" @click="sync">客户轨迹</span>
<ButtonSync class="btn-sync" :lastSyncTime="lastSyncTime" @click="sync"
>同步</ButtonSync
......
<script>
import { getFollowUpRecord } from '@/api/customer'
import { getFollowUpRecord, syncTrack } from '@/api/customer'
import { dictTrackState } from '@/utils/dictionary'
export default {
name: '',
......@@ -68,6 +68,18 @@ export default {
.catch(() => {
this.loading = false
})
},
sync() {
this.loading = true
syncTrack(this.userId)
.then(() => {
this.getList(1)
this.msgSuccess('后台开始同步数据,请稍后关注进度')
})
.catch((fail) => {
this.loading = false
console.error(fail)
})
}
}
}
......@@ -76,7 +88,7 @@ export default {
<template>
<div v-loading="loading">
<template v-if="viewType">
<el-table :data="list" v-loading="loading">
<el-table :data="list">
<el-table-column label="员工" align="center" prop="userName" />
<el-table-column label="跟进记录" align="center" prop="trackContent" />
<el-table-column prop="trackState" label="跟进状态" align="center">
......
......@@ -36,22 +36,22 @@ export default {
this.getDetail()
},
methods: {
updateBirthday() {
if (!this.birthday || this.birthday == this.customer.birthday) {
return
}
let data = {
externalUserid: this.customer.externalUserid,
birthday: this.birthday,
firstUserId: this.customer.firstUserId
}
updateBirthday(data).then((response) => {
this.msgSuccess('操作成功')
// this.getDetail()
this.$set(this.customer, 'birthday', this.birthday)
// this.datePickerVisible = false
})
},
// updateBirthday() {
// if (!this.birthday || this.birthday == this.customer.birthday) {
// return
// }
// let data = {
// externalUserid: this.customer.externalUserid,
// birthday: this.birthday,
// firstUserId: this.customer.firstUserId
// }
// updateBirthday(data).then((response) => {
// this.msgSuccess('操作成功')
// // this.getDetail()
// this.$set(this.customer, 'birthday', this.birthday)
// // this.datePickerVisible = false
// })
// },
/**
*客户详情基础(基础信息+社交关系)
* @param {*}
......
......@@ -207,7 +207,7 @@ export default {
<el-button v-hasPermi="['customerManage:group:query']" type="primary" @click="getList(1)"
>查询</el-button
>
<el-button v-hasPermi="['customerManage:group:query']" type="info" @click="resetQuery"
<el-button v-hasPermi="['customerManage:group:query']" type="success" @click="resetQuery"
>重置</el-button
>
<!-- <el-button v-hasPermi="['customerManage:group:export']" type="success" @click="handleExport"
......@@ -272,7 +272,7 @@ export default {
@click="
$router.push({
path: 'groupDetail',
query: scope.row
query: { chatId: scope.row.chatId }
})
"
v-hasPermi="['customerManage:group:view']"
......
......@@ -24,7 +24,7 @@ export default {
query: {
pageNum: 1,
pageSize: 10,
groupId: undefined,
chatId: undefined,
name: undefined
},
dictJoinGroupType,
......@@ -34,25 +34,21 @@ export default {
}
},
created() {
this.group = this.$route.query
this.query.chatId = this.group.chatId
// this.getDetail()
this.query.chatId = this.$route.query.chatId
this.getDetail()
this.getList()
},
methods: {
getDetail() {
api.getDetail(this.query.chatId).then((res) => {
if (res.code == 200) {
this.group = Object.assign({}, this.group, res.data)
// console.log(this.group)
this.group.createTime = moment(this.group.createTime).format('YYYY-MM-DD HH:mm:SS')
if (this.group.tagIds) {
let arr = this.group.tagIds.split(',')
this.selectedTag = arr.map((dd) => {
return { tagId: dd }
})
}
api.getDetail(this.query.chatId).then(({ data }) => {
// this.group = Object.assign({}, this.group, res.data)
// console.log(this.group)
// this.group.createTime = moment(this.group.createTime).format('YYYY-MM-DD HH:mm:SS')
if (data.tagIds) {
data.tagIds = data.tagIds.split(',')
data.tags = data.tags.split(',')
}
this.group = data
})
},
getList(page) {
......@@ -86,7 +82,7 @@ export default {
submitSelectTag(data) {
this.loading = true
api
.makeGroupTag(this, {
.makeGroupTag({
chatId: this.query.chatId,
weeGroupTagRel: data.map((row) => ({
chatId: this.query.chatId,
......@@ -96,7 +92,7 @@ export default {
.then((res) => {
if (res.code == 200) {
this.loading = false
// this.getGroupDetail()
this.getDetail()
this.msgSuccess('操作成功')
}
})
......@@ -169,7 +165,7 @@ export default {
<span class="line"></span>
<div>
<div class="value">
{{ group.joinGroupMemberNum || 0 }}
{{ group.toDayMemberNum || 0 }}
</div>
<div class="key">今日进群数</div>
</div>
......
......@@ -290,7 +290,7 @@ export default {
query: {
externalUserid: row.externalUserid,
userId: row.firstUserId,
delFlag: row.delFlag
delFlag: 1
}
})
"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!