Commit 51416852 authored by 邓春圆's avatar 邓春圆

客户id丢失

parent 539f8eaf
...@@ -612,15 +612,17 @@ export default { ...@@ -612,15 +612,17 @@ export default {
if(this.form.lightUnit){ if(this.form.lightUnit){
this.showPao = true this.showPao = true
} }
// 获取重泡货路线 if(customerId){
getCustomerLines(customerId).then(res => { // 获取重泡货路线
this.zhongLines = res.data.filter(item => item.zhongPaoType == 1) getCustomerLines(customerId).then(res => {
this.paoLines = res.data.filter(item => item.zhongPaoType == 2) this.zhongLines = res.data.filter(item => item.zhongPaoType == 1)
if(this.zhongLines.length)this.showZhong1 = true this.paoLines = res.data.filter(item => item.zhongPaoType == 2)
if(this.paoLines.length) this.showPao1 = true if(this.zhongLines.length)this.showZhong1 = true
// /admin-api/customer-line/get-by-customer if(this.paoLines.length) this.showPao1 = true
// /admin-api/customer-line/get-by-customer?customerId=29564 // /admin-api/customer-line/get-by-customer
}) // /admin-api/customer-line/get-by-customer?customerId=29564
})
}
}) })
} else { } else {
this.getZhongPao() this.getZhongPao()
......
...@@ -432,7 +432,7 @@ import MemberSelector from '@/components/MemberSelector' ...@@ -432,7 +432,7 @@ import MemberSelector from '@/components/MemberSelector'
export default { export default {
name: "editIndirect", name: "editIndirect",
props: { props: {
customerId: String, // customerId: String,
}, },
components: { components: {
Template, Template,
...@@ -445,27 +445,28 @@ export default { ...@@ -445,27 +445,28 @@ export default {
this.getCustomerSelect() this.getCustomerSelect()
this.reset() this.reset()
// this.getUserMemberUserFn() // this.getUserMemberUserFn()
if(this.$route.query.id) { if(this.$route.query && this.$route.query.id) {
// 编辑客户 // 编辑客户
this.customerId = this.$route.query.id this.customerId = this.$route.query.id
this.getCustomer(this.customerId).then(() => { this.getCustomer( this.$route.query.id).then(() => {
getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => { if(this.$route.query && this.$route.query.id){
if(r.data&&r.data.length>0){ getCustomerContactsListByCustomer({customerId: this.$route.query.id}).then(r => {
this.form.customerContacts = r.data if(r.data&&r.data.length>0){
let list = this.form.customerContacts.map(item => item.userid); this.form.customerContacts = r.data
if(list.length >0){ let list = this.form.customerContacts.map(item => item.userid);
memberUserList({ids:list.join(',')}).then(r=>{ if(list.length >0){
this.selectMemberList = r.data memberUserList({ids:list.join(',')}).then(r=>{
}) this.selectMemberList = r.data
} })
} }
if(this.form.promoter){ }
getCustomerList({ids:this.form.promoter}).then(r => { if(this.form.promoter){
this.recommended = r.data; getCustomerList({ids:this.form.promoter}).then(r => {
}) this.recommended = r.data;
} })
}) }
})
}
// 打开重泡货开关 // 打开重泡货开关
if(this.form.weightUnit){ if(this.form.weightUnit){
this.showZhong = true this.showZhong = true
...@@ -473,17 +474,18 @@ export default { ...@@ -473,17 +474,18 @@ export default {
if(this.form.lightUnit){ if(this.form.lightUnit){
this.showPao = true this.showPao = true
} }
if(this.$route.query && this.$route.query.id){
// 获取重泡货路线 // 获取重泡货路线
getCustomerLines(this.customerId).then(res => { getCustomerLines(this.$route.query.id).then(res => {
console.log({getCustomerLines: res}) console.log({getCustomerLines: res})
this.zhongLines = res.data.filter(item => item.zhongPaoType == 1) this.zhongLines = res.data.filter(item => item.zhongPaoType == 1)
this.paoLines = res.data.filter(item => item.zhongPaoType == 2) this.paoLines = res.data.filter(item => item.zhongPaoType == 2)
if(this.zhongLines.length)this.showZhong1 = true if(this.zhongLines.length)this.showZhong1 = true
if(this.paoLines.length) this.showPao1 = true if(this.paoLines.length) this.showPao1 = true
// /admin-api/customer-line/get-by-customer // /admin-api/customer-line/get-by-customer
// /admin-api/customer-line/get-by-customer?customerId=29564 // /admin-api/customer-line/get-by-customer?customerId=29564
}) })
}
}) })
} else { } else {
// 新建客户 // 新建客户
...@@ -519,6 +521,7 @@ export default { ...@@ -519,6 +521,7 @@ export default {
}, },
data(){ data(){
return { return {
customerId:'',
isCustomerServiceConfirmed:false, isCustomerServiceConfirmed:false,
getDictDatas, getDictDatas,
DICT_TYPE, DICT_TYPE,
......
...@@ -429,7 +429,7 @@ export default { ...@@ -429,7 +429,7 @@ export default {
}, },
created() { created() {
//获取信用类型 //获取信用类型
if(this.$route.query.id){ if(this.$route.query && this.$route.query.id){
this.id = this.$route.query.id this.id = this.$route.query.id
} }
getCreditRulePage({page:1,rows:999,type:2}).then(r => { getCreditRulePage({page:1,rows:999,type:2}).then(r => {
...@@ -438,24 +438,27 @@ export default { ...@@ -438,24 +438,27 @@ export default {
getNodeList().then(r => { getNodeList().then(r => {
this.nodeList = r.data this.nodeList = r.data
}) })
getCustomer(this.id).then(response => { if(this.$route.query && this.id){
this.customer = { ...this.customer, ...response.data } getCustomer(this.id).then(response => {
console.log(this.id) this.customer = { ...this.customer, ...response.data }
getCustomerContactsListByCustomer({customerId: this.id}).then(r => { if(this.$route.query && this.$route.query.id){
if(r.data&&r.data.length>0){ getCustomerContactsListByCustomer({customerId: this.$route.query.id}).then(r => {
this.customerContacts = r.data if(r.data&&r.data.length>0){
let list = this.customerContacts.map(r => r.userid) this.customerContacts = r.data
memberUserList({ids:list.join(',')}).then(r => { let list = this.customerContacts.map(r => r.userid)
this.memberList = r.data memberUserList({ids:list.join(',')}).then(r => {
}) this.memberList = r.data
} })
}
}) })
}
getCountry(this.customer.country ? this.customer.country : 0 ).then(r => { getCountry(this.customer.country ? this.customer.country : 0 ).then(r => {
this.country = r.data?r.data.nameZh:'' this.country = r.data?r.data.nameZh:''
})
}) })
}) }
getProductTypeList().then(r => { getProductTypeList().then(r => {
this.productTypeList = r.data this.productTypeList = r.data
}) })
...@@ -479,6 +482,7 @@ export default { ...@@ -479,6 +482,7 @@ export default {
}, },
data() { data() {
return { return {
customerId:'',
STATUS:{ STATUS:{
0:this.$t('取消报价'), 0:this.$t('取消报价'),
1:this.$t('特价审批中'), 1:this.$t('特价审批中'),
...@@ -597,9 +601,9 @@ export default { ...@@ -597,9 +601,9 @@ export default {
customerService() { customerService() {
return this.serviceUserList.find(e => e.id === this.customer.customerService)?.nickname || '' return this.serviceUserList.find(e => e.id === this.customer.customerService)?.nickname || ''
}, },
id() { // id() {
return this.customerId ? parseInt(this.customerId) : undefined // return this.customerId ? parseInt(this.customerId) : undefined
}, // },
creditScoreCalculation(){ creditScoreCalculation(){
return (val)=>{ return (val)=>{
if(val === 'all'){ if(val === 'all'){
......
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