<template>
|
<div class="detail-view">
|
<el-drawer
|
:visible.sync="detailConfig.visible"
|
size="80%"
|
:before-close="handleClose"
|
:wrapperClosable="false"
|
:append-to-body="true"
|
>
|
<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-tab-pane label="收款预测" name="collectionForecast"></el-tab-pane> -->
|
<el-tab-pane label="报价单" name="quotation"></el-tab-pane>
|
<el-tab-pane label="销售明细单" name="detail"></el-tab-pane>
|
<el-tab-pane label="服务合同" name="serviceContract"></el-tab-pane>
|
</el-tabs>
|
</div>
|
<div v-if="activeName === 'first'" class="detail">
|
<!-- 进度追踪 -->
|
<div class="basic-info">
|
<div class="basic-info-label" @click="expandClick('schdule')">
|
<i v-if="isSchduleExpand" 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="isSchduleExpand" class="basic-info-content">
|
<div class="step-view">
|
<el-steps :active="sale_active" align-center>
|
<el-step :active-color="'#fff'" :title="item.name" :key="item.id" v-for="(item, index) in stepsList">
|
<template slot="title">
|
<div class="step-title-view">
|
<div class="step-label">{{ item.name }}</div>
|
<div v-show="sale_active === index" class="step-btn" @click="advanceClick(item)">
|
<!-- && sale_stage_id !== stepsList.length -->
|
推进
|
</div>
|
<!-- <div class="step-desc">{{ item.desc }}</div> -->
|
</div>
|
</template>
|
</el-step>
|
</el-steps>
|
</div>
|
</div>
|
</div>
|
<!-- 机会基本信息 -->
|
<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" 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('forecast')">
|
<i v-if="isForecastExpand" 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="isForecastExpand" class="basic-info-content">
|
<ul>
|
<li v-for="(item, i) in forecastList" :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" 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" 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('business')">
|
<i v-if="isBusinessExpand" class="el-icon-arrow-down"></i>
|
<i v-else class="el-icon-arrow-up"></i>
|
<span style="margin-left: 10px">商机七要素(5W2P)</span>
|
</div>
|
<div v-show="isBusinessExpand" class="basic-info-content">
|
<ul>
|
<li v-for="(item, i) in businessInfoList" :key="i">
|
<div class="all">
|
<div class="content-title">{{ item.leftStr + ":" }}</div>
|
<div class="content-data">{{ item.leftValue }}</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
</div>
|
<!-- SWOT分析 -->
|
<div class="basic-info">
|
<div class="basic-info-label" @click="expandClick('swot')">
|
<i v-if="isSwotExpand" class="el-icon-arrow-down"></i>
|
<i v-else class="el-icon-arrow-up"></i>
|
<span style="margin-left: 10px">SWOT分析</span>
|
</div>
|
<div v-show="isSwotExpand" class="basic-info-content">
|
<ul>
|
<li v-for="(item, i) in swotInfoList" :key="i">
|
<div class="left">
|
<div class="content-title">{{ item.leftStr + ":" }}</div>
|
<div class="content-data">{{ item.leftValue }}</div>
|
</div>
|
<div v-if="item.rightStr" class="right">
|
<div class="content-title">{{ item.rightStr + ":" }}</div>
|
<div class="content-data">{{ item.rightValue }}</div>
|
</div>
|
</li>
|
</ul>
|
</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" 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.remark }}</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
</div>
|
<!-- 附件信息 -->
|
<!-- <div class="basic-info">
|
<div class="basic-info-label" @click="expandClick('annex')">
|
<i v-if="isAnnexExpand" 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="isAnnexExpand" class="basic-info-content">
|
<ul>
|
<li>
|
<div class="left remark">
|
<div class="content-title">{{ "附件:" }}</div>
|
<div class="content-data">{{ "" }}</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
</div> -->
|
<!-- 销售机会阶段推进历史 -->
|
<!-- <div class="basic-info">
|
<div class="basic-info-label" @click="expandClick('history')">
|
<i v-if="isHistoryExpand" 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="isHistoryExpand" class="basic-info-content">
|
<ul>
|
<li v-for="(item, i) in historyList" :key="i">
|
<div class="left remark history">
|
<div class="content-title">{{ "日期:" + "2023-08-04 13:33:36" }}</div>
|
<div class="content-data">{{ "销售阶段:" + "成功结案" }}</div>
|
<div class="content-data">{{ "修改人:" + "系统管理员" }}</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
</div> -->
|
</div>
|
<div v-if="activeName === 'second'" class="second">
|
<FollowupRecords :isDetail="true" :add-config="addConfig" />
|
</div>
|
<div v-if="activeName === 'collectionForecast'" class="second">
|
<!-- <SalesOpportunity :isDetail="true" /> -->
|
</div>
|
<div v-if="activeName === 'quotation'" class="second">
|
<Quotation :isDetail="true" :add-config="addConfig" />
|
</div>
|
<div v-if="activeName === 'detail'" class="second">
|
<SalesDetails :isDetail="true" :add-config="addConfig" />
|
</div>
|
<div v-if="activeName === 'serviceContract'" class="second">
|
<ServiceContract :isDetail="true" :add-config="addConfig" />
|
</div>
|
</div>
|
<!-- 推进 -->
|
<DetailAdvanceDialog v-if="advanceConfig.visible" :advance-config="advanceConfig" @pushed="updatePushData" />
|
</el-drawer>
|
</div>
|
</template>
|
|
<script>
|
import FollowupRecords from "@/views/client/followupRecords"
|
import Quotation from "@/views/sales/quotation"
|
import SalesDetails from "@/views/sales/salesDetails"
|
import ServiceContract from "@/views/service/serviceContract"
|
import DetailAdvanceDialog from "@/views/sales/salesOpportunity/DetailAdvanceDialog"
|
import { getSaleStageList } from "@/api/sales/salesOpportunity"
|
import {getAllData} from "@/api/client/client";
|
export default {
|
name: "DetailClientManage",
|
props: {
|
opportunityDetail: {
|
type: Object,
|
default: () => {
|
return {
|
visible: false,
|
infomation: {}
|
}
|
}
|
}
|
},
|
components: { FollowupRecords, Quotation, SalesDetails, DetailAdvanceDialog, ServiceContract },
|
computed: {},
|
data() {
|
return {
|
statusList: [],
|
detailConfig: this.opportunityDetail,
|
activeName: "first",
|
isSchduleExpand: true, // 进度追踪
|
stepsList: [],
|
isBasicExpand: true, // 基本信息展开
|
basicInfoList: [],
|
isForecastExpand: true, // 销售预测
|
forecastList: [],
|
isDynamicExpand: true, // 动态信息
|
dynamicInfoList: [],
|
isBusinessExpand: true, // 商机七要素
|
businessInfoList: [],
|
isSwotExpand: true, // SWOT分析
|
swotInfoList: [],
|
isAddressExpand: true, // 地址信息
|
addressInfoList: [],
|
isRemarkExpand: true, // 备注信息
|
isAnnexExpand: true, // 附件信息
|
isHistoryExpand: true, // 推进历史
|
historyList: [],
|
sale_active: 0,
|
advanceConfig: {
|
visible: false,
|
active: "",
|
allOptions: [],
|
options: []
|
},
|
addConfig: {}
|
}
|
},
|
created() {
|
this.setData(this.detailConfig.infomation)
|
this.addConfig = {
|
id_name: "sale_chance_id",
|
keywordType: "销售机会",
|
keyword: this.detailConfig.infomation.name,
|
id: this.detailConfig.infomation.id,
|
common_name: this.detailConfig.infomation.name,
|
client_name: this.detailConfig.infomation.client.name,
|
contact_name: this.detailConfig.infomation.contact_name,
|
client_id: this.detailConfig.infomation.client_id,
|
contact_id: this.detailConfig.infomation.contact_id,
|
sale_chance_name: this.detailConfig.infomation.name,
|
sale_chance_id: this.detailConfig.infomation.id
|
}
|
this.getSaleStageList().then(()=>{
|
return this.getAllData()
|
}).then((statusList)=>{
|
this.statusList =statusList
|
|
this.setData(this.detailConfig.infomation)
|
|
})
|
console.log('this.detailConfig.infomation',this.detailConfig.infomation)
|
},
|
mounted() {},
|
methods: {
|
/**
|
* 更新推进记录
|
*/
|
updatePushData(e){
|
this.sale_active = e.step - 1
|
},
|
async getSaleStageList() {
|
await getSaleStageList().then((res) => {
|
this.stepsList = res.data.list
|
res.data.list.map((item, index) => {
|
if (item.id === this.detailConfig.infomation.sale_stage_id) {
|
this.sale_active = index
|
}
|
})
|
})
|
},
|
setData(item) {
|
this.basicInfoList = [
|
{
|
leftStr: "客户名称",
|
leftValue: item.client_name,
|
rightStr: "销售机会编号",
|
rightValue: item.id
|
},
|
{
|
leftStr: "机会名称",
|
leftValue: item.name,
|
rightStr: "联系人姓名",
|
rightValue: item.contact_name
|
},
|
{
|
leftStr: "商机来源",
|
leftValue: item.sales_sources.name,
|
rightStr: "商机类型",
|
rightValue: item.sale_type.name
|
},
|
{
|
leftStr: "销售阶段",
|
leftValue: item.sale_stage_name,
|
rightStr: "销售负责人",
|
rightValue: item.member.username
|
},
|
{
|
leftStr: "老客户营销",
|
leftValue: item.regular_customers.name,
|
rightStr: "审批状态",
|
rightValue: ""
|
},
|
{
|
leftStr: "竞争对手",
|
leftValue: item.competitors,
|
rightStr: "创建人",
|
rightValue: ""
|
},
|
{
|
leftStr: "创建时间",
|
leftValue: "",
|
rightStr: "",
|
rightValue: ""
|
}
|
]
|
this.forecastList = [
|
{
|
leftStr: "可能性(%)",
|
leftValue: item.possibility.name,
|
rightStr: "币种",
|
rightValue: "人民币"
|
},
|
{
|
leftStr: "预算绝对值",
|
leftValue: item.capital_budget,
|
rightStr: "预计成交日期",
|
rightValue: item.expected_time
|
},
|
{
|
leftStr: "预计合同金额",
|
leftValue: item.projected_amount,
|
rightStr: "当前状态",
|
rightValue: this.statusList.find(ele=>ele.id === item.status_id)?.name ?? ''
|
}
|
]
|
this.dynamicInfoList = [
|
{
|
leftStr: "未联系天数",
|
leftValue: "",
|
rightStr: "最新联系日期",
|
rightValue: ""
|
},
|
{
|
leftStr: "未推荐天数",
|
leftValue: "",
|
rightStr: "最新推进时间",
|
rightValue: ""
|
},
|
{
|
leftStr: "最新联系人",
|
leftValue: "",
|
rightStr: "最新更新时间",
|
rightValue: ""
|
}
|
]
|
this.businessInfoList = [
|
{
|
leftStr: "客户需求或痛点(why)",
|
leftValue: item.pain_points
|
},
|
{
|
leftStr: "是否已经立项(plan)",
|
leftValue: item.whether_established
|
},
|
{
|
leftStr: "资金预算是多少(plan)",
|
leftValue: item.capital_budget
|
},
|
{
|
leftStr: "关键决策人是谁(who)",
|
leftValue: item.key_maker
|
},
|
{
|
leftStr: "关键决策因素有哪些(what)",
|
leftValue: item.key_factors
|
},
|
{
|
leftStr: "决策流程是怎样的(what)",
|
leftValue: item.process
|
},
|
{
|
leftStr: "竞争对手提供的方案(what)",
|
leftValue: item.solutions
|
}
|
]
|
this.swotInfoList = [
|
{
|
leftStr: "优势(S)",
|
leftValue: item.advantages,
|
rightStr: "劣势(W)",
|
rightValue: item.disadvantages
|
},
|
{
|
leftStr: "机会(O)",
|
leftValue: item.opportunities,
|
rightStr: "威胁(T)",
|
rightValue: item.threats
|
}
|
]
|
this.addressInfoList = [
|
{
|
leftStr: "国家",
|
leftValue: "中国",
|
rightStr: "省份",
|
rightValue: item.Province.name
|
},
|
{
|
leftStr: "城市",
|
leftValue: item.City.name,
|
rightStr: "",
|
rightValue: ""
|
},
|
{
|
leftStr: "详细地址",
|
leftValue: "",
|
rightStr: "",
|
rightValue: ""
|
}
|
]
|
this.historyList = [
|
{
|
date: "2023-08-04 13:22:36",
|
stage: "成功结案",
|
modify: "系统管理员"
|
},
|
{
|
date: "2023-08-04 13:22:36",
|
stage: "成功结案",
|
modify: "系统管理员"
|
}
|
]
|
},
|
handleClose() {
|
this.detailConfig.visible = false
|
this.$parent.getData()
|
},
|
// tab切换
|
tabsClick(tab, event) {
|
console.log(tab, event)
|
},
|
// 展开收起点击事件
|
expandClick(value) {
|
console.log(value)
|
if (value === "schdule") {
|
this.isSchduleExpand = !this.isSchduleExpand
|
} else if (value === "basic") {
|
this.isBasicExpand = !this.isBasicExpand
|
} else if (value === "forecast") {
|
this.isForecastExpand = !this.isForecastExpand
|
} else if (value === "dynamic") {
|
this.isDynamicExpand = !this.isDynamicExpand
|
} else if (value === "business") {
|
this.isBusinessExpand = !this.isBusinessExpand
|
} else if (value === "swot") {
|
this.isSwotExpand = !this.isSwotExpand
|
} else if (value === "address") {
|
this.isAddressExpand = !this.isAddressExpand
|
} else if (value === "remark") {
|
this.isRemarkExpand = !this.isRemarkExpand
|
} else if (value === "annex") {
|
this.isAnnexExpand = !this.isAnnexExpand
|
} else if (value === "history") {
|
this.isHistoryExpand = !this.isHistoryExpand
|
}
|
},
|
// 推进
|
advanceClick(item) {
|
let options = []
|
for (let i = 0; i < this.stepsList.length; i++) {
|
options.push(this.stepsList[i])
|
}
|
this.advanceConfig = {
|
visible: true,
|
active: item.id,
|
allOptions: this.stepsList,
|
options: options,
|
id: this.detailConfig.infomation.id
|
}
|
},
|
|
getAllData(){
|
return getAllData()
|
.then((res) => {
|
return res.data.status
|
})
|
.catch((err) => {
|
console.log(err)
|
})
|
}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
::v-deep {
|
.el-drawer__header {
|
padding: 0;
|
margin-bottom: 0px;
|
.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;
|
}
|
}
|
}
|
.el-tabs--top .el-tabs__item.is-top:nth-child(2) {
|
padding-left: 20px;
|
}
|
.el-tabs__item.is-active,
|
.el-tabs__item:hover,
|
.el-tabs__active-bar {
|
color: $color-primary;
|
}
|
.el-tabs__header {
|
margin: 0;
|
}
|
.el-drawer__body {
|
.content {
|
background-color: rgb(230, 233, 240);
|
padding: 8px;
|
.tab-view {
|
background: #fff;
|
.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,
|
.all {
|
width: 50%;
|
display: flex;
|
align-items: center;
|
height: 40px;
|
.content-title {
|
width: 320px;
|
text-align: right;
|
color: #555;
|
}
|
.content-data {
|
text-align: left;
|
margin-left: 25px;
|
color: #333;
|
}
|
}
|
.all {
|
width: 100%;
|
}
|
.remark {
|
width: 100%;
|
}
|
.history {
|
.content-title {
|
width: 200px;
|
color: #8b0000;
|
}
|
.content-data {
|
color: #8b0000;
|
}
|
}
|
}
|
.step-view {
|
padding: 30px 60px 5px;
|
height: 80px;
|
.step-title-view {
|
margin-top: 10px;
|
font-size: 12px;
|
color: #555;
|
position: relative;
|
.step-label {
|
margin-top: -65px;
|
height: 60px;
|
}
|
.step-btn {
|
position: absolute;
|
bottom: -25px;
|
left: 50%;
|
margin-left: -28px;
|
width: 56px;
|
height: 24px;
|
line-height: 24px;
|
text-align: center;
|
color: #2d82f4;
|
border: 1px solid #2d82f4;
|
border-radius: 15px;
|
cursor: pointer;
|
}
|
.step-desc {
|
margin-top: 15px;
|
}
|
}
|
.el-step__head.is-process {
|
color: #ff8707;
|
border-color: #ff8707;
|
}
|
.el-step__head.is-finish .el-step__line {
|
background-color: #409eff;
|
}
|
}
|
}
|
}
|
}
|
.second {
|
background: #fff;
|
.followup-records {
|
.table-view {
|
margin-top: 0 !important;
|
margin-bottom: 0;
|
}
|
}
|
}
|
}
|
}
|
}
|
</style>
|