<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<%@ include file="/WEB-INF/jspf/common.jspf" %>
<%@ include file="/WEB-INF/jspf/ztreeCommom.jsp" %>
<%@ include file="/WEB-INF/jspf/confirmJsp.jspf" %>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>功能组别分配</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv=X-UA-Compatible IE=EmulateIE7>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="${path}/static/js/html5shiv.min.js"></script>
    <script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="${path}/static/js/respond.min.js"></script>
    <![endif]-->
    <script>
        var path = "${path}";
    </script>
    <style type="text/css">
        .left{
            float:left;
        }
        /**搜索区*/
        .mainDiv{
            background-color: #fff;
        }
        .searchDiv{
            padding-top:10px;
            height:48px;
        }
        /**查询按钮组*/
        .btnsDiv{
            height:30px;
            text-align: right;
        }
        .btns{
            margin-left: 1%;
        }
        .typeBtn{
            margin-left: 10%;
        }
        .dateSearchDiv{
            text-align: right;
            width:34%;
        }
        .dateSearchInput{
            width:30%;
            margin-left:3%;
        }
        .dateLabelDiv{
            width: 28%;
        }
        /*搜索区域*/
        .searchInput{
            text-align: right;
            width:18%;
        }
        /*搜索区域labelDiv*/
        .searchElement{
            width: 48%;
        }
        /*搜索区域inputDiv*/
        .searchInputElement{
            width: 52%;
        }
        .labelDiv{
            padding-top:4%;
            margin-left: 2%;
        }
        #tableDiv{
            margin-left:12px;
        }
        .pagination{
            margin:0!important;
        }
        /*模态框头*/
        .modal-header{
            background-color: #199ED8;
            text-align: center;
        }
        #treeDemo{
            width: 248px;
            height: 300px;
            overflow: auto;
        }
    </style>
</head>
<body>
<input type="hidden" id="roleId" value="${CURRENT_USER.roleId}">
<input type="hidden" id="checks">
<div class="main">
    <div class="headDiv">
        <div class="headSpanDiv">
            <span class="headspan">
                功能组别分配
            </span>
        </div>
    </div>
    <div class="mainDiv">
        <!--搜索区-->
        <div class="searchDiv">
            <form id="searchForm">
                <div class="searchInput left" style="margin-left: 12px;">
                    <div class="searchElement left">
                        <label class="labelDiv">功能组别：</label>
                    </div>
                    <div class="searchInputElement left">
                        <select class="form-control input-sm input" id="searchTypeFlag">
                            <option value="">选择功能组别</option>
                        </select>
                    </div>
                </div>
                <div class="searchInput left">
                    <div class="searchElement left">
                        <label class="labelDiv">已分配：</label>
                    </div>
                    <div class="searchInputElement left">
                        <input type="text" class="form-control input-sm" id="searchUserName" maxlength="16">
                    </div>
                </div>
                <div class="dateSearchDiv left">
                    <div class="dateLabelDiv left">
                        <label class="labelDiv">有效日期：</label>
                    </div>
                    <div class="dateSearchInput left">
                        <input type="text" class="form-control input-sm" id="startTime1" placeholder="开始时间" maxlength="10" autocomplete="off">
                    </div>
                    <div class="dateSearchInput left">
                        <input type="text" class="form-control input-sm" id="endTime1" placeholder="结束时间" maxlength="10" autocomplete="off">
                    </div>
                </div>
                <div class="searchInput left">
                    <div class="searchElement left">
                        <label class="labelDiv">是否有效：</label>
                    </div>
                    <div class="searchInputElement left">
                        <select class="form-control input-sm input" id="searchEffective">
                            <option value="">全部</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="left" style="margin-left: 1%">
                    <button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
                </div>
            </form>
        </div>

        <!--数据表格-->
        <div class="btnsDiv">
            <shiro:hasPermission name="/funGroupDistribution/deleteById">
                <button type="button" class="btn btn-sm btn-danger btns" onclick="deleteByIds()">批量删除</button>
            </shiro:hasPermission>
            <shiro:hasPermission name="/funGroupDistribution/addFunGroupDistribution">
                <button type="button" class="btn btn-sm btn-warning btns" onclick="addDistribution()" data-toggle="modal" data-target="#myModal2">  +  增加</button>
            </shiro:hasPermission>
            <shiro:hasPermission name="/funGroupDistribution/exportExcel">
                <button type="button" class="btn btn-sm btn-primary btns" onclick="exportExcel()"><i class="fa fa-reply"></i>导出</button>
            </shiro:hasPermission>
        </div>
        <div id="tableDiv" class="tableDiv">
            <table id="mytab" class="table text-nowrap table-bordered">
            </table>
        </div>
    </div>
</div>
<!-- 模态框2（Modal）添加收藏 -->
<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabe2" aria-hidden="true">
    <div class="modal-dialog" id="modalDialog2">
        <div class="modal-content" style="width:80%">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" style="font-weight: bold">
                    组别分配
                </h4>
            </div>
            <div class="modal-body" id="modal-body" style="height:295px">
                <form class="form-horizontal" id="form2">
                    <input type="hidden" name="formToken" id="formToken1">
                    <input type="hidden" id="id" name="id">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">功能组别：</label>
                            <div class="col-sm-7">
                                <select class="form-control input-sm input" id="typeFlag" name="typeFlag">
                                </select>
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">分配用户：</label>
                            <div class="col-sm-7" id="insert">
                                <input id="txtTreeSelect1" type="text" onclick="showMenu1(); return false;"
                                       class="form-control input-sm input" placeholder="分配用户"
                                       data-id=""
                                       readonly="readonly"
                                       name="userNames"
                                />
                                <input type="hidden" id="userIds" name="userIds">
                            </div>
                            <div class="col-sm-7" id="update">
                                <input class="form-control input-sm input" id="userName" name="userName" readonly>
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                        <div id="menuContent1" class="menuContent" style="display:none;background: #f9f9f9;
                                                 position:static;z-index:10;width:288px;margin-left:170px">
                            <ul id="treeDemo" class="ztree" style="margin-top: 0;">
                            </ul>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">是否有效：</label>
                            <div class="col-sm-7">
                                <select class="form-control input-sm input" id="effective" name="effective">
                                    <option value="1">是</option>
                                    <option value="0">否</option>
                                </select>
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">有效日期：</label>
                            <div class="col-sm-7">
                                <input class="form-control input-sm input date" id="effectiveTime" name="effectiveTime" maxlength="10" autocomplete="off"/>
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">备注：</label>
                            <div class="col-sm-7">
                                <textarea class="form-control input-sm input" id="remark" name="remark" maxlength="100"></textarea>
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    <div style="text-align: center">
                        <shiro:hasPermission name="/collect/addCollect">
                            <button type="button" class="btn btn-sm btn-primary typeBtn" onclick="saveDistribution()">保存</button>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="/collect/deleteCollect">
                            <button type="button" class="btn btn-sm btn-default typeBtn" onclick="addDistribution()">清空</button>
                        </shiro:hasPermission>
                    </div>
                </form>
                <div style="text-align: center;" id="approveDiv">
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${path}/static/js/otherManage/funGroupDistribution.js"></script>
<script src="${path}/static/js/dateUtil.js"></script>
</body>
</html>
