12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154 |
- const $ = require('jquery');
- require("../css/reset.less")
- require("../css/deptConsole.less")
- require("../images/logo.png")
- require("../images/arrow_down.png")
- require('./modal.js');
- // import 'zrender/lib/svg/svg';
- const { api } = require('./api.js')
- const echarts = require('echarts');
- require('./../resource/jquery-ui/jquery-ui.min.js');
- require('./../resource/jquery-ui/jquery-ui.min.css');
- const { post, setCookie, delCookie, getCookie, focusMenuItem, picEmptyData, initScroll, listenScroll } = require('../js/utils.js');
- let payMoney = [], behosDateStart = "", behosDateEnd = "", ownSelectDate = '', dayLis = [], dateType = 2, curDept = '', curDeptId = '', datafst = [], datasec = [], datatrd = [], datafour = [], dataFif = [], dataSix = [], hospital = getCookie("hospital");
- let isPlacefile = getCookie('isPlacefile') || 1
- $(function () {
- listenScroll(".deptConsole")
- if (!hasData('YH-KZT') && !hasData('YH-KZTKS')) {
- $("body").html('')
- }
- initConsole()//质控列表
- getOwnDept()
- dateChange()
- $(window).click(function () {
- window.parent.userActionHide()
- $(".toggleSlide ul").css("display", "none")
- })
- $(".toggleSlide p").click(function (e) {
- e.stopPropagation()
- $(this).next().slideToggle()
- })
- $(".part02").on("mouseenter", ".bingli li.sec", function () {
- $(this).find(".explainNum").css("color", "#00A1FF")
- })
- $(".part02").on("mouseleave", ".bingli li.sec", function () {
- $(this).find(".explainNum").css("color", "#A5ADBF")
- })
- if (isPlacefile == 0) {
- $(".circleBLis .circleB .title24").html('入院记录24h未完成').append(`<img class="detailGo" src="${require("../images/details.png")}" alt="">`)
- } else {
- $(".circleBLis .circleB .title24").html('病案首页合格率占比').append(`<img class="detailGo" src="${require("../images/details.png")}" alt="">`)
- }
- })
- function tiaomu(dateType) {
- $(".defect .partTitlePub").click(function () {
- focusMenuItem("YH-KSZR-GMKQXZB_XQ");
- $(parent.document).find("#contentIframe").attr("src", "mukuai.html?from=2&deptName=" + curDept + "&dateType=" + dateType + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
- });
- $(".homePageNo .title").click(function () {
- focusMenuItem("YH-KSZR-TMQXZB_XQ");
- $(parent.document).find("#contentIframe").attr("src", "singleVeto.html?from=2&deptName=" + curDept + "&shijian=" + dateType + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
- });
- $(".homePage .title").click(function () {
- if (isPlacefile == 0) {
- focusMenuItem("YH-KSZR-SXXXGTJ_XQ")
- $(parent.document).find("#contentIframe").attr("src", "uncorrectedCasesStatisticsDept.html?from=2&deptName=" + curDept + "&dateType=" + dateType + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
- } else {
- focusMenuItem("YH-KSZR-BASYHGLZB_XQ")
- $(parent.document).find("#contentIframe").attr("src", "partDetailControlDept.html?from=2&deptName=" + curDept + "&deptId=" + curDeptId + "&dateType=" + dateType + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
- }
- });
- $(".part02 .bingliLis").click(function () {
- focusMenuItem("YH-KSZR-KSQXZB_XQ");
- $(parent.document).find("#contentIframe").attr("src", "deptScoreDetailControlDept.html?from=2&deptName=" + curDept + "&dateType=" + dateType + "&curDeptId=" + curDeptId + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
- });
- $(".part01 .partTitlePub").click(function () {
- const txt = $(this).find(".name").text()
- if (txt == "入院人数统计") {
- focusMenuItem("YH-KSZR-RYRSTJ_XQ");
- $(parent.document).find("#contentIframe").attr("src", "qcListOutHospitalDept.html?from=2&deptName=" + curDept + "&dateType=" + dateType + "&curDeptId=" + curDeptId + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
- }
- });
- $(".part01").on('click', '.chuyuan .lis', function () {
- $(".container", parent.document).removeClass("console-cont")
- let txt = $(this).find(".explainNum").text(), type = "";
- if (txt == "死亡人数") {
- type = 1
- } else {
- type = 3
- }
- focusMenuItem("YH-KSZR-RYRSTJ_XQ");
- $(parent.document).find("#contentIframe").attr("src", "qcListOutHospitalDept.html?from=2&deptName=" + curDept + "&dateType=" + dateType + "&curDeptId=" + curDeptId + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd + '&outNum=' + txt + '&outNumType=' + type)
- });
- $(".part02").on("click", ".bingli li.sec", function () {
- focusMenuItem("YH-BLZK-ZKPFKS");
- let dataC = $(this).attr("data-c")
- let chengdu = dataC == 1 ? '甲' : dataC == 2 ? '乙' : '丙'
- $(parent.document).find("#contentIframe").attr("src", "./qcListDept.html?from=1&dateType=" + dateType + "&chengdu=" + chengdu + "&deptName=" + curDept + "&deptId=" + curDeptId + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
- });
- $("body").on("click", ".homegodetail", function () {
- let name = $(this).attr("data-name")
- focusMenuItem("YH-KSZR-TMQXZB_XQ");
- $(parent.document).find("#contentIframe").attr("src", "./singleVeto.html?from=2&special=1&shijian=" + dateType + "&model=" + name + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd + "&deptName=" + curDept)
- })
- }
- //判断有无某一权限
- function hasData(data) {
- let lis = JSON.parse(getCookie("codeLis")) || []
- if (lis.indexOf(data) > -1) {//有权限
- return true
- }
- return false;
- }
- function resizeBox() {
- $(".partWrap").css({
- height: $(window).height() - 38 + 'px'
- })
- }
- //所有数据切换日期筛选
- function dateChange() {
- $(".monthYear .mon").click(function () {
- $(this).css({
- backgroundColor: '#00A1FF',
- color: '#E9EBEF',
- "border-color": '#00A1FF'
- }).siblings().css({
- "border-color": '#A5ADBF',
- color: '#A5ADBF',
- backgroundColor: '#203463'
- })
- dateType = 1
- ownSelectDate = ''
- dateConsole(1, 1)
- })
- $(".monthYear .year").click(function () {
- $(this).css({
- backgroundColor: '#00A1FF',
- color: '#E9EBEF',
- "border-color": '#00A1FF'
- }).siblings().css({
- "border-color": '#A5ADBF',
- color: '#A5ADBF',
- backgroundColor: '#203463'
- })
- dateType = 2
- ownSelectDate = ''
- dateConsole(2, 1)
- })
- }
- //控制台数
- function initConsole(result) {
- let url = {
- '本月病历数': require("../images/icon6.png"),
- '本月不合格病历-机器': require("../images/icon7.png"),
- '本月质控数-机器': require("../images/icon10.png"),
- '本月甲级病历-机器': require("../images/icon8.png"),
- '本月乙级病历-机器': require("../images/icon9.png"),
- '本年病历数': require("../images/icon6.png"),
- '本年不合格病历-机器': require("../images/icon7.png"),
- '本年质控数-机器': require("../images/icon10.png"),
- '本年甲级病历-机器': require("../images/icon8.png"),
- '本年乙级病历-机器': require("../images/icon9.png"),
- }
- let dom = '';
- for (let i in result) {
- if (i.indexOf("人工") == -1) {
- let name = i.split("-")[0];
- let num = 0;
- if (name == '本月病历数' || name == '本年病历数') {
- num = result[i]
- } else {
- num = result[name + '-人工'] + result[i]
- }
- dom += `
- <li class="partLi">
- <div class="partIn">
- <p class="top">${name}</p>
- <p class="btm clearfix">
- <img src="${url[i]}" alt="">
- <span>${num}</span>
- </p>
- </div>
- </li>
- `
- }
- }
- $(".partAll").html(dom)
- }
- //获取科室列表
- function getOwnDept() {
- // if(hasData('FUNC000058')){
- post(api.getDept, {}).then((res) => {
- let data = res.data;
- if (data.code == 0) {
- let result = data.data
- renderDeptLis(result)//科室tab渲染
- curDept = result[0].deptName
- curDeptId = result[0].deptId
- $(".partTitle p i,.toggleSlide p span").html(curDept).attr({ "title": curDept, 'data-dept': curDept, 'dept-id': curDeptId })
- $(".partTitle .hosdept").html(hospital + curDept)
- getBarData(2)//图标数据获取
- } else {
- $(".partTitle p i,.toggleSlide p span").html('--')
- }
- }).catch(() => {
- $(".partTitle p i,.toggleSlide p span").html('--')
- })
- // }
- }
- function renderDeptLis(data) {
- let str = ''
- for (let i = 0; i < data.length; i++) {
- str += `
- <li title="${data[i].deptName}" dept-id="${data[i].deptId}" class="${i == 0 ? 'li0 toggleAverge toggleSlide1' : 'toggleAverge toggleSlide1'}" data-dept="${data[i].deptName}">${data[i].deptName}</li>
- `
- }
- $(".toggleSlide ul").html(str)
- $(".toggleSlide ul li").click(function () {
- let name = $(this).attr("data-dept")
- let did = $(this).attr("dept-id")
- curDept = name
- curDeptId = did
- $(this).parent().slideToggle().prev().find("span").html(name).attr({ "title": name, 'data-dept': curDept, 'dept-id': curDeptId })
- $(".partTitle p i").html(hospital + name).attr({ "title": name, 'data-dept': curDept, 'dept-id': curDeptId })
- $(".partTitle .hosdept").html(hospital + name)
- if (isPlacefile == 0) {
- enterHospital(dataFif[name] || [])
- } else {
- personNum(datafst[name] || [])
- }
- setNumDetail(datasec[name] || [])
- queList(datatrd[name] || [])
- getHomePageLevelStatisticsByDept()
- for (let i = 0; i < datafour[name].length; i++) {
- datafour[name][i].value = datafour[name][i].num
- }
- emptyCircleBc(datafour[name])
- panDetailBc(datafour[name])
- // if (hospital == "台州市立") {
- // emptyCircleB(datafour[name])
- // panDetailB(datafour[name])
- // } else {
- // emptyCircleBc(datafour[name])
- // panDetailBc(datafour[name])
- // }
- $(this).addClass("li0").siblings().removeClass("li0")
- })
- }
- //获取图表数据
- function getBarData(type) {
- if (hasData('FUNC000054') && isPlacefile == 1) {
- $(".part01 .name").html('出院人数统计')
- post(api.leaveHosCountByDept, {//出院人数统计
- "type": type || 1,//1月2年
- "startDate": behosDateStart,
- "endDate": behosDateEnd
- }).then((res) => {
- let data = res.data;
- if (data.code == 0) {
- let result = data.data[curDept] || []
- datafst = data.data
- personNum(result)
- }
- })
- }
- if (isPlacefile == 0) {//运行入院人数
- $(".part01 .name").html('入院人数统计').append(`<img class="detailGo" src="${require("../images/details.png")}" alt="">`)
- post(api.beHosCountByDept, {
- "type": type || 1,//1月2年
- "startDate": behosDateStart,
- "deptName": curDept,
- "deptClass": curDeptId,
- "endDate": behosDateEnd
- }).then((res) => {
- let data = res.data;
- if (data.code == 0) {
- let result = data.data[curDept] || []
- dataFif = data.data
- enterHospital(result)
- }
- })
- }
- if (hasData('FUNC000055')) {
- post(api.mrCountByDept, {//质控病历统计
- "type": type || 1,//1月2年
- "startDate": behosDateStart,
- "endDate": behosDateEnd
- }).then((res) => {
- let data = res.data
- if (data.code == 0) {
- let result3 = data.data[curDept] || []
- datasec = data.data
- setNumDetail(result3)
- }
- })
- }
- if (hasData('FUNC000056')) {
- post(api.entryCountGroupByCaseAndDept, {//各模块缺陷占比排行
- "type": type || 1,//1月2年
- "startDate": behosDateStart,
- "endDate": behosDateEnd
- }).then((res) => {
- let data = res.data;
- if (data.code == 0) {
- let result1 = data.data[curDept] || []
- datatrd = data.data
- queList(result1)
- }
- })
- }
- if (hasData('FUNC000057')) {
- post(api.entryCountGroupByEntryAndDept, {//条目缺陷占比
- "type": type || 1,//1月2年
- "startDate": behosDateStart,
- "endDate": behosDateEnd
- }).then((res) => {
- let data = res.data;
- if (data.code == 0) {
- let result3 = data.data[curDept] || []
- for (let i = 0; i < result3.length; i++) {
- result3[i].value = result3[i].num
- }
- datafour = data.data
- emptyCircleBc(result3)
- panDetailBc(result3)
- }
- })
- // if(hospital=="台州市立"){
- // post(api.entryCountGroupByEntryAndDept,{//条目缺陷占比
- // "type": type||1,//1月2年
- // "startDate":behosDateStart,
- // "endDate":behosDateEnd
- // }).then((res)=>{
- // let data = res.data;
- // if(data.code == 0){
- // let result3 = data.data[curDept]||[]
- // for(let i = 0;i < result3.length;i++){
- // result3[i].value = result3[i].num
- // }
- // datafour = data.data
- // emptyCircleB(result3)
- // panDetailB(result3)
- // }
- // })
- // }else{
- // post(api.entryCountGroupByEntryAndDept,{//条目缺陷占比
- // "type": type||1,//1月2年
- // "startDate":behosDateStart,
- // "endDate":behosDateEnd
- // }).then((res)=>{
- // let data = res.data;
- // if(data.code == 0){
- // let result3 = data.data[curDept]||[]
- // for(let i = 0;i < result3.length;i++){
- // result3[i].value = result3[i].num
- // }
- // datafour = data.data
- // emptyCircleBc(result3)
- // panDetailBc(result3)
- // }
- // })
- // }
- }
- getHomePageLevelStatisticsByDept(type)
- }
- function getHomePageLevelStatisticsByDept(type) {
- // if(hospital=="长兴医院"&&hasData("FUNC000076")){
- post(isPlacefile == 0 ? api.casesEntryStatisticsByDept : api.homePageLevelStatisticsByDept, {//病案首页
- "type": dateType || 2,//1月2年
- "deptName": curDept,
- "deptClass": curDeptId,
- "startDate": behosDateStart,
- "endDate": behosDateEnd
- }).then((res) => {
- let data = res.data;
- if (data.code == 0) {
- let result1 = isPlacefile == 0 ? data.data[curDept] || [] : data.data || []
- dataSix = data.data
- lineChartSpecial(result1)
- }
- })
- // }
- }
- function lineChartSpecial(result1) {
- let dataX = [], dataY = []
- for (let i = 0; i < result1.length; i++) {
- dataX.push(result1[i].doctorName)
- dataY.push(isPlacefile == 0 ? result1[i].num : result1[i].firstLevelPercentStr.replace('%', ''))
- }
- if (dataX.length == 0 && dataY.length == 0) {
- $(".emptyLineCircle").css("display", "none")
- picEmptyData('.emptyLineCircleEmpty')
- return
- } else {
- $(".emptyLineCircle").css("display", "block")
- $(".emptyLineCircleEmpty").css("display", "none")
- }
- var myCharts = echarts.init(document.getElementById('lineChart'));
- $(window).resize(function () {
- myCharts.resize()
- });
- option = {
- color: ['#37C4FC'],
- tooltip: {
- trigger: 'axis',
- position: 'right',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'line' // 默认为直线,可选为:'line' | 'shadow'
- },
- formatter: function (param) {
- return '<div style="color:#fff;">' + param[0].name + "<br>" + `<i style="background:#37C4FC;margin-right:5px;display:inline-block;width:8px;height:8px;border-radius:50%"></i>${isPlacefile == 0 ? '入院记录24h未完成' : '病案首页合格率'}:` + param[0].value + (isPlacefile == 0 ? "" : "%") + "<br>"
- '</div>'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [
- {
- type: 'category',
- data: dataX,
- axisTick: {
- alignWithLabel: true
- },
- axisLabel: {//x轴刻度
- textStyle: {
- color: '#E9EBEF'
- },
- rotate: 45,
- formatter: function (value) {
- //x轴的文字改为竖版显示
- if (value.length > 7) {
- return value.slice(0, 7) + '...'
- }
- return value;
- }
- },
- axisLine: {//x轴
- lineStyle: {
- color: '#4A5D8E'
- }
- }
- }
- ],
- yAxis: [
- {
- type: 'value',
- axisLine: {//y轴
- show: false
- },
- axisTick: {
- show: false
- },
- axisLabel: {//y轴刻度
- textStyle: {
- color: '#E9EBEF'
- }
- },
- splitLine: {//分割线
- lineStyle: {
- color: '#344876'
- }
- }
- }
- ],
- title: [{
- text: isPlacefile == 0 ? '数量' : '合格率',
- top: 15,
- left: 10,
- textStyle: {
- fontSize: 14,
- color: '#fff',
- fontWeight: 400
- }
- }],
- series: [
- {
- name: isPlacefile == 0 ? '入院记录24h未完成' : '病案首页合格率',
- type: 'bar',
- barWidth: '23%',
- data: dataY
- }
- ]
- };
- myCharts.setOption(option);
- }
- //入院人数统计
- function enterHospital(result) {
- let dataX = [], dataY = []
- for (let i = 0; i < result.length; i++) {
- dataX.push(result[i].doctorName)
- dataY.push(result[i].num)
- }
- if (dataX.length == 0) {
- $(".chuyuan,.personNum").css("display", "none")
- picEmptyData(".chuyuanEmpty")
- return
- } else {
- $(".personNum").html("总人数:" + (dataY[0] || '--'))
- $(".chuyuanEmpty").css("display", "none")
- $(".chuyuan,.personNum").css("display", "block")
- }
- var myCharts = echarts.init(document.getElementById("chuyuan"));
- $(window).resize(function () {
- myCharts.resize()
- });
- option = {
- color: ['#37CBCB'],
- tooltip: {
- trigger: 'axis',
- position: 'right',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'line' // 默认为直线,可选为:'line' | 'shadow'
- },
- formatter: function (param) {
- return '<div style="color:#fff;">' + param[0].name + "<br>" + '<i style="background:#37C4FC;margin-right:5px;display:inline-block;width:8px;height:8px;border-radius:50%"></i>' + ("入院人数:") + param[0].value + "<br>"
- '</div>'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- top: '25',
- containLabel: true
- },
- xAxis: [
- {
- type: 'category',
- data: dataX,
- axisTick: {
- alignWithLabel: true
- },
- axisLabel: {//x轴刻度
- textStyle: {
- color: '#E9EBEF'
- },
- rotate: 45,
- formatter: function (value) {//x轴的文字改为竖版显示
- if (value.length > 7) {
- return value.slice(0, 7) + '...'
- }
- return value;
- }
- },
- axisLine: {//x轴
- lineStyle: {
- color: '#4A5D8E'
- }
- }
- }
- ],
- yAxis: [
- {
- type: 'value',
- axisLine: {//y轴
- show: false
- },
- axisTick: {
- show: false
- },
- splitNumber: 3,
- axisLabel: {//y轴刻度
- textStyle: {
- color: '#E9EBEF'
- },
- formatter: function (value) {
- return value;
- }
- },
- splitLine: {//分割线
- lineStyle: {
- color: '#344876'
- }
- }
- }
- ],
- title: [{
- text: '数量',
- top: 0,
- left: 10,
- textStyle: {
- fontSize: 14,
- color: '#E9EBEF',
- fontWeight: 400
- }
- }],
- series: [
- {
- name: '病案首页合格率',
- type: 'bar',
- barWidth: '23%',
- data: dataY
- }
- ]
- };
- myCharts.setOption(option);
- }
- //part01
- function personNum(data) {
- let flg = JSON.stringify(data) !== '[]'
- if (data['总人数'] == 0) {
- $(".chuyuan,.personNum").css("display", "none")
- picEmptyData(".chuyuanEmpty")
- return
- } else {
- $(".chuyuanEmpty").css("display", "none")
- $(".chuyuan,.personNum").css("display", "block")
- }
- let str = `
- <ul class="clearfix" style="cursor: default;">
- <li>
- <div class="lis">
- <p class="numShow died">${flg ? data['死亡人数'] + '' || '--' : '--'}</p>
- <p class="explainNum">死亡人数</p>
- </div>
- </li>
- <li class="li03">
- <div class="lis li02">
- <p class="numShow patientNum">${flg ? data['手术病人数'] + '' || '--' : '--'}</p>
- <p class="explainNum">手术病人数</p>
- </div>
- </li>
- </ul>
- `
- $(".personNum").html("总人数:" + (data['总人数'] || '--'))
- $(".part01 .numCheck").css({ "cursor": "default" })
- $(".chuyuan").html(str)
- }
- //part02
- function setNumDetail(data) {
- if (data.length == 0) {
- $(".pingfendengji").css("display", "block")
- $(".bldjs").css("display", "none")
- picEmptyData(".pingfendengjiEmpty")
- return
- } else {
- $(".bldjs").css("display", "block")
- $(".pingfendengji").css("display", "none")
- }
- let str = ''
- for (let i = 0; i < data.length; i++) {
- str += `
- <li class="${i == 0 ? 'fst' : i == data.length - 1 ? ' four sec' : 'sec'}" data-c="${i}">
- <p class="numShow">${data[i].num}</p>
- <p class="explainNum">${data[i].name}</p>
- </li>
- `
- if (data[i].name == '甲级病历') {
- let tmp = []
- data[i].value = data[i].num
- tmp.push(data[i])
- tmp.push({ percentStr: (1 - data[i].percent) * 100 + '%', value: data[i].totleNum - data[i].num })
- part02pan(tmp, 'fen01')
- }
- if (data[i].name == '乙级病历') {
- let tmp = []
- data[i].value = data[i].num
- tmp.push(data[i])
- tmp.push({ percentStr: (1 - data[i].percent) * 100 + '%', value: data[i].totleNum - data[i].num })
- part02pan(tmp, 'fen02')
- }
- if (data[i].name == '丙级病历') {
- let tmp = []
- data[i].value = data[i].num
- tmp.push(data[i])
- tmp.push({ percentStr: (1 - data[i].percent) * 100 + '%', value: data[i].totleNum - data[i].num })
- part02pan(tmp, 'fen03')
- }
- }
- $('.bingli').html(str)
- }
- //part02pan
- function part02pan(data, dom) {
- dom = echarts.init(document.getElementById(dom));
- $(window).resize(function () {
- dom.resize()
- });
- let bgColor = '#fff';
- let title = '总量';
- let color = ['#3fffd1', '#4c5c82'];
- let echartData = data;
- option = {
- // backgroundColor: bgColor,
- color: color,
- title: [{
- text: '{val|' + echartData[0].percentStr + '}',
- top: 'center',
- left: 'center',
- textStyle: {
- rich: {
- val: {
- fontSize: 14,
- color: '#E9EBEF',
- fontWeight: 'bold',
- padding: [10, 0]
- },
- name: {
- fontSize: 12,
- fontWeight: 'normal',
- color: '#E9EBEF',
- }
- }
- }
- }],
- series: [{
- name: '',
- type: 'pie',
- radius: ['70%', '90%'],
- data: echartData,
- hoverAnimation: true,
- hoverOffset: 3,
- itemStyle: {
- normal: {
- borderColor: '#203463',
- borderWidth: 3
- }
- },
- label: {
- normal: {
- show: false,
- }
- },
- }]
- };
- dom.setOption(option);
- }
- //柱状图住院日期
- function emptyCircleB(data) {
- if (data.length == 0) {
- $(".emptyCircleBData").css("'display", "none !important")
- picEmptyData(".emptyCircleBWrap")
- } else {
- $(".emptyCircleBData").css("'display", "block")
- $(".emptyCircleBWrap").css("display", "none")
- }
- if (!document.getElementById('emptyCircleB')) return
- var myChart = echarts.init(document.getElementById('emptyCircleB'));
- $(window).resize(function () {
- myChart.resize()
- });
- let bgColor = '#fff';
- let title = '总量';
- let color = ['#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336', '#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336'];
- let echartData = data;
- let total = echartData.length > 0 ? echartData[0].totleNum : 0;
- option = {
- // backgroundColor: bgColor,
- color: color,
- title: [{
- text: data.length > 0 ? '{val|' + total + '}\n{name|' + title + '}' : '',
- top: 'center',
- left: 'center',
- textStyle: {
- rich: {
- val: {
- fontSize: 24,
- color: '#E9EBEF',
- fontWeight: 'bold',
- padding: [10, 0]
- },
- name: {
- fontSize: 12,
- fontWeight: 'normal',
- color: '#E9EBEF',
- }
- }
- }
- }],
- tooltip: {
- trigger: 'item',
- position: 'right',
- // formatter: '{b} : {c} ({d}%)',
- formatter: function (item) {
- const { name, num, percentStr } = item.data
- return `${name} : ${num} (${percentStr})`
- }
- },
- series: [{
- name: '',
- type: 'pie',
- radius: ['70%', '90%'],
- data: echartData,
- hoverAnimation: true,
- hoverOffset: 5,
- itemStyle: {
- normal: {
- // borderColor: bgColor,
- borderWidth: 3
- }
- },
- labelLine: {
- normal: {
- length: 20,
- length2: 120,
- lineStyle: {
- color: '#e6e6e6'
- }
- }
- },
- label: {
- normal: {
- show: false,
- formatter: params => {
- return params.name == 'A类' ? params.name : ''
- },
- padding: [0, -100, 25, -100],
- rich: {
- icon: {
- fontSize: 16
- },
- name: {
- fontSize: 14,
- padding: [0, 10, 0, 4],
- color: '#666666'
- },
- value: {
- fontSize: 18,
- fontWeight: 'bold',
- color: '#333333'
- }
- }
- }
- },
- }]
- };
- myChart.setOption(option);
- }
- function emptyCircleBc(data) {
- if (data.length == 0) {
- $(".emptyCircleBDatas").css("'display", "none !important")
- picEmptyData(".emptyCircleBWraps")
- } else {
- $(".emptyCircleBDatas").css("'display", "block")
- $(".emptyCircleBWraps").css("display", "none")
- }
- var myChart = echarts.init(document.getElementById('emptyCircleBc'));
- $(window).resize(function () {
- myChart.resize()
- });
- let bgColor = '#fff';
- let title = '总量';
- let color = ['#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336', '#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336'];
- let echartData = data;
- let total = echartData.length > 0 ? echartData[0].totleNum : 0;
- option = {
- // backgroundColor: bgColor,
- color: color,
- title: [{
- text: data.length > 0 ? '{val|' + total + '}\n{name|' + title + '}' : '',
- top: 'center',
- left: 'center',
- textStyle: {
- rich: {
- val: {
- fontSize: 24,
- color: '#E9EBEF',
- fontWeight: 'bold',
- padding: [10, 0]
- },
- name: {
- fontSize: 12,
- fontWeight: 'normal',
- color: '#E9EBEF',
- }
- }
- }
- }],
- tooltip: {
- trigger: 'item',
- position: 'right',
- // formatter: '{b} : {c} ({d}%)',
- formatter: function (item) {
- const { name, num, percentStr } = item.data
- return `${name} : ${num} (${percentStr})`
- }
- },
- series: [{
- name: '',
- type: 'pie',
- radius: ['70%', '90%'],
- data: echartData,
- hoverAnimation: true,
- hoverOffset: 5,
- itemStyle: {
- normal: {
- borderColor: '#203463',
- borderWidth: 3
- }
- },
- labelLine: {
- normal: {
- length: 20,
- length2: 120,
- lineStyle: {
- color: '#fff'
- }
- }
- },
- label: {
- normal: {
- show: false,
- formatter: params => {
- return params.name == 'A类' ? params.name : ''
- },
- padding: [0, -100, 25, -100],
- rich: {
- icon: {
- fontSize: 16
- },
- name: {
- fontSize: 14,
- padding: [0, 10, 0, 4],
- color: '#fff'
- },
- value: {
- fontSize: 18,
- fontWeight: 'bold',
- color: '#fff'
- }
- }
- }
- },
- }]
- };
- myChart.setOption(option);
- }
- //缺陷列表渲染
- function queList(data) {
- let strAll = '', tmp = `mm
- <tr class="thead">
- <td class="td01">排名</td>
- <td class="td02">模块名称</td>
- <td class="td04">缺陷占比</td>
- </tr>`
- if (data.length == 0) {
- $(".qtable").css("display", "none")
- picEmptyData(".qtableEmpty")
- return
- } else {
- $(".qtableEmpty").css("display", "none")
- $(".qtable").css("display", "table")
- }
- for (let i = 0; i < data.length; i++) {
- strAll += `
- <tr>
- <td style="text-align:center;"><i style="background:${i < 3 ? '#ECB22E' : '#526186'};color:${i < 3 ? '#fff' : '#B7BDCC'};">${i + 1}</i></td>
- <td class="homegodetail" data-name="${data[i].name}"><p class="td02name ellipsis">${data[i].name}</p></td>
- <td>${data[i].percentStr}</td>
- </tr>
- `
- }
- $(".qtable").html(tmp + strAll)
- // initScroll("list","Y",2)
- }
- //饼图列表注释渲染
- function panDetailB(data) {
- let color = ['#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336', '#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336'];
- let strAll = '';
- for (let i = 0; i < data.length; i++) {
- strAll += `
- <tr class="explainLi">
- <td class="deptName" title="${data[i].name}">
- <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
- </td>
- <td class="deptNum">${data[i].num}</td>
- <td class="percent">(${data[i].percentStr})</td>
- </tr>
- `
- }
- $(".explainPanB table").html(strAll);
- $(".explainPan").css({
- marginTop: -($(".explainPan").height() / 2 - 20) + 'px'
- })
- // initScroll("explainPanB","Y",2)
- }
- function panDetailBc(data) {
- let color = ['#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336', '#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336'];
- let strAll = '';
- for (let i = 0; i < data.length; i++) {
- strAll += `
- <tr class="explainLi" data-dept="${data[i].name}">
- <td class="deptName" title="${data[i].name}">
- <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
- </td>
- <td class="deptNum">${data[i].num}</td>
- <td class="percent">(${data[i].percentStr})</td>
- </tr>
- `
- }
- $(".explainPanBc table").html(strAll);
- $(".explainPan").css({
- marginTop: -($(".explainPanc").height() / 2 - 20) + 'px'
- })
- // $(".homePageNo .explainPanBc .explainLi").click(function(){
- // let deptName = $(this).attr("data-dept")
- // focusMenuItem("YH-BLZK-ZKPFKS");
- // $(parent.document).find("#contentIframe").attr("src","./qcList.html?from=1&dateType="+dateType+"&deptName="+deptName)
- // })
- }
- //时间获取
- function getTimeDetail() {
- const d = new Date();
- const days = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
- let sec = d.getSeconds()
- let min = d.getMinutes()
- let hour = d.getHours()
- let str = `${d.getFullYear()}年${d.getMonth() + 1}月${d.getDate()}日 / ${days[d.getDay()]} / ${hour > 9 ? hour : '0' + hour}:${min > 9 ? min : '0' + min}:${sec > 9 ? sec : '0' + sec}`
- $(".dateDetail").html(str)
- }
- $(".sureDate").click(function () {
- if (!getStaticDate()) {
- return
- }
- $(".monthYear .year").css({
- "border-color": '#A5ADBF',
- color: '#A5ADBF',
- backgroundColor: '#203463'
- })
- $(".monthYear .mon").css({
- "border-color": '#A5ADBF',
- color: '#A5ADBF',
- backgroundColor: '#203463'
- })
- setCookieAction(behosDateStart.split(" ")[0], behosDateEnd.split(" ")[0])
- ownSelectDate = 3
- getBarData(dateType)
- tiaomu(ownSelectDate || dateType)
- })
- //日期联动
- function dateConsole(dateType, flg) {
- let startDate = "", endDate = new Date()
- let year = new Date().getFullYear()
- let month = new Date().getMonth() + 1
- if (dateType == '1') {
- startDate = new Date(`${year}-${month}-01`)
- } else if (dateType == '2') {
- startDate = new Date(`${year}-01-01`)
- } else {
- startDate = "-1m"
- }
- if (getCookie("behosDateStart") && !flg) {
- ownSelectDate = 3
- startDate = new Date(getCookie("behosDateStart"))
- endDate = new Date(getCookie("behosDateEnd"))
- $(".monthYear .year").css({
- "border-color": '#A5ADBF',
- color: '#A5ADBF',
- backgroundColor: '#203463'
- })
- $(".monthYear .mon").css({
- "border-color": '#A5ADBF',
- color: '#A5ADBF',
- backgroundColor: '#203463'
- })
- }
- $("#datepicker").datepicker({
- yearRange: "2015:" + year,
- changeMonth: true,
- changeYear: true,
- dateFormat: "yy/mm/dd",
- }).datepicker("setDate", startDate);
- $("#datepicker2").datepicker({
- yearRange: "2015:" + year,
- changeMonth: true,
- changeYear: true,
- dateFormat: "yy/mm/dd"
- }).datepicker("setDate", endDate);
- getStaticDate(flg)
- tiaomu(ownSelectDate || dateType)
- }
- function setCookieAction(startDate, endDate) {
- setCookie('behosDateStart', startDate)
- setCookie('behosDateEnd', endDate)
- }
- function getStaticDate(flg) {
- behosDateStart = $("#datepicker").val().trim()
- behosDateEnd = $("#datepicker2").val().trim()
- const start = new Date(behosDateStart).getTime()
- const end = new Date(behosDateEnd).getTime()
- if (!getCookie("behosDateEnd")) {
- setCookie('behosDateStart', behosDateStart)
- setCookie('behosDateEnd', behosDateEnd)
- }
- if (start > end) {
- $.alerModal({ "message": '开始时间不能大于结束时间~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
- return false
- }
- if (flg) {
- setCookieAction(behosDateStart, behosDateEnd)
- }
- if (behosDateStart) {
- behosDateStart = behosDateStart.replace(/\//g, '-') + ' 00:00:00'
- }
- if (behosDateEnd) {
- behosDateEnd = behosDateEnd.replace(/\//g, '-') + ' 23:59:59'
- }
- getBarData(dateType)
- return true
- }
- $(function () {
- const iconCalenBlue = require("./../images/darkDate.png")
- const iconCalenGrey = require("./../images/icon_calen_grey.png")
- $.datepicker.regional['zh-CN'] = {
- clearText: '清除',
- clearStatus: '清除已选e799bee5baa6e59b9ee7ad9431333361303131日期',
- closeText: '关闭',
- closeStatus: '不改变当前选择',
- prevText: '<上月',
- prevStatus: '显示上月',
- prevBigText: '<<',
- prevBigStatus: '显示上一年',
- nextText: '下月>',
- nextStatus: '显示下月',
- nextBigText: '>>',
- nextBigStatus: '显示下一年',
- currentText: '今天',
- currentStatus: '显示本月',
- monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
- monthNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
- yearNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
- monthStatus: '选择月份',
- yearStatus: '选择年份',
- weekHeader: '周',
- weekStatus: '年内周次',
- dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
- dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
- dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
- dayStatus: '设置 DD 为一周起始',
- dateStatus: '选择 m月 d日, DD',
- dateFormat: 'yy-mm-dd',
- firstDay: 1,
- initStatus: '请选择日期',
- isRTL: false
- };
- $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
- dateConsole(dateType)
- $('.iconCalen').on("mouseenter", function (e) {
- $(this).attr("src", iconCalenBlue)
- })
- $('.iconCalen').on("mouseleave", function (e) {
- $(this).attr("src", iconCalenGrey)
- })
- $('.iconCalen').on("click", function (e) {
- $(this).parent().find("input").focus()
- })
- // initScroll("partWrap","Y",2)
- // initScroll("console","X",2)
- });
|