Commit 7d2cefdc by 怪兽?别跑

update

1 parent fdc57864
<script> <script>
import { import {
updateBirthday, updateBirthday,
getDetail, getDetail,
findCustomerAddWay, findCustomerAddWay,
getFollowUpRecord, getFollowUpRecord,
getCustomerInfoByUserId, getCustomerInfoByUserId
} from '@/api/customer' } from '@/api/customer'
import { getList } from '@/api/salesCenter/businessConver.js' import { getList } from '@/api/salesCenter/businessConver.js'
import { dictJoinGroupType, dictTrackState } from '@/utils/dictionary' import { 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()
}
},
dictAddType: {},
dictJoinGroupType,
dictTrackState,
active: 0, active: 0,
openedTabs: ['0'], openedTabs: ['0']
} }
},
created() {
this.findCustomerAddWay()
this.getDetail()
this.getStage()
},
methods: {
findCustomerAddWay() {
findCustomerAddWay().then(({ data }) => {
data.forEach((element) => {
this.dictAddType[element.code] = element.value
})
})
},
getStage() {
getList().then((res) => {
this.stageList = res.data
})
}, },
setValue(data) { created() {
let str = '' this.findCustomerAddWay()
this.stageList.forEach((dd) => { this.getDetail()
if (dd.stageVal == data) { this.getStage()
str = dd.stageKey
}
})
return str
}, },
// updateBirthday() { methods: {
// if (!this.birthday || this.birthday == this.customer.birthday) { findCustomerAddWay() {
// return api.findCustomerAddWay().then(({ data }) => {
// } data.forEach((element) => {
// let data = { this.dictAddType[element.code] = element.value
// externalUserid: this.customer.externalUserid, })
// birthday: this.birthday, })
// firstUserId: this.customer.firstUserId },
// } getStage() {
// updateBirthday(data).then((response) => { getList().then((res) => {
// this.msgSuccess('操作成功') this.stageList = res.data
// // this.getDetail() })
// this.$set(this.customer, 'birthday', this.birthday) },
// // this.datePickerVisible = false setValue(data) {
// }) let str = ''
// }, this.stageList.forEach((dd) => {
/** if (dd.stageVal == data) {
*客户详情基础(基础信息+社交关系) str = dd.stageKey
* @param {*} }
* externalUserid 是 当前客户id })
* userId 是 当前跟进人id return str
*/ },
getDetail() { // updateBirthday() {
getDetail({ ...this.$route.query, delFlag: this.$route.query.isDelete ? 1 : 0 }).then(({ data }) => { // if (!this.birthday || this.birthday == this.customer.birthday) {
data.companyTags && (data.companyTags = data.companyTags.split(',')) // return
this.customer = data // }
// 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: this.$route.query.isDelete ? 1 : 0 }).then(({ data }) => {
data.companyTags && (data.companyTags = data.companyTags.split(','))
this.customer = data
if (data.trackUsers && data.trackUsers.length === 1) { if (data.trackUsers && data.trackUsers.length === 1) {
this.openedTabs = [data.trackUsers[0].trackUserId] this.openedTabs = [data.trackUsers[0].trackUserId]
} }
this.birthday = data.birthday this.birthday = data.birthday
}) })
}, },
changeTab(tab) { changeTab(tab) {
this.openedTabs.includes(tab.$attrs.id) || this.openedTabs.push(tab.$attrs.id) this.openedTabs.includes(tab.$attrs.id) || this.openedTabs.push(tab.$attrs.id)
}, }
// remark(item) { // remark(item) {
// return ( // return (
// item.remark || // item.remark ||
// this.customer.customerName + (item.remarkCorpName ? '-' + item.remarkCorpName : '') // this.customer.customerName + (item.remarkCorpName ? '-' + item.remarkCorpName : '')
// ) // )
// } // }
}, }
} }
</script> </script>
<template> <template>
...@@ -180,11 +180,13 @@ export default { ...@@ -180,11 +180,13 @@ export default {
v-for="(item, index) of customer.trackUsers" v-for="(item, index) of customer.trackUsers"
:key="index" :key="index"
:label="item.userName" :label="item.userName"
:id="item.trackUserId"> :id="item.trackUserId"
>
<info-tab <info-tab
v-if="openedTabs.includes(item.trackUserId)" v-if="openedTabs.includes(item.trackUserId)"
:stageList="stageList" :stageList="stageList"
:userId="item.trackUserId"></info-tab> :userId="item.trackUserId"
></info-tab>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
...@@ -192,32 +194,32 @@ export default { ...@@ -192,32 +194,32 @@ export default {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.avatar { .avatar {
width: 80px; width: 80px;
height: 80px; height: 80px;
border-radius: var(--border-radius-big); border-radius: var(--border-radius-big);
flex: none; flex: none;
} }
.info-wrap { .info-wrap {
margin-left: 20px; margin-left: 20px;
.info { .info {
color: #aaa; color: #aaa;
line-height: 32px; line-height: 32px;
}
} }
}
.el-icon-s-custom { .el-icon-s-custom {
font-size: 16px; font-size: 16px;
margin-left: 4px; margin-left: 4px;
color: #999; color: #999;
&.man { &.man {
color: #13a2e8; color: #13a2e8;
}
&.woman {
color: #f753b2;
}
} }
&.woman { .g-card-title {
color: #f753b2; margin-bottom: 5px;
} }
}
.g-card-title {
margin-bottom: 5px;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!