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