| | |
| | | querySearchAsync(queryString, callback, 'subbill') |
| | | } |
| | | " |
| | | value-key="name" |
| | | value-key="number" |
| | | @select="handleSelectClient('subbill', $event)" |
| | | :disabled="isNameChanceEdit" |
| | | ></el-autocomplete> |
| | |
| | | editSelectChanceConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | infomation: {}, |
| | | search_map: {} |
| | | }, |
| | | editSelCommonConfig: { |
| | | editVisible: false, |
| | |
| | | infomation: {} |
| | | }, |
| | | clientId: this.editCommonConfig.infomation.client_id, |
| | | saleChanceId: this.editCommonConfig.infomation.saleChanceId, |
| | | saleChanceId: this.editCommonConfig.infomation.sale_chance_id, |
| | | subbillId: this.editCommonConfig.infomation.subbillId, |
| | | productId: 1, |
| | | isNoProduct: true, |
| | |
| | | getAllData() |
| | | .then((res) => { |
| | | this.memberOptions = res.data.member |
| | | this.dataProcess() |
| | | // this.dataProcess() |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | |
| | | // 保存 |
| | | saveClick(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | this.validateFormNumber() |
| | | if (valid) { |
| | | console.log(this.editConfig.infomation) |
| | | for (let i = 0; i < this.tableData.length; i++) { |
| | |
| | | } else if (value === "subbill") { |
| | | restaurants = this.subOrderList |
| | | } |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants |
| | | cb(results) |
| | | }, |
| | | createStateFilter(queryString) { |
| | | createStateFilter(queryString, value) { |
| | | return (state) => { |
| | | return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | if (value === "subbill") { |
| | | return state.number.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | } else { |
| | | return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | } |
| | | } |
| | | }, |
| | | async handleSelectClient(value, item) { |
| | | // 销售机会列表 |
| | | async getSaleChanceList(item) { |
| | | await getSaleChanceList({ |
| | | page: 1, |
| | | pageSize: 15, |
| | | search_map: { |
| | | client_id: item.id |
| | | } |
| | | }).then((res) => { |
| | | console.log(res) |
| | | this.saleChancelist = res.data.list |
| | | }) |
| | | }, |
| | | // 销售子单列表 |
| | | async getSubOrderList(item) { |
| | | await getSubOrderList({ |
| | | page: 1, |
| | | pageSize: 15, |
| | | search_map: { |
| | | client_id: item.id |
| | | } |
| | | }).then((res) => { |
| | | this.subOrderList = res.data.list |
| | | }) |
| | | }, |
| | | handleSelectClient(value, item) { |
| | | if (value === "client") { |
| | | this.clientId = item.id |
| | | this.editConfig.infomation.client_name = item.name |
| | | // 需要修改 |
| | | await getSaleChanceList({ |
| | | page: 1, |
| | | pageSize: 15, |
| | | search_map: { |
| | | client_id: item.id |
| | | } |
| | | }).then((res) => { |
| | | console.log(res) |
| | | this.saleChancelist = res.data.list |
| | | }) |
| | | await getSubOrderList({ |
| | | page: 1, |
| | | pageSize: 15, |
| | | search_map: { |
| | | client_id: item.id |
| | | } |
| | | }).then((res) => { |
| | | this.subOrderList = res.data.list |
| | | }) |
| | | this.getSaleChanceList(item) |
| | | this.getSubOrderList(item) |
| | | } else if (value === "chance") { |
| | | this.saleChanceId = item.id |
| | | this.editConfig.infomation.client_name = item.name |
| | |
| | | if (value === "client") { |
| | | this.editConfig.infomation.client_name = row.name |
| | | this.clientId = row.id |
| | | this.getSaleChanceList(row) |
| | | this.getSubOrderList(row) |
| | | } else if (value === "chance") { |
| | | this.editConfig.infomation.sale_chance_name = row.name |
| | | this.saleChanceId = row.id |