|
|
|
@ -397,6 +397,7 @@ export default { |
|
|
|
|
NoAdd: true, |
|
|
|
|
phoneRepeat: false, |
|
|
|
|
emailRepeat: false, |
|
|
|
|
submiting: false // 新增编辑防抖标识 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
@ -552,7 +553,7 @@ export default { |
|
|
|
|
saveAdd(formName){ |
|
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
console.log(this.phoneRepeat); |
|
|
|
|
if (this.submiting) return false |
|
|
|
|
if (this.phoneRepeat) { |
|
|
|
|
this.$message.warning("该手机号已存在"); |
|
|
|
|
return; |
|
|
|
@ -561,6 +562,7 @@ export default { |
|
|
|
|
this.$message.warning("该邮箱已存在"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.submiting = true |
|
|
|
|
if(this.NoAdd){ |
|
|
|
|
let obj = {}; |
|
|
|
|
obj = this.schoolList.find((item)=>{ |
|
|
|
@ -591,7 +593,9 @@ export default { |
|
|
|
|
this.$post(this.api.updateCustomer,data).then((res) => { |
|
|
|
|
this.$message.success('编辑成功') |
|
|
|
|
this.goback() |
|
|
|
|
}).catch((res) => {}) |
|
|
|
|
}).catch((res) => { |
|
|
|
|
this.submiting = false |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
this.$post(this.api.addCustomer,data).then((res) => { |
|
|
|
|
let customerId = res.customerId |
|
|
|
@ -615,7 +619,9 @@ export default { |
|
|
|
|
|
|
|
|
|
this.$message.success('添加成功') |
|
|
|
|
this.goback() |
|
|
|
|
}).catch((res) => {}) |
|
|
|
|
}).catch((res) => { |
|
|
|
|
this.submiting = false |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
this.$message.warning('该客户已存在') |
|
|
|
|