Commit 6d60141e authored by 黎博's avatar 黎博

提交时新增校验

parent aa88ea0d
......@@ -113,25 +113,37 @@ export default {
},
// 新增
addRobotProject() {
addProjectRobot(this.robotForm).then((resp) => {
if (resp.data.data === true) {
this.addDialogVisible = false
this.getProjectRobotList()
return this.$message.success('新增成功!')
} else if (resp.data.data === false) {
return this.$message.error(resp.data.msg)
this.$refs.addRobotFormRef.validate((valid) => {
if (!valid) {
return false
} else {
addProjectRobot(this.robotForm).then((resp) => {
if (resp.data.data === true) {
this.addDialogVisible = false
this.getProjectRobotList()
return this.$message.success('新增成功!')
} else if (resp.data.data === false) {
return this.$message.error(resp.data.msg)
}
})
}
})
},
// 编辑
editRobotProject() {
modifyProjectRobot(this.editRobotForm).then((resp) => {
if (resp.data.data === true) {
this.editDialogVisible = false
this.getProjectRobotList()
return this.$message.success('修改成功!')
} else if (resp.data.data === false) {
return this.$message.error(resp.data.msg)
this.$refs.editRobotFormRef.validate((valid) => {
if (!valid) {
return false
} else {
modifyProjectRobot(this.editRobotForm).then((resp) => {
if (resp.data.data === true) {
this.editDialogVisible = false
this.getProjectRobotList()
return this.$message.success('修改成功!')
} else if (resp.data.data === false) {
return this.$message.error(resp.data.msg)
}
})
}
})
},
......
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