From 0d5d6ff11d07b109dc383b6377f1f83adafd309b Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Tue, 22 Oct 2024 10:29:38 +0800 Subject: [PATCH] 10.22 --- .../newHomeComponents/accountPending.vue | 37 ++++++------------- 1 file changed, 12 insertions(+), 25 deletions(-) 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()