<!--{include file="<!--{$oapath}-->public/ins_popup.tpl"}-->
<block name="content">
	<input type="hidden" name="val" id="val">
	<input type="hidden" name="name" id="name">
	<div class="popup-header clearfix">
		<div class="pull-left">
			<h1>请选择上级部门</h1>
		</div>
		<div class="pull-right">
			<a onclick="save();" class="btn btn-sm btn-primary">确定</a>
			<a onclick="myclose();" class="btn btn-sm btn-default">关闭</a>
		</div>
	</div>
	<div class="popup-body" style="height: 420px;overflow-y: auto;">
		<div class="popup_tree_menu">
			<ul class="tree_menu">
				<li>
					<a node="0"><i class="fa fa-angle-right"></i> <span>根节点</span> </a>
					<!--{$menu}-->
				</li>
			</ul>
		</div>
	</div>
</block>

                                		</div>
		<!-- Mainly scripts -->
		<script src="<!--{$oapath}-->Ins/js/jquery-2.1.1.js"></script>
		<script src="<!--{$oapath}-->Ins/js/bootstrap.min.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/metisMenu/jquery.metisMenu.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<!-- Custom and plugin javascript -->
		<script src="<!--{$oapath}-->Ins/js/inspinia.js"></script>
		<script src="<!--{$oapath}-->Ins/js/common.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/pace/pace.min.js"></script>
                
		<script src="<!--{$oapath}-->Ins/js/plugins/toastr/toastr.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/gritter/jquery.gritter.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/bootbox/bootbox.min.js"></script>
		<block name="js"></block>
		<script>
			$(document).ready(function() {
				$(".popup-container").width($("#dialog", parent.document).width());
				if (is_mobile()) {
					$(".popup-container").height(window.screen.height - 40);
					$(".popup-container").css('overflow', 'auto');
				}
			});
		</script>
 <block name="js">
	<script type="text/javascript">
		function save() {
			if ($("#name").val().length > 0) {
				$("#dept_name", parent.document).val($("#name").val());
				$("#pid", parent.document).val($("#val").val());
			} else {
				ui_error("请选择级部门");
				return false;
			}
			myclose();
		}

		$(document).ready(function() {
			parent_node = $(".sub_left_menu ul.tree_menu a.active", parent.document).attr("node");
			$("ul.tree_menu a[node='" + parent_node + "']").addClass("disabled");
			$(".popup_tree_menu a:not('.disabled')").click(function() {
				$("#val").val($(this).attr("node"));
				$("#name").val($(this).children("span").text());
				$(".tree_menu a.active").removeClass("active");
				$(this).addClass("active");
			});
		});
	</script>
</block>
	</body>
</html>