This commit is contained in:
cun-nan 2024-10-22 10:29:38 +08:00
parent cdb9262c12
commit 0d5d6ff11d

View File

@ -57,35 +57,22 @@ export default {
return val.id
},
async querySearch1(queryString, cb) {
await this.getUnitList();
let _this = this;
let obj = {};
let results = _this.unitList
const restaurants = this.unitList
let results
if (queryString) {
_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;
}
})
results = restaurants.filter(this.createFilter(queryString))
}else {
results = restaurants
}
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()