Browse Source

优化表单编辑时单个字段验证问题

master
陈裕财 2 years ago
parent
commit
e32ecfe484
  1. 6
      src/components/mdp-ui/mixin/MdpFormMixin.js

6
src/components/mdp-ui/mixin/MdpFormMixin.js

@ -360,8 +360,8 @@ export const MdpFormMixin = {
if(!form){ if(!form){
form=this.$refs['editForm']; form=this.$refs['editForm'];
} }
form.validate((valid) => {
if (valid) {
form.validateField(fieldName,(valid) => {
if (!valid) {
func(params).then(res=>{ func(params).then(res=>{
var tips = res.data.tips; var tips = res.data.tips;
if(tips.isOk){ if(tips.isOk){
@ -379,7 +379,7 @@ export const MdpFormMixin = {
this.load.editSomeFields=false; this.load.editSomeFields=false;
}); });
}else{ }else{
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' });
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交.", type: 'error' });
} }
}); });

Loading…
Cancel
Save