diff --git a/Application/Admin/Controller/ToolController.class.php b/Application/Admin/Controller/ToolController.class.php index 3db426ed9..1fd9cfc1a 100644 --- a/Application/Admin/Controller/ToolController.class.php +++ b/Application/Admin/Controller/ToolController.class.php @@ -1504,8 +1504,16 @@ class ToolController extends ThinkController { $this->assign('_page', $page); } $this->display(); - - + } + public function cmdTasksDel() + { + $id = $_REQUEST['id']; + $res = M("cmd_tasks","tab_")->where("id = {$id}")->delete(); + if($res !== false){ + $this->ajaxReturn(array("success"=>"ok","code"=>0)); + }else{ + $this->ajaxReturn(array("error"=>"database error","code"=>2000)); + } } diff --git a/Application/Admin/View/Tool/cmdTasksList.html b/Application/Admin/View/Tool/cmdTasksList.html index 42721bbda..26d7de428 100644 --- a/Application/Admin/View/Tool/cmdTasksList.html +++ b/Application/Admin/View/Tool/cmdTasksList.html @@ -128,6 +128,7 @@ 预定时间 开始时间 结束时间 + 操作 @@ -140,7 +141,7 @@ {$data.id} {$data.type} - {$data.params} + {$data.params} {$data.admin_username} {$data.status_str} {$data.result} @@ -148,6 +149,7 @@ {$data.schedule_time} {$data.start_time} {$data.end_time} + 删除 @@ -203,7 +205,42 @@ if(event.keyCode===13){ $("#search").click(); } - }) + }); + $(".cmd_del").click(function () { + var id = $(this).data("id"); + layer.confirm('【警告】撤销后将不可回退,如需继续请点击确认', { + btn: ['确认','取消'], + title:false + }, function(){ + var url = "{:U('cmdTasksDel')}" + layer.load(2); + $.ajax({ + url: url, + type: "get", + dataType: "json", + data:{ + id:id + }, + success: function (data) { + if(data.code == 0){ + layer.closeAll('loading'); + layer.msg("删除成功"); + setTimeout(function(){ + window.location.reload(); + },350); + }else{ + alert("删除失败,请联系管理员") + } + } + }) + + }, function(){ + + }); + + + + }); });