<%@ 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/confirmJsp.jspf" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>打印用途管理iframe页面</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 type="text/javascript" src="${path}/static/js/recordManage/printing/function.js"></script>
    <script>
        var path = "${path}";
    </script>
    <style type="text/css">
        .saveBtn{
             width: 100%;
             height: 50px;
             text-align: center;
         }
        .DropShadow{
            background-color:#00ACD6;
            color:#fff;
            text-align: center;
        }
        /*.btnTr{
            height:5%!important;
        }*/
        /*.btns{
            margin-left:2%;
        }*/
        .labelDiv{
            width:30%;
            float:left;
            text-align: right;
        }
        .control-label{
            padding-right: 10%;
            padding-top:5px;
        }
        .inputDiv{
            width:60%;
            float:left;
        }
    </style>
</head>
<body>
<div class="row clearfix">
    <div class="col-md-12">
        <table class="table table-bordered">
            <tr>
                <th>序号</th>
                <th>类别标志</th>
                <th>类别名称</th>
                <th>排序</th>
                <th>有效否</th>
                <th>选中否</th>
                <th>创建人</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            <tr style="height:40px;">
                <td  style="height:40px">${emrType.id}</td>
                <td id="typeFlag" style="height:40px">${emrType.typeFlag}</td>
                <td id="typeName">${emrType.typeName}</td>
                <td id="typeSort">${emrType.typeSort}</td>
                <c:choose>
                    <c:when test="${emrType.effective == 1}">
                        <td id="effective">是</td>
                    </c:when>
                    <c:when test="${emrType.effective == 0}">
                        <td id="effective">否</td>
                    </c:when>
                    <c:otherwise>
                        <td id="effective"></td>
                    </c:otherwise>
                </c:choose>
                <c:choose>
                    <c:when test="${emrType.selectFlag == 1}">
                        <td id="selectFlag">是</td>
                    </c:when>
                    <c:when test="${emrType.selectFlag == 0}">
                        <td id="selectFlag">否</td>
                    </c:when>
                    <c:otherwise>
                        <td id="selectFlag"></td>
                    </c:otherwise>
                </c:choose>
                <td id="creater">${emrType.creater}</td>
                <td id="createTime">${emrType.createTime}</td>
                <td>
                    <shiro:hasPermission name="/printing/updateEmrType">
                        <button type="button" class="btn btn-sm btn-info btns left" data-toggle="modal" data-target="#myModal2">编辑</button>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="/printing/deleteEmrType">
                        <button type="button" class="btn btn-sm btn-danger btns left" onclick="del()">删除</button>
                    </shiro:hasPermission>
                </td>
            </tr>
        </table>
    </div>
</div>
<FORM id="Form1" name="Form1"  method="POST">
    <br>
    <table border="0" width="100%" cellspacing="0" cellpadding="0">
        <tr height=10><td></td></tr>
        <tr>
            <td width="100%">
                <table border="0" class="mainTable" width="100%" cellspacing="3" cellpadding="0">
                    <tr height=10>
                        <TD width="10%"></TD>
                        <TD width="25%" class="DropShadow">未选中列表</TD>
                        <td width="20%">
                        <TD width="25%" class="DropShadow">选中列表</TD>
                        <td width="20%">
                    </tr>
                    <tr>
                        <input type="hidden" name="isexpEnglishs" id=isexpEnglishs value="">
                        <td width="10%"></td>
                        <td width="73%" colspan="4">
                            <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="30%" rowspan="5">
                                        <!--左边未选中-->
                                        <select name="colname1" id="colname1"
                                                size="17" multiple="true" ondblclick="JavaScript:Add('colname1','colname2','colname')"
                                                style="width:92%;height:361px">
                                            <c:forEach items="${assorts }" var="assort">
                                                <c:if test="${assort.printFlag == null}">
                                                    <option value="${assort.assortId}" >${assort.assortName}</option>
                                                </c:if>
                                            </c:forEach>
                                        </select>
                                    </td>
                                    <td width="20%"></td>
                                    <td width="30%" rowspan="5" id="colnameDiv">
                                        <!--右边选中-->
                                        <select  name="colname2" id="colname2" size="17" multiple="true" ondblclick="JavaScript:Remove('colname1','colname2','colname')" style="width:92%;height:361px">
                                            <c:forEach items="${assorts }" var="assort">
                                                <c:if test="${assort.printFlag != null}">
                                                    <option value="${assort.assortId}" >${assort.assortName}</option>
                                                </c:if>
                                            </c:forEach>
                                        </select>
                                    </td>
                                    <td width="20%"></td>
                                </tr>

                                <tr class="btnTr">
                                    <td width="90" align="center">
                                        <input name="DoAddb" class="btn btn-default" type="button" value="|《   全部" onClick="JavaScript:allRemove()">
                                    </td>
                                </tr>
                                <tr class="btnTr">
                                    <td width="90" align="center">
                                        <input name="DoDelb" class="btn btn-default" type="button" value="《   左移" onClick="JavaScript:Remove()">
                                    </td>
                                </tr>
                                <tr class="btnTr">
                                    <td width="90" align="center">
                                        <input name="DoDelb" class="btn btn-default" type="button" value="右移   》" onClick="JavaScript:Add()">
                                    </td>
                                </tr>
                                <tr class="btnTr">
                                    <td width="90" align="center">
                                        <input name="DoDelb" class="btn btn-default" type="button" value="全部    》|" onClick="JavaScript:allAdd()">
                                    </td>
                                </tr>

                                <tr><td width="73">
                                    <INPUT type="hidden"  id="typeId" value="${id }">
                                </td></tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
       <%-- <tr height=10><td></td></tr>
        <tr height=10><td></td></tr>--%>
    </table>
</FORM>

<div class="row">
    <shiro:hasPermission name="/printing/addTypeRelated">
        <div class="saveBtn">
            <button type="button" class="btn btn-sm btn-primary btn-info" style="width:20%" onclick="update()">保存</button>
        </div>
    </shiro:hasPermission>
</div>
<!-- 模态框2（Modal）修改 -->
<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    <font size="30">&times;</font>
                </button>
                <h4 class="modal-title" style="font-weight: bold">
                    打印用途管理
                </h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" role="form" id="updateForm">
                    <input type="hidden" id="selectFlagId" name="selectFlagId" value="${selectFlagId}">
                    <input type="hidden" id="id" name="id" value="${emrType.id}">

                    <div class="form-group">
                        <div class="labelDiv">
                            <label class="control-label">类别标志：</label>
                        </div>
                        <div class="inputDiv">
                            <input type="text" class="form-control input-sm input" name="typeFlag" id="typeFlag1" value="${emrType.typeFlag}" maxlength="25">
                        </div>
                        <div class="col-sm-1"></div>
                    </div>
                    <div class="form-group">
                        <div class="labelDiv">
                            <label class="control-label">类别名称：</label>
                        </div>
                        <div class="inputDiv">
                            <input type="text" class="form-control input-sm input" name="typeName" id="typeName1" value="${emrType.typeName}" maxlength="25">
                        </div>
                        <div class="col-sm-1"></div>
                    </div>
                    <div class="form-group">
                        <div class="labelDiv">
                            <label class="control-label">排序：</label>
                        </div>
                        <div class="inputDiv">
                            <input type="number" class="form-control input-sm input" name="typeSort" id="typeSort1" value="${emrType.typeSort}" oninput="if(value.length>9)value=value.slice(0,9)">
                        </div>
                        <div class="col-sm-1"></div>
                    </div>
                    <div class="form-group">
                        <div class="labelDiv">
                            <label class="control-label">有效否：</label>
                        </div>
                        <div class="inputDiv">
                            <select class="form-control input-sm input" name="effective" id="effective1">
                                <option value="1" <c:if test="${emrType.effective == 1}">selected</c:if>>是</option>
                                <option value="0" <c:if test="${emrType.effective == 0}">selected</c:if>>否</option>
                            </select>
                        </div>
                        <div class="col-sm-1"></div>
                    </div>
                    <div class="form-group">
                        <div class="inputDiv" style="margin-left:40%">
                            <input type="radio" value="1" name="selectFlag" id="selectFlag1" <c:if test="${emrType.selectFlag == 1}">checked</c:if>>选中类别为当前使用
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-sm btn-primary" onclick="update1()">
                    提交更改
                </button>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="${path}/static/js/recordManage/printing/printManageIframe.js"></script>
</body>
</html>
