Commit a7bcaf40 authored by dcy's avatar dcy

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

parent 0f5df4c2
...@@ -149,10 +149,18 @@ export function getMyCustomerService(query){ ...@@ -149,10 +149,18 @@ export function getMyCustomerService(query){
}) })
} }
//获取会员列表 //获取会员列表
export function userMemberUserList(){ export function userMemberUserList(params){
return request({ return request({
url:'/member/user/member-user-list', 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 @@ ...@@ -282,8 +282,8 @@
> >
<template v-slot = "{row}"> <template v-slot = "{row}">
<el-form-item label=""> <el-form-item label="">
<el-select v-model="row.userid" @change="selectBD" size="mini" filterable> <el-select v-model="row.userid" remote :remote-method="getUserMemberUserFn" @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-option v-for="(item,index) in userMemberUser" :value="item.id" :key="index" :label="item.nickname + '(' + item.mobile + ')'" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
...@@ -408,7 +408,7 @@ import { ...@@ -408,7 +408,7 @@ import {
createCustomer, createCustomer,
getCustomer, getCustomer,
getCustomerList, getCustomerList,
getCustomerPage, getCustomerPage, memberUserList,
updateCustomer, updateCustomer,
userMemberUserList, userMemberUserList,
} from '@/api/ecw/customer' } from '@/api/ecw/customer'
...@@ -440,16 +440,23 @@ export default { ...@@ -440,16 +440,23 @@ export default {
created() { created() {
this.getCustomerSelect() this.getCustomerSelect()
this.reset() this.reset()
this.getUserMemberUserFn()
if(this.customerId !== '0') { if(this.customerId !== '0') {
// 编辑客户 // 编辑客户
this.getCustomer(this.customerId).then(() => { this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => { getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => {
this.form.customerContacts = r.data this.form.customerContacts = r.data
getCustomerList({ids:this.form.promoter}).then(r => { let list = this.form.customerContacts.map(item => item.userid);
console.log(r,'r'); if(list.length >0){
this.recommended = r.data; memberUserList({ids:list.join(',')}).then(r=>{
}) this.selectMemberList = r.data
})
}
if(this.form.promoter){
getCustomerList({ids:this.form.promoter}).then(r => {
this.recommended = r.data;
})
}
}) })
}) })
} else { } else {
...@@ -478,10 +485,6 @@ export default { ...@@ -478,10 +485,6 @@ export default {
getCountryListAll().then(r => { getCountryListAll().then(r => {
this.countryList = r.data this.countryList = r.data
}) })
userMemberUserList().then(r => {
this.memberList = r.data
})
this.getZhongPao() this.getZhongPao()
}, },
data(){ data(){
...@@ -532,10 +535,16 @@ export default { ...@@ -532,10 +535,16 @@ export default {
zhongLines: [], // 重货线路 zhongLines: [], // 重货线路
paoLines: [], // 泡货线路 paoLines: [], // 泡货线路
memberList:[],//会员列表 memberList:[],//会员列表
selectMemberList:[]//选中会员列表
} }
}, },
methods: { methods: {
getUserMemberUserFn(val){
userMemberUserList({pageNo:1,pageSize:100,searchKey:val}).then(r => {
this.memberList = r.data.list
})
},
remoteMethod(val){ remoteMethod(val){
this.getCustomerSelect(val); this.getCustomerSelect(val);
}, },
...@@ -585,8 +594,12 @@ export default { ...@@ -585,8 +594,12 @@ export default {
this.form.customerContacts[0].isDefault = 1 this.form.customerContacts[0].isDefault = 1
} }
}, },
selectBD(){ selectBD(val){
this.$forceUpdate(); 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() { cancel() {
...@@ -743,6 +756,12 @@ export default { ...@@ -743,6 +756,12 @@ export default {
} }
}, },
computed: { computed: {
userMemberUser(){
let list = this.memberList.filter(item => {
return this.selectMemberList.findIndex(i => i.id === item.id) < 0
})
return [...this.selectMemberList,...list]
},
productListFilter(){ productListFilter(){
return this.productList.filter((p) => p.typeId === this.form.productType) 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