$(document).ready(function() { var ID = helper.request.queryString("str"); console.log(ID); /*tree下拉框效果*/ $(".inpBox .tree").click(function() { if($(this).parent().find(".addTree").is(":hidden")) { $(this).parent().find(".addTree").show(); } else { $(this).parent().find(".addTree").hide(); } }); /*普通下拉框效果*/ $(".inpBox .select").click(function() { if($(this).parent().find(".xl_common").is(":hidden")) { $(this).parent().find(".xl_common").show(); } else { $(this).parent().find(".xl_common").hide(); } }); $(".xl").click(function() { if($(this).parent().find(".addTree").is(":hidden")) { $(this).parent().find(".addTree").show(); } else { $(this).parent().find(".addTree").hide(); } if($(this).parent().find(".xl_common").is(":hidden")) { $(this).parent().find(".xl_common").show(); } else { $(this).parent().find(".xl_common").hide(); } }); $(".inpBox").mouseleave(function() { $(this).children(".addTree").hide(); $(this).children(".xl_common").hide(); }) $(".xl_box").on("click", "li", function() { var obj = $(this).parent().parent().parent(); obj.find("input").eq(0).val($(this).text()); obj.find("input").eq(1).val($(this).attr("itemid")); obj.find(".xl_common").hide(); }) $("input[name='ltype']").click(function() { var val = $("input[name='ltype']:checked").val(); if(val == '0') { $(".js").show(); } else if(val == '1') { $(".js").hide(); } }) if($("#zrbmtree")) { getBM($("#zrbmtree")); } //获取部门 var setting = { data: { key: { name: "F_DeptName" }, simpleData: { enable: true, idKey: "F_DeptId", pIdKey: "F_ParentId", rootPId: 0 } }, callback: { onClick: zTreeOnClick } }; function getBM(obj) { $.getJSON(huayi.config.callcenter_url + 'Department/GetAllList', { "token": $.cookie("token") }, function(result) { if(result.state.toLowerCase() == "success") { $.fn.zTree.init(obj, setting, result.data); } }) } function zTreeOnClick(event, treeId, treeNode) { if(event) { event.stopPropagation(); } var obj = $("#" + event.data.treeId).parent(); obj.parent().find("input").eq(0).val(treeNode.F_DeptName); obj.parent().find("input").eq(1).val(treeNode.F_DeptId); obj.hide(); getRY($(".clid"), $("#clbm").val()); }; //获取人员 function getRY(obj, deptid) { obj.empty(); obj.append('