Commit b67a89c6 authored by 黄卓's avatar 黄卓

后台新建客户时,可以设置多个默认联系人(应控制最多只能设置一个默认联系人)

http://zentao.jdshangmen.com/bug-view-209.html
parent 7e7878f9
......@@ -248,7 +248,7 @@
区号 <span style="color: #ff0000">*</span>
</template>
<template v-slot="{row}">
<el-select v-model="row.areaCode" placeholder="请选择区号" filterable>
<el-select v-model="row.areaCode" placeholder="请选择区号" filterable size="mini">
<el-option v-for="(item, index) in countryList"
:key="index" :label="item.nameShort + item.nameZh + '(' + item.tel + ')'" :value="item.tel" />
</el-select>
......@@ -270,7 +270,7 @@
label="关联账号"
>
<template v-slot = "{row}">
<el-select v-model="row.userid" @change="selectBD">
<el-select v-model="row.userid" @change="selectBD" size="mini">
<el-option v-for="(item,index) in memberList" :value="item.id" :key="item.id" :label="item.nickname + '(' + item.mobile + ')'" ></el-option>
</el-select>
</template>
......@@ -280,7 +280,7 @@
label="社交软件"
>
<template v-slot="{row}">
<el-select v-model="row.social" placeholder="请选择社交软件">
<el-select v-model="row.social" placeholder="请选择社交软件" size="mini">
<el-option v-for="dict in getDictDatas(DICT_TYPE.SOCIAL)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
......@@ -306,8 +306,8 @@
prop="isDefault"
label="设为默认"
>
<template v-slot="{row}">
<el-select v-model="row.isDefault" placeholder="设为默认">
<template v-slot="{ row, column, $index }">
<el-select v-model="row.isDefault" placeholder="设为默认" @change="handleDefaultChange($index)" size="mini">
<el-option v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)"
:key="dict.value" :label="dict.label" :value="Number(dict.value)" />
</el-select>
......@@ -484,6 +484,20 @@ export default {
},
methods: {
handleDefaultChange($index){
if (this.form.customerContacts.length === 1 && this.form.customerContacts[0].isDefault === 0){
this.$modal.msgWarning('至少拥有一个默认联系人')
this.form.customerContacts[0].isDefault = 1
return
}
let i = 0
this.form.customerContacts.forEach(e => {
if (i !== $index){
e.isDefault = 0
}
i++
})
},
selectBD(){
this.$forceUpdate();
},
......
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