Commit f094925f by 前端

Merge branch 'wangzh_dev_2.0' into 'master'

客户跟进2.0开发

See merge request !2
2 parents 426920fa ef483281
......@@ -44,31 +44,48 @@
</div>
</div>
</div>
<div class="detail-bg detail-third">
<div class="title">客户标签</div>
<div class="detail-label">
<div v-if="userInfo.labelInfos && !userInfo.labelInfos.length" class="no-label">
<div class="btn text-center" @click="handleTag">
<van-icon name="plus" class="plus" />
<span>标签</span>
<template v-for="(label, ids) in labelArray">
<template v-if="(merchantModel == 2 && label.labelGroupType != '自店标签') || merchantModel == 1">
<div class="detail-bg detail-third" :key="ids">
<div class="title">
{{ label.labelGroupType }}
<span v-if="label.labelGroupType == '系统标签'" class="prompt-text">系统标签不支持手动修改</span>
</div>
</div>
<div class="has-label" v-else>
<template v-for="(i, index) in userInfo.labelInfos">
<div class="label-box" :key="index">
<div class="label-title">{{ i.labelGroupInfo.labelGroupName }}</div>
<div v-for="item in i.labelInfoList" :key="item.id" class="label-text text-center">{{ item.labelName }}</div>
<div class="detail-label">
<div v-if="label.labelGroupType !== '系统标签' && customerId == 0" class="no-label">
<div class="btn text-center" @click="handleTag(label.labelGroupType)">
<van-icon name="plus" class="plus" />
<span>标签</span>
</div>
</div>
</template>
<div class="btn-box" v-if="customerId == 0">
<div class="btn text-center" @click="handleTag">
<van-icon name="plus" class="plus" />
<span>标签</span>
<div class="has-label" v-if="label.isShow && label.children.length > 0">
<template v-for="(i, index) in label.children">
<div class="label-box" :key="index">
<div class="label-title">{{ i.labelGroupInfo.labelGroupName }}</div>
<div v-for="item in i.labelInfoList" :key="item.id" class="label-text text-center">{{ item.labelName }}</div>
</div>
</template>
<!-- <div class="btn-box">
<div class="btn text-center" @click="handleTag">
<van-icon name="plus" class="plus" />
<span>标签8888</span>
</div>
</div> -->
</div>
</div>
<template v-if="label.children.length > 0">
<div class="detail-more text-center" @click="moreInfoLabel(ids)">
<div class="btn text-center">
{{ label.isShow ? '收起' : '展开全部' }}
<div :class="['sprite-icon', 'icon-open-arrow', { more: label.isShow }]"></div>
</div>
</div>
</template>
</div>
</div>
</div>
</template>
</template>
<div class="detail-bg detail-fourth">
<div class="title">所属群聊</div>
<div class="detail-group">
......@@ -90,7 +107,7 @@
<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-popup>
<make @success="successHandle" :externalUserIds="[id]" :chooseItems="userInfo.labelInfos" :isCustomer="false" ref="popRefs"></make>
<make @success="successHandle" :externalUserIds="[id]" :chooseItems="userInfo.labelInfos" :isCustomer="false" ref="popRefs"></make>
</div>
</template>
......@@ -102,8 +119,10 @@ export default {
components: { make },
data() {
return {
labelType: '',
flag: false,
isMore: false,
labels: [],
userInfo: {
labels: [],
vehicleInfo: {},
......@@ -116,6 +135,8 @@ export default {
1: '男',
2: '女'
},
merchantModel: '',
labelArray: [],
detailObj: [
{
title: '添加时间',
......@@ -235,7 +256,7 @@ export default {
target: '',
customerId: 0, //默认是客户显示打标签按钮
userAgent: false,
isTrue: true
isTrue: false
}
},
activated() {
......@@ -248,6 +269,7 @@ export default {
})
},
mounted() {
this.merchantModel = this.getLocalStorage('dj_scrm_userInfo').merchantModel
this.userAgent = this.isMobile()
this.showLoading()
let { id, customerId, isTrue } = this.getQuery()
......@@ -300,6 +322,9 @@ export default {
}
this.isMore = !this.isMore
},
moreInfoLabel(index) {
this.labelArray[index].isShow = !this.labelArray[index].isShow
},
getCustomerDetail(userId) {
this.hideLoading()
detailApi.getCustomerDetail({ userId }).then(res => {
......@@ -316,9 +341,40 @@ export default {
Object.keys(res).map(key => {
if (res[key]) this.userInfo[key] = res[key]
})
this.initLabel()
}
})
},
//标签分组
initLabel() {
console.log('this.userInfo.labelInfos', this.userInfo.labelInfos)
let labelArray = [
{
labelGroupType: '企业标签',
children: [],
isShow: false
},
{
labelGroupType: '自店标签',
children: [],
isShow: false
},
{
labelGroupType: '系统标签',
children: [],
isShow: false
}
]
this.userInfo.labelInfos.forEach(ele => {
labelArray.forEach(label => {
if (ele.labelGroupInfo.labelGroupType == label.labelGroupType) {
label.children.push(ele)
}
})
})
console.log(labelArray)
this.labelArray = labelArray
},
setDetail({ type, title, save_key, maxlength }) {
let {
detailObj,
......@@ -414,7 +470,8 @@ export default {
})
})
},
handleTag() {
handleTag(labelType) {
this.$refs.popRefs.labelType = labelType
this.$refs.popRefs.clearData()
this.$refs.popRefs.toggle()
},
......@@ -555,20 +612,30 @@ export default {
}
.detail-third {
margin: 10px 16px;
padding: 16px;
padding: 10px 16px 16px 16px;
position: relative;
.title {
font-size: 16px;
color: #333;
font-weight: 600;
line-height: 22px;
.prompt-text {
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 17px;
margin-left: 6px;
}
}
.detail-label {
position: relative;
min-height: 65px;
.no-label {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
top: 10px;
right: 16px;
z-index: 99;
// top: 50%;
// left: 50%;
// transform: translate(-50%, -50%);
}
.btn {
width: 60px;
......@@ -609,6 +676,33 @@ export default {
box-sizing: border-box;
}
}
.detail-more {
border-radius: 0 0 4px 4px;
color: #999;
font-size: 12px;
text-align: center;
line-height: 18px;
padding: 20px 0 0 0;
position: relative;
z-index: 2;
background-color: #fff;
top: -1px;
.btn {
width: 108px;
height: 21px;
border-radius: 12px;
border: 1px solid #3975c6;
color: #3975c6;
font-size: 12px;
.sprite-icon {
margin-left: 4px;
transition: all 0.5s;
}
.more {
transform: rotate(-180deg);
}
}
}
}
.detail-fourth {
margin: 10px 16px 36px 10px;
......
......@@ -61,7 +61,8 @@ export default {
tagList: [],
checkAll: [],
tagShow: false,
tagFlag: false
tagFlag: false,
labelType:''
}
},
props: {
......@@ -134,16 +135,22 @@ export default {
this.tagFlag = false
},
init() {
let { chooseItems, keyWord, isCustomer } = this
console.log(chooseItems, 'chooseItems')
let { chooseItems, keyWord, isCustomer, labelType } = this
let obj = {
keyWord
}
groupTag.gettagList(obj).then(res => {
this.tagFlag = true
if (res && res.length > 0) {
this.tagList = res
console.log('this.tagList', this.tagList)
if (!isCustomer) {
this.tagList= res.filter(label => {
return label.labelType == labelType
})
} else {
this.tagList = res
}
if (this.tagList.length > 0) {
for (let i = 0; i < this.tagList.length; i++) {
this.tagList[i].checked = false
......@@ -212,7 +219,6 @@ export default {
},
//打标签
handleTag() {
console.log('this.tagList', this.tagList)
let tagIds = []
let deletetagIds = []
for (let i = 0; i < this.tagList.length; i++) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!