<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
<title>详细</title>
<%@ include file="/include/header.jsp"%>
<link type="text/css" rel="stylesheet" href="${ctx}/css/baseFrame.css" />
</head>
<body class="bg1">
	<table id="tbwrap" class="table_list"></table>
		<thead>
			<tr>
				<th>用户ID</th>
				<th>用户名</th>
                <th>用户状态</th> 
				<th>用户级别</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody data-type="body">
			<!if(list.length>0) { 
				for(var i=0;i<list.length;i++){			
					var item = list[i],classItem = (i%2!=0)?"odd td_odd":"even";
				!>
				<tr class="gradeA <!=classItem!>">
					<td title="<!=item["userId"]!>"><!=item["userId"]!></td>
					<td title="<!=item["userName"]!>"><!=item["userName"]!></td>
					<td title="<!=item["status"]!>"><!=item["status"]!></td>
                    <td title="<!=item["level"]!>"><!=item["level"]!></td>
					<td>
                        <a title="下发" data-value="<!=item["userId"]!>" data-name="<!=item["userId"]!>" onclick="nextTask(<!=item["userId"]!>)" class="nextTask">下发</a>
                    </td>
				</tr>
			<!}!>
			<!}else{!>
				<tr>
					<td colspan="6"> 暂无数据</td>
				</tr>
			<!}!>
		</tbody>
   
         <div class="action_box m_t10 t_c">
			<input type="button" class="b_btn" id="returnBtn" value="返回" />
		</div>
	
	
	
	<script type="text/javascript">
	//下发
		$(function() {
            //下发任务
           function nextTask(id){
            	$.ajax({
            		type:"POST",
            		data:{id:id},
            		url:"${ctx}/sysTask/nextTask.do",
            		dataType:"json",
            		success:function(result){
            			if(result){
            				alert("下发成功！");
            			}else{
            				alert("下发失败！");
            			}
            		}
            	})
            }
            });
		$(function(){
			// 注册返回按钮事件
			$("#returnBtn").click(function () {
				// 关闭弹窗窗口
				parent.sysTaskDialog.close();
	        });
		});
		
	</script>
</body>
</html>