init
Showing
1 changed file
with
35 additions
and
0 deletions
| ... | @@ -99,6 +99,41 @@ | ... | @@ -99,6 +99,41 @@ |
| 99 | layer.msg('通过'); | 99 | layer.msg('通过'); |
| 100 | }); | 100 | }); |
| 101 | } | 101 | } |
| 102 | |||
| 103 | function cancel(id) { | ||
| 104 | layer.confirm('确定取消?', { | ||
| 105 | btn: ['是','否'], | ||
| 106 | title: '确认', | ||
| 107 | icon: 3 | ||
| 108 | }, function(){ | ||
| 109 | var targetUrl = 'flow/cancelOrder/' + id; | ||
| 110 | $.ajax({ | ||
| 111 | type: 'put', | ||
| 112 | url: apiBaseUrl + targetUrl, | ||
| 113 | cache: false, | ||
| 114 | dataType: 'json', | ||
| 115 | contentType: "application/json; charset=UTF-8", | ||
| 116 | success: function (data) { | ||
| 117 | if (data.msg) { | ||
| 118 | layer.alert(data.msg); | ||
| 119 | } else if (data.code != 0) { | ||
| 120 | layer.alert('请求失败'); | ||
| 121 | } else { | ||
| 122 | layer.alert('请求成功'); | ||
| 123 | } | ||
| 124 | setTimeout(function () { | ||
| 125 | if(!data.code) { | ||
| 126 | table.fnDraw(); | ||
| 127 | layer_close(); | ||
| 128 | } | ||
| 129 | },500); | ||
| 130 | }, | ||
| 131 | error: function () { | ||
| 132 | layer.alert("请求失败") | ||
| 133 | } | ||
| 134 | }) | ||
| 135 | }); | ||
| 136 | } | ||
| 102 | </script> | 137 | </script> |
| 103 | </body> | 138 | </body> |
| 104 | <html> | 139 | <html> | ... | ... |
-
Please register or sign in to post a comment