|
|
@@ -43,8 +43,8 @@
|
|
|
<el-radio :label="item.dictValue" v-for="item in statusOptions">{{item.dictLabel}}</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="客户来源" prop="source">
|
|
|
- <el-select v-model="form.source" placeholder="请选择客户来源" clearable size="small">
|
|
|
+ <el-form-item label="客户来源" prop="sourceArr">
|
|
|
+ <el-select multiple v-model="form.sourceArr" placeholder="请选择客户来源" clearable size="small">
|
|
|
<el-option
|
|
|
v-for="item in sourceOptions"
|
|
|
:key="item.dictValue"
|
|
|
@@ -167,7 +167,7 @@
|
|
|
mobile: [
|
|
|
{ required: true, message: "手机号不能为空", trigger: "blur" }
|
|
|
],
|
|
|
- source: [
|
|
|
+ sourceArr: [
|
|
|
{ required: true, message: "客户来源不能为空", trigger: "blur" }
|
|
|
],
|
|
|
}
|
|
|
@@ -275,6 +275,7 @@
|
|
|
companyId: null,
|
|
|
isLine: null,
|
|
|
source: null,
|
|
|
+ sourceArr: [],
|
|
|
tags: null,
|
|
|
|
|
|
};
|
|
|
@@ -315,8 +316,10 @@
|
|
|
if(this.form.sex!=null){
|
|
|
this.form.sex = this.form.sex.toString();
|
|
|
}
|
|
|
- if(this.form.source!=null){
|
|
|
- this.form.source = this.form.source.toString();
|
|
|
+ if(this.form.crmSource!=null){
|
|
|
+ this.$set(this.form, 'sourceArr', this.form.crmSource.split(","));
|
|
|
+ } else {
|
|
|
+ this.$set(this.form, 'sourceArr', []);
|
|
|
}
|
|
|
if(this.form.tags!=null){
|
|
|
this.tags = this.form.tags.split(",")
|
|
|
@@ -358,6 +361,9 @@
|
|
|
if (valid) {
|
|
|
if (this.form.customerId != null) {
|
|
|
this.form.extJson=JSON.stringify(this.exts);
|
|
|
+ if(this.form.sourceArr && this.form.sourceArr.length>0){
|
|
|
+ this.form.crmSource=this.form.sourceArr.join(",");
|
|
|
+ }
|
|
|
updateCustomer(this.form).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.msgSuccess("操作成功");
|
|
|
@@ -367,6 +373,9 @@
|
|
|
} else {
|
|
|
this.form.extJson=JSON.stringify(this.exts);
|
|
|
if(this.addType==1){
|
|
|
+ if(this.form.sourceArr && this.form.sourceArr.length>0){
|
|
|
+ this.form.crmSource=this.form.sourceArr.join(",");
|
|
|
+ }
|
|
|
addCustomer(this.form).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.msgSuccess("操作成功");
|
|
|
@@ -375,6 +384,9 @@
|
|
|
});
|
|
|
}
|
|
|
else if(this.addType==2){
|
|
|
+ if(this.form.sourceArr && this.form.sourceArr.length>0){
|
|
|
+ this.form.crmSource=this.form.sourceArr.join(",");
|
|
|
+ }
|
|
|
addMyCustomer(this.form).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.msgSuccess("操作成功");
|