![在这里插入图片描述](https://img-blog.csdnimg.cn/20210302150602822.png#pic_center)
<el-autocomplete
class="inline-input"
v-model="scope.row.proId"
:fetch-suggestions="proIdSearch"
placeholder="请输入内容"
@select="proIdSelect"
></el-autocomplete>
data() {
return {
restaurants: [],
}
}
getProductList() {
listProduct(this.productParams).then(response => {
let restaurants = response.rows
restaurants.map((item, index) => {
this.restaurants.push({
value: item.proName,
price: item.price
})
})
})
},
proIdSearch(queryString, cb) {
var restaurants = this.restaurants
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
cb(results);
},
createFilter(queryString) {
return (state) => {
return (state.value.indexOf(queryString) === 0)
}
},
proIdSelect(item) {
this.quotationDetails.filter(value => {
if (value.proId && value.proId === item.value) {
value.price = item.price
}
})
},