<%@ page import="com.jeeplus.modules.sys.utils.UserUtils" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>报告号</title>
	<meta name="decorator" content="default"/>


	<style>
		.widthClass{
			display: inline-block;
		}
		.shows .input-group{
			width: 48%!important;
		}
	</style>
	<style>
		body{
			background-color:transparent;
			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
			color:#ffffff;
			background-color:rgba(255,255,255,0);
			height:100%;
		}
	</style>
</head>
<body>
<div class="wrapper wrapper-content">
	<sys:message content="${message}"/>
	<div class="layui-row">


		<div class="full-width fl">
			<div class="contentShadow layui-form contentDetails">
				<div class="nav-btns">
					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="getOne()" title="领取"><i class="fa fa-plus"></i>&nbsp;领一个</button>
					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="getMore()" title="领取"><i class="fa fa-plus"></i>&nbsp;领多个</button>
					<div style="clear: both;"></div>
				</div>
				<table class="oa-table layui-table" id="contentTable">
				</table>

				<div style="clear: both;"></div>
			</div>
		</div>
	</div>
</div>
<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
<script>
    layui.use('table', function(){
        layui.table.render({
            limit:${ page.pageSize }
            ,elem: '#contentTable'
            ,page: false
            ,cols: [[
                {field:'index',align:'center',width:120, title: '序号'},
                {field:'num',align:'center',  title: '报告号'}
				,{field:'op',align:'center',title:"操作",width:200,templet:function(d){
						var xml = "";
						 xml +="<a href=\"${ctx}/projectreportnum/projectReportNum/download?number=" +encodeURIComponent(encodeURIComponent( d.num ))+ "\"    class=\"op-btn op-btn-edit\"><i class=\"fa fa-edit\"></i> 生成报告模板</a>";
						 return xml
				}
				}
            ]]
            ,data: [
                <c:if test="${ not empty page.list}">
                <c:forEach items="${page.list}" var="reportNum" varStatus="index">
                <c:if test="${index.index != 0}">,</c:if>
                {
                    "index":"${index.index+1}"
                    ,"num":"${reportNum.num}"
                }
                </c:forEach>
                </c:if>
            ]

        });

    })
</script>
<script>
    resizeListWindow1();
    $(window).resize(function(){
        resizeListWindow1();
    });
</script>
<script type="text/javascript">
    $(document).ready(function() {


    });
    function getOne() {
		$.ajax({
			url:"${ctx}/projectreportnum/projectReportNum/save",
			data:{type:"one"},
			success:function (result) {
				if(result.code == '1') {
					layer.msg(result.msg, {icon: 1});
					window.location.reload();
				}else {
					layer.msg(result.msg, {icon: 5});
				}
			}
		})
	}
	function getMore() {
		$.ajax({
			url:"${ctx}/projectreportnum/projectReportNum/save",
			data:{type:"more"},
			success:function (result) {
				if(result.code == '1') {
					layer.msg(result.msg, {icon: 1});
					window.location.reload();
				}else {
					layer.msg(result.msg, {icon: 5});
				}
			}
		})
	}

</script>
</body>
</html>