Commit a7bcaf40 authored by dcy's avatar dcy

会员你列表添加分页,添加回显

parent 0f5df4c2
......@@ -149,10 +149,18 @@ export function getMyCustomerService(query){
})
}
//获取会员列表
export function userMemberUserList(){
export function userMemberUserList(params){
return request({
url:'/member/user/member-user-list',
method:'get'
method:'get',
params
})
}
export function memberUserList(params){
return request({
url:'/member/user/list',
method:'get',
params
})
}
//查看某客户授权的品牌
......
......@@ -282,8 +282,8 @@
>
<template v-slot = "{row}">
<el-form-item label="">
<el-select v-model="row.userid" @change="selectBD" size="mini" filterable>
<el-option v-for="(item,index) in memberList" :value="item.id" :key="item.id" :label="item.nickname + '(' + item.mobile + ')'" ></el-option>
<el-select v-model="row.userid" remote :remote-method="getUserMemberUserFn" @change="selectBD" size="mini" filterable>
<el-option v-for="(item,index) in userMemberUser" :value="item.id" :key="index" :label="item.nickname + '(' + item.mobile + ')'" ></el-option>
</el-select>
</el-form-item>
</template>
......@@ -408,7 +408,7 @@ import {
createCustomer,
getCustomer,
getCustomerList,
getCustomerPage,
getCustomerPage, memberUserList,
updateCustomer,
userMemberUserList,
} from '@/api/ecw/customer'
......@@ -440,16 +440,23 @@ export default {
created() {
this.getCustomerSelect()
this.reset()
this.getUserMemberUserFn()
if(this.customerId !== '0') {
// 编辑客户
this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => {
this.form.customerContacts = r.data
let list = this.form.customerContacts.map(item => item.userid);
if(list.length >0){
memberUserList({ids:list.join(',')}).then(r=>{
this.selectMemberList = r.data
})
}
if(this.form.promoter){
getCustomerList({ids:this.form.promoter}).then(r => {
console.log(r,'r');
this.recommended = r.data;
})
}
})
})
} else {
......@@ -478,10 +485,6 @@ export default {
getCountryListAll().then(r => {
this.countryList = r.data
})
userMemberUserList().then(r => {
this.memberList = r.data
})
this.getZhongPao()
},
data(){
......@@ -532,10 +535,16 @@ export default {
zhongLines: [], // 重货线路
paoLines: [], // 泡货线路
memberList:[],//会员列表
selectMemberList:[]//选中会员列表
}
},
methods: {
getUserMemberUserFn(val){
userMemberUserList({pageNo:1,pageSize:100,searchKey:val}).then(r => {
this.memberList = r.data.list
})
},
remoteMethod(val){
this.getCustomerSelect(val);
},
......@@ -585,8 +594,12 @@ export default {
this.form.customerContacts[0].isDefault = 1
}
},
selectBD(){
this.$forceUpdate();
selectBD(val){
let i = this.selectMemberList.find(item => item.id === val);
if(i === undefined){
this.selectMemberList.push(this.memberList.find(item => item.id === val))
}
this.getUserMemberUserFn()
},
/** 取消按钮 */
cancel() {
......@@ -743,6 +756,12 @@ export default {
}
},
computed: {
userMemberUser(){
let list = this.memberList.filter(item => {
return this.selectMemberList.findIndex(i => i.id === item.id) < 0
})
return [...this.selectMemberList,...list]
},
productListFilter(){
return this.productList.filter((p) => p.typeId === this.form.productType)
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment