|
|
@@ -2,7 +2,7 @@
|
|
|
* @Author: wanglj 471442253@qq.com
|
|
|
* @Date: 2022-12-26 09:30:47
|
|
|
* @LastEditors: wanglj
|
|
|
- * @LastEditTime: 2023-01-10 15:25:50
|
|
|
+ * @LastEditTime: 2023-01-11 16:09:07
|
|
|
* @Description: file content
|
|
|
* @FilePath: \opms_frontend\src\views\customer\detail.vue
|
|
|
-->
|
|
|
@@ -16,12 +16,12 @@
|
|
|
{{ detail.custName }}
|
|
|
<span>
|
|
|
<template v-if="privateCus == 1">
|
|
|
- <el-button @click="handleShift">转移客户</el-button>
|
|
|
- <el-button @click="handleToOpen">移入公海</el-button>
|
|
|
+ <el-button v-permissions="['customer:shift']" @click="handleShift">转移客户</el-button>
|
|
|
+ <el-button v-permissions="['customer:open']" @click="handleToOpen">移入公海</el-button>
|
|
|
<el-button>创建项目</el-button>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <el-button @click="handleReceive">领取客户</el-button>
|
|
|
+ <el-button v-permissions="['customer:receive']" @click="handleReceive">领取客户</el-button>
|
|
|
<el-button v-permissions="['customer:allocate']" @click="handleAllocate">分配客户</el-button>
|
|
|
</template>
|
|
|
</span>
|
|
|
@@ -45,7 +45,7 @@
|
|
|
{{ detail.custStatus == 10 ? '正常' : '异常' }}
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item content-class-name="my-content" label="最后跟进时间" label-class-name="my-label">
|
|
|
- {{ detail.followUpDate }}
|
|
|
+ {{ parseTime(detail.followUpDate, '{y}-{m}-{d} {h}:{i}') }}
|
|
|
</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
</header>
|
|
|
@@ -108,7 +108,22 @@
|
|
|
<div v-else class="no-follow">暂无跟进记录</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="详细信息" name="detail">
|
|
|
- <el-descriptions border :column="2" size="medium">
|
|
|
+ <!-- <div class="detail-container">
|
|
|
+ <ul>
|
|
|
+ <li>客户级别</li>
|
|
|
+ <li>下次联系时间</li>
|
|
|
+ <li>所在地区</li>
|
|
|
+ <li>详细地址</li>
|
|
|
+ <li>客户级别</li>
|
|
|
+ <li>客户级别</li>
|
|
|
+ </ul>
|
|
|
+ </div> -->
|
|
|
+ <el-descriptions
|
|
|
+ border
|
|
|
+ :column="2"
|
|
|
+ :content-style="{ width: '25%', 'word-break': 'break-all' }"
|
|
|
+ :label-style="{ width: '25%' }"
|
|
|
+ size="medium">
|
|
|
<el-descriptions-item label="客户级别">
|
|
|
{{ detail.custLevel }}
|
|
|
</el-descriptions-item>
|
|
|
@@ -162,18 +177,18 @@
|
|
|
<el-tab-pane label="联系人" name="contact">
|
|
|
<vab-query-form>
|
|
|
<vab-query-form-left-panel :span="12">
|
|
|
- <el-input placeholder="请输入单据名称/编号" prefix-icon="el-icon-search" style="width: 50%" />
|
|
|
+ <el-input
|
|
|
+ v-model="cuctName"
|
|
|
+ placeholder="请输入单据名称/编号"
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
+ style="width: 50%"
|
|
|
+ @keyup.enter.native="handleClick({ name: 'contact' })" />
|
|
|
</vab-query-form-left-panel>
|
|
|
<vab-query-form-right-panel :span="12">
|
|
|
<el-button icon="el-icon-plus" @click="addContact">新建联系人</el-button>
|
|
|
</vab-query-form-right-panel>
|
|
|
</vab-query-form>
|
|
|
- <el-table
|
|
|
- v-loading="listLoading"
|
|
|
- border
|
|
|
- :data="contactList"
|
|
|
- height="calc(100% - 42px)"
|
|
|
- @selection-change="setSelectRows">
|
|
|
+ <el-table border :data="contactList" height="calc(100% - 42px)" @selection-change="setSelectRows">
|
|
|
<el-table-column align="center" type="selection" />
|
|
|
<el-table-column align="center" label="姓名" prop="cuctName" />
|
|
|
<el-table-column align="center" label="岗位" prop="postion" />
|
|
|
@@ -193,11 +208,42 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="项目记录" name="item">项目记录</el-tab-pane>
|
|
|
- <el-tab-pane label="合同记录" name="contract">合同记录</el-tab-pane>
|
|
|
+ <el-tab-pane label="项目记录" name="item">
|
|
|
+ <el-table border :data="items" height="calc(100% - 42px)">
|
|
|
+ <el-table-column align="center" label="商机标题" prop="nboName" width="120px" />
|
|
|
+ <el-table-column align="center" label="关联客户" prop="custName" width="200px" />
|
|
|
+ <el-table-column align="center" label="审批状态" prop="approStatus" width="320px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ getStatus(scope.row.approStatus) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="商机状态" prop="nboPhase" width="320px" />
|
|
|
+ <el-table-column align="center" label="商机类别" prop="nboType" width="320px" />
|
|
|
+ <el-table-column align="center" label="商机金额" prop="estTransPrice" width="320px" />
|
|
|
+ <el-table-column align="center" label="最后跟进时间" prop="finalFollowTime" width="320px" />
|
|
|
+ <el-table-column align="center" label="下次跟进时间" prop="nextFollowTime " width="320px" />
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="合同记录" name="contract">
|
|
|
+ <el-table border :data="contracts" height="calc(100% - 42px)">
|
|
|
+ <el-table-column align="center" label="合同编号" prop="contractCode" width="320px" />
|
|
|
+ <el-table-column align="center" label="合同名称" prop="contractName" width="200px" />
|
|
|
+ <el-table-column align="center" label="项目名称" prop="nboName" width="320px" />
|
|
|
+ <el-table-column align="center" label="审批状态" prop="approStatus" width="120px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ getStatus(scope.row.approStatus) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="合同类型" prop="contractType" width="120px" />
|
|
|
+ <el-table-column align="center" label="合同金额" prop="contractAmount" width="120px" />
|
|
|
+ <el-table-column align="center" label="负责人" prop="inchargeName" width="120px" />
|
|
|
+ <el-table-column align="center" label="公司签约人" prop="signatoryName" width="140px" />
|
|
|
+ <el-table-column align="center" label="经销商" prop="distributorName" width="320px" />
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
<el-tab-pane label="工单记录" name="worksheet">工单记录</el-tab-pane>
|
|
|
<el-tab-pane label="归属记录" name="belong">
|
|
|
- <el-table v-loading="listLoading" border :data="belongs" height="calc(100% - 42px)">
|
|
|
+ <el-table border :data="belongs" height="calc(100% - 42px)">
|
|
|
<el-table-column align="center" label="归属销售" prop="saleName" />
|
|
|
<el-table-column align="center" label="原来归属" prop="origSaleName" />
|
|
|
<el-table-column align="center" label="操作方式" prop="opnType">
|
|
|
@@ -210,6 +256,8 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作人" prop="createdName" />
|
|
|
<el-table-column align="center" label="操作时间" min-width="160px" prop="opnDatetime" />
|
|
|
+ <el-table-column align="center" label="开始时间" min-width="160px" prop="startDate" />
|
|
|
+ <el-table-column align="center" label="结束时间" min-width="160px" prop="endDate" />
|
|
|
<el-table-column align="center" label="备注" prop="remark" />
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
@@ -217,8 +265,9 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="buttons">
|
|
|
- <el-button type="primary" @click="handleEdit">编辑</el-button>
|
|
|
- <el-button @click="handleDelete">删除</el-button>
|
|
|
+ <el-button v-permissions="['customer:edit']" type="primary" @click="handleEdit">编辑</el-button>
|
|
|
+ <el-button v-permissions="['customer:delete']" @click="handleDelete">删除</el-button>
|
|
|
+ <el-button @click="$router.go(-1)">返回</el-button>
|
|
|
</div>
|
|
|
<ul class="records">
|
|
|
<li v-for="(value, key) in records" :key="key">
|
|
|
@@ -271,6 +320,8 @@
|
|
|
import api from '@/api/customer'
|
|
|
import follow from '@/api/customer/follow'
|
|
|
import to from 'await-to-js'
|
|
|
+ import businessApi from '@/api/proj/business'
|
|
|
+ import contractApi from '@/api/contract'
|
|
|
import Contact from './components/Contact'
|
|
|
import Edit from './components/Edit'
|
|
|
import Allocate from './components/Allocate'
|
|
|
@@ -312,12 +363,15 @@
|
|
|
drawTotal: '', //开票总额
|
|
|
},
|
|
|
activeName: 'follow',
|
|
|
- listLoading: false,
|
|
|
+ cuctName: '',
|
|
|
contactList: [],
|
|
|
selectRows: [],
|
|
|
records: [], //操作记录
|
|
|
followList: [], //跟进记录
|
|
|
belongs: [],
|
|
|
+ items: [], //项目
|
|
|
+ contracts: [], //合同
|
|
|
+ appro: [],
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -335,12 +389,19 @@
|
|
|
},
|
|
|
methods: {
|
|
|
async init() {
|
|
|
- Promise.all([api.getDetail({ ids: [parseInt(this.id)] }), api.getAbstract({ id: parseInt(this.id) })]).then(
|
|
|
- ([detail, abstract]) => {
|
|
|
- if (detail.data.list[0]) this.detail = detail.data.list[0]
|
|
|
- if (abstract.data.list) this.abstract = abstract.data.list
|
|
|
- }
|
|
|
- )
|
|
|
+ Promise.all([
|
|
|
+ api.getDetail({ ids: [parseInt(this.id)] }),
|
|
|
+ api.getAbstract({ id: parseInt(this.id) }),
|
|
|
+ this.getDicts('proj_appro_status'),
|
|
|
+ ]).then(([detail, abstract, appro]) => {
|
|
|
+ if (detail.data.list[0]) this.detail = detail.data.list[0]
|
|
|
+ if (abstract.data.list) this.abstract = abstract.data.list
|
|
|
+ this.appro = appro.data.values || []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getStatus(val) {
|
|
|
+ const obj = this.appro.find((item) => item.key == val)
|
|
|
+ if (obj) return obj.value
|
|
|
},
|
|
|
async getDynamics() {
|
|
|
const [err, res] = await to(api.dynamicsList({ custId: parseInt(this.id) }))
|
|
|
@@ -361,7 +422,7 @@
|
|
|
async handleClick(tab) {
|
|
|
let err, res
|
|
|
if (tab.name == 'contact') {
|
|
|
- ;[err, res] = await to(api.getContact({ custId: parseInt(this.id) }))
|
|
|
+ ;[err, res] = await to(api.getContact({ custId: parseInt(this.id), cuctName: this.cuctName }))
|
|
|
if (err) return
|
|
|
this.contactList = res.data.list || []
|
|
|
} else if (tab.name == 'follow') {
|
|
|
@@ -372,10 +433,17 @@
|
|
|
;[err, res] = await to(follow.getListByDay(params))
|
|
|
if (err) return
|
|
|
this.followList = res.data.list || []
|
|
|
- } else if (tab.name == 'belong' && this.belongs.length == 0) {
|
|
|
+ } else if (tab.name == 'belong') {
|
|
|
;[err, res] = await to(api.getBelongs({ custId: parseInt(this.id) }))
|
|
|
if (err) return
|
|
|
this.belongs = res.data.list || []
|
|
|
+ } else if (tab.name == 'item') {
|
|
|
+ ;[err, res] = await to(businessApi.getList({ custName: this.detail.custName }))
|
|
|
+ if (err) return
|
|
|
+ this.items = res.data.list || []
|
|
|
+ } else if (tab.name == 'contract') {
|
|
|
+ ;[err, res] = await to(contractApi.getList({ custId: parseInt(this.id) }))
|
|
|
+ this.contracts = res.data.list || []
|
|
|
}
|
|
|
},
|
|
|
// 添加联系人
|
|
|
@@ -522,6 +590,7 @@
|
|
|
padding: 20px 40px;
|
|
|
> .el-row {
|
|
|
flex: 1;
|
|
|
+ width: 100%;
|
|
|
|
|
|
> .el-col {
|
|
|
height: 100%;
|
|
|
@@ -585,6 +654,12 @@
|
|
|
|
|
|
.el-tab-pane {
|
|
|
height: 100%;
|
|
|
+ .el-descriptions {
|
|
|
+ table-layout: fixed;
|
|
|
+ .is-bordered {
|
|
|
+ table-layout: fixed;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -814,11 +889,4 @@
|
|
|
.height-enter, .height-leave-to /* .fade-leave-active below version 2.1.8 */ {
|
|
|
height: 0;
|
|
|
}
|
|
|
-
|
|
|
- ::v-deep .el-descriptions__table tbody {
|
|
|
- td,
|
|
|
- th {
|
|
|
- width: 25%;
|
|
|
- }
|
|
|
- }
|
|
|
</style>
|