57ba2561 by yangjianbin

init

1 parent 4ad0c170
...@@ -134,13 +134,38 @@ ...@@ -134,13 +134,38 @@
134 $('#table').DataTable().columns().search("").draw(); 134 $('#table').DataTable().columns().search("").draw();
135 } 135 }
136 136
137 function cancel() { 137 function cancel(id) {
138 layer.confirm('确定取消?', { 138 layer.confirm('确定取消?', {
139 btn: ['是','否'], 139 btn: ['是','否'],
140 title: '确认', 140 title: '确认',
141 icon: 3 141 icon: 3
142 }, function(){ 142 }, function(){
143 layer.msg('通过'); 143 var targetUrl = 'flow/cancelOrder/' + id;
144 $.ajax({
145 type: 'put',
146 url: apiBaseUrl + targetUrl,
147 cache: false,
148 dataType: 'json',
149 contentType: "application/json; charset=UTF-8",
150 success: function (data) {
151 if (data.msg) {
152 layer.alert(data.msg);
153 } else if (data.code != 0) {
154 layer.alert('请求失败');
155 } else {
156 layer.alert('请求成功');
157 }
158 setTimeout(function () {
159 if(!data.code) {
160 table.fnDraw();
161 layer_close();
162 }
163 },500);
164 },
165 error: function () {
166 layer.alert("请求失败")
167 }
168 })
144 }); 169 });
145 } 170 }
146 </script> 171 </script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!