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

提交时新增校验

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