Commit efd36ad9 by 姜鹏凯

离职继承优化

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