Commit 2c97cb50 by 匡雅琴

联调

1 parent 052123a9
......@@ -8,11 +8,11 @@
<template>
<div>
<el-popover :popper-class="'search-popper'" placement="bottom-start" width="280" trigger="manual" v-model="visible">
<el-popover @blur="handleBlur" :popper-class="'search-popper'" placement="bottom-start" width="280" trigger="manual" v-model="visible">
<ul v-if="name == 'merchant'" 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> -->
<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.self="selectItem(item)">
<li class="el-cascader__suggestion-item" :class="item.departmentName == searchKey.departmentName" v-for="item in searchList" :key="item.id" @click.self="selectMerchantItem(item)">
<!-- <el-radio :label="item">{{ item.departmentName }}</el-radio> -->
<div>{{ item.merchantName }}</div>
<div class="parent-merchant">{{ item.merchantLegalPerson }}</div>
......@@ -35,7 +35,7 @@
<li>无数据</li>
</template>
</ul>
<el-input slot="reference" debounce style="width: 320px" v-model="searchKey.departmentName" :size="size" @input="handleInput" @blur="handleBlur" @focus="handleFocus" :placeholder="type">
<el-input slot="reference" debounce style="width: 320px" v-model="searchKey.departmentName" :size="size" @input="handleInput" @focus="name === 'merchant' ? getMerchantSearchList() : getSearchList()" @blur="handleBlur" :placeholder="type">
<!-- <i slot="suffix" class="el-input__icon el-icon-arrow-down" :class="isOpen ? 'is-focus' : ''"></i> -->
<template slot="append">
<div class="input_append" @click.stop="arrowClick()">
......@@ -122,24 +122,23 @@ export default {
var params = JSON.parse(JSON.stringify(this.pageParams))
params.departmentName = val
console.log(params)
if (params.departmentName) {
this.$apis.baseInfo.findDepartmentList(params).then(res => {
console.log(res)
if (res.data.length) {
this.count = res.count
if (res.pageNum == 1) {
this.searchList = res.data
} else {
this.searchList = this.searchList.concat(res.data)
}
// if (params.departmentName) {
this.$apis.baseInfo.findDepartmentList(params).then(res => {
console.log(res)
if (res.data.length) {
this.count = res.count
if (res.pageNum == 1) {
this.searchList = res.data
} else {
this.searchList = this.searchList.concat(res.data)
}
this.pageParams.pageNum++
console.log(this.searchList)
})
this.loading = false
} else {
this.searchList = []
}
}
// this.pageParams.pageNum++
console.log(this.searchList)
})
// } else {
// this.searchList = []
// }
},
// 根据输入内容搜索商户账户数据
getMerchantSearchList(val) {
......@@ -148,25 +147,35 @@ export default {
params.merchantName = val
params.merchantId = this.$globalState.session.merchantId
console.log(params)
if (params.merchantName) {
this.$apis.baseInfo.findMerchantTreeList(params).then(res => {
console.log(res)
if (res.data.length) {
this.count = res.count
if (res.pageNum == 1) {
this.searchList = res.data
} else {
this.searchList = this.searchList.concat(res.data)
}
// if (params.merchantName) {
this.$apis.baseInfo.findMerchantTreeList(params).then(res => {
console.log(res)
if (res.data.length) {
this.count = res.count
if (res.pageNum == 1) {
this.searchList = res.data
} else {
this.searchList = this.searchList.concat(res.data)
}
this.pageParams.pageNum++
console.log(this.searchList)
})
} else {
this.searchList = []
}
}
// this.pageParams.pageNum++
console.log(this.searchList)
})
// } else {
// this.searchList = []
// }
this.visible = true
},
// 下拉选择商户账户
selectMerchantItem(val) {
console.log(val)
this.searchKey.id = val.merchantNo
this.searchKey.departmentName = val.merchantName
// this.searchList = [val]
this.visible = false
this.$emit('getCurMerchant', val)
},
// 下拉选择门店
selectItem(val) {
console.log(val)
this.searchKey = val
......@@ -192,23 +201,30 @@ export default {
this.searchKey.departmentName = val.first.merchantName
this.$emit('getCurMerchant', val.first)
},
// 输入框失去焦点调用
handleBlur() {
console.log(11111)
this.searchKey.departmentName = ''
this.visible = false
// this.searchKey = {}
this.searchList = []
},
handleFocus() {
console.log(this.name)
if (this.name === 'merchant') {
this.getMerchantSearchList()
return
}
this.getSearchList(this.searchKey.departmentName)
},
// handleFocus() {
// console.log(this.name)
// if (this.name === 'merchant') {
// this.getMerchantSearchList()
// return
// }
// this.getSearchList(this.searchKey.departmentName)
// },
load() {
// this.searchList.push(`Aaaaa${this.count++}`)
this.pageParams.pageNum++
if (this.searchList.length < this.count) {
if (this.name === 'merchant') {
this.getMerchantSearchList()
return
}
this.getSearchList(this.searchValue)
}
}
......
......@@ -293,7 +293,7 @@ export default {
})
let all = [...arrpara1, ...arrpara2, ...arrpara3]
let para = Object.assign({}, ...all)
console.log(para)
this.$confirm(' 请确认是否关联当前信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!