From a3fd86cfd8138e068da70b4da9ea2b250d1e05f3 Mon Sep 17 00:00:00 2001 From: proudlx <965752348@qq.com> Date: Fri, 30 Apr 2021 10:20:00 +0800 Subject: [PATCH] =?UTF-8?q?'=E5=B7=A5=E4=BD=9C=E5=8D=95=E4=BD=8D=E5=90=88?= =?UTF-8?q?=E5=B9=B6'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/SearchField.vue | 33 +++++++++++-------- src/views/ebiz/sale/InsuredPerson.vue | 47 +++++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 17 deletions(-) diff --git a/src/components/common/SearchField.vue b/src/components/common/SearchField.vue index 94ef3cdb3..0b842b829 100644 --- a/src/components/common/SearchField.vue +++ b/src/components/common/SearchField.vue @@ -3,7 +3,7 @@ @@ -41,6 +39,10 @@ export default { }, value: { type: String + }, + isAsync: { + type: Boolean, + default: false } }, components: { @@ -55,7 +57,7 @@ export default { computed: { computedCustomerList() { let searchStr = this.value.trim() - return this.customerList.filter(item => { + return this.customerList.filter((item) => { return item.label.includes(searchStr) }) }, @@ -68,6 +70,7 @@ export default { const result = await getTreasureMenus(param) if (result.result === '0') { this.customerList = result.content + this.$emit('workcompanys', result.content) } else { this.$toast(result.resultMessage) } @@ -81,16 +84,18 @@ export default { this.$emit('input', this.value) }, onInputFocus() { - this.showCustomer = true - setTimeout(() => { - this.$refs.picker.scrollIntoView() - }, 300) - this.$nextTick(() => { - this.$refs.picker.scrollTo({ - top: 0, - behavior: 'smooth' + if (this.isAsync) { + this.showCustomer = true + setTimeout(() => { + this.$refs.picker.scrollIntoView() + }, 300) + this.$nextTick(() => { + this.$refs.picker.scrollTo({ + top: 0, + behavior: 'smooth' + }) }) - }) + } }, chooseCustomer(item) { this.$emit('input', item.label) diff --git a/src/views/ebiz/sale/InsuredPerson.vue b/src/views/ebiz/sale/InsuredPerson.vue index cecfaef6a..923575acf 100644 --- a/src/views/ebiz/sale/InsuredPerson.vue +++ b/src/views/ebiz/sale/InsuredPerson.vue @@ -308,7 +308,16 @@ clearable :readonly="isAppnt" /> --> - + +