Commit f84d86ec by 匡雅琴

提交

1 parent b03e2301
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<ul class="el-scrollbar__view el-cascader__suggestion-list" v-infinite-scroll="load" style="overflow: auto"> <ul class="el-scrollbar__view el-cascader__suggestion-list" v-infinite-scroll="load" style="overflow: auto">
<!-- <li class="el-cascader__suggestion-item" :class="isCheck ? 'is-checked' : ''">dafsd</li> --> <!-- <li class="el-cascader__suggestion-item" :class="isCheck ? 'is-checked' : ''">dafsd</li> -->
<template v-if="searchList.length"> <template v-if="searchList.length">
<li class="el-cascader__suggestion-item" :class="item.departmentName == searchKey.departmentName" v-for="item in searchList" :key="item.id" @click="selectItem(item)"> <li class="el-cascader__suggestion-item" :class="item.departmentName == searchKey.departmentName" v-for="item in searchList" :key="item.id" @click.self="selectItem(item)">
<!-- <el-radio :label="item">{{ item.departmentName }}</el-radio> --> <!-- <el-radio :label="item">{{ item.departmentName }}</el-radio> -->
<div>{{ item.departmentName }}</div> <div>{{ item.departmentName }}</div>
<div class="parent-merchant">{{ item.entmicroParentName }}</div> <div class="parent-merchant">{{ item.entmicroParentName }}</div>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<li>无数据</li> <li>无数据</li>
</template> </template>
</ul> </ul>
<el-input slot="reference" debounce style="width: 320px" v-model="searchKey.departmentName" :size="size" @input="handleInput" @blur="handleBlur" placeholder="请输入内容"> <el-input slot="reference" debounce style="width: 320px" v-model="searchKey.departmentName" :size="size" @input="handleInput" @focus="handleFocus" @blur="handleBlur" placeholder="请输入内容">
<!-- <i slot="suffix" class="el-input__icon el-icon-arrow-down" :class="isOpen ? 'is-focus' : ''"></i> --> <!-- <i slot="suffix" class="el-input__icon el-icon-arrow-down" :class="isOpen ? 'is-focus' : ''"></i> -->
<template slot="append"> <template slot="append">
<div class="input_append" @click.stop="arrowClick"> <div class="input_append" @click.stop="arrowClick">
...@@ -114,15 +114,23 @@ export default { ...@@ -114,15 +114,23 @@ export default {
}, },
select(val) { select(val) {
console.log(val) console.log(val)
this.searchKey.id = val.first.departmentId // this.searchKey = {
// id: val.first.departmentId,
// departmentName: val.first.departmentName
// }
this.searchKey.id = val.first.departmentId + ''
this.searchKey.departmentName = val.first.departmentName this.searchKey.departmentName = val.first.departmentName
this.$emit('getCurDepartment', val.first) this.$emit('getCurDepartment', val.first)
}, },
handleBlur() { handleBlur() {
this.visible = false this.visible = false
this.searchKey = '' // this.searchKey = {}
this.searchList = [] this.searchList = []
}, },
handleFocus() {
this.getSearchList(this.searchKey.departmentName)
if (this.searchList.length) this.visible = true
},
load() { load() {
// this.searchList.push(`Aaaaa${this.count++}`) // this.searchList.push(`Aaaaa${this.count++}`)
if (this.searchList.length < this.count) { if (this.searchList.length < this.count) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!