<%@ 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="workAttendanceRule" action="${ctx}/workattendance/workAttendanceRule/" 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="branchOffice" name="branchOffice.id" value="${workAttendanceRule.branchOffice.id}" labelName="branchOffice.name"  labelValue="${workAttendanceRule.branchOffice.name}"
													  title="部门" url="/sys/office/treeDataCompanyDSF?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="name" 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">
					<shiro:hasPermission name="workattendance:workAttendanceRule:add">
						<table:addRow url="${ctx}/workattendance/workAttendanceRule/form" title="考勤规则"></table:addRow><!-- 增加按钮 -->
					</shiro:hasPermission>
					<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:'number', align:'center',title: '报告编号',width:80}
                ,{field:'branchOffice', align:'center',title: '分公司',minWidth:120}
                ,{field:'name',align:'center', title: '规则名称',minWidth:160,templet:function(d){
                        return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看考勤规则', '${ctx}/workattendance/workAttendanceRule/form?id=" + d.id + "&view=view','95%', '95%')\">" + d.name + "</a>";
                    }}
                ,{field:'type', align:'center',title: '考勤方式',minWidth:160}
                ,{field:'notWorkCount', align:'center',title: '非工作日计算加班',minWidth:160}
                ,{field:'updateDate', align:'center',title: '修改日期',width:200}
                ,{align:'center',title:"操作",width:200,templet:function(d){
                        ////对操作进行初始化
                        var xml = "";
                        if(d.canedit1 != undefined && d.canedit1 == "1")
                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialog('修改考勤规则', '${ctx}/workattendance/workAttendanceRule/form	?id="+ d.id + "','95%','95%')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 修改</a>";
                        if(d.candelete != undefined && d.candelete == "1")
                            xml +="<a href=\"${ctx}/workattendance/workAttendanceRule/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该考勤规则吗？', this.href)\"   class=\"op-btn op-btn-delete\"><i class=\"fa fa-trash\"></i> 删除</a>";

                        return xml;
                    }}
            ]]
            ,data: [
                <c:if test="${ not empty page.list}">
                <c:forEach items="${page.list}" var="workAttendanceRule" varStatus="index">
                <c:if test="${index.index != 0}">,</c:if>
                {
                    "id":"${workAttendanceRule.id}"
                    ,"number":"${workAttendanceRule.number}"
                    ,"branchOffice":"${workAttendanceRule.branchOffice.name}"
                    ,"name":"${workAttendanceRule.name}"
                    ,"type":"${fns:getDictLabel(workAttendanceRule.type, 'attendance_type', '')}"
                    ,"notWorkCount":"${fns:getDictLabel(workAttendanceRule.notWorkCount, 'not_work_count', '')}"
                    ,"updateDate":"<fmt:formatDate value="${workAttendanceRule.updateDate}" pattern="yyyy-MM-dd"/>"
                    <shiro:hasPermission name="workattendance:workAttendanceRule:edit">,"canedit1":"1"</shiro:hasPermission>
                    <shiro:hasPermission name="workattendance:workAttendanceRule:del"> ,"candelete":"1"</shiro:hasPermission>
                }
                </c:forEach>
                </c:if>
            ]
            // ,even: true
            // ,height: 315
        });

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