Commit 41efa714 authored by 黄卓's avatar 黄卓

新建客户,至少填写一个联系人信息

http://zentao.jdshangmen.com/bug-view-8.html
parent 6fc8b14b
......@@ -548,30 +548,14 @@ export default {
},
/** 提交按钮 */
submitForm() {
// this.$refs["contactForm"].validate(valid => {
// if (!valid) {
// return;
// }
// // todo
// console.log(1)
// })
this.$refs["form"].validate(valid => {
if (!valid) {
this.$refs["contactForm"].validate(valid1 => {
this.$refs["form"].validate(valid2 => {
if (!valid1 || !valid2) {
return;
}
if (this.form.customerContacts.length === 0){
this.$modal.msgError("至少填写一个联系人信息");
return
} else {
this.form.customerContacts.forEach(e => {
if (!e.name) {
this.$modal.msgWarning('请输入联系人')
} else if (!e.areaCode) {
this.$modal.msgWarning('请选择区号')
} else if (!e.phoneNew) {
this.$modal.msgWarning('请输入联系方式')
}
})
}
// 修改的提交
if (this.form.id != null) {
......@@ -601,6 +585,7 @@ export default {
this.$modal.msgError(e.msg || '添加客户失败,请联系管理员')
});
});
})
},
/** 表单重置 */
reset() {
......
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