Showing
1 changed file
with
10 additions
and
4 deletions
@@ -659,14 +659,20 @@ | @@ -659,14 +659,20 @@ | ||
659 | dataType: "json", | 659 | dataType: "json", |
660 | type: "POST", | 660 | type: "POST", |
661 | data: JSON.stringify(ajaxData), | 661 | data: JSON.stringify(ajaxData), |
662 | - success: function(data) { | ||
663 | - that.submitFlag = false; | 662 | + success: function(ret) { |
664 | $.messager.progress("close"); | 663 | $.messager.progress("close"); |
665 | - $.messager.alert('操作提示', '提交成功!'); | ||
666 | - window.location.href = contextPath + "/html/product/productList.html"; | 664 | + that.submitFlag = false; |
665 | + | ||
666 | + if (ret && ret.code == 200) { | ||
667 | + $.messager.alert('操作提示', '提交成功!'); | ||
668 | + window.location.href = contextPath + "/html/product/productList.html"; | ||
669 | + } else { | ||
670 | + $.messager.alert('操作提示', ret.message || '提交失败'); | ||
671 | + } | ||
667 | }, | 672 | }, |
668 | error: function(err) { | 673 | error: function(err) { |
669 | that.submitFlag = false; | 674 | that.submitFlag = false; |
675 | + $.messager.progress("close"); | ||
670 | $.messager.alert('操作提示', err.message || '提交失败'); | 676 | $.messager.alert('操作提示', err.message || '提交失败'); |
671 | } | 677 | } |
672 | }); | 678 | }); |
-
Please register or login to post a comment