<%@ 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>
	<script type="text/javascript">
        function changeBtn(obj) {

        }
	</script>
</head>
<body>
<div class="wrapper wrapper-content">
	<sys:message content="${message}"/>
	<div class="layui-row ">
		<div class="full-width fl">
			<div class="contentShadow layui-row" id="queryDiv">
				<form:form id="searchForm" modelAttribute="workAttendanceCount" action="${ctx}/workattendance/workAttendanceCount/" method="post" class="form-inline">
					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
					<div class="commonQuery lw9">
						<div class="layui-item query athird">
							<label class="layui-form-label">部门:</label>
							<div class="layui-input-block with-icon">
								<sys:treeselectChange id="office" name="office.id" value="${workAttendanceCount.office.id}" labelName="office.name"  labelValue="${workAttendanceCount.office.name}"
													  title="部门" url="/sys/office/treeDataBranchOffice?type=2" cssClass="form-control required layui-input" allowClear="true" />
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">月份：</label>
							<div class="layui-input-block">
								<form:input path="attendanceMonth" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
							</div>
						</div>
						<div class="layui-item athird">
							<div class="input-group">
								<button id="searchReset" class="fixed-btn searchReset fr" onclick="reset()">重置</button>
								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
							</div>
						</div>
						<div style="    clear:both;"></div>
					</div>
					<div id="moresees" style="clear:both;display:none;" class="lw9">

						<div style="clear:both;"></div>
					</div>
				</form:form>
			</div>
		</div>
		<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="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
					<div style="clear: both;"></div>
				</div>
				<table class="oa-table layui-table" id="contentTable1"></table>

				<!-- 分页代码 -->
				<table:page page="${page}"></table:page>
				<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: '#contentTable1'
            ,page: false
            ,cols: [[
                // {checkbox: true, fixed: true},
                {field:'attendanceMonth',align:'center', title: '月份',minWidth:160,templet:function(d){
                        return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('考勤单', '${ctx}/workattendance/workAttendanceCount/form?id=" + d.id + "&view=view','95%', '95%')\">" + d.attendanceMonth + "</a>";
                    }}
                ,{field:'office', align:'center',title: '部门',minWidth:120}
                ,{field:'officeCount', align:'center',title: '部门人数',minWidth:120}
                ,{field:'attendanceCount', align:'center',title: '考勤人数',minWidth:160}
                ,{field:'attendanceEndDate', align:'center',title: '考勤截止日',minWidth:160}
                ,{field:'attendanceDate', align:'center',title: '确认时间',width:200}
                ,{field:'user', align:'center',title: '确认人',width:200}
                ,{field:'status', align:'center',title: '确认状态',width:200}

            ]]
            ,data: [
                <c:if test="${ not empty page.list}">
                <c:forEach items="${page.list}" var="workAttendanceCount" varStatus="index">
                <c:if test="${index.index != 0}">,</c:if>
                {
                    "id":"${workAttendanceCount.id}"
                    ,"attendanceMonth":"${workAttendanceCount.attendanceMonth}"
                    ,"office":"${workAttendanceCount.office.name}"
                    ,"officeCount":"${workAttendanceCount.officeCount}"
                    ,"attendanceCount":"${workAttendanceCount.attendanceCount}"
                    ,"attendanceEndDate":"<fmt:formatDate value="${workAttendanceCount.attendanceEndDate}" pattern="yyyy-MM-dd"/>"
                    ,"attendanceDate":"<fmt:formatDate value="${workAttendanceCount.attendanceDate}" pattern="yyyy-MM-dd"/>"
                    ,"user":"${workAttendanceCount.user.name}"
                    ,"status":"${fns:getDictLabel(workAttendanceCount.status, 'attendance_count_status', '')}"
                }
                </c:forEach>
                </c:if>
            ]
            // ,even: true
            // ,height: 315
        });

    })
    resizeListTable();/*消除由于有竖向滚动条造成table出现横向滚动条*/
    $("a").on("click",addLinkVisied);
</script>
<script>
    resizeListWindow1();
    $(window).resize(function(){
        resizeListWindow1();
    });
</script>
</body>
</html>
