Compare commits
No commits in common. "9741831c8dbe3f62a856b05381ed13d72f63786f" and "b897fa3629e9e6a0db602dd06f626009ddcabd89" have entirely different histories.
9741831c8d
...
b897fa3629
@ -57,22 +57,35 @@ export default {
|
||||
return val.id
|
||||
},
|
||||
async querySearch1(queryString, cb) {
|
||||
const restaurants = this.unitList
|
||||
let results
|
||||
|
||||
await this.getUnitList();
|
||||
let _this = this;
|
||||
let obj = {};
|
||||
let results = _this.unitList
|
||||
if (queryString) {
|
||||
results = restaurants.filter(this.createFilter(queryString))
|
||||
}else {
|
||||
results = restaurants
|
||||
_this.unitList.forEach(item => {
|
||||
results = [];
|
||||
if (item.unitName.includes(queryString)) {
|
||||
obj = item;
|
||||
obj.value = `${item.unitName}(${item.personCredit} ${item.contactMobile})`
|
||||
results.push(obj)
|
||||
return;
|
||||
}
|
||||
if (item.personCredit.includes(queryString)) {
|
||||
obj = item;
|
||||
obj.value = `${item.unitName}(${item.personCredit} ${item.contactMobile})`
|
||||
results.push(obj)
|
||||
return;
|
||||
}
|
||||
if (item.contactMobile.includes(queryString)) {
|
||||
obj = item;
|
||||
obj.value = `${item.unitName}(${item.personCredit} ${item.contactMobile})`
|
||||
results.push(obj)
|
||||
return;
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(results,68)
|
||||
cb(results);
|
||||
},
|
||||
createFilter(queryString) {
|
||||
return (restaurant) => {
|
||||
return (restaurant.unitName.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
|
||||
}
|
||||
},
|
||||
changeAmount(){
|
||||
this.$emit('changeAmount',this.ruleForm)
|
||||
this.$forceUpdate()
|
||||
|
Loading…
Reference in New Issue
Block a user