Commit efd36ad9 by 姜鹏凯

离职继承优化

1 parent 2aa13666
<script> <script>
import { import { updateBirthday, getDetail, getSummary, getFollowUpRecord, getCustomerInfoByUserId } from '@/api/customer'
updateBirthday,
getDetail,
getSummary,
getFollowUpRecord,
getCustomerInfoByUserId,
} from '@/api/customer'
import { dictAddType, dictJoinGroupType, dictTrackState } from '@/utils/dictionary' import { dictAddType, dictJoinGroupType, dictTrackState } from '@/utils/dictionary'
import InfoTab from './customer/infoTab.vue' import InfoTab from './customer/infoTab.vue'
export default { export default {
name: 'CustomerDetail', name: 'CustomerDetail',
components: { InfoTab }, components: { InfoTab },
data() { data() {
return { return {
datePickerVisible: false, datePickerVisible: false,
customer: { customer: {
// weFlowerCustomerRels: [{}] // weFlowerCustomerRels: [{}]
},
birthday: '',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
}, },
}, birthday: '',
dictAddType, pickerOptions: {
dictJoinGroupType, disabledDate(time) {
dictTrackState, return time.getTime() > Date.now()
}
active: 0, },
openedTabs: ['0'], dictAddType,
} dictJoinGroupType,
}, dictTrackState,
created() {
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
// })
// },
/**
*客户详情基础(基础信息+社交关系)
* @param {*}
* externalUserid 是 当前客户id
* userId 是 当前跟进人id
*/
getDetail() {
getDetail(this.$route.query).then(({ data }) => {
data.companyTags && (data.companyTags = data.companyTags.split(','))
this.customer = data
if (data.trackUsers && data.trackUsers.length === 1) { active: 0,
this.openedTabs = [data.trackUsers[0].trackUserId] openedTabs: ['0']
} }
this.birthday = data.birthday
})
}, },
changeTab(tab) { created() {
this.openedTabs.includes(tab.$attrs.id) || this.openedTabs.push(tab.$attrs.id) 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
// })
// },
/**
*客户详情基础(基础信息+社交关系)
* @param {*}
* externalUserid 是 当前客户id
* userId 是 当前跟进人id
*/
getDetail() {
getDetail({ ...this.$route.query, delFlag: 1 }).then(({ data }) => {
data.companyTags && (data.companyTags = data.companyTags.split(','))
this.customer = data
// remark(item) { if (data.trackUsers && data.trackUsers.length === 1) {
// return ( this.openedTabs = [data.trackUsers[0].trackUserId]
// item.remark || }
// this.customer.customerName + (item.remarkCorpName ? '-' + item.remarkCorpName : '') this.birthday = data.birthday
// ) })
// } },
}, changeTab(tab) {
} this.openedTabs.includes(tab.$attrs.id) || this.openedTabs.push(tab.$attrs.id)
}
// remark(item) {
// return (
// item.remark ||
// this.customer.customerName + (item.remarkCorpName ? '-' + item.remarkCorpName : '')
// )
// }
}
}
</script> </script>
<template> <template>
<div> <div>
<!-- <el-button slot="append" circle icon="el-icon-back" @click="$router.back()"></el-button>返回 --> <!-- <el-button slot="append" circle icon="el-icon-back" @click="$router.back()"></el-button>返回 -->
<div class="flex aic mb20" @click="goRoute(customer)"> <div class="flex aic mb20" @click="goRoute(customer)">
<el-image style="width: 80px; height: 80px" :src="customer.avatar" fit="fit"></el-image> <el-image style="width: 80px; height: 80px;" :src="customer.avatar" fit="fit"></el-image>
<div class="ml10"> <div class="ml10">
<div> <div>
{{ customer.customerName + (customer.corpName ? '-' + customer.corpName : '') }} {{ customer.customerName + (customer.corpName ? '-' + customer.corpName : '') }}
...@@ -112,10 +106,7 @@ export default { ...@@ -112,10 +106,7 @@ export default {
</el-card> --> </el-card> -->
<div class="card-title mb5">社交关系</div> <div class="card-title mb5">社交关系</div>
<el-tabs value="1"> <el-tabs value="1">
<el-tab-pane <el-tab-pane :label="`跟进员工(${customer.trackUsers ? customer.trackUsers.length : 0})`" name="1">
:label="`跟进员工(${customer.trackUsers ? customer.trackUsers.length : 0})`"
name="1"
>
<el-table :data="customer.trackUsers"> <el-table :data="customer.trackUsers">
<el-table-column label="员工" align="center" prop="userName" /> <el-table-column label="员工" align="center" prop="userName" />
<el-table-column prop="addMethod" label="添加方式" align="center"> <el-table-column prop="addMethod" label="添加方式" align="center">
...@@ -144,11 +135,7 @@ export default { ...@@ -144,11 +135,7 @@ export default {
</el-tabs> </el-tabs>
<el-tabs value="0" @tab-click="changeTab"> <el-tabs value="0" @tab-click="changeTab">
<el-tab-pane <el-tab-pane v-if="customer.trackUsers && customer.trackUsers.length > 1" label="客户画像汇总" id="0">
v-if="customer.trackUsers && customer.trackUsers.length > 1"
label="客户画像汇总"
id="0"
>
<info-tab :trackUsers="customer.trackUsers"></info-tab> <info-tab :trackUsers="customer.trackUsers"></info-tab>
</el-tab-pane> </el-tab-pane>
<el-tab-pane <el-tab-pane
...@@ -157,42 +144,39 @@ export default { ...@@ -157,42 +144,39 @@ export default {
:label="item.userName" :label="item.userName"
:id="item.trackUserId" :id="item.trackUserId"
> >
<info-tab <info-tab v-if="openedTabs.includes(item.trackUserId)" :userId="item.trackUserId"></info-tab>
v-if="openedTabs.includes(item.trackUserId)"
:userId="item.trackUserId"
></info-tab>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.info-wrap { .info-wrap {
margin-left: 20px; margin-left: 20px;
.info { .info {
color: #aaa; color: #aaa;
line-height: 32px; line-height: 32px;
}
} }
}
.el-card { .el-card {
::v-deep.el-card__header { ::v-deep.el-card__header {
border: 0; border: 0;
} }
}
.el-icon-s-custom {
font-size: 16px;
margin-left: 4px;
color: #999;
&.man {
color: #13a2e8;
} }
&.woman { .el-icon-s-custom {
color: #f753b2; font-size: 16px;
margin-left: 4px;
color: #999;
&.man {
color: #13a2e8;
}
&.woman {
color: #f753b2;
}
} }
}
.card-title { .card-title {
font-weight: 600; font-weight: 600;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!