Commit 49402f40 by 匡雅琴

企微门店

1 parent 6a7a1cad
......@@ -24,7 +24,7 @@
<i class="el-breadcrumb__separator el-icon-arrow-right"></i>
</span>
</div>
<div>
<div v-loading="loading">
<div class="tree-list" :style="{ height: listHeight + 'px' }">
<el-radio-group v-model="checkObj.first" @change="selectChange">
<div class="tree-item" v-for="item in departmentList" :key="item.departmentId" @click.self="toNext(item, $event)">
......@@ -47,6 +47,7 @@ export default {
name: 'MerchantTree',
data() {
return {
loading: false,
visible: false,
dialogTitle: '选择商户账户',
listHeight: 220,
......@@ -73,6 +74,7 @@ export default {
methods: {
// 获取门店数据
getDepartmentList(depth, id) {
this.loading = true
var params = {}
depth ? (params.depth = depth) : (params.depth = 0)
if (id) {
......@@ -82,6 +84,7 @@ export default {
console.log(res)
this.departmentList = res
console.log(this.departmentList)
this.loading = false
})
},
handleClose() {
......
......@@ -45,6 +45,7 @@ export default {
},
data() {
return {
loading: false,
searchKey: {
id: '',
departmentName: ''
......@@ -78,25 +79,30 @@ export default {
handleInput: utils.debounce(function(val) {
console.log(val)
this.searchValue = val
this.getSearchList()
this.pageParams.pageNum = 1
this.getSearchList(val)
}, 300),
// 根据输入内容搜索企微门店数据
getSearchList() {
getSearchList(val) {
this.loading = true
console.log(this.searchValue)
var params = JSON.parse(JSON.stringify(this.pageParams))
params.departmentName = this.searchValue
params.departmentName = val
console.log(params)
if (this.searchValue) {
if (params.departmentName) {
this.$apis.baseInfo.findDepartmentList(params).then(res => {
console.log(res)
this.searchList.push(res.data)
if (res.data.length) {
this.searchList = this.searchList.concat(res.data)
}
this.pageParams.pageNum++
console.log(this.searchList)
})
this.loading = false
} else {
this.searchList = []
}
console.log(this.searchList)
this.visible = !this.visible
this.visible = true
},
selectItem(val) {
console.log(val)
......@@ -112,13 +118,13 @@ export default {
this.$emit('getCurDepartment', val.first)
},
handleBlur() {
this.visible = false
this.searchKey = ''
this.searchList = []
// this.visible = false
// this.searchKey = ''
// this.searchList = []
},
load() {
// this.searchList.push(`Aaaaa${this.count++}`)
this.getSearchList()
this.getSearchList(this.searchValue)
}
}
}
......@@ -161,7 +167,7 @@ export default {
}
.el-cascader__suggestion-list {
overflow: auto;
width: 300px;
width: 100%;
}
/deep/.el-input-group__append {
padding: 0;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!