Commit 55717174 authored by zhengyi's avatar zhengyi

客户跳转新增报价bug修复

parent 58c674ff
......@@ -1088,13 +1088,19 @@ export default {
},
activated() {
if (this.$route.query.id && this.form.offerId !== this.$route.query.id) {
console.log("编辑报价单跳转")
// if (this.$route.query.id) {
this.getOffer()
}
if (this.$route.query.copyId && this.form.copyId !== this.$route.query.copyId) {
console.log("copy报价单跳转")
// if (this.$route.query.copyId) {
this.getOffer()
}
if (this.$route.query.type && this.$route.query.type === 1) {
console.log("客户页面跳转")
this.getCustomerContactsListByCustomer()
}
},
async created() {
await this.getChannelList()
......@@ -1108,28 +1114,17 @@ export default {
competitorListAll().then((res) => (this.competitorList = res.data))
if (this.$route.query.id || this.$route.query.copyId) {
console.log("编辑或复制报价单转进")
this.getOffer()
} else {
} else if (this.$route.query.type && this.$route.query.type == 1) {
console.log("客户转进")
this.getCustomerContactsListByCustomer()
}else {
console.log("新增报价单转进")
// alert(this.$route.query.customer.defaultContactPhone)
this.addProduct()
}
if (this.$route.query.type && this.$route.query.type === 1) {
let res = await getCustomerContactsListByCustomer({ customerId: parseInt(this.$route.query.customerId || 0) })
this.customer = res.data.find((item) => item.isDefault)
if (this.$route.query.customerType) {
// 客户类型不为空时
const types = this.$route.query.customerType.split(",")
if (types.includes("0")) {
this.form.relation = 1
} else {
this.form.relation = 2
}
}
} else {
// this.form.relation = 1
}
},
methods: {
async getChannelList() {
......@@ -1146,6 +1141,22 @@ export default {
}
this.tradeCityList = (await getTradeCityList(query)).data || []
},
getCustomerContactsListByCustomer(){
getCustomerContactsListByCustomer({ customerId: parseInt(this.$route.query.customerId || 0) }).then((res) =>{
this.customer = res.data.find((item) => item.isDefault)
if (this.$route.query.customerType) {
// 客户类型不为空时
const types = this.$route.query.customerType.split(",")
console.log("客户类型:", types)
if (types.includes("0")) {
this.form.relation = 1
} else {
this.form.relation = 2
}
}
})
},
getOffer() {
//加了是否从全部客户列表中报价按钮进来的判断
if (this.$route.query.type !== 1) {
......
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