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" /> --> - + +