Commit 699e01d1 authored by 邓春圆's avatar 邓春圆

客户详情页面优化

parent 4f53836b
......@@ -29,7 +29,7 @@ export default {
},
computed:{
getCustomerList(){
let index = this.customerList.findIndex(item => item.id !== this.recommended[0])
let index = this.customerList.findIndex(item => item.id === this.recommended[0]?.id)
if(index > -1) return this.customerList
else return [...this.customerList,...this.recommended]
}
......@@ -50,7 +50,6 @@ export default {
},
watch:{
value(val){
console.log(val,'val')
this.customer = val;
if(!(this.customerList.some(i => i.id === val)) && val !== undefined){
getCustomerList({ids:val}).then(r => {
......
......@@ -29,7 +29,7 @@
<el-descriptions-item :label="$t('客户等级')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_LEVEL, customer.level) }}</el-descriptions-item>
<el-descriptions-item :label="$t('信用等级')">{{isChinese ? customer.creditLevelNameZh :customer.creditLevelNameEn }}</el-descriptions-item>
<el-descriptions-item :label="$t('国家')">{{ isChinese ? country.nameZh : country.nameEn }}</el-descriptions-item>
<el-descriptions-item :label="$t('国家')">{{$l('countryName',customer)}}</el-descriptions-item>
<!-- <el-descriptions-item :label="$t('业务员')">{{ customer }}</el-descriptions-item>-->
<el-descriptions-item :label="$t('客户来源')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_SOURCE, customer.source) }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户类别')">
......@@ -37,15 +37,15 @@
</el-descriptions-item>
<!-- <el-descriptions-item :label="$t('联系方式')">{{ customer }}</el-descriptions-item>-->
<el-descriptions-item :label="$t('推介人')">{{ customer.promoterName }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户经理')">{{customerService }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户经理')">{{customer.customerServiceName }}</el-descriptions-item>
<el-descriptions-item :label="$t('公司名称')">{{ customer.company }}</el-descriptions-item>
<el-descriptions-item :label="$t('公司英文名称')">{{ customer.companyEn }}</el-descriptions-item>
<el-descriptions-item :label="$t('联系地址')">{{ customer.address }}</el-descriptions-item>
<el-descriptions-item :label="$t('创建时间')">{{ parseTime(customer.createTime) }}</el-descriptions-item>
<el-descriptions-item :label="$t('创建人')">{{ customer.founderName }}</el-descriptions-item>
<el-descriptions-item :label="$t('状态')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_STATUS, customer.status) }}</el-descriptions-item>
<el-descriptions-item :label="$t('主营类别')">{{ productType }}</el-descriptions-item>
<el-descriptions-item :label="$t('常提货网点')">{{ pickupPoint }}</el-descriptions-item>
<el-descriptions-item :label="$t('主营类别')">{{ $l('productTypeName', customer) }}</el-descriptions-item>
<el-descriptions-item :label="$t('常提货网点')">{{ $l('pickupPointName',customer) }}</el-descriptions-item>
<el-descriptions-item :label="$t('图片')">
<el-image v-show="!!customer.picture" :src="customer.picture" style="width: 100px;height: 100px"></el-image>
</el-descriptions-item>
......@@ -303,10 +303,10 @@
<pagination @pagination="getInfoListOfferPage" :page.sync="infoListOfferFrom.pageNo" :limit.sync="infoListOfferFrom.pageSize" :total="infoListOfferTotal" ></pagination>
</el-tab-pane>
<el-tab-pane name="follow" :label="$t('跟进')">
<customer-follow customerQuery ref="customerFollow" :id="id" :customer-id="id"></customer-follow>
<customer-follow v-if="activeName === 'follow'" customerQuery ref="customerFollow" :id="id" :customer-id="id"></customer-follow>
</el-tab-pane>
<el-tab-pane name="complain" :label="$t('客户投诉')">
<customer-complaint ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint>
<customer-complaint v-if="activeName === 'complain'" ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint>
</el-tab-pane>
<el-tab-pane name="bill" :label="$t('账单')">
<el-table style="width: 100%" :data="infoListReceiptList">
......@@ -529,38 +529,31 @@ export default {
getCreditRulePage({page:1,rows:999,type:2}).then(r => {
this.creditTypeList = r.data.list
})
getNodeList().then(r => {
this.nodeList = r.data
})
// getNodeList().then(r => {
// this.nodeList = r.data
// })
getCustomer(this.id).then(response => {
this.customer = { ...this.customer, ...response.data }
console.log( this.customer,'this.customer')
getCustomerContactsListByCustomer({customerId: this.id}).then(r => {
this.customerContacts = r.data
let list = this.customerContacts.map(r => r.userid)
memberUserList({ids:list.join(',')}).then(r => {
this.memberList = r.data
})
let list = this.customerContacts.filter(r => r.userid)
if(list.length > 0){
memberUserList({ids:list.map(i=>i.userid).join(',')}).then(r => {
this.memberList = r.data
})
}
})
getCountry(this.customer.country ? this.customer.country : 0 ).then(r => {
this.country = r.data
})
})
getProductTypeList().then(r => {
this.productTypeList = r.data
})
getCustomerSelect({pageSize:1000,pageNo:1}).then(r => {
this.customerSelect = r.data.list
})
// getCustomerSelect({pageSize:1000,pageNo:1}).then(r => {
// this.customerSelect = r.data.list
// })
listServiceUser().then(r => {
this.serviceUserList = r.data
})
// this.getBrankByCustomerList()//品牌授权
this.getCustomerGrade()
// this.getCustomerGrade()
// this.creditLogPage()//等级日志
this.getorderList()//订单
// this.getInfoListOfferPage()//报价
......@@ -716,22 +709,16 @@ export default {
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
productType(){
const productType = this.productTypeList.find(p => p.id === parseInt(this.customer.productType))
return productType ? productType.titleZh : ''
},
pickupPoint(){
const pickupPoint = this.nodeList.find(p => p.id === parseInt(this.customer.pickupPoint))
return pickupPoint ? pickupPoint.titleZh : ''
},
promoter() {
return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || ''
},
customerService() {
return this.serviceUserList.find(e => e.id === this.customer.customerService)?.nickname || ''
},
// promoter() {
// return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || ''
// },
id() {
return this.customerId ? parseInt(this.customerId) : undefined
return parseInt(this.$route.params.customerId)
},
creditScoreCalculation(){
return (val)=>{
......
......@@ -416,9 +416,13 @@ export default {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
getCustomerList({ids:this.list.map(i => i.customerId).join(',')}).then(r => {
this.customerSelect = r.data
})
let list = []
list = this.list.filter(i => i.customerId)
if(list.length > 0){
getCustomerList({ids:list.map(i => i.customerId).join(',')}).then(r => {
this.customerSelect = r.data
})
}
});
},
/** 取消按钮 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment