diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/newHomeComponents/accountPending.vue b/fuintCashierWeb/src/views/cashier/NewComponents/newHomeComponents/accountPending.vue index d6ecbb154..ed85c558d 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/newHomeComponents/accountPending.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/newHomeComponents/accountPending.vue @@ -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()