<template>
|
<div class="detail-view">
|
<el-drawer :visible.sync="detailConfig.visible" size="80%" :before-close="handleClose" :wrapperClosable="false">
|
<template slot="title">
|
<div class="header">
|
<span class="header-label">客户名称</span>
|
<span class="header-title">{{ detailConfig.infomation.name }}</span>
|
</div>
|
</template>
|
<div class="content">
|
<div class="tab-view">
|
<el-tabs v-model="activeName" @tab-click="tabsClick">
|
<el-tab-pane label="详情" name="first"></el-tab-pane>
|
<el-tab-pane label="跟进记录" name="second">
|
<!-- <template slot="label">
|
<div>跟进记录<el-badge type="primary" :value="2"> </el-badge></div>
|
</template> -->
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
<div v-if="activeName === 'first'" class="detail">
|
<!-- 基本信息 -->
|
<div class="basic-info">
|
<div class="basic-info-label" @click="expandClick('basic')">
|
<i v-if="isBasicExpand" class="el-icon-arrow-down"></i>
|
<i v-else class="el-icon-arrow-up"></i>
|
<span style="margin-left: 10px">基本信息</span>
|
</div>
|
<div v-show="isBasicExpand" class="basic-info-content">
|
<ul>
|
<li v-for="(item, i) in basicInfoList" :key="i">
|
<div class="left">
|
<div class="content-title">{{ item.leftStr + ":" }}</div>
|
<div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
|
</div>
|
<div v-if="item.rightStr && item.rightStr.length > 0" class="right">
|
<div class="content-title">{{ item.rightStr + ":" }}</div>
|
<div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
</div>
|
<!-- 动态信息 -->
|
<div class="basic-info">
|
<div class="basic-info-label" @click="expandClick('dynamic')">
|
<i v-if="isDynamicExpand" class="el-icon-arrow-down"></i>
|
<i v-else class="el-icon-arrow-up"></i>
|
<span style="margin-left: 10px">动态信息</span>
|
</div>
|
<div v-show="isDynamicExpand" class="basic-info-content">
|
<ul>
|
<li v-for="(item, i) in dynamicInfoList" :key="i">
|
<div class="left">
|
<div class="content-title">{{ item.leftStr + ":" }}</div>
|
<div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
|
</div>
|
<div v-if="item.rightStr && item.rightStr.length > 0" class="right">
|
<div class="content-title">{{ item.rightStr + ":" }}</div>
|
<div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
|
</div>
|
</li>
|
</ul>
|
<div class="business_scope">
|
<div class="content-title">{{ "最新进展" }}</div>
|
<div class="content-data">{{ record ? record : "--" }}</div>
|
</div>
|
</div>
|
</div>
|
<!-- 地址信息 -->
|
<div class="basic-info">
|
<div class="basic-info-label" @click="expandClick('address')">
|
<i v-if="isAddressExpand" class="el-icon-arrow-down"></i>
|
<i v-else class="el-icon-arrow-up"></i>
|
<span style="margin-left: 10px">地址信息</span>
|
</div>
|
<div v-show="isAddressExpand" class="basic-info-content">
|
<ul>
|
<li v-for="(item, i) in addressInfoList" :key="i">
|
<div class="left">
|
<div class="content-title">{{ item.leftStr + ":" }}</div>
|
<div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
|
</div>
|
<div v-if="item.rightStr && item.rightStr.length > 0" class="right">
|
<div class="content-title">{{ item.rightStr + ":" }}</div>
|
<div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
</div>
|
<!-- 备注信息 -->
|
<div class="basic-info">
|
<div class="basic-info-label" @click="expandClick('remark')">
|
<i v-if="isRemarkExpand" class="el-icon-arrow-down"></i>
|
<i v-else class="el-icon-arrow-up"></i>
|
<span style="margin-left: 10px">备注信息</span>
|
</div>
|
<div v-show="isRemarkExpand" class="basic-info-content">
|
<ul>
|
<li>
|
<div class="left remark">
|
<div class="content-title">{{ "备注:" }}</div>
|
<div class="content-data">{{ detailConfig.infomation.desc }}</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
</div>
|
</div>
|
<div v-if="activeName === 'second'" class="second">
|
<FollowupRecords
|
:isDetail="true"
|
:follow-record="detailConfig.infomation.FollowRecord"
|
:add-config="addConfig"
|
/>
|
</div>
|
</div>
|
</el-drawer>
|
</div>
|
</template>
|
|
<script>
|
import FollowupRecords from "@/views/client/followupRecords"
|
export default {
|
name: "DetailSalesLead",
|
props: {
|
salesLeadDetail: {
|
type: Object,
|
default: () => {
|
return {
|
visible: false,
|
infomation: {}
|
}
|
}
|
}
|
},
|
components: { FollowupRecords },
|
computed: {},
|
data() {
|
return {
|
detailConfig: this.salesLeadDetail,
|
activeName: "first",
|
isBasicExpand: true, // 基本信息展开
|
basicInfoList: [],
|
isDynamicExpand: true, // 动态信息
|
dynamicInfoList: [],
|
isAddressExpand: true, // 地址信息
|
addressInfoList: [],
|
isRemarkExpand: true, // 备注信息
|
remarkInfoList: [],
|
addConfig: {},
|
record: ""
|
}
|
},
|
created() {
|
this.setData(this.detailConfig.infomation)
|
this.addConfig = {
|
id_name: "sales_leads_id",
|
id: this.detailConfig.infomation.id,
|
common_name: this.detailConfig.infomation.id,
|
sales_leads_name: this.detailConfig.infomation.name,
|
sales_leads_id: this.detailConfig.infomation.id
|
}
|
},
|
mounted() {},
|
methods: {
|
setData(item) {
|
if (item.FollowRecord && item.FollowRecord.length > 0) {
|
this.record = item.FollowRecord[0].record
|
}
|
this.basicInfoList = [
|
{
|
leftStr: "客户名称",
|
leftValue: item.name,
|
rightStr: "销售线索编号",
|
rightValue: item.number
|
},
|
{
|
leftStr: "联系人姓名",
|
leftValue: item.contact_name,
|
rightStr: "联系人职务",
|
rightValue: item.contact_position
|
},
|
{
|
leftStr: "手机号码",
|
leftValue: item.contact_phone,
|
rightStr: "商机状态",
|
rightValue: "新建"
|
},
|
{
|
leftStr: "商机来源",
|
leftValue: item.sales_resources,
|
rightStr: "负责人",
|
rightValue: item.member_name
|
},
|
{
|
leftStr: "分配日期",
|
leftValue: "",
|
rightStr: "公海状态",
|
rightValue: ""
|
},
|
{
|
leftStr: "创建时间",
|
leftValue: "",
|
rightStr: "创建人",
|
rightValue: ""
|
},
|
{
|
leftStr: "关闭原因",
|
leftValue: "",
|
rightStr: "",
|
rightValue: ""
|
}
|
]
|
this.dynamicInfoList = [
|
{
|
leftStr: "未联系天数",
|
leftValue: "",
|
rightStr: "最新联系日期",
|
rightValue: ""
|
},
|
{
|
leftStr: "最新进展",
|
leftValue: this.record,
|
rightStr: "",
|
rightValue: ""
|
}
|
]
|
this.addressInfoList = [
|
{
|
leftStr: "国家",
|
leftValue: "中国",
|
rightStr: "省份",
|
rightValue: item.Province.name
|
},
|
{
|
leftStr: "城市",
|
leftValue: item.City.name,
|
rightStr: "",
|
rightValue: ""
|
}
|
]
|
},
|
handleClose() {
|
this.detailConfig.visible = false
|
},
|
// tab切换
|
tabsClick(tab, event) {
|
console.log(tab, event)
|
},
|
// 展开收起点击事件
|
expandClick(value) {
|
console.log(value)
|
if (value === "basic") {
|
this.isBasicExpand = !this.isBasicExpand
|
} else if (value === "dynamic") {
|
this.isDynamicExpand = !this.isDynamicExpand
|
} else if (value === "address") {
|
this.isAddressExpand = !this.isAddressExpand
|
} else if (value === "remark") {
|
this.isRemarkExpand = !this.isRemarkExpand
|
}
|
}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
.detail-view {
|
.header {
|
height: 56px;
|
display: flex;
|
align-items: center;
|
padding-left: 10px;
|
.header-label {
|
padding: 5px;
|
border-radius: 4px;
|
background-color: #ff6600;
|
color: #fff;
|
font-size: 12px;
|
}
|
.header-title {
|
color: #323232;
|
font-size: 15px;
|
margin-left: 10px;
|
font-weight: inherit;
|
}
|
}
|
.content {
|
background-color: rgb(230, 233, 240);
|
padding: 8px;
|
.tab-view {
|
background: #fff;
|
// .tab-view-pane {
|
// position: relative;
|
.item {
|
position: absolute;
|
top: 0px;
|
right: 0px;
|
}
|
// }
|
}
|
.detail {
|
.basic-info {
|
.basic-info-label {
|
padding-left: 10px;
|
height: 42px;
|
line-height: 42px;
|
background: #f4f8fe;
|
color: #333;
|
font-size: 14px;
|
}
|
.basic-info-content {
|
background: #fff;
|
ul {
|
padding-inline-start: 0;
|
}
|
li {
|
display: flex;
|
font-size: 14px;
|
font-family: PingFangSC;
|
border-bottom: 1px solid #f9f9fb;
|
.left,
|
.right {
|
width: 50%;
|
display: flex;
|
align-items: center;
|
height: 40px;
|
.content-title {
|
width: 220px;
|
text-align: right;
|
color: #555;
|
}
|
.content-data {
|
text-align: left;
|
margin-left: 25px;
|
color: #333;
|
}
|
}
|
.remark {
|
width: 100%;
|
}
|
}
|
.business_scope {
|
display: flex;
|
align-items: center;
|
font-size: 14px;
|
min-height: 40px;
|
.content-title {
|
width: 320px;
|
text-align: right;
|
color: #555;
|
}
|
.content-data {
|
flex: 1;
|
padding: 5px;
|
text-align: left;
|
margin-left: 25px;
|
color: #333;
|
}
|
}
|
}
|
}
|
}
|
.second {
|
background: #fff;
|
.followup-records {
|
.table-view {
|
margin-top: 0 !important;
|
margin-bottom: 0;
|
}
|
}
|
}
|
}
|
}
|
::v-deep {
|
.el-drawer__header {
|
padding: 0;
|
margin-bottom: 0px;
|
}
|
.el-tabs--top .el-tabs__item.is-top:nth-child(2) {
|
padding-left: 20px;
|
}
|
.el-tabs__item.is-active {
|
color: $color-primary;
|
}
|
.el-tabs__item:hover {
|
color: $color-primary;
|
}
|
.el-tabs__active-bar {
|
background-color: $color-primary;
|
}
|
.el-tabs__header {
|
margin: 0;
|
}
|
}
|
</style>
|