https://www.cnblogs.com/luoxuemei/p/9295506.html
function submitRepairForm(formName) {
debugger;
// 总的页面验证结果标志
var validPass = true;
this.$refs[formName].validate((valid) => {
debugger;
if (valid) {
debugger;
for (var i=0; i < this.$refs["parts"].length; i++) {
this.$refs["parts"][i].validate(isValid => {
if (isValid == 0) {
validPass = false;
return false;
}
});
}
} else {
console.log(formName + 'error submit!!');
return false;
}
if (validPass) {
// 通过验证,提交数据
// KeepAccountsOfConsumableMaterial(toolingType,toolingModel,materialName,count)
this.$http.post('KeepAccounts', { parts: this.repairForm }, { emulateJSON: true }
).then(function (res) {
if (res.data.ReturnResult == '0') {
//在PWS记账成功
this.showMessage('repair', 'success', res.data.ReturnMessage);
//防止重复记账
this.isAccountDisabled = true;
} else {
this.showMessage('repair', 'error', res.data.ReturnMessage);
}
}, function () {
this.showMessage('error', '@SEMI.TMS.Resources.StringResource.Sys_ExeFail');
});
}
});
}