init
Showing
1 changed file
with
25 additions
and
1 deletions
| ... | @@ -90,7 +90,31 @@ | ... | @@ -90,7 +90,31 @@ |
| 90 | title: '删除产品', | 90 | title: '删除产品', |
| 91 | icon: 3 | 91 | icon: 3 |
| 92 | }, function(){ | 92 | }, function(){ |
| 93 | layer.msg('删除'); | 93 | $.ajax({ |
| 94 | type: 'delete', | ||
| 95 | url: apiBaseUrl + 'config/product/' + id, | ||
| 96 | cache: false, | ||
| 97 | data: JSON.stringify(data), | ||
| 98 | dataType: 'json', | ||
| 99 | contentType: "application/json; charset=UTF-8", | ||
| 100 | success: function (data) { | ||
| 101 | if (data.msg) { | ||
| 102 | layer.alert(data.msg); | ||
| 103 | } else if (data.code != 0) { | ||
| 104 | layer.alert('请求失败'); | ||
| 105 | } else { | ||
| 106 | layer.msg('删除成功'); | ||
| 107 | } | ||
| 108 | if(!data.code) { | ||
| 109 | window.parent.reload(); | ||
| 110 | layer_close(); | ||
| 111 | } | ||
| 112 | }, | ||
| 113 | error: function () { | ||
| 114 | layer.alert("请求失败") | ||
| 115 | } | ||
| 116 | }) | ||
| 117 | |||
| 94 | }); | 118 | }); |
| 95 | } | 119 | } |
| 96 | function reload() { | 120 | function reload() { | ... | ... |
-
Please register or sign in to post a comment