Commit 6a262fcb authored by dcy's avatar dcy

关联会员

parent 90a28d05
<template>
<template xmlns="">
<div>
<el-row type="flex" style="margin-top: 15px;margin-bottom: 15px" justify="center">
......@@ -264,6 +264,12 @@
prop=""
label="关联账号"
>
<template v-slot = "{row}">
{{row.userid}}
<el-select v-model="row.userid" @change="selectBD" multiple>
<el-option :disabled="selectMembers.indexOf(item.id) > -1" v-for="(item,index) in memberList" :value="item.id" :key="item.id" :label="item.mobile" ></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="social"
......@@ -370,7 +376,7 @@
<script>
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload'
import {createCustomer, getCustomer, updateCustomer, } from '@/api/ecw/customer'
import {createCustomer, getCustomer, updateCustomer, userMemberUserList,} from '@/api/ecw/customer'
import {getNodeList} from "@/api/ecw/node"
import { getProductTypeList } from '@/api/ecw/productType'
import { getProductList } from '@/api/ecw/product'
......@@ -382,6 +388,7 @@ import {listServiceUser} from "@/api/system/user"
import {getZhongPaoPage} from '@/api/ecw/zhongPao'
import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
import { getCountryListAll } from '@/api/ecw/country'
import Template from "@/views/cms/template";
export default {
name: "edit",
......@@ -389,6 +396,7 @@ export default {
customerId: String
},
components: {
Template,
upload,
CustomerLineTable
},
......@@ -398,6 +406,9 @@ export default {
this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => {
this.form.customerContacts = r.data
this.form.customerContacts.forEach( item => {
item.userid = item.userid ? item.userid.split(',').map(e => Number(e)) : []
})
})
})
}
......@@ -426,6 +437,9 @@ export default {
getCountryListAll().then(r => {
this.countryList = r.data
})
userMemberUserList().then(r => {
this.memberList = r.data
})
this.getZhongPao()
},
......@@ -464,10 +478,14 @@ export default {
zhongLines: [], // 重货线路
paoLines: [], // 泡货线路
memberList:[],//会员列表
}
},
methods: {
selectBD(){
this.$forceUpdate();
},
/** 取消按钮 */
cancel() {
this.open = false;
......@@ -479,6 +497,9 @@ export default {
if (!valid) {
return;
}
this.form.customerContacts.forEach(e => {
e.userid = e.userid.join(',')
})
// 修改的提交
if (this.form.id != null) {
this.form.customerContacts.forEach(e => {
......@@ -572,7 +593,7 @@ export default {
"position": "",
"social": undefined,
"socialNumber": "",
// "userid": 0,
"userid": [],
// "username": ""
})
},
......@@ -592,6 +613,16 @@ export default {
computed: {
productListFilter(){
return this.productList.filter((p) => p.typeId === this.form.productType)
},
selectMembers(){
let m = []
if(!this.form.customerContacts) return []
this.form.customerContacts.forEach(e => {
if(e.userid){
m.push(...e.userid)
}
})
return m
}
},
watch: {
......
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