Commit 55717174 authored by zhengyi's avatar zhengyi

客户跳转新增报价bug修复

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