Commit fa64e1ee by Mr. Lan

fix bug.

parent f92049a5
Showing with 29 additions and 18 deletions
...@@ -182,12 +182,14 @@ export default { ...@@ -182,12 +182,14 @@ export default {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
createClassify(this.ruleForm).then(response => { createClassify(this.ruleForm).then(response => {
this.getList() if (response !== undefined) {
this.$message({ this.getList()
type: 'success', this.$message({
message: '分类已增加!' type: 'success',
}) message: '分类已增加!'
this.open = false })
this.open = false
}
}) })
} }
}) })
...@@ -196,12 +198,14 @@ export default { ...@@ -196,12 +198,14 @@ export default {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
updateClassify(this.ruleForm).then(response => { updateClassify(this.ruleForm).then(response => {
this.getList() if (response !== undefined) {
this.$message({ this.getList()
type: 'success', this.$message({
message: '分类已更新!' type: 'success',
}) message: '分类已更新!'
this.open = false })
this.open = false
}
}) })
} }
}) })
...@@ -219,12 +223,19 @@ export default { ...@@ -219,12 +223,19 @@ export default {
}).then(() => { }).then(() => {
deleteClassify({ deleteClassify({
classifyId: row.id classifyId: row.id
}).then(() => { }).then(response => {
this.getList() if (response !== undefined) {
this.$message({ this.getList()
type: 'success', this.$message({
message: '分类已删除!' type: 'success',
}) message: '分类已删除!'
})
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
}) })
}) })
}, },
......
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 sign in to comment