| | |
| | | computed: { |
| | | clientList() { |
| | | return this.$store.state.getClientName.clientList |
| | | } |
| | | }, |
| | | // saleChancelist() { |
| | | // return this.$store.state.getClientName.saleChancelist |
| | | // }, |
| | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | mounted(){ |
| | | this.getSaleChanceList() |
| | | this.getQuotation() |
| | | }, |
| | | created() { |
| | | if (this.editConfig.title !== "新建") { |
| | |
| | | }, |
| | | // 获取报价单 |
| | | getQuotation(id, value) { |
| | | getQuotationList({ |
| | | page: 0, |
| | | let params={ |
| | | page: 0, |
| | | pageSize: 0, |
| | | search_map: { |
| | | sale_chance_id: id |
| | | } |
| | | }).then((res) => { |
| | | } |
| | | if(id){ |
| | | params.search_map={ |
| | | sale_chance_id: id |
| | | } |
| | | } |
| | | getQuotationList(params).then((res) => { |
| | | if (res.code == 200) { |
| | | console.log(res) |
| | | this.quotationList = res.data.list |
| | |
| | | restaurants = this.clientList |
| | | console.log(restaurants, "客户单") |
| | | } else if (value === "chance") { |
| | | if (this.editConfig.infomation.client_name) { |
| | | restaurants = this.saleChancelist |
| | | } |
| | | } else if (value === "subbill") { |
| | | restaurants = this.subOrderList |
| | | } else if (value === "quotation") { |
| | | if (this.editConfig.infomation.sale_chance_name) { |
| | | restaurants = this.quotationList |
| | | } |
| | | } |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants |
| | | cb(results) |
| | |
| | | }, |
| | | // 销售机会列表 |
| | | async getSaleChanceList(item) { |
| | | await getSaleChanceList({ |
| | | page: 1, |
| | | pageSize: 15, |
| | | search_map: { |
| | | let params={} |
| | | if(item){ |
| | | params={ |
| | | page: 0, |
| | | pageSize: 0, |
| | | } |
| | | params.search_map={ |
| | | client_id: item.id |
| | | } |
| | | }).then((res) => { |
| | | }else{ |
| | | params={ |
| | | page: 0, |
| | | pageSize: 0, |
| | | } |
| | | } |
| | | await getSaleChanceList(params).then((res) => { |
| | | console.log(res) |
| | | this.saleChancelist = res.data.list |
| | | }) |
| | |
| | | } else if (value === "chance") { |
| | | this.saleChanceId = item.id |
| | | this.editConfig.infomation.sale_chance_name = item.name |
| | | this.clientId = item.client.id |
| | | this.editConfig.infomation.client_name = item.client.name |
| | | this.isAddQuatation = false |
| | | this.getSaleChanceList({id:this.clientId}) |
| | | this.getQuotation(item.id) |
| | | } else if (value === "subbill") { |
| | | console.log("下拉框点击", item) |
| | |
| | | this.tableData = item.products |
| | | this.editConfig.infomation.quotation_number = item.number |
| | | this.quotationId = item.id |
| | | //反向 客户名称 |
| | | this.editConfig.infomation.client_name = item.client.name |
| | | this.clientId = item.client.id |
| | | this.getSaleChanceList({id:this.clientId}) |
| | | //反向 销售机会 |
| | | this.editConfig.infomation.sale_chance_name = item.sale_chance.name |
| | | this.saleChanceId = item.sale_chance.id |
| | | this.getQuotation(this.saleChanceId) |
| | | } |
| | | }, |
| | | selClientClick(value) { |
| | |
| | | this.clientId = 0 |
| | | this.saleChanceId = 0 |
| | | this.subbillId = 0 |
| | | this.getSaleChanceList() |
| | | } else if (value === "chance") { |
| | | this.editConfig.infomation.sale_chance_name = "" |
| | | this.saleChanceId = 0 |
| | | this.isAddQuatation = true |
| | | this.editConfig.infomation.quotation_number = "" |
| | | this.quotationId = 0 |
| | | this.getQuotation(this.saleChanceId) |
| | | } else if (value === "subbill") { |
| | | this.editConfig.infomation.subbill_name = "" |
| | | this.subbillId = 0 |