//@ sourceURL=index.js //菜单 // var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; // // var randomScalingFactor = function () { // return Math.round(Math.random() * 100); // //return 0; // }; // var randomColorFactor = function () { // return Math.round(Math.random() * 255); // }; // var randomColor = function (opacity) { // var rgg='rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',' + (opacity || '.3') + ')'; // console.log(rgg); // return rgg; // }; var config = { type: 'line', data: { labels: [], datasets: [ { label: "挂号金额", data: [], /* fill: false,*/ // borderDash: [5, 5], borderColor: 'rgba(130,236,134,0.4)', backgroundColor: 'rgba(13,199,122,0.5)', // pointBorderColor: 'rgba(69,231,165,0.7)', // pointBackgroundColor: 'rgba(229,185,45,0.5)', pointBorderWidth: 1, }, { //hidden: true, label: '接诊金额', data: [], borderColor: 'rgba(185,190,209,0.4)', backgroundColor: 'rgba(77,5,148,0.5)', pointBorderWidth: 1, }, { label: "退号金额", data: [], borderColor: 'rgba(152,99,170,0.4)', backgroundColor: 'rgba(166,86,59,0.5)', pointBorderWidth: 1, }, { label: "退费金额", data: [], borderColor: 'rgba(254,169,161,0.4)', backgroundColor: 'rgba(235,30,145,0.5)', // pointBorderColor: 'rgba(254,169,161,0.4)', // pointBackgroundColor: randomColor(0.5), pointBorderWidth: 1, } ] }, options: { responsive: true, /* legend: { position: 'bottom', },*/ // title: { // // display: true, // // text: '门诊运营趋势', // // }, tooltips: { mode: 'label', callbacks: { // beforeTitle: function() { // return '...beforeTitle'; // }, // afterTitle: function() { // return '...afterTitle'; // }, // beforeBody: function() { // return '...beforeBody'; // }, // afterBody: function() { // return '...afterBody'; // }, // beforeFooter: function() { // return '...beforeFooter'; // }, // footer: function() { // return 'Footer'; // }, // afterFooter: function() { // return '...afterFooter'; // }, } }, hover: { mode: 'dataset' }, scales: { xAxes: [{ display: true, scaleLabel: { show: true, labelString: 'Month' } }], yAxes: [{ display: true, scaleLabel: { show: true, labelString: 'Value' }, ticks: { suggestedMin: 0, suggestedMax: 250, } }] } } }; // window.onload = function() { // var ctx = document.getElementById("canvas").getContext("2d"); // window.myLine = new Chart(ctx, config); // }; $(function () { init_daterangepicker(); $('#reportrange span').html(moment().subtract(6, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD')); $.ajax({ type: "GET", url: '/thmz/getIndexCount', 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; } if (res.code == 0) { $("#registrationNum").html(res.registrationNum); $("#haveClinicalNum").html(res.haveClinicalNum); if (res.ghAmount != null) { $("#ghAmount").html(res.ghAmount.toFixed(2)); } if (res.sfAmount != null) { $("#sfAmount").html(res.sfAmount.toFixed(2)); } } } }); var rePortRangeArr = getRePortRangeArr(); $.ajax({ type: "POST", url: '/thmz/getMzyytsqs', contentType: "application/json;charset=UTF-8", dataType: "json", headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")}, data: JSON.stringify({beginTime: new Date(rePortRangeArr[0]), endTime: new Date(rePortRangeArr[1])}), success: function (res) { if (res == '401' || res == 401) { window.location.href = '/thmz/login/view' return; } if (res.code == 0) { if(res.keyList!=null && res.keyList.length>0){ for (var i=0;i0){ var ghje=config.data.datasets[0].data; var jzje=config.data.datasets[1].data; var thje=config.data.datasets[2].data; var tfje=config.data.datasets[3].data; for (var i=0;i0){ for(var i=0;i'; html+=''; html+=obj.icd_text+''; html+='
'; html+=obj.num; html+=' 次
'; } } $("#numberOfIcdText").html(html); } } }); }); /** * 获取时间选择器的时间数组 * @returns {string[]} */ function getRePortRangeArr() { var rePortRange = $('#reportrange span').html(); var rePortRangeArr = rePortRange.split(" - "); rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00" rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59" return rePortRangeArr; } /** * 获取时间选择器的时间数组 * @returns {string[]} */ function getRePortRangeArrById(id) { var rePortRange = $('#'+id+' span').html(); var rePortRangeArr = rePortRange.split(" - "); rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00" rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59" return rePortRangeArr; } /** * 获取年龄(小于7岁精确到天) * @param birthDay 出生日期 * @param nowDate 当前日期 * @returns {string} */ function getBirthSlot(birthDay,nowDate) { var birth = new Date(birthDay); var now = new Date(nowDate); var date1 = Date.parse(birth); var date2 = Date.parse(now); var day = Math.ceil((date2 - date1) / (60 * 60 * 1000 * 24)); var age = ''; var year = Math.floor(day / 365); if(year > 0) age += year + '岁'; var y = day % 365; var month = Math.floor(y / 30); if(month > 0) age += month + '月'; var d = Math.floor(day % 365 % 30); if(d > 0) age += d + '天'; if(age.substring(0,age.indexOf('岁')) >= 7){ age = age.substring(0,age.indexOf('岁')+1); } return age; } /** * 根据编码获取性别 * @param code * @returns {string} */ function getSex(code) { var sex = ''; if (code == 1) { sex = '男'; } else if (code == 2) { sex = '女'; } else { sex = '未知'; } return sex }