Commit 59042b75 authored by dragondean@qq.com's avatar dragondean@qq.com

Merge remote-tracking branch 'origin/dev' into dev

parents 85be7758 df908536
import request from '@/utils/request'
import query from "@/views/ecw/customer/query";
import * as url from "url";
import {methods} from "vue2-ace-editor";
// 创建客户
export function createCustomer(data) {
......@@ -26,7 +27,14 @@ export function updateCustomer(data) {
data: data
})
}
// 新建潜在客户
export function createPotential(data){
return request({
url:'/ecw/customer/create-potential',
method:'post',
data
})
}
// 删除客户
export function deleteCustomer(id) {
return request({
......@@ -72,6 +80,14 @@ export function getCustomerSelect(query) {
params: query
})
}
// 潜在客户
export function getPotential(query){
return request({
url:'/ecw/customer/get-potential',
method:'get',
params:query
})
}
// 根据客户id集合获得客户详情列表
export function getCustomerList(query) {
......@@ -381,6 +397,14 @@ export function changeCustomerAir(data){
})
}
// 设置整柜
export function setChangeCustomerFcl(data){
return request({
url:'/ecw/customer/change-customer-fcl',
method:'put',
data
})
}
//获得客户日志
export function getCustomerOperatelogPage(params){
return request({
......
......@@ -59,7 +59,7 @@
<el-table-column :label="$t('发布人') + '/' + $t('发布时间')" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<div>{{ scope.row.creatorName }}</div>
<div>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</div>
<div>{{ parseTime(scope.row.createTime) }}</div>
</template>
</el-table-column>
<el-table-column :label="$t('开始时间')" align="center" prop="startTime" width="180">
......@@ -73,7 +73,7 @@
<div v-if="row.overdueStatus == 0" style="color: red">{{ $t('已过期') }}</div>
</template>
</el-table-column>
<!--
<!--
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
......@@ -82,7 +82,7 @@
<el-table-column :label="$t('更新人') + '/' + $t('更新时间')" align="center" width="180">
<template slot-scope="scope">
<div>{{ scope.row.updaterName }}</div>
<div>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</div>
<div>{{ parseTime(scope.row.updateTime)}}</div>
</template>
</el-table-column>
<el-table-column :label="$t('状态')" align="center" prop="createTime" width="180">
......@@ -108,7 +108,7 @@
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<el-dialog :title="$t('延期活动时间')" :visible="!!updateEndtimeItem" :before-close="() => updateEndtimeItem=null">
<div v-if="updateEndtimeItem">
{{$t('优惠活动“{name}”的当前结束时间:{time}',{
......@@ -312,4 +312,4 @@ export default {
}
}
};
</script>
\ No newline at end of file
</script>
<template>
<div>
<el-dialog title="新建客户信息" :visible.sync="dialogTableVisible">
<el-form ref="form" :rules="rules" :model="form" label-width="100px" style="padding: 0 20px;">
<el-form-item prop="name" label="客户姓名">
<el-input v-model="form.name" placeholder="placeholder"></el-input>
</el-form-item>
<el-form-item required label="联系方式" >
<el-row :gutter="20">
<el-col :span="4" >
<el-form-item prop="customerContacts[0].areaCode" >
<area-code-selector v-model="form.customerContacts['0'].areaCode" />
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item prop="customerContacts[0].phoneNew">
<el-input style="width:100%;" v-model="form.customerContacts[0].phoneNew" maxlength="11" :placeholder="$t('请输入联系方式')" />
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-form-item prop="source" label="客户来源">
<el-select v-model="form.source" :placeholder="$t('请选择客户来源')">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
<el-form-item label="客户类别" prop="type" >
<dict-selector v-model="form.type" :type="DICT_TYPE.CUSTOMER_TYPE" form-type="checkbox" multiple ></dict-selector>
</el-form-item>
<el-form-item label="客户经理" >
<el-select v-model="form.customerService" :placeholder="$t('请选择客户经理')">
<el-option v-for="item in serviceUserList"
:key="item.id" :label="item.nickname" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="公司名称">
<el-input v-model="form.company" ></el-input>
</el-form-item>
<el-form-item label="公司英文名称">
<el-input v-model="form.companyEn" ></el-input>
</el-form-item>
<el-form-item :label="$t('主营类别')" prop="productType">
<el-row :gutter="10">
<el-col :span="11">
<el-select v-model="form.productType" style="width: 100%" @change="getProductListFn" :placeholder="$t('请选择产品类别')" >
<el-option :label="item.titleZh" :value="item.id" v-for="(item) in productTypeList" :key="item.id"/>
</el-select>
</el-col>
<el-col :span="11">
<el-select v-model="form.productId" style="width: 100%" :placeholder="$t('请选择')">
<el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="(item) in productList" :key="item.id"/>
</el-select>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="询盘信息" >
<el-input
v-model="form.inquiry"
type="textarea"
:rows="3"
placeholder="请输入内容">
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogTableVisible = false">取 消</el-button>
<el-button type="primary" @click="submit">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import {listServiceUser} from "@/api/system/user";
import {getProductTypeList} from "@/api/ecw/productType";
import {getProductList} from "@/api/ecw/product";
import {createPotential} from "@/api/ecw/customer";
export default {
name: "addPotentialCustom",
methods: {
getDictDatas,
getProductListFn(val){
getProductList({typeId:val}).then(r => {
this.productList = r.data
})
},
reset(){
this.form = {
name:undefined,
customerContacts:[{areaCode:undefined,phoneNew:undefined,name:undefined,isDefault: 1}],
source:undefined,
type:[],
customerService:undefined,
company:undefined,
companyEn:undefined,
inquiry:undefined,
productType:undefined,
productId:undefined,
}
},
submit(){
this.$refs.form.validate((valId)=>{
if (valId){
let p = {...this.form}
p.type = p.type.join(',')
p.customerContacts[0].name = p.name + p.customerContacts[0].phoneNew
createPotential(p).then(r => {
if(r.code === 0){
this.$emit('change');
this.dialogTableVisible = false;
this.$message('创建成功');
}
})
}
})
},
},
components: {AreaCodeSelector},
created() {
this.reset()
listServiceUser().then(r => {
this.serviceUserList = r.data
})
getProductTypeList().then(r => {
this.productTypeList = r.data
})
},
computed: {
DICT_TYPE() {
return DICT_TYPE
},
rules(){
return {
name:{ required:true,message:'请输入名称',target:'blur' },
customerContacts:[{areaCode:{required:true,message:'请输入区号。',target:'blur'},phoneNew:{required:true,message:'请输入电话号码。',target:'blur'} },],
type:{ type:'array', message:'请输入客户类别。', required:true, target:['blur','change']},
source:{message:'前请输入客户来源',required:true,target:'change',type:'number'}
}
}
},
data(){
return {
dialogTableVisible:false,
serviceUserList:[],
productTypeList:[],
productList:[],
form:{}
}
},
}
</script>
<style scoped>
</style>
<template>
<div style="display: inline-block">
<span @click="visible = true"> <slot></slot></span>
<el-dialog title="更多联系人" :visible.sync="visible">
<div v-if="info">
<div style="text-align: center;margin-bottom: 20px;" v-for="(item, index) in info" :key="index">
联系人{{index + 1}}{{$l('name', item)}}联系方式{{index + 1}}:+{{item.areaCode}} {{item.phoneNew}}<br/>
邮箱:{{item.email}}
</div>
</div>
<div v-else>
暂无数据
</div>
</el-dialog>
</div>
</template>
<script>
import {getCustomerContacts, getCustomerContactsListByCustomer} from "@/api/ecw/customerContacts";
export default {
name: "contacts",
props:{
id:[Number]
},
data(){
return {
visible:false,
info:null,
}
},
methods:{
getCustomerContactsFn() {
getCustomerContactsListByCustomer({customerId: this.id}).then(r => {
console.log(r,'rrr')
this.info = r.data
})
}
},
watch:{
visible(val){
if(val){
this.getCustomerContactsFn()
}
}
}
}
</script>
<style scoped>
</style>
......@@ -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 => {
......
......@@ -60,7 +60,7 @@
<!-- </el-form-item>-->
<el-form-item :label="$t('常用提货网点')" prop="remarks">
<el-select v-model="form.pickupPoint">
<el-option v-for="item in serviceNetworkList " :value="item.id" :label="isChinese ? item.titleZh : item.titleEn "></el-option>
<el-option v-for="item in getNodeLists " :value="item.id" :label="isChinese ? item.titleZh : item.titleEn "></el-option>
</el-select>
</el-form-item>
</el-col>
......@@ -98,13 +98,13 @@
<el-form-item :label="$t('主营类别')" prop="productType">
<el-row :gutter="10">
<el-col :span="11">
<el-select v-model="form.productType" :placeholder="$t('请选择产品类别')" @change="form.productId = ''">
<el-select @change="change" v-model="form.productType" :placeholder="$t('请选择产品类别')">
<el-option :label="item.titleZh" :value="item.id" v-for="(item) in productTypeList" :key="item.id"/>
</el-select>
</el-col>
<el-col :span="11">
<el-select v-model="form.productId" :placeholder="$t('请选择')">
<el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="(item) in productListFilter" :key="item.id"/>
<el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="(item) in productList" :key="item.id"/>
</el-select>
</el-col>
</el-row>
......@@ -193,7 +193,11 @@
<el-switch v-model="form.isShowTidanPrice"></el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('询盘信息')">
<el-input show-word-limit v-model="form.inquiry" :rows="3" type="textarea" :maxlength="500"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('到仓确认')" prop="arrivalConfirm">
<el-switch v-model="form.arrivalConfirm" :active-value="1" :inactive-value="0" />
......@@ -358,12 +362,17 @@
</template>
</el-table-column>
<el-table-column
width="260px"
prop="email"
:label="$t('邮箱')"
>
<template v-slot="{row}">
<el-form-item label="">
<el-input v-model="row.email" :placeholder="$t('请输入邮箱')" size="mini"/>
<el-form-item v-for="(item, index) in row.email" :key="index" label="">
<div style="display: flex;align-items: center;">
<el-input v-model="row.email[index]" :placeholder="$t('请输入邮箱')" size="mini"/>
<el-button @click="deleteEmail(row.email,index)" v-if="row.email.length !== 1" style="height:25px;margin-left: 5px" type="danger" size="mini">删除</el-button>
<el-button @click="addEmail(row.email)" style="height: 25px;margin-left: 5px" v-if="index === row.email.length -1 && row.email.length < 5" size="mini" type="primary">添加</el-button>
</div>
</el-form-item>
</template>
</el-table-column>
......@@ -592,19 +601,19 @@ export default {
this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({customerId: customerId}).then(r => {
this.form.customerContacts = r.data
let list = this.form.customerContacts.map(item => item.userid);
if(list.length >0){
memberUserList({ids:list.join(',')}).then(r=>{
this.selectMemberList = r.data
})
}
if(this.form.promoter){
getCustomerList({ids:this.form.promoter}).then(r => {
this.recommended = r.data;
})
}
this.form.customerContacts.forEach(item => {
if(item.email){
item.email = item.email.split(',')
}else {
item.email = [""]
}
})
})
if(this.form.promoter){
getCustomerList({ids:this.form.promoter}).then(r => {
this.recommended = r.data;
})
}
// 打开重泡货开关
if(this.form.weightUnit){
this.showZhong = true
......@@ -634,14 +643,12 @@ export default {
}
getNodeList().then(r => {
this.nodeList = r.data
this.getNodeLists = r.data
})
getProductTypeList().then(r => {
this.productTypeList = r.data
})
getProductList().then(r => {
this.productList = r.data
})
getTradeCityList({type: 1}).then(r => {
this.importCityList = r.data.filter(item => item.type === '1')
})
......@@ -657,13 +664,10 @@ export default {
getCountryListAll().then(r => {
this.countryList = r.data
})
// 获取服务网点
getServiceNetwork().then(r =>{
this.serviceNetworkList = r.data
})
},
data(){
return {
getNodeLists:[],
isCustomerServiceConfirmed:false,
getDictDatas,
DICT_TYPE,
......@@ -718,6 +722,21 @@ export default {
},
methods: {
addEmail(row){
row.push('')
},
deleteEmail(row, index){
row.splice(index, 1)
},
change(val){
this.form.productId = '';
this.getProductListFn(val);
},
getProductListFn(val){
getProductList({typeId:val}).then(r => {
this.productList = r.data
})
},
deleteBankData(index){
this.form.customerBanks.splice(index, 1);
},
......@@ -842,7 +861,10 @@ export default {
}
this.updateCustomerLines()
const form = {...this.form, type: this.form.type?.join(','), transportType: (this.form.transportType || [])?.join(','), taxRate: Number(this.form.taxRate)}
form.customerContacts = JSON.parse(JSON.stringify(this.form.customerContacts))
form.customerContacts.forEach(e =>{
e.email = [...e.email].join(',')
})
// 检查路线是否启用了但是没选择目的仓
let errors = 0
form.customerLines.forEach(line => {
......@@ -896,6 +918,7 @@ export default {
/** 表单重置 */
reset() {
this.form = {
inquiry:undefined,
id: undefined,
number: undefined,
name: undefined,
......@@ -949,6 +972,11 @@ export default {
return getCustomer(id).then(response => {
console.log(response,'response')
this.form = { ...this.form, ...response.data, id: this.customerId,transportType: response.data.transportType && response.data.transportType !== '' ? response.data.transportType.split(',') : [],customerBanks:response.data.customerBankBackVOList };
if(this.form.productType){
console.log('1231',this.form.productType)
this.getProductListFn(this.form.productType)
}
this.open = true;
this.title = this.$t('修改客户');
this.getZhongPao()
......@@ -969,7 +997,7 @@ export default {
"areaCode": "",
// "customerId": 0,q
"department": "",
"email": "",
"email": [''],
"isDefault": this.form.customerContacts.length === 0 ? 1 : 0,
"name": "",
"phoneNew": "",
......
......@@ -68,7 +68,8 @@
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
<el-button v-if="path === '/customer/potential'" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddPotential">{{$t('新增潜在客户')}}</el-button>
<el-button v-else type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="[ selectAuthorityFn('ecw:customer:create')]">{{$t('新增')}}</el-button>
</el-col>
<el-col :span="1.5" >
......@@ -87,6 +88,13 @@
<el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(false)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"
v-hasPermi="['ecw:customer:transport']">{{$t('设为非空运客户')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button :disabled="!selectCustomerList.length" @click="setFullContainerLoad(true)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading">{{$t('设置海运整柜客户')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button :disabled="!selectCustomerList.length" @click="setFullContainerLoad(false)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"
>{{$t('设置海运非整柜客户')}}</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
......@@ -124,7 +132,10 @@
<el-table-column :label="$t('主联系人')" prop="defaultContactName"></el-table-column>
<el-table-column :label="$t('主联系方式')" prop="defaultContactPhone">
<template v-slot="{row}">
+{{row.defaultContactPhone}}
+{{row.defaultContactPhone}} <br/>
<contacts :id="row.id" >
<el-button type="text">更多</el-button>
</contacts>
</template>
</el-table-column>
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
......@@ -512,13 +523,24 @@
<customer-follow-list :customer-id="customerId" :id="customerId" ref="CustomerFollowList"></customer-follow-list>
<customer-complaints :customer-id="customerId" ref="customerComplaints"></customer-complaints>
<transfer-customer :show.sync="transferShow" :customer-ids.sync="selectCustomerList"></transfer-customer>
<add-potential-custom ref="potentialCustom" @change="getList" ></add-potential-custom>
</div>
</template>
<script>
import {
createCustomer, updateCustomer, deleteCustomer, getCustomer,
getCustomerPage, exportCustomerExcel, testEnterToOpenSea, getCustomerDeptPage, changeCustomerAir
createCustomer,
updateCustomer,
deleteCustomer,
getCustomer,
getCustomerPage,
exportCustomerExcel,
testEnterToOpenSea,
getCustomerDeptPage,
changeCustomerAir,
getPotential,
setChangeCustomerFcl
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants'
......@@ -533,10 +555,14 @@ import { getCountryListAll } from '@/api/ecw/country'
import {getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer";
import Template from "@/views/cms/template/index.vue";
import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
export default {
name: "EcwCustomerIndex",
components: {
Contacts,
AddPotentialCustom,
Template,
upload,
CustomerFollowList,
......@@ -604,6 +630,9 @@ export default {
};
},
computed:{
path(){
return this.$route.path
},
channel(){
return (val)=>{
return !!val ? this.getDictDatas(this.DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE).filter(i => (val.split(',') || []).includes(i.value)).map(i => this.isChinese ? i.label : i.labelEn ).join('') :''
......@@ -642,9 +671,6 @@ export default {
this.creditList = r.data.list
})
this.getList();
// getNodeList().then(r => {
// this.nodeList = r.data
// })
listServiceUser().then(r=>{
this.customerServiceList = r.data;
})
......@@ -656,6 +682,19 @@ export default {
this.getList();
},
methods: {
// 设置整柜
setFullContainerLoad(isFcl){
setChangeCustomerFcl({
"customerIdList": this.selectCustomerList,
isFcl
}).then(r =>{
if(r.code === 0){
this.$message.success(isFcl ? '设置客户为海运整柜成功!' : '设置客户为非海运整柜成功!')
this.selectCustomerList = []
this.getList()
}
})
},
// 设置空运客户
setChangeCustomerAir(isAir){
changeCustomerAir({
......@@ -709,6 +748,9 @@ export default {
case '/customer/department-customers':
getCustomerDeptPage(params).then(this.setData);
break;
case '/customer/potential':
getPotential(params).then(this.setData)
break;
}
},
......@@ -719,6 +761,10 @@ export default {
// this.open = true;
// this.title = this.$t("添加客户");
},
// 新增潜在客户
handleAddPotential(){
this.$refs.potentialCustom.dialogTableVisible = true;
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
......
......@@ -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(customer,'countryName')}}{{customer.countryName}}</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('状态')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_STATUS, customer.status)}}</el-descriptions-item>
<el-descriptions-item :label="$t('主营类别')">{{ $l(customer,'productTypeName') }}</el-descriptions-item>
<el-descriptions-item :label="$t('常提货网点')">{{ $l(customer,'pickupPointName') }}</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