报价单,销售明细单 2个模块初始时请求对应的销售机会,销售报价单的列表并且给下拉列表赋值
| | |
| | | saleChancelist: [] |
| | | } |
| | | }, |
| | | mounted(){ |
| | | this.getSaleChanceList() |
| | | }, |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.$store.dispatch("geContact") |
| | |
| | | }, |
| | | // 销售机会列表 |
| | | async getSaleChanceList(item) { |
| | | await getSaleChanceList({ |
| | | let params={} |
| | | if(item){ |
| | | params={ |
| | | page: 1, |
| | | pageSize: 15, |
| | | search_map: { |
| | | } |
| | | 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 |
| | | }) |
| | |
| | | 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({ |
| | | let params={ |
| | | page: 0, |
| | | pageSize: 0, |
| | | search_map: { |
| | | } |
| | | if(id){ |
| | | params.search_map={ |
| | | sale_chance_id: id |
| | | } |
| | | }).then((res) => { |
| | | } |
| | | 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 |
| | | } |
| | | console.log(this.quotationList,'quotationList') |
| | | } |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants |
| | | cb(results) |
| | |
| | | }, |
| | | // 销售机会列表 |
| | | async getSaleChanceList(item) { |
| | | await getSaleChanceList({ |
| | | let params={} |
| | | if(item){ |
| | | params={ |
| | | page: 1, |
| | | pageSize: 15, |
| | | search_map: { |
| | | } |
| | | 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 |
| | | }) |