Commit fa64e1ee by Mr. Lan

fix bug.

parent f92049a5
Showing with 12 additions and 1 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 => {
if (response !== undefined) {
this.getList() this.getList()
this.$message({ this.$message({
type: 'success', type: 'success',
message: '分类已增加!' 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 => {
if (response !== undefined) {
this.getList() this.getList()
this.$message({ this.$message({
type: 'success', type: 'success',
message: '分类已更新!' 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 => {
if (response !== undefined) {
this.getList() this.getList()
this.$message({ this.$message({
type: 'success', type: 'success',
message: '分类已删除!' 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