//@ sourceURL=request-config.js $(function () { $(".selectpicker").selectpicker({ dropuAuto: false }); initDeptSelect(); //告警阈值 $.ajax({ type: "GET", url: '/thmz/getConfigByKey?key=alarm_num', dataType: "json", headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")}, success: function (res) { if (res == '401' || res == 401) { window.location.href = '/thmz/login/view' return; } $("#alarmNum").val(res.data.configValue); } }); $('#send').click(function () { //修改告警设置 $.ajax({ type: "POST", contentType: "application/json;charset=UTF-8", url: '/thmz/setConfig', dataType: "json", data: JSON.stringify({"configKey": "alarm_num","configValue": $("#alarmNum").val()}), headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")}, success: function (res) { if (res == '401' || res == 401) { window.location.href = '/thmz/login/view' return; } if (res.code == 0) { //修改告警人员 var doctor=$("#doctor").val(); var doctorStr=null; if(doctor!=null && doctor.length>0){ for (var i=0;i' + comment.name + '(' + comment.pyCode + ')'; }); $('#deptNo').empty(); $('#deptNo').html(html); $('#deptNo').selectpicker('refresh'); $("#deptNo").selectpicker('val', '1400002'); $("#deptNo").selectpicker('refresh'); initDoctorSelect(); } }); } /** * 挂号列表中的医生列表初始化 */ function initDoctorSelect() { //医生列表 $.ajax({ type: "GET", url: '/thmz/listEmployeeByDepts?depts=' + $('#deptNo').val(), //url: '/thmz/listEmployeeByDepts?depts=null', dataType: "json", headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")}, success: function (res) { if (res == '401' || res == 401) { window.location.href = '/thmz/login/view' return; } var html = ''; $.each(res.data, function (commentIndex, comment) { html += ''; }); $('#doctor').empty(); $('#doctor').html(html); $('#doctor').selectpicker('destroy').selectpicker('refresh'); //告警人员设置 $.ajax({ type: "GET", url: '/thmz/getConfigByKey?key=alarm_user', dataType: "json", headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")}, success: function (res) { if (res == '401' || res == 401) { window.location.href = '/thmz/login/view' return; } var doctorStr=res.data.configValue; if(doctorStr!=null && doctorStr!=''){ var arr =doctorStr.split(","); $("#doctor").selectpicker('val', arr); $("#doctor").selectpicker('refresh'); } } }); } }); }