Commit 57eaa83f by xinla

客户画像标签接口修改过

1 parent e40e7e41
...@@ -61,12 +61,10 @@ ...@@ -61,12 +61,10 @@
<div>客户标签</div> <div>客户标签</div>
<div class="data" is-link @click="labelEdit">编辑</div> <div class="data" is-link @click="labelEdit">编辑</div>
</div> </div>
<div v-if="form.weTagGroupList" class="labelstyle mt10"> <div v-if="form.tags" class="labelstyle mt10">
<template v-for="item in form.weTagGroupList"> <div class="label" v-for="(unit, unique) in form.tags" :key="unique">
<div class="label" v-for="(unit, unique) in item.weTags" :key="unique">
{{ unit.name }} {{ unit.name }}
</div> </div>
</template>
</div> </div>
</div> </div>
<div class="divider"></div> <div class="divider"></div>
...@@ -258,7 +256,7 @@ export default { ...@@ -258,7 +256,7 @@ export default {
// 接口开始 // 接口开始
externalUserid: '', externalUserid: '',
// externalUserid: 'wmiGuBCgAAoCBD1frD3hRplbsXoBLx6g', // 客户IdwmiGuBCgAAoCBD1frD3hRplbsXoBLx6g // externalUserid: 'wmiGuBCgAAoCBD1frD3hRplbsXoBLx6g', // 客户IdwmiGuBCgAAoCBD1frD3hRplbsXoBLx6g
// externalUserid: 'wmiGuBCgAA617zOzAIg-0sZG3Vok7BUA', externalUserid: 'wmiGuBCgAA617zOzAIg-0sZG3Vok7BUA',
form: { form: {
name: '', // 昵称 name: '', // 昵称
remarkMobiles: '', // 手机号 remarkMobiles: '', // 手机号
...@@ -307,8 +305,7 @@ export default { ...@@ -307,8 +305,7 @@ export default {
}, },
computed: { computed: {
userId() { userId() {
return this.$store.state.userId return this.$store.state.userId || 'FengJuZhuDeJieDao'
// || 'FengJuZhuDeJieDao'
}, },
// activeLabel : () => { // activeLabel : () => {
// this.addTag.forEach((value) => { // this.addTag.forEach((value) => {
...@@ -328,24 +325,16 @@ export default { ...@@ -328,24 +325,16 @@ export default {
forbidClick: true forbidClick: true
}) })
// 获取agentId // 获取agentId
let query = param2Obj(window.location.search) // let query = param2Obj(window.location.search)
let hash = param2Obj(window.location.hash) // let hash = param2Obj(window.location.hash)
query = Object.assign(query, hash) // query = Object.assign(query, hash)
this.agentId = query.agentId // this.agentId = query.agentId
console.log(agentId)
// this.findAddaddEmployes() this.findAddaddEmployes()
// this.findAddGroupNum() this.findAddGroupNum()
// this.getCustomerInfo() this.getCustomerInfo()
// this.findTrajectory() this.findTrajectory()
this.getAllTags()
// getAllTags()
// .then(({ data }) => {
// this.alllabel = data
// })
// .catch((err) => {
// console.log(err)
// })
}, },
methods: { methods: {
...@@ -376,13 +365,7 @@ export default { ...@@ -376,13 +365,7 @@ export default {
_this.findAddGroupNum() _this.findAddGroupNum()
_this.getCustomerInfo() _this.getCustomerInfo()
_this.findTrajectory() _this.findTrajectory()
getAllTags() _this.getAllTags()
.then(({ data }) => {
_this.alllabel = data
})
.catch((err) => {
console.log(err)
})
} else { } else {
//错误处理 //错误处理
_this.$dialog({ message: '进入失败:' + JSON.stringify(res) }) _this.$dialog({ message: '进入失败:' + JSON.stringify(res) })
...@@ -396,6 +379,22 @@ export default { ...@@ -396,6 +379,22 @@ export default {
} }
}) })
}, },
getAllTags() {
getAllTags()
.then(({ data }) => {
this.alllabel = data
this.listTagOneArray = []
data.forEach((element) => {
element.weTags.forEach((d) => {
this.listTagOneArray.push(d)
})
})
})
.catch((err) => {
console.log(err)
})
},
// 客户待办点击保存事件 // 客户待办点击保存事件
saveInfo2() {}, saveInfo2() {},
// 添加或编辑轨迹 // 添加或编辑轨迹
...@@ -548,12 +547,31 @@ export default { ...@@ -548,12 +547,31 @@ export default {
}, },
// 点击编辑按钮 // 点击编辑按钮
labelEdit() { labelEdit() {
this.show = true let tags = this.form.tags
if (this.form.weTagGroupList) { let hasErrorTag = [] // 异常活已经删除的标签
this.form.weTagGroupList.forEach((ele) => { let repeat = [] // 重复的标签
this.addTag.push(...ele.weTags) tags.forEach((unit) => {
// 判断是否有重复标签
let isRepeat = this.addTag.some((d) => {
return d.tagId === unit.tagId
})
// 去重
if (isRepeat) {
repeat.push(unit.name)
return
}
let filter = this.listTagOneArray.find((d) => {
return d.tagId === unit.tagId
}) })
// 如果没有匹配到,则说明该便签处于异常状态,可能已被删除或破坏
if (!filter) {
hasErrorTag.push(unit.name)
return
} }
this.addTag.push(filter)
})
this.show = true
// 获取用户当前的lable,将当前用户的lable与所有lable进行对比,相同的弹框内蓝色展示 // 获取用户当前的lable,将当前用户的lable与所有lable进行对比,相同的弹框内蓝色展示
// 弹框内的标签组选中时蓝色展示 // 弹框内的标签组选中时蓝色展示
// 弹框内的子标签与选中时蓝色展示,点击时 // 弹框内的子标签与选中时蓝色展示,点击时
...@@ -597,6 +615,17 @@ export default { ...@@ -597,6 +615,17 @@ export default {
}) })
.then(({ data }) => { .then(({ data }) => {
// console.log(data); // console.log(data);
if (data.tagIds && data.tagNames) {
data.tagIds = data.tagIds.split(',')
data.tagNames = data.tagNames.split(',')
data.tags = []
data.tagIds.forEach((unit, index) => {
data.tags.push({
tagId: unit,
name: data.tagNames[index]
})
})
}
this.form = data this.form = data
// console.log(this.form); // console.log(this.form);
}) })
......
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
element.tagIds.forEach((unit, index) => { element.tagIds.forEach((unit, index) => {
element.tags.push({ element.tags.push({
tagId: unit, tagId: unit,
tagNames: element.tagNames[index] tagName: element.tagNames[index]
}) })
}) })
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!