Commit 028ba3d0 by 王志慧

群客户跟进,客户跟进标签修改

1 parent 05286f2a
const url = '/rop-scrm-entmicro/router' const url = '/rop-scrm-entmicro/router'
// const url = 'http://192.168.1.78:8064/rop-scrm-entmicro/router'
export default { export default {
/** 侧边栏-客户跟进 */ /** 侧边栏-客户跟进 */
getCustomerDetail(data) { getCustomerDetail(data) {
...@@ -7,5 +8,39 @@ export default { ...@@ -7,5 +8,39 @@ export default {
url, url,
data, data,
}) })
},
/** 侧边栏-群客户跟进-群基本信息 */
getCustomerBaseDetail(data) {
data.method = 'entmicro.api.customer.base.detail'
return window.$HTTP({
url,
data,
})
},
/** 侧边栏-群客户跟进-统计接口 */
getCustomerBaseDetailStatics(data) {
data.method = 'entmicro.api.customer.base.detail.statics'
return window.$HTTP({
url,
data,
})
},
/** 侧边栏-群客户跟进-群客户列表 */
getCustomerCustList(data) {
data.method = 'entmicro.api.customer.base.cust.list'
return window.$HTTP({
url,
data,
})
},
/** 侧边栏-群客户跟进-群员工列表 */
getCustomerStaffList(data) {
data.method = 'entmicro.api.customer.base.staff.list'
return window.$HTTP({
url,
data,
})
} }
} }
...@@ -49,7 +49,6 @@ const WxConfig = { ...@@ -49,7 +49,6 @@ const WxConfig = {
**/ **/
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.invoke('getContext', {}, (res) => { wx.invoke('getContext', {}, (res) => {
console.log(res)
let { err_msg, entry, shareTicket } = res let { err_msg, entry, shareTicket } = res
/** entry 说明 /** entry 说明
*contact_profile 从联系人详情进入 3.0.24 *contact_profile 从联系人详情进入 3.0.24
...@@ -84,7 +83,18 @@ const WxConfig = { ...@@ -84,7 +83,18 @@ const WxConfig = {
}) })
}) })
}, },
/**获取当前客户群ID */
getCurExternalChat() {
return new Promise((resolve, reject) => {
wx.invoke('getCurExternalChat', {}, res => {
if (res.err_msg == "getCurExternalChat:ok") {
resolve(res.chatId) //返回当前客户群的群聊ID
} else {
reject(res)
}
})
})
},
/** 外部联系人选人接口 */ /** 外部联系人选人接口 */
selectExternalContact() { selectExternalContact() {
return new Promise((resolve) => { return new Promise((resolve) => {
......
...@@ -13,29 +13,55 @@ ...@@ -13,29 +13,55 @@
} }
} }
.content { .content {
height: calc(100vh - 90px); height: calc(100vh - 363px);
.item { .item {
height: 79px; height: 78px;
border-bottom: 1px solid rgba(195, 195, 195, 0.3); border-bottom: 1px solid rgba(195, 195, 195, 0.3);
padding: 0 16px; margin: 0 20px;
position: relative; position: relative;
box-sizing: border-box;
.avatar { .avatar {
margin-right: 16px; margin-right: 10px;
width:46px;
height:46px;
} }
.info { .info {
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
.phone { .phone {
font-size: 14px;
font-weight: 600; font-weight: 600;
font-size: 16px; color: #333333;
line-height: 20px;
margin-bottom: 6px; margin-bottom: 6px;
.wx { .wx {
font-size: 14px;
font-weight: 400; font-weight: 400;
color: #6760ff; color: #3975C6;
line-height: 20px;
} }
} }
.time { .time{
font-size: 12px;
font-weight: 400;
color: #999999; color: #999999;
line-height: 17px;
}
.tag-wrap {
font-size: 12px;
font-weight: 400;
color: #3975C6;
.tag{
padding:3px 14px;
background: rgba(57, 117, 198, 0.15);
border-radius: 14px;
margin-right:4px;
width: 52px;
box-sizing: border-box;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
} }
} }
.btns { .btns {
...@@ -55,9 +81,18 @@ ...@@ -55,9 +81,18 @@
} }
} }
} }
.mark{
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 17px;
position: absolute;
right: 19px;
}
.icon-arrow { .icon-arrow {
position: absolute; position: absolute;
right: 16px; right: 4px;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
...@@ -65,63 +100,63 @@ ...@@ -65,63 +100,63 @@
} }
} }
.page-type-0 { // .page-type-0 {
.content { // .content {
height: calc(100vh - 220px); // height: calc(100vh - 220px);
} // }
.copy-box { // .copy-box {
height: 130px; // height: 130px;
box-sizing: border-box; // box-sizing: border-box;
padding: 10px 16px; // padding: 10px 16px;
font-weight: 500; // font-weight: 500;
font-size: 14px; // font-size: 14px;
color: #333333; // color: #333333;
word-break: break-all; // word-break: break-all;
position: relative; // position: relative;
background: #ffffff; // background: #ffffff;
box-shadow: 0px 1px 0px 0px #e9e9e9; // box-shadow: 0px 1px 0px 0px #e9e9e9;
.sprite-icon { // .sprite-icon {
position: absolute; // position: absolute;
top: 10px; // top: 10px;
right: 15px; // right: 15px;
} // }
.title { // .title {
margin-bottom: 16px; // margin-bottom: 16px;
} // }
} // }
} // }
.page-type-2 {
.content {
height: calc(100vh - 164px);
}
.checked-box {
margin-right: 16px;
.checked {
width: 14px;
height: 14px;
border-radius: 2px;
border: 1px solid rgba(0, 0, 0, 0.15);
}
}
.checked-control {
font-size: 14px;
color: #333333;
padding: 0 16px;
height: 74px;
.all {
font-size: 16px;
font-weight: 600;
margin-right: 16px;
}
.btn {
width: 148px;
height: 36px;
background: #3975C6;
box-shadow: 0px 2px 4px 0px rgba(88, 80, 255, 0.3);
border-radius: 21px;
margin-left: auto;
color: #ffffff;
}
}
}
\ No newline at end of file \ No newline at end of file
// .page-type-2 {
// .content {
// height: calc(100vh - 164px);
// }
// .checked-box {
// margin-right: 16px;
// .checked {
// width: 14px;
// height: 14px;
// border-radius: 2px;
// border: 1px solid rgba(0, 0, 0, 0.15);
// }
// }
// .checked-control {
// font-size: 14px;
// color: #333333;
// padding: 0 16px;
// height: 74px;
// .all {
// font-size: 16px;
// font-weight: 600;
// margin-right: 16px;
// }
// .btn {
// width: 148px;
// height: 36px;
// background: #3975C6;
// box-shadow: 0px 2px 4px 0px rgba(88, 80, 255, 0.3);
// border-radius: 21px;
// margin-left: auto;
// color: #ffffff;
// }
// }
// }
\ No newline at end of file \ No newline at end of file
...@@ -61,3 +61,21 @@ img { ...@@ -61,3 +61,21 @@ img {
.sticky { .sticky {
position: static; position: static;
} }
.text-12{
font-size: 12px;
font-weight: 400;
color: #FFFFFF;
line-height: 17px;
}
.text-20{
font-size: 20px;
font-weight: 500;
color: #FFFFFF;
line-height: 28px;
}
.text-14{
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
<template> <template>
<div class="search"> <div class="search">
<van-search <van-search v-model="value" :placeholder="placeholder" @search="onSearch" />
v-model="value"
:placeholder="placeholder"
@search="onSearch"
/>
</div> </div>
</template> </template>
...@@ -21,15 +17,19 @@ export default { ...@@ -21,15 +17,19 @@ export default {
default: '请输入内容搜索' default: '请输入内容搜索'
} }
}, },
data () { watch: {
keyword(e) {
this.value = e
}
},
data() {
return { return {
value: this.keyword value: this.keyword
} }
}, },
mounted () { mounted() {},
},
methods: { methods: {
onSearch (e) { onSearch(e) {
this.$emit('search', e) this.$emit('search', e)
} }
} }
......
<template>
<div class="tab" v-if="data.length > 0">
<!-- 样式占位符-->
<div class="canvas-tab flex">
<template v-for="(i, index) in data">
<div @click="click(index)" :class="['item', `${tabIndex == index ? 'active-' + index : ''}`]" :key="index"></div>
</template>
</div>
<div class="canvas-place-tab flex placeholder">
<template v-for="(i, index) in data">
<div @click="click(index)" :class="['item', 'text-center', `${tabIndex == index ? 'active' : ''}`]" :key="index + 'i'">{{ i }}</div>
</template>
</div>
<slot></slot>
</div>
</template>
<script>
export default {
name: 'TabCustomer',
props: {
index: {
type: Number,
default: 0
},
list: {
type: Array,
default: () => {
return []
}
}
},
data() {
return {
data: this.list,
tabIndex: this.index
}
},
watch: {
index(n) {
this.tabIndex = n
},
list(n) {
this.data = n
}
},
mounted() {},
methods: {
click(index) {
this.$emit('change', index)
}
}
}
</script>
<style scoped lang='scss'>
.tab {
height: auto;
box-shadow: 0px 3px 10px 0px rgba(223, 228, 234, 0.81);
border-radius: 4px;
position: relative;
background-color: #fff;
.canvas-tab {
width: 100%;
height: 50px;
box-sizing: border-box;
background-color: #dfe7f1;
.item {
width: 50%;
transition: all 0.5s;
font-size: 14px;
}
.active-0 {
height: 0;
border-bottom: 50px solid #ffffff;
border-right: 10px solid transparent;
}
.active-1 {
height: 0;
border-bottom: 50px solid #ffffff;
border-left: 10px solid transparent;
}
}
.canvas-place-tab {
width: 100%;
height: 50px;
box-sizing: border-box;
font-size: 12px;
color: #333333;
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 9;
.item {
color: #333333;
flex: 1;
transition: all 0.5s;
font-size: 14px;
}
.active {
color: #3975c6;
height: 50px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -16,10 +16,10 @@ const pages = { ...@@ -16,10 +16,10 @@ const pages = {
backgroundColor: '#F7F7F7', backgroundColor: '#F7F7F7',
keepAlive: true, keepAlive: true,
} }
},{ }, {
name:'detail', name: 'detail',
meta:{ meta: {
title:'渠道活码', title: '渠道活码',
keepAlive: true, keepAlive: true,
} }
}], }],
...@@ -43,6 +43,13 @@ const pages = { ...@@ -43,6 +43,13 @@ const pages = {
keepAlive: true, keepAlive: true,
} }
}, { }, {
name: 'groupDetail',
meta: {
title: '客户跟进',
backgroundColor: '#F7F7F7',
keepAlive: true,
}
}, {
name: 'editDetail', name: 'editDetail',
meta: { meta: {
backgroundColor: '#F7F7F7', backgroundColor: '#F7F7F7',
...@@ -74,6 +81,7 @@ const pages = { ...@@ -74,6 +81,7 @@ const pages = {
const redirect = '' const redirect = ''
let routes = [] let routes = []
const keepAlives = [] const keepAlives = []
console.log(Object.keys(pages))
Object.keys(pages).map(parent => { Object.keys(pages).map(parent => {
pages[parent].map(val => { pages[parent].map(val => {
const isIndex = parent == redirect && val.name == 'index' const isIndex = parent == redirect && val.name == 'index'
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<div class="detail-bg detail-third"> <div class="detail-bg detail-third">
<div class="title">客户标签</div> <div class="title">客户标签</div>
<div class="detail-label"> <div class="detail-label">
<div v-if="!userInfo.labelInfos.length" class="no-label"> <div v-if="userInfo.labelInfos&&!userInfo.labelInfos.length" class="no-label">
<div class="btn text-center" @click="handleTag"> <div class="btn text-center" @click="handleTag">
<van-icon name="plus" class="plus" /> <van-icon name="plus" class="plus" />
<span>标签</span> <span>标签</span>
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<van-popup v-model="showDatePicker" position="bottom" round> <van-popup v-model="showDatePicker" position="bottom" round>
<van-datetime-picker v-model="selectDate" type="date" title="选择年月日" :min-date="minDate" :max-date="maxDate" @confirm="confirmDate" @cancel="showDatePicker = false" /> <van-datetime-picker v-model="selectDate" type="date" title="选择年月日" :min-date="minDate" :max-date="maxDate" @confirm="confirmDate" @cancel="showDatePicker = false" />
</van-popup> </van-popup>
<make @success="successHandle" :externalUserIds="[id]" :chooseItems="userInfo.labelInfos" ref="popRefs"></make> <make @success="successHandle" :externalUserIds="[id]" :chooseItems="userInfo.labelInfos" :isCustomer='false' ref="popRefs"></make>
</div> </div>
</template> </template>
...@@ -242,11 +242,12 @@ export default { ...@@ -242,11 +242,12 @@ export default {
}, },
mounted() { mounted() {
this.showLoading() this.showLoading()
let { id } = this.getQuery() let { id, customerId } = this.getQuery()
// console.log(id) console.log(id)
// id = 'wm219ICgAARGgXJUmUdGxCgNfGxRCWDg' // id = 'wmdMreDgAA2tF6eep95QX1zxGuKjObHA'
if (id) { if (id) {
this.id = id this.id = id
this.customerId = customerId //用来判断。若员工尚未添加该客户为好友,则暂不允许在客户跟进中修改客户的信息,仅只读。
this.getCustomerDetail(id) this.getCustomerDetail(id)
} else { } else {
wxConfig.init(['getCurExternalContact']).then(() => { wxConfig.init(['getCurExternalContact']).then(() => {
...@@ -304,6 +305,7 @@ export default { ...@@ -304,6 +305,7 @@ export default {
userInfo: { vehicleInfo, info } userInfo: { vehicleInfo, info }
} = this } = this
let userId = this.id let userId = this.id
if (this.customerId == 0) return
if (type == 'tel') { if (type == 'tel') {
if (info.customerPhone && save_key == 'customerPhone') return if (info.customerPhone && save_key == 'customerPhone') return
this.$router.push({ this.$router.push({
......
<template>
<div class="group-customer-wrap">
<div class="group-customer-vehicle">
<div class="group-customer-vehicle-info">{{ groupBase && groupBase.groupName }}</div>
<div class="group-customer-person-info">
<div class="line-person-info text-14 flex">
<div class="person-info-title">群主|</div>
<div>{{ groupBase && groupBase.groupHostName }}</div>
</div>
<div class="line-person-info text-14 flex">
<div class="person-info-title">创建时间|</div>
<div>{{ groupBase && groupBase.createDate }}</div>
</div>
</div>
</div>
<div class="group-customer-members flex">
<div class="group-customer-members-line">
<div class="group-customer-members-line-text text-12">全部群成员</div>
<div class="flex text-20">
{{ baseStatics && baseStatics.total }}
<div class="text-12">人</div>
</div>
</div>
<div class="line"></div>
<div class="group-customer-members-line">
<div class="group-customer-members-line-text text-12">今日入群</div>
<div class="flex text-20">
{{ baseStatics && baseStatics.addNum }}
<div class="text-12">人</div>
</div>
</div>
<div class="line"></div>
<div class="group-customer-members-line">
<div class="group-customer-members-line-text text-12">今日退群</div>
<div class="flex text-20">
{{ baseStatics && baseStatics.removeNum }}
<div class="text-12">人</div>
</div>
</div>
</div>
<tab-customer :list="list" @change="change" :index="tabIndex">
<index ref="customerIndex" :index="tabIndex" :chatId="chatId" @listChange="getList"></index>
</tab-customer>
</div>
</template>
<script>
import index from '@/views/customer'
import { detailApi, wxConfig } from '@/api'
export default {
components: { index },
data() {
return {
tabIndex: 0,
baseStatics: '', //群统计
groupBase: '',
list: ['客户', '员工'],
chatId: ''
}
},
mounted() {
this.showLoading()
let { id } = this.getQuery()
console.log('id',id)
// id = '1103'
if (id) {
this.chatId = id
this.initData(id)
this.hideLoading()
} else {
wxConfig.init(['getCurExternalContact']).then(() => {
wxConfig
.getCurExternalContact()
.then(chatId => {
this.chatId = chatId
this.initData(id)
})
.catch(e => {
this.hideLoading()
Dialog.alert({
title: '提示',
message: '该功能暂不支持在群侧边栏打开',
confirmButtonText: '知道了',
confirmButtonColor: '#3975c6'
}).then(() => {
wx.closeWindow()
})
})
})
}
},
methods: {
initData(id) {
this.getCustomerBaseDetail(id) //群基本信息
this.getCustomerBaseDetailStatics(id) //统计接口
},
//群基本信息
getCustomerBaseDetail(id) {
let obj = {
id,
pageSize: 10,
pageNum: 1
}
detailApi.getCustomerBaseDetail(obj).then(res => {
if (res) {
let reg = /(\d{4})\/(\d{1,2})\/(\d{1,2})/
res.createDate = res.createDate.replace(reg, '$1-$2-$3')
this.groupBase = res
}
})
},
//统计接口
getCustomerBaseDetailStatics(id) {
let obj = {
id,
pageSize: 10,
pageNum: 1
}
detailApi.getCustomerBaseDetailStatics(obj).then(res => {
if (res) {
this.baseStatics = res
}
})
},
change(index) {
this.$refs.customerIndex.initSearch()
this.tabIndex = index
},
getList(data) {
this.list = data.list
}
}
}
</script>
<style lang="scss" scoped>
.group-customer-wrap {
margin: 10px 16px;
.group-customer-vehicle {
width: 100%;
height: 130px;
background: #ffffff;
box-shadow: 0px 4px 8px 0px rgba(224, 224, 224, 0.5);
border-radius: 4px;
padding: 10px;
box-sizing: border-box;
&-info {
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 22px;
padding: 10px 0 20px 10px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.group-customer-person-info {
margin: 9px 0 10px 10px;
.line-person-info {
margin-bottom: 7px;
.person-info-title {
width: 70px;
text-align: right;
margin-right: 6px;
color: #999999;
}
}
}
}
.group-customer-members {
width: 100%;
height: 93px;
background: linear-gradient(127deg, #3975c6 0%, rgba(57, 117, 198, 0.99) 98%, #3975c6 100%);
border-radius: 4px;
margin: 10px 0;
padding: 20px 30px;
box-sizing: border-box;
justify-content: space-between;
.line {
width: 2px;
height: 40px;
background: #fff;
}
&-line {
display: flex;
width: auto;
flex-direction: column;
align-items: center;
&-text {
margin-bottom: 8px;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div :class="['layout',`page-type-${tabIndex}`]"> <div :class="['layout', `page-type-${tabIndex}`]">
<tab <search :placeholder="tabIndex == 0 ? '姓名、手机、车牌号' : '输入员工姓名'" :keyword="keyWord" @search="searchkeyWord"></search>
:list="['待添加','待通过','已通过','全部']" <template v-if="tabIndex == 0 ? custList.length > 0 : staffList.length > 0">
@change="change" <scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
sticky <template v-for="(item, index) in tabIndex == 0 ? custList : staffList">
:index="tabIndex" <div :key="index" class="item flex" @click="goTo(item)">
></tab>
<div class="tips flex">
您共有5位客户待添加!
<div class="time">2021/7/24</div>
</div>
<template>
<template> <template>
<scroll-view
class="content"
@ReachBottom="onReachBottom"
ref="scrollView"
>
<template v-for="(item,index) in 10">
<div
:key="index"
class="item flex"
>
<template v-if="tabIndex == 2">
<div class="checked-box">
<template v-if="index % 2 == 0">
<div class="sprite-icon icon-customer-active"></div>
</template>
<template v-else>
<div class="checked"></div>
</template>
</div>
<div class="avatar"> <div class="avatar">
<div class="sprite-icon icon-avatar"></div> <img :src="tabIndex == 0 ? item.avatar : item.thumbAvatar" alt="" v-if="item.avatar || item.thumbAvatar" />
<div v-else class="sprite-icon icon-avatar"></div>
</div> </div>
<div class="info"> <div class="info">
<div class="phone flex"> <div class="phone flex">
恒河猴 {{ item.groupNickName }}
<div class="wx">@微信</div> <div class="wx">{{ item.type == 1 ? '@微信' : '@企微' }}</div>
</div>
<div class="time">2021年7月24日添加</div>
</div> </div>
<div class="sprite-icon icon-arrow"></div> <template v-if="tabIndex == 1">
<div class="time">进群时间:{{ item.joinTime }}</div>
</template> </template>
<template v-else> <div class="tag-wrap flex" v-else>
<template v-if="tabIndex == 3"> <template v-if="item.labels.length > 0">
<div class="avatar"> <div class="tag" v-for="tag in item.labels.slice(0, 3)" :key="tag.labelId">{{ tag.labelValue }}</div>
<div class="sprite-icon icon-avatar"></div>
</div>
</template> </template>
<div class="info">
<div class="phone">13931970596</div>
恒河猴
</div>
<template v-if="tabIndex != 1">
<div class="btns flex">
<div class="btn flex">
<div class="sprite-icon icon-customer-add"></div>
加好友
</div>
<div class="line"></div>
<div
class="btn flex"
@click="makePhoneCall(13931970596)"
>
<div class="sprite-icon icon-customer-phone"></div>
拨打电话
</div> </div>
</div> </div>
<template v-if="item.isMyCustomer == 0 && tabIndex == 0">
<div class="mark">我的客户</div>
</template> </template>
<div class="sprite-icon icon-arrow" v-if="tabIndex == 0"></div>
</template> </template>
</div> </div>
</template> </template>
</scroll-view> </scroll-view>
</template> </template>
</template>
<template v-if="tabIndex == 0">
<div class="copy-box">
<div class="sprite-icon icon-customer-copy"></div>
<div class="title">客户好友申请文案</div>
<div>
我是深圳福田宝马4S店的售后经理王俊凯,添加企业微信,帮你解决您购车售后任何问题。
</div>
</div>
</template>
<template v-if="tabIndex == 2">
<div class="checked-control flex">
<div class="checked-box">
<template v-if="true">
<div class="sprite-icon icon-customer-active"></div>
</template>
<template v-else> <template v-else>
<div class="checked"></div> <empty description="暂无数据" />
</template>
</div>
<div class="all">全选</div>
已选1个客户
<div class="btn text-center">批量打标签</div>
</div>
</template> </template>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { detailApi, ssoApi, wxConfig } from '@/api'
export default { export default {
name: '', name: '',
data () { data() {
return { return {
tabIndex: 0 tabIndex: this.index,
custList: [],
staffList: [],
keyWord: '',
list: [],
id: this.chatId
}
},
props: {
index: {
type: Number,
default: 0
},
chatId: {
type: String,
default: ''
} }
}, },
mounted () { watch: {
index(n) {
this.tabIndex = n
},
custList: {
handler() {
this.$emit('listChange', { list: ['客户(' + this.custList.length + ')', '员工(' + this.staffList.length + ')'] })
},
deep: true,
immediate: true
},
staffList: {
handler() {
this.$emit('listChange', { list: ['客户(' + this.custList.length + ')', '员工(' + this.staffList.length + ')'] })
},
deep: true,
immediate: true
},
chatId: {
handler(e) {
this.id = e
this.initData()
},
immediate: true
}
},
created() {
this.getuserInfo()
},
mounted() {
this.initWx()
}, },
methods: { methods: {
change (e) { //初始化微信接口
console.log(e) initWx() {
wxConfig.init(['openEnterpriseChat']).then(() => {})
},
initData(index) {
// if (index == 0) this.getCustomerCustList() //群客户列表
// if (index == 1) this.getCustomerStaffList() //群员工列表
this.getCustomerCustList() //群客户列表
this.getCustomerStaffList() //群员工列表
},
initSearch() {
this.keyWord = ''
// console.log(this.keyWord)
this.initData()
},
getuserInfo() {
ssoApi.getuserInfo().then(res => {
this.workUserId = res.data.workUserId
})
},
//群客户列表
getCustomerCustList() {
let obj = {
id: this.id,
pageSize: 20,
pageNum: 1,
keyword: this.tabIndex == 0 ? this.keyWord : ''
}
detailApi.getCustomerCustList(obj).then(res => {
if (res) {
this.custList = res
// console.log(this.custList)
}
})
},
//群员工列表
getCustomerStaffList() {
let obj = {
id: this.id,
pageSize: 20,
pageNum: 2,
customerName: this.tabIndex == 1 ? this.keyWord : ''
}
detailApi.getCustomerStaffList(obj).then(res => {
if (res) {
this.staffList = res
// console.log(this.staffList)
}
})
},
searchkeyWord(e) {
this.keyWord = e
if (this.tabIndex == 0) this.getCustomerCustList() //群客户列表
if (this.tabIndex == 1) this.getCustomerStaffList() //群员工列表
},
change(e) {
// console.log(e)
this.tabIndex = e this.tabIndex = e
}, },
onReachBottom () { onReachBottom() {
console.log('触底') // console.log('触底')
this.$refs.scrollView.loading = false this.$refs.scrollView.loading = false
this.$refs.scrollView.finished = true this.$refs.scrollView.finished = true
},
goTo(data) {
if (!data.oneid && this.tabIndex == 0) {
Toast('该用户尚未成为企业微信客户,请先添加为客户')
return
}
if (this.tabIndex == 0) this.$router.push({ path: '/customer/detail', query: { id: data.userId, customerId: data.isMyCustomer } })
if (this.tabIndex == 1) {
let seach = {
userIds: [this.workUserId], //参与会话的企业成员列表,格式为userid1;userid2;...,用分号隔开。
externalUserIds: [data.userId], // 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
groupName: '', // 会话名称。单聊时该参数传入空字符串""即可。
chatId: ''
}
wxConfig.openEnterpriseChat(seach).then(res => {})
}
} }
} }
} }
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
<div class="tag-title">{{ item.groupName }}</div> <div class="tag-title">{{ item.groupName }}</div>
<div class="tag-list"> <div class="tag-list">
<template v-for="(tag, ids) in item.taggingList"> <template v-for="(tag, ids) in item.taggingList">
<div :key="ids" :class="['text-center', 'tag', { active: tag.isChecked || tag.disabled }]" @click="chooseTag(index, ids)">{{ tag.taggingName }}</div> <div :key="ids" :class="['text-center', 'tag', { active: tag.isChecked }]" @click="chooseTag(index, ids)">{{ tag.taggingName }}</div>
<!-- { active: tag.isChecked || tag.disabled } -->
</template> </template>
</div> </div>
</div> </div>
...@@ -71,6 +72,10 @@ export default { ...@@ -71,6 +72,10 @@ export default {
chooseItems: { chooseItems: {
type: Array, type: Array,
default: () => [] default: () => []
},
isCustomer: {
type: Boolean,
default: true
} }
}, },
created() { created() {
...@@ -79,7 +84,8 @@ export default { ...@@ -79,7 +84,8 @@ export default {
methods: { methods: {
chooseTag(index, ids) { chooseTag(index, ids) {
let { disabled } = this.tagList[index].taggingList[ids] let { disabled } = this.tagList[index].taggingList[ids]
if (disabled) { let { isCustomer } = this
if (disabled && isCustomer) {
this.showToast('标签修改功能即将上线,敬请期待') this.showToast('标签修改功能即将上线,敬请期待')
return return
} }
...@@ -106,6 +112,7 @@ export default { ...@@ -106,6 +112,7 @@ export default {
} }
} }
} }
console.log(this.checkAll)
}, },
close(data, value) { close(data, value) {
this.checkAll.splice(value, 1) this.checkAll.splice(value, 1)
...@@ -127,7 +134,8 @@ export default { ...@@ -127,7 +134,8 @@ export default {
this.tagFlag = false this.tagFlag = false
}, },
init() { init() {
let { chooseItems, keyWord } = this let { chooseItems, keyWord, isCustomer } = this
console.log(chooseItems, 'chooseItems')
let obj = { let obj = {
keyWord keyWord
} }
...@@ -135,6 +143,7 @@ export default { ...@@ -135,6 +143,7 @@ export default {
this.tagFlag = true this.tagFlag = true
if (res && res.length > 0) { if (res && res.length > 0) {
this.tagList = res this.tagList = res
console.log('this.tagList', this.tagList)
if (this.tagList.length > 0) { if (this.tagList.length > 0) {
for (let i = 0; i < this.tagList.length; i++) { for (let i = 0; i < this.tagList.length; i++) {
this.tagList[i].checked = false this.tagList[i].checked = false
...@@ -143,6 +152,8 @@ export default { ...@@ -143,6 +152,8 @@ export default {
} }
} }
} }
//
if (chooseItems && chooseItems.length > 0) {
chooseItems.map(e => { chooseItems.map(e => {
this.tagList.map(t => { this.tagList.map(t => {
if (e.labelGroupInfo.labelGroupId == t.groupId) { if (e.labelGroupInfo.labelGroupId == t.groupId) {
...@@ -150,12 +161,18 @@ export default { ...@@ -150,12 +161,18 @@ export default {
e.labelInfoList.map(s => { e.labelInfoList.map(s => {
if (s.labelId == k.taggingId) { if (s.labelId == k.taggingId) {
k.disabled = true k.disabled = true
k.isChecked = true
//客户跟进获取已打标签的数据
if (!isCustomer) this.checkAll.unshift(k)
console.log(this.checkAll)
} }
}) })
}) })
} }
}) })
}) })
}
if (this.checkAll.length > 0 && this.tagList.length > 0) { if (this.checkAll.length > 0 && this.tagList.length > 0) {
this.saveTag() this.saveTag()
} }
...@@ -195,25 +212,34 @@ export default { ...@@ -195,25 +212,34 @@ export default {
}, },
//打标签 //打标签
handleTag() { handleTag() {
let taggingInfo = [] console.log('this.tagList', this.tagList)
for (let i = 0; i < this.tagList.length; i++) {
if (this.tagList[i].checked) {
let tagIds = [] let tagIds = []
let deletetagIds = []
for (let i = 0; i < this.tagList.length; i++) {
this.tagList[i].taggingList.forEach(tag => { this.tagList[i].taggingList.forEach(tag => {
tag.isChecked ? tagIds.push(tag.taggingId) : '' !tag.isChecked && tag.disabled ? deletetagIds.push(tag.taggingId) : ''
}) tag.isChecked && !tag.disabled ? tagIds.push(tag.taggingId) : ''
taggingInfo.push({
labelType: this.tagList[i].labelType,
groupId: this.tagList[i].groupId,
tagIds: tagIds.join(',')
}) })
} // taggingInfo.push({
} // labelType: this.tagList[i].labelType,
if (taggingInfo.length > 0) { // groupId: this.tagList[i].groupId,
// tagIds: tagIds.join(',')
// })
// deleteTaggingInfo.push({
// labelType: this.tagList[i].labelType,
// groupId: this.tagList[i].groupId,
// tagIds: deletetagIds.join(',')
// })
// }
}
if (tagIds.length > 0 || deletetagIds.length > 0) {
let obj = { let obj = {
externalUserIds: this.externalUserIds.join(','), externalUserIds: this.externalUserIds.join(','),
taggingInfo: JSON.stringify(taggingInfo) labelIdAddList: tagIds,
labelIdDelList: deletetagIds,
taggingInfo: 1111
} }
console.log(obj)
groupTag.putCustomertag(obj).then(res => { groupTag.putCustomertag(obj).then(res => {
if (res) Toast(this.externalUserIds.length > 1 ? '标签批量添加成功' : '标签添加成功') if (res) Toast(this.externalUserIds.length > 1 ? '标签批量添加成功' : '标签添加成功')
this.clearData() this.clearData()
......
...@@ -49,7 +49,7 @@ const spritesmithFunction = data => { ...@@ -49,7 +49,7 @@ const spritesmithFunction = data => {
return `${shared}\n${perSprite}` return `${shared}\n${perSprite}`
} }
module.exports = { module.exports = {
publicPath: IS_PROD ? './' : '/dj-scrm-wx-group-chat/', // 署应用包时的基本 URL。 vue-router hash 模式使用 publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-test/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router hash 模式使用 // publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-attachment-customer/', // 署应用包时的基本 URL。 vue-router hash 模式使用 // publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-attachment-customer/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-attachment-customer/', // 署应用包时的基本 URL。 vue-router history模式使用 // publicPath: '/dj-scrm-wx-work-attachment-customer/', // 署应用包时的基本 URL。 vue-router history模式使用
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!