Commit 49402f40 by 匡雅琴

企微门店

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