function setTabLab(name, cursel, n, isHideTitle) { var jumpMenu = document.getElementById(name + cursel); if (typeof ($(jumpMenu).attr("jumpUrl")) == "undefined") { for (i = 1; i <= n; i++) { var menu = document.getElementById(name + i); var con = document.getElementById("con_" + name + "_" + i); var conTable = document.getElementById("conTable_" + name + "_" + i); menu.className = i == cursel ? "border_L active" : "border_L"; var displays = "none"; if (i == cursel) { displays = ""; } con.style.display = displays; conTable.style.display = displays; $(conTable).find(".select_table").css({ "display": displays }); if (i == cursel) { getDepDescription(name + cursel, i); } } if (isHideTitle) { $("#Scheduling_title").hide(); $("#Scheduling_icon_box").hide(); } else { $("#Scheduling_title").show(); $("#Scheduling_icon_box").show(); } var tbody_T = $("#Scheduling").offset().top; var y = $(document).scrollTop(); var Jque_Btn = $("#Scheduling_icon_box").find(".Scheduling_btn"); if (y >= tbody_T) { $("#Scheduling_icon_box").css({ "position": "fixed", "top": "0px" }); $(".cz_search").css({ "top": "42px" }); $("table#Scheduling_table").css({ "marginTop": "127px" }); if ($("#First_tb").find("#First_tr").length > 0) { $(".conTable_tableb").each(function () { if ($(this).find(".First_tr").length <= 0) { $(this).find(".select_table").prepend($("#First_tb").find("#First_tr")); $(this).find(".select_table").prepend($("#First_tb").find("#displayFirstTd")); } }); } $(".conTable_tableb:visible").find(".select_table:visible").find("#First_tr").prependTo("#First_tb"); $(".conTable_tableb:visible").find(".select_table:visible").find("#displayFirstTd").prependTo("#First_tb"); $("#Scheduling_tab").hide(); $("#Scheduling").css({ "position": "initial" }); Jque_Btn.show(); } else { $("#Scheduling_tab").css({ "position": "initial" }); $("#Scheduling_icon_box").css({ "position": "relative" }); $(".cz_search").css({ "top": "12px" }); $("table#Scheduling_table").css({ "marginTop": "0" }); $("#Scheduling_tab").show(); if ($("#First_tb").find("#First_tr").length > 0) { $(".conTable_tableb").each(function () { if ($(this).find(".First_tr").length <= 0) { $(this).find(".select_table").prepend($("#First_tb").find("#First_tr")); $(this).find(".select_table").prepend($("#First_tb").find("#displayFirstTd")); } }); } $(".conTable_tableb:visible").find(".select_table").prepend($("#First_tb").find("#First_tr")); $(".conTable_tableb:visible").find(".select_table").prepend($("#First_tb").find("#displayFirstTd")); Jque_Btn.hide(); } } else { window.open($(jumpMenu).attr("jumpUrl")); } } //处理科室备注信息,如无科室备注显示默认 function getDepDescription(name, i) { var oldName = name; if (i == 1) { name = name + i; } var conTable = $("#" + name); if (conTable.length > 0) { if (conTable.attr("class").indexOf("active") > 0) { getDepDescription(name, 1); } else { getDepDescription(oldName + (i + 1), 1); } } else { if ($("#DepDescription_" + oldName).length > 0) { if ($("#DepDescription_" + oldName).html() == "") { $("#DepDescription").html($("#currDepDescription").html()); } else { $("#DepDescription").html($("#DepDescription_" + oldName).html()); } } else { $("#DepDescription").html($("#currDepDescription").html()); } } } $(function () { $("#tableb1").click(); getDepDescription("tableb", 1); var tbody_T = $("#Scheduling").offset().top; var Min_W = $(".main_content").width(); var lastY = 0; $("#Scheduling").css({ "width": Min_W }); $("#Scheduling_icon_box").css({ "width": Min_W }); $(window).scroll(function () { var y = $(document).scrollTop(); if (y != lastY) { lastY = y; var Jque_Btn = $("#Scheduling_icon_box").find(".Scheduling_btn"); if (y >= tbody_T) { $("#Scheduling_icon_box").css({ "position": "fixed", "top": "0px" }); $(".cz_search").css({ "top": "42px" }); $("table#Scheduling_table").css({ "marginTop": "127px" }); if ($("#First_tb").find("#First_tr").length > 0) { $(".conTable_tableb").each(function () { if ($(this).find(".First_tr").length <= 0) { $(this).find(".select_table").prepend($("#First_tb").find("#First_tr")); $(this).find(".select_table").prepend($("#First_tb").find("#displayFirstTd")); } }); } $(".conTable_tableb:visible").find(".select_table:visible").find("#First_tr").prependTo("#First_tb"); $(".conTable_tableb:visible").find(".select_table:visible").find("#displayFirstTd").prependTo("#First_tb"); $("#Scheduling_tab").hide(); $("#Scheduling").css({ "position": "initial" }); Jque_Btn.show(); Jque_Btn.click(function () { if (y >= tbody_T) { $("#Scheduling_tab").show(); $(this).hide(); $("#Scheduling_icon_box").css({ "position": "relative" }); $(".cz_search").css({ "top": "12px" }); $("#Scheduling").css({ "position": "fixed", "top": "0" }); } }) } else { $("#Scheduling_tab").css({ "position": "initial" }); $("#Scheduling_icon_box").css({ "position": "relative" }); $(".cz_search").css({ "top": "12px" }); $("table#Scheduling_table").css({ "marginTop": "0" }); $("#Scheduling_tab").show(); if ($("#First_tb").find("#First_tr").length > 0) { $(".conTable_tableb").each(function () { if ($(this).find(".First_tr").length <= 0) { $(this).find(".select_table").prepend($("#First_tb").find("#First_tr")); $(this).find(".select_table").prepend($("#First_tb").find("#displayFirstTd")); } }); } $(".conTable_tableb:visible").find(".select_table").prepend($("#First_tb").find("#First_tr")); $(".conTable_tableb:visible").find(".select_table").prepend($("#First_tb").find("#displayFirstTd")); Jque_Btn.hide(); } } }) //定位院区 var levelId = GetQueryString("levelId"); var levelId1 = GetQueryString("levelId1"); var levelId2 = GetQueryString("levelId2"); if (levelId != null) { $('#tableb' + levelId).click(); } if (levelId != null && levelId1 != null) { $('#tableb' + levelId + levelId1).click(); } if (levelId != null && levelId1 != null && levelId2 != null) { $('#tableb' + levelId + levelId1 + levelId2).click(); } // 医生弹窗 // $(".showson").hover( // function () { $(this).addClass("zIndex").find(".speace_span:first").fadeIn(500) }, // function () { $(this).removeClass("zIndex").find(".speace_span:first").stop(true, true).hide(250) } // ) }); function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; }