console.js 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327
  1. const $ = require('jquery');
  2. require("../css/reset.less")
  3. require("../css/console.less")
  4. require("../images/logo.png")
  5. require("../images/arrow_down.png")
  6. // import 'zrender/lib/svg/svg';
  7. const {api} = require('./api.js')
  8. const echarts = require('echarts');
  9. const {post,setCookie,delCookie,getCookie,focusMenuItem,picEmptyData} = require('../js/utils.js');
  10. let payMoney = [],dayLis = [],dateType = 2,slideType = 1,hospital=getCookie("hospital"),deptType="内科",deptId="";
  11. $(function(){
  12. if(!hasData('YH-KZT')){
  13. $("body").html('')
  14. }
  15. if(hospital == "台州市立"){
  16. $(".part03 .partTitlePub .name").html('各科室甲级病例占比')
  17. $(".innerOuter").css("display","block")
  18. }else{
  19. $(".part03 .partTitlePub .name").html('病案首页合格率')
  20. $(".innerOuter").css("display","none")
  21. }
  22. $(".partTitle p span").html(hospital)
  23. setInterval(() => {
  24. getTimeDetail()
  25. }, 1000);
  26. resizeBox()
  27. initConsole()//质控列表
  28. getBarData(2)//图标数据获取
  29. dateChange()
  30. $(window).resize(function(){
  31. resizeBox()
  32. })
  33. $(window).click(function(){
  34. window.parent.userActionHide()
  35. $(".toggleSlide ul").css("display","none")
  36. })
  37. let sildeIS = true
  38. if(!hasData('FUNC000045')&&!hasData('FUNC000046')){
  39. $(".toggleSlide").css("opacity","0.5")
  40. sildeIS = false
  41. }
  42. $(".toggleSlide p").click(function(e){
  43. if(!sildeIS)return
  44. e.stopPropagation()
  45. $(this).next().slideToggle()
  46. })
  47. $(".toggleSlide li").click(function(){
  48. let str = $(this).attr("data-str"),type = $(this).attr("data-type")
  49. if(type == 1){
  50. if(!hasData('FUNC000045')){
  51. return
  52. }
  53. slideType = 1
  54. $(".pubEchart .title span").html("科室平均住院天数柱状图")
  55. barChart(dayLis,dateType)
  56. $(this).parent().slideToggle().prev().find("span").html(str)
  57. }else if(type == 2){
  58. if(!hasData('FUNC000046')){
  59. return
  60. }
  61. slideType = 2
  62. $(".pubEchart .title span").html("科室平均住院花费柱状图")
  63. barChart(payMoney,dateType)
  64. $(this).parent().slideToggle().prev().find("span").html(str)
  65. }else if(type == 3){//科室平均分内科
  66. if(!hasData('FUNC000091')){
  67. return
  68. }
  69. deptType="内科"
  70. getAverageScoreLis()
  71. $(this).parent().slideToggle().prev().find("span").html(str+"系统")
  72. }else if(type == 4){//科室平均分外科
  73. if(!hasData('FUNC000091')){
  74. return
  75. }
  76. deptType="外科"
  77. getAverageScoreLis()
  78. $(this).parent().slideToggle().prev().find("span").html(str+"系统")
  79. }
  80. })
  81. $(".part02").on("mouseenter",".bingli li.sec",function(){
  82. $(this).find(".explainNum").css("color","#00A1FF")
  83. })
  84. $(".part02").on("mouseleave",".bingli li.sec",function(){
  85. $(this).find(".explainNum").css("color","#A5ADBF")
  86. })
  87. getDetails()
  88. getAverageScoreLis()
  89. })
  90. function getDetails(){
  91. $(".pubEchartB.paymoney .title").click(function(){
  92. focusMenuItem("YH-ZKK-GKSQXZB_XQ");
  93. $(parent.document).find("#contentIframe").attr("src","./deptScoreDetailControl.html?from=1&dateType="+dateType+"&deptType="+deptType)
  94. })
  95. $(".part02 .bingliLis,.part03 .circle .title").click(function(){
  96. focusMenuItem("YH-ZKK-GKSQXZB_XQ");
  97. $(parent.document).find("#contentIframe").attr("src","./deptScoreDetailControl.html?from=1&dateType="+dateType)
  98. })
  99. $(".part02").on("click",".bingli li.sec",function(){
  100. focusMenuItem("YH-BLZK-ZKPF");
  101. let dataC = $(this).attr("data-c")
  102. let chengdu = dataC == 1?'甲':dataC==2?'乙':'丙'
  103. $(parent.document).find("#contentIframe").attr("src","./qcList.html?from=1&dateType="+dateType+"&chengdu="+chengdu)
  104. })
  105. $(".part03 .partTitlePub").click(function(){
  106. if(hospital=="台州市立"){
  107. focusMenuItem("YH-ZKK-GKSJJBLZB_XQ")
  108. $(parent.document).find("#contentIframe").attr("src","./jiaji.html?from=1&dateType="+dateType)
  109. }else{
  110. focusMenuItem("YH-ZKK-BASYHGLZB_XQ");
  111. $(parent.document).find("#contentIframe").attr("src","./partDetailControl.html?from=1&dateType="+dateType)
  112. }
  113. })
  114. $(".paymoney.pubEchart .title").click(function(){
  115. if($(this).text().indexOf("花费")!==-1){
  116. focusMenuItem("YH-ZKK-KSPJZYHF_XQ");
  117. $(parent.document).find("#contentIframe").attr("src","./payDetail.html?from=1&dateType="+dateType)
  118. }else{
  119. focusMenuItem("YH-ZKK-KSPJZYTS_XQ");
  120. $(parent.document).find("#contentIframe").attr("src","./dayDetail.html?from=1&dateType="+dateType)
  121. }
  122. })
  123. $(".defect .partTitlePub").click(function(){//from 1 console / 2 deptConsole
  124. focusMenuItem("YH-ZKK-GMKQXZB_XQ");
  125. $(parent.document).find("#contentIframe").attr("src","./mukuaiControl.html?from=1&dateType="+dateType)
  126. })
  127. $(".circleB .title").click(function(){
  128. focusMenuItem("YH-ZKK-TMQXZB_XQ");
  129. $(parent.document).find("#contentIframe").attr("src","./tiaomuControl.html?from=1&dateType="+dateType)
  130. })
  131. }
  132. //判断有无某一权限
  133. function hasData(data){
  134. let lis = JSON.parse(getCookie("codeLis"))
  135. // console.log(lis)
  136. if(lis.indexOf(data)>-1){//有权限
  137. return true
  138. }
  139. return false;
  140. }
  141. function resizeBox(){
  142. $(".partWrap").css({
  143. height:$(window).height()-43+'px'
  144. })
  145. }
  146. //所有数据切换日期筛选
  147. function dateChange(){
  148. $(".monthYear .mon").click(function(){
  149. $(this).css({
  150. backgroundColor:'#00A1FF',
  151. color:'#E9EBEF',
  152. "border-color":'#00A1FF'
  153. }).siblings().css({
  154. "border-color":'#A5ADBF',
  155. color:'#A5ADBF',
  156. backgroundColor:'#203463'
  157. })
  158. dateType = 1
  159. getBarData(1)
  160. getAverageScoreLis()
  161. })
  162. $(".monthYear .year").click(function(){
  163. $(this).css({
  164. backgroundColor:'#00A1FF',
  165. color:'#E9EBEF',
  166. "border-color":'#00A1FF'
  167. }).siblings().css({
  168. "border-color":'#A5ADBF',
  169. color:'#A5ADBF',
  170. backgroundColor:'#203463'
  171. })
  172. dateType = 2
  173. getAverageScoreLis()
  174. getBarData(2)
  175. })
  176. }
  177. //控制台数
  178. function initConsole(result){
  179. let url = {
  180. '本月病历数':require("../images/icon6.png"),
  181. '本月不合格病历-机器':require("../images/icon7.png"),
  182. '本月质控数-机器':require("../images/icon10.png"),
  183. '本月甲级病历-机器':require("../images/icon8.png"),
  184. '本月乙级病历-机器':require("../images/icon9.png"),
  185. '本年病历数':require("../images/icon6.png"),
  186. '本年不合格病历-机器':require("../images/icon7.png"),
  187. '本年质控数-机器':require("../images/icon10.png"),
  188. '本年甲级病历-机器':require("../images/icon8.png"),
  189. '本年乙级病历-机器':require("../images/icon9.png"),
  190. }
  191. let dom = '';
  192. for(let i in result){
  193. if(i.indexOf("人工")==-1){
  194. let name = i.split("-")[0];
  195. let num = 0;
  196. if(name=='本月病历数'||name=='本年病历数'){
  197. num = result[i]
  198. }else{
  199. num = result[name+'-人工']+result[i]
  200. }
  201. dom += `
  202. <li class="partLi">
  203. <div class="partIn">
  204. <p class="top">${name}</p>
  205. <p class="btm clearfix">
  206. <img src="${url[i]}" alt="">
  207. <span>${num}</span>
  208. </p>
  209. </div>
  210. </li>
  211. `
  212. }
  213. }
  214. $(".partAll").html(dom)
  215. }
  216. //平均分
  217. function getAverageScoreLis(){
  218. let url = ''
  219. if(hospital=="台州市立"&&hasData('FUNC000091')){
  220. url = api.getAverageScoreByDeptClass
  221. }else if(hospital=="长兴医院"&&hasData('FUNC000047')){
  222. url = api.getAverageScore
  223. }else{
  224. return
  225. }
  226. post(url,{//各科室质控平均分
  227. "type": dateType||1,//1月2年
  228. "deptClass":deptType
  229. }).then((res)=>{
  230. let data = res.data;
  231. if(data.code == 0){
  232. let result1 = (hospital=="台州市立"?data.data:data.data['各科室质控平均分'])||[]
  233. let dataX1=[],dataY1=[]
  234. for(let i = 0;i < result1.length;i++){
  235. dataX1.push(result1[i].name)
  236. dataY1.push(result1[i].averageValue)
  237. }
  238. barChartPay(dataX1,dataY1)
  239. }
  240. })
  241. }
  242. //获取图表数据
  243. function getBarData(type){
  244. if(hasData('FUNC000045')){
  245. post(api.getAverageDayNum,{//平均住院天数
  246. "type": type||1//1月2年
  247. }).then((res)=>{
  248. let data = res.data;
  249. if(data.code == 0){
  250. let result2 = data.data['平均住院日']||[]
  251. dayLis = result2
  252. if(slideType == 1){
  253. barChart(result2,type||1)
  254. }
  255. }
  256. })
  257. }else{
  258. $(".toggleSlide1").css("opacity",0.5)
  259. }
  260. if(hasData('FUNC000046')){
  261. post(api.getAverageFee,{//平均住院费用
  262. "type": type||1//1月2年
  263. }).then((res)=>{
  264. let data = res.data;
  265. if(data.code == 0){
  266. let result3 = data.data['平均住院费用']||[]
  267. payMoney = result3;
  268. if(slideType == 2){
  269. barChart(result3,type||1)
  270. }
  271. }
  272. })
  273. }else{
  274. $(".toggleSlide2").css("opacity",0.5)
  275. }
  276. if(hasData('FUNC000048')&&hospital=="台州市立"){
  277. post(api.getLevelResultDept,{//各科室甲级占比
  278. "type": type||1//1月2年
  279. }).then((res)=>{
  280. let data = res.data;
  281. if(data.code == 0){
  282. let result2 = data.data['各科室甲级病历占比']||[]
  283. let dataX2=[],dataY2=[];
  284. for(let i = 0;i < result2.length;i++){
  285. dataX2.push(result2[i].deptName)
  286. dataY2.push(result2[i].firstPercent.replace('%',''))
  287. }
  288. lineChart(dataX2,dataY2)
  289. }
  290. })
  291. }
  292. if(hasData('FUNC000075')&&hospital=="长兴医院"){
  293. post(api.homePageLevelLimit,{//病案首页
  294. "type": type||1//1月2年
  295. }).then((res)=>{
  296. let data = res.data;
  297. if(data.code == 0){
  298. let result1 = data.data||[]
  299. let dataX1=[],dataY1=[]
  300. for(let i = 0;i < result1.length;i++){
  301. dataX1.push(result1[i].deptName)
  302. dataY1.push(result1[i].firstLevelPercentStr.replace('%',''))
  303. }
  304. lineChartSpecial(dataX1,dataY1)
  305. }
  306. })
  307. }
  308. if(hasData('FUNC000049')){
  309. post(api.leaveHosCount,{//出院人数统计
  310. "type": type||1//1月2年
  311. }).then((res)=>{
  312. let data = res.data;
  313. if(data.code == 0){
  314. // barChart(result2,type||1)
  315. // console.log(data)
  316. let result1 = data.data['出院人数统计']||[]
  317. personNum(result1)
  318. }
  319. })
  320. }
  321. if(hasData('FUNC000050')){
  322. post(api.mrCount,{//质控病历统计
  323. "type": type||1//1月2年
  324. }).then((res)=>{
  325. let data = res.data
  326. if(data.code == 0){
  327. let result3 = data.data['病历数统计']||[]
  328. setNumDetail(result3)
  329. }
  330. })
  331. }
  332. if(hasData('FUNC000051')){
  333. post(api.entryCountGroupByCase,{//各模块缺陷占比排行
  334. "type": type||1//1月2年
  335. }).then((res)=>{
  336. let data = res.data;
  337. if(data.code == 0){
  338. let result1 = data.data['各模块缺陷占比排行']||[];
  339. // result1.length>8?result1.length=8:"";
  340. queList(result1)
  341. }
  342. })
  343. }
  344. if(hasData('FUNC000052')){
  345. post(api.entryCountGroupByEntry,{//条目缺陷占比
  346. "type": type||1//1月2年
  347. }).then((res)=>{
  348. let data = res.data;
  349. if(data.code == 0){
  350. let result3 = data.data['条目缺陷占比']||[]
  351. for(let i = 0;i < result3.length;i++){
  352. result3[i].value = result3[i].num
  353. }
  354. emptyCircleB(result3)
  355. panDetailB(result3)
  356. }
  357. })
  358. }
  359. if(hasData('FUNC000053')){
  360. post(api.entryByDept,{//各科室缺陷占比
  361. "type": type||1//1月2年
  362. }).then((res)=>{
  363. let data = res.data;
  364. if(data.code == 0){
  365. let result2 = data.data['各科室缺陷占比']||[]
  366. for(let i = 0;i < result2.length;i++){
  367. result2[i].value = result2[i].num
  368. }
  369. emptyCircle(result2)
  370. panDetail(result2)
  371. }
  372. })
  373. }
  374. }
  375. //part01
  376. function personNum(data){
  377. if(data['总人数']==0){
  378. $(".chuyuan,.personNum").css("display","none")
  379. picEmptyData(".chuyuanEmpty")
  380. return
  381. }else{
  382. $(".chuyuanEmpty").css("display","none")
  383. $(".chuyuan,.personNum").css("display","block")
  384. }
  385. $(".personNum").html("总人数:"+data['总人数'])
  386. $(".died").html(data['死亡人数'])
  387. $(".newborn").html(data['新生儿人数'])
  388. $(".patientNum").html(data['手术病人数'])
  389. }
  390. //part02
  391. function setNumDetail(data){
  392. // console.log(data,2222222222)
  393. if(data.length == 0){
  394. $(".pingfendengji").css("display","block")
  395. $(".bldjs").css("display","none")
  396. picEmptyData(".pingfendengjiEmpty")
  397. return
  398. }else{
  399. $(".bldjs").css("display","block")
  400. $(".pingfendengji").css("display","none")
  401. }
  402. let str = ''
  403. for(let i = 0;i < data.length;i++){
  404. str += `
  405. <li class="${i==0?'fst':'sec'}" data-c="${i}">
  406. <p class="numShow">${data[i].num}</p>
  407. <p class="explainNum">${data[i].name}</p>
  408. </li>
  409. `
  410. if(data[i].name == '甲级病历'){
  411. let tmp = []
  412. data[i].value = data[i].num
  413. tmp.push(data[i])
  414. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  415. part02pan(tmp,'fen01')
  416. }
  417. if(data[i].name == '乙级病历'){
  418. let tmp = []
  419. data[i].value = data[i].num
  420. tmp.push(data[i])
  421. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  422. part02pan(tmp,'fen02')
  423. }
  424. if(data[i].name == '丙级病历'){
  425. let tmp = []
  426. data[i].value = data[i].num
  427. tmp.push(data[i])
  428. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  429. part02pan(tmp,'fen03')
  430. }
  431. }
  432. $('.bingli').html(str)
  433. }
  434. //part02pan
  435. function part02pan(data,dom){
  436. // console.log(data,33333)
  437. dom = echarts.init(document.getElementById(dom));
  438. $(window).resize(function(){
  439. dom.resize()
  440. });
  441. let bgColor = '#fff';
  442. let title = '总量';
  443. let color = ['#3fffd1','#4c5c82'];
  444. let echartData = data;
  445. option = {
  446. //backgroundColor: bgColor,
  447. color: color,
  448. title: [{
  449. text:'{val|' + echartData[0].percentStr + '}',
  450. top: 'center',
  451. left: 'center',
  452. textStyle: {
  453. rich: {
  454. val: {
  455. fontSize: 12,
  456. color: '#E9EBEF',
  457. /*fontWeight: 'bold',*/
  458. padding: [10, 0]
  459. },
  460. name: {
  461. fontSize: 12,
  462. fontWeight: 'normal',
  463. color: '#E9EBEF',
  464. }
  465. }
  466. }
  467. }],
  468. series: [{
  469. name: '',
  470. type: 'pie',
  471. radius: ['65%', '95%'],
  472. data: echartData,
  473. hoverAnimation:true,
  474. hoverOffset:3,
  475. itemStyle: {
  476. normal: {
  477. borderColor: '#203463',
  478. borderWidth: 3
  479. }
  480. },
  481. label: {
  482. normal: {
  483. show:false,
  484. }
  485. },
  486. }]
  487. };
  488. dom.setOption(option);
  489. }
  490. //折现图
  491. function lineChart(dataX,dataY){
  492. if(dataX.length==0&&dataY.length==0){
  493. $(".barChartLine").css("display","none")
  494. picEmptyData(".barChartLineEmpty")
  495. return
  496. }else{
  497. $(".barChartLine").css("display","block")
  498. $(".barChartLineEmpty").css("display","none")
  499. }
  500. var myCharts = echarts.init(document.getElementById('lineChart'));
  501. $(window).resize(function(){
  502. myCharts.resize()
  503. });
  504. option = {
  505. color:"#00A1FF",
  506. tooltip: {
  507. trigger: 'axis',
  508. color:'#fff',
  509. formatter: function(param) {
  510. return '<div style="color:#fff;"> '+ param[0].name + "<br>" +"甲级病历占比:"+ param[0].value+"%" + "<br>"
  511. '</div>'
  512. }
  513. },
  514. grid: {
  515. left: '3%',
  516. right: '5%',
  517. bottom: '3%',
  518. containLabel: true
  519. },
  520. title:[{
  521. text: dataX.length>0?'百分比':'',
  522. top: 15,
  523. left: 0,
  524. textStyle: {
  525. fontSize: 14,
  526. color:'#E9EBEF',
  527. fontWeight: 400
  528. }
  529. }],
  530. toolbox: {
  531. show: false,
  532. feature: {
  533. dataZoom: {
  534. yAxisIndex: 'none'
  535. },
  536. dataView: {readOnly: false},
  537. magicType: {type: ['line', 'bar']},
  538. restore: {
  539. },
  540. saveAsImage: {}
  541. },
  542. emphasis:{
  543. iconStyle:{
  544. color:'red'
  545. }
  546. },
  547. },
  548. xAxis: {
  549. type: 'category',
  550. boundaryGap: false,
  551. data: dataX,
  552. axisLabel: {//x轴刻度
  553. textStyle: {
  554. color: '#E9EBEF'
  555. },
  556. rotate:'45',
  557. formatter: function (value) {
  558. //x轴的文字改为竖版显示
  559. if(value.length>7){
  560. return value.slice(0,7)+'...'
  561. }
  562. return value;
  563. }
  564. },
  565. axisLine: {//x轴
  566. lineStyle:{
  567. color:'#4A5D8E'
  568. }
  569. }
  570. },
  571. yAxis: {
  572. type: 'value',
  573. axisLabel: {
  574. formatter: '{value} %',
  575. textStyle: {
  576. color: '#E9EBEF'
  577. }
  578. },
  579. axisLine: {//y轴
  580. show: false
  581. },
  582. axisTick: {
  583. show: false
  584. },
  585. splitLine:{//分割线
  586. lineStyle:{
  587. color:'#344876'
  588. }
  589. }
  590. },
  591. series: [
  592. {
  593. name: '甲级病历占比:',
  594. type: 'line',
  595. data: dataY,
  596. }
  597. ]
  598. };
  599. myCharts.setOption(option);
  600. }
  601. function lineChartSpecial(dataX,dataY){
  602. if(dataX.length==0&&dataY.length==0){
  603. $(".barChartLine").css("display","none")
  604. picEmptyData(".barChartLineEmpty")
  605. return
  606. }else{
  607. $(".barChartLine").css("display","block")
  608. $(".barChartLineEmpty").css("display","none")
  609. }
  610. var myCharts = echarts.init(document.getElementById('lineChart'));
  611. $(window).resize(function(){
  612. myCharts.resize()
  613. });
  614. option = {
  615. color: ['#37C4FC'],
  616. tooltip: {
  617. trigger: 'axis',
  618. position: 'right',
  619. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  620. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  621. },
  622. formatter: function(param) {
  623. 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>"
  624. '</div>'
  625. }
  626. },
  627. grid: {
  628. left: '3%',
  629. right: '4%',
  630. bottom: '3%',
  631. containLabel: true
  632. },
  633. xAxis: [
  634. {
  635. type: 'category',
  636. data: dataX,
  637. axisTick: {
  638. alignWithLabel: true
  639. },
  640. axisLabel: {//x轴刻度
  641. textStyle: {
  642. color: '#E9EBEF'
  643. },
  644. rotate:45,
  645. formatter: function (value) {
  646. //x轴的文字改为竖版显示
  647. if(value.length>7){
  648. return value.slice(0,7)+'...'
  649. }
  650. return value;
  651. }
  652. },
  653. axisLine: {//x轴
  654. lineStyle:{
  655. color:'#4A5D8E'
  656. }
  657. }
  658. }
  659. ],
  660. yAxis: [
  661. {
  662. type: 'value',
  663. axisLine: {//y轴
  664. show: false
  665. },
  666. axisTick: {
  667. show: false
  668. },
  669. axisLabel: {//y轴刻度
  670. textStyle: {
  671. color: '#E9EBEF'
  672. }
  673. },
  674. splitLine:{//分割线
  675. lineStyle:{
  676. color:'#344876'
  677. }
  678. }
  679. }
  680. ],
  681. title:[{
  682. text: '合格率',
  683. top: 15,
  684. left: 10,
  685. textStyle: {
  686. fontSize: 14,
  687. color:'#E9EBEF',
  688. fontWeight: 400
  689. }
  690. }],
  691. series: [
  692. {
  693. name: '病案首页合格率',
  694. type: 'bar',
  695. barWidth: '23%',
  696. data: dataY
  697. }
  698. ]
  699. };
  700. myCharts.setOption(option);
  701. }
  702. //柱状图住院费用
  703. function barChartPay(dataX,dataY){
  704. // console.log(dataX,dataY,78787878)
  705. if(dataX.length==0&&dataY.length==0){
  706. $("#barChartPay,.innerOuter").css("display","none")
  707. picEmptyData('.barChartPayEmptys')
  708. return
  709. }else{
  710. if(hospital == "台州市立"){
  711. $(".innerOuter").css("display","block")
  712. }else{
  713. $(".innerOuter").css("display","none")
  714. }
  715. $("#barChartPay").css("display","block")
  716. $(".barChartPayEmptys").css("display","none")
  717. }
  718. var myCharts = echarts.init(document.getElementById('barChartPay'));
  719. $(window).resize(function(){
  720. myCharts.resize()
  721. });
  722. option = {
  723. color: ['#37C4FC'],
  724. tooltip: {
  725. trigger: 'axis',
  726. position: 'right',
  727. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  728. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  729. }
  730. },
  731. grid: {
  732. left: '3%',
  733. right: '4%',
  734. bottom: '3%',
  735. containLabel: true
  736. },
  737. xAxis: [
  738. {
  739. type: 'category',
  740. data: dataX,
  741. axisTick: {
  742. alignWithLabel: true
  743. },
  744. axisLabel: {//x轴刻度
  745. textStyle: {
  746. color: '#E9EBEF'
  747. },
  748. rotate:45,
  749. formatter: function (value) {
  750. //x轴的文字改为竖版显示
  751. if(value.length>7){
  752. return value.slice(0,7)+'...'
  753. }
  754. return value;
  755. }
  756. },
  757. axisLine: {//x轴
  758. lineStyle:{
  759. color:'#4A5D8E'
  760. }
  761. }
  762. }
  763. ],
  764. yAxis: [
  765. {
  766. type: 'value',
  767. axisLine: {//y轴
  768. show: false
  769. },
  770. axisTick: {
  771. show: false
  772. },
  773. axisLabel: {//y轴刻度
  774. textStyle: {
  775. color: '#E9EBEF'
  776. }
  777. },
  778. splitLine:{//分割线
  779. lineStyle:{
  780. color:'#344876'
  781. }
  782. }
  783. }
  784. ],
  785. title:[{
  786. text: dataX.length>0?'分数':'',
  787. top: 15,
  788. left: 10,
  789. textStyle: {
  790. fontSize: 14,
  791. color:'#E9EBEF',
  792. fontWeight: 400
  793. }
  794. }],
  795. series: [
  796. {
  797. name: '质控平均分',
  798. type: 'bar',
  799. barWidth: '23%',
  800. data: dataY
  801. }
  802. ]
  803. };
  804. myCharts.setOption(option);
  805. }
  806. //柱状图住院日期
  807. function barChart(data,type){
  808. // console.log(data,type,78787888787787)
  809. if(data.length==0){
  810. $(".toggleSlide,#barChart").css("display","none")
  811. picEmptyData('.barChartPayEmpty')
  812. return
  813. }else{
  814. $(".toggleSlide,#barChart").css("display","block")
  815. $(".barChartPayEmpty").css("display","none")
  816. }
  817. var myChart = echarts.init(document.getElementById('barChart'));
  818. $(window).resize(function(){
  819. myChart.resize()
  820. });
  821. var posList = [
  822. 'left', 'right', 'top', 'bottom',
  823. 'inside',
  824. 'insideTop', 'insideLeft', 'insideRight', 'insideBottom',
  825. 'insideTopLeft', 'insideTopRight', 'insideBottomLeft', 'insideBottomRight'
  826. ];
  827. let app = {}
  828. app.configParameters = {
  829. rotate: {
  830. min: -90,
  831. max: 90
  832. },
  833. align: {
  834. options: {
  835. left: 'left',
  836. center: 'center',
  837. right: 'right'
  838. }
  839. },
  840. verticalAlign: {
  841. options: {
  842. top: 'top',
  843. middle: 'middle',
  844. bottom: 'bottom'
  845. }
  846. },
  847. position: {
  848. options: echarts.util.reduce(posList, function (map, pos) {
  849. map[pos] = pos;
  850. return map;
  851. }, {})
  852. },
  853. distance: {
  854. min: 0,
  855. max: 100
  856. }
  857. };
  858. app.config = {
  859. rotate: 90,
  860. align: 'left',
  861. verticalAlign: 'middle',
  862. position: 'insideBottom',
  863. distance: 15,
  864. onChange: function () {
  865. var labelOption = {
  866. normal: {
  867. rotate: app.config.rotate,
  868. align: app.config.align,
  869. verticalAlign: app.config.verticalAlign,
  870. position: app.config.position,
  871. distance: app.config.distance
  872. }
  873. };
  874. myChart.setOption({
  875. series: [{
  876. label: labelOption
  877. }, {
  878. label: labelOption
  879. }, {
  880. label: labelOption
  881. }, {
  882. label: labelOption
  883. }]
  884. });
  885. }
  886. };
  887. var labelOption = {
  888. show: false,
  889. position: app.config.position,
  890. distance: app.config.distance,
  891. align: app.config.align,
  892. verticalAlign: app.config.verticalAlign,
  893. rotate: app.config.rotate,
  894. formatter: '{c} {name|{a}}',
  895. fontSize: 12,
  896. rich: {
  897. name: {
  898. textBorderColor: '#fff'
  899. }
  900. }
  901. };
  902. let dataX = []
  903. let data1 = []
  904. let data2 = []
  905. let data3 = []
  906. for(let i = 0;i < data.length;i++){
  907. dataX.push(data[i].name)
  908. data1.push(data[i].averageValue)//本月
  909. data2.push(data[i].lastAverageValue)//本年
  910. data3.push(data[i].lastYearAverageValue)//去年本月
  911. }
  912. option = {
  913. color: ['#37CBCB','#5A8EEE', '#FAD336' ],
  914. tooltip: {
  915. trigger: 'axis',
  916. axisPointer: {
  917. type: 'shadow'
  918. }
  919. },
  920. grid: {
  921. left: '3%',
  922. right: '4%',
  923. bottom: '3%',
  924. containLabel: true
  925. },
  926. title:[{
  927. text: dataX.length>0?(slideType==1?'天数':'元'):'',
  928. top: 15,
  929. left: 10,
  930. textStyle: {
  931. fontSize: 14,
  932. color:'#E9EBEF',
  933. fontWeight: 400
  934. }
  935. }],
  936. legend: {
  937. itemWidth :10,
  938. itemHeight :10,
  939. right:15,
  940. top:15,
  941. selectedMode:false,
  942. textStyle:{
  943. color:'#E9EBEF'
  944. },
  945. formatter: function (name) {
  946. return name;
  947. }
  948. },
  949. toolbox: {
  950. show: false,
  951. orient: 'vertical',
  952. left: 'right',
  953. top: 'center',
  954. feature: {
  955. mark: {show: true},
  956. dataView: {show: true, readOnly: false},
  957. magicType: {show: true, type: ['line', 'bar', 'stack', 'tiled']},
  958. restore: {show: true},
  959. saveAsImage: {show: true}
  960. }
  961. },
  962. xAxis: [
  963. {
  964. type: 'category',
  965. axisTick: {show: false},
  966. data: dataX,
  967. axisLabel: {//x轴刻度
  968. textStyle: {
  969. color: '#E9EBEF'
  970. },
  971. rotate:'45',
  972. formatter: function (value) {
  973. //x轴的文字改为竖版显示
  974. if(value.length>7){
  975. return value.slice(0,7)+'...'
  976. }
  977. return value;
  978. }
  979. },
  980. axisLine: {//x轴
  981. lineStyle:{
  982. color:'#4A5D8E'
  983. }
  984. },
  985. }
  986. ],
  987. yAxis: [
  988. {
  989. type: 'value',
  990. axisLine: {//y轴
  991. show: false
  992. },
  993. axisTick: {
  994. show: false
  995. },
  996. axisLabel: {//y轴刻度
  997. textStyle: {
  998. color: '#E9EBEF'
  999. }
  1000. },
  1001. splitLine:{//分割线
  1002. lineStyle:{
  1003. color:'#344876'
  1004. }
  1005. }
  1006. }
  1007. ],
  1008. series: [
  1009. {
  1010. name: type==1?'上月':'',
  1011. type: 'bar',
  1012. barGap: 0,
  1013. label: labelOption,
  1014. barWidth: '15%',
  1015. data: type==1?data2:[]
  1016. },
  1017. {
  1018. name: type==1?'去年本月':'去年',
  1019. type: 'bar',
  1020. label: labelOption,
  1021. barWidth: '15%',
  1022. data: data3
  1023. },
  1024. {
  1025. name: type==1?'本月':'本年',
  1026. type: 'bar',
  1027. label: labelOption,
  1028. barWidth: '15%',
  1029. data: data1
  1030. }
  1031. ]
  1032. };
  1033. myChart.setOption(option);
  1034. }
  1035. //空心饼图
  1036. function emptyCircle(data){
  1037. // console.log(data,1111111111)
  1038. var myChart = echarts.init(document.getElementById('emptyCircle'));
  1039. $(window).resize(function(){
  1040. myChart.resize()
  1041. });
  1042. if(data.length == 0){
  1043. $(".emptyCircleWrap").css("'display","none !important")
  1044. picEmptyData("#emptyCircleWrapEmpty")
  1045. }else{
  1046. $(".emptyCircleWrap").css("'display","block")
  1047. $(".console #emptyCircleWrapEmpty").html('')
  1048. }
  1049. let bgColor = '#203463';
  1050. let title = '总量';
  1051. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  1052. let echartData = data;
  1053. let total = 0;
  1054. for(let i = 0;i < echartData.length;i++){
  1055. total += echartData[i].num
  1056. }
  1057. option = {
  1058. /*backgroundColor: bgColor,*/
  1059. color: color,
  1060. title: [{
  1061. text: data.length>0?'{val|' + total + '}\n{name|' + title + '}':'',
  1062. top: 'center',
  1063. left: 'center',
  1064. textStyle: {
  1065. rich: {
  1066. val: {
  1067. fontSize: 24,
  1068. color: '#E9EBEF',
  1069. fontWeight: 'bold',
  1070. padding: [10, 0]
  1071. },
  1072. name: {
  1073. fontSize: 12,
  1074. fontWeight: 'normal',
  1075. color: '#E9EBEF',
  1076. }
  1077. }
  1078. }
  1079. }],
  1080. tooltip: {
  1081. trigger: 'item',
  1082. // formatter: '{b} : {c} ({d}%)',
  1083. formatter:function(item){
  1084. const {name, num, percentStr} = item.data
  1085. return `${name} : ${num} (${percentStr})`
  1086. }
  1087. },
  1088. series: [{
  1089. name: '',
  1090. type: 'pie',
  1091. radius: ['70%', '90%'],
  1092. data: echartData,
  1093. hoverAnimation:true,
  1094. hoverOffset:5,
  1095. itemStyle: {
  1096. normal: {
  1097. borderColor: bgColor,
  1098. borderWidth: 2
  1099. }
  1100. },
  1101. labelLine: {
  1102. normal: {
  1103. length: 20,
  1104. length2: 120,
  1105. lineStyle: {
  1106. color: '#e6e6e6'
  1107. }
  1108. }
  1109. },
  1110. label: {
  1111. normal: {
  1112. show:false,
  1113. formatter: params => {
  1114. return params.name == 'A类'?params.name:''
  1115. },
  1116. padding: [0 , -100, 25, -100],
  1117. rich: {
  1118. icon: {
  1119. fontSize: 16
  1120. },
  1121. name: {
  1122. fontSize: 14,
  1123. padding: [0, 10, 0, 4],
  1124. color: '#666666'
  1125. },
  1126. value: {
  1127. fontSize: 18,
  1128. fontWeight: 'bold',
  1129. color: '#333333'
  1130. }
  1131. }
  1132. }
  1133. },
  1134. }]
  1135. };
  1136. myChart.setOption(option);
  1137. }
  1138. function emptyCircleB(data){
  1139. if(data.length == 0){
  1140. $(".emptyCircleBData,.emptyCircle").css("'display","none !important")
  1141. picEmptyData(".emptyCircleBWrap")
  1142. }else{
  1143. $(".emptyCircleBData").css("'display","block")
  1144. $(".emptyCircleBWrap").css("display","none")
  1145. }
  1146. var myChart = echarts.init(document.getElementById('emptyCircleB'));
  1147. $(window).resize(function(){
  1148. myChart.resize()
  1149. });
  1150. let bgColor = '#203463';
  1151. let title = '总量';
  1152. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  1153. let echartData = data;
  1154. let total = echartData.length>0?echartData[0].totleNum:0;
  1155. option = {
  1156. /*backgroundColor: bgColor,*/
  1157. color: color,
  1158. title: [{
  1159. text: data.length>0?'{val|' + total + '}\n{name|' + title + '}':'',
  1160. top: 'center',
  1161. left: 'center',
  1162. textStyle: {
  1163. rich: {
  1164. val: {
  1165. fontSize: 24,
  1166. color: '#E9EBEF',
  1167. fontWeight: 'bold',
  1168. padding: [10, 0]
  1169. },
  1170. name: {
  1171. fontSize: 12,
  1172. fontWeight: 'normal',
  1173. color: '#E9EBEF',
  1174. }
  1175. }
  1176. }
  1177. }],
  1178. tooltip: {
  1179. trigger: 'item',
  1180. position: 'right',
  1181. // formatter: '{b} : {c} ({d}%)',
  1182. formatter:function(item){
  1183. const {name, num, percentStr} = item.data
  1184. return `${name} : ${num} (${percentStr})`
  1185. }
  1186. },
  1187. series: [{
  1188. name: '',
  1189. type: 'pie',
  1190. radius: ['70%', '90%'],
  1191. data: echartData,
  1192. hoverAnimation:true,
  1193. hoverOffset:5,
  1194. itemStyle: {
  1195. normal: {
  1196. borderColor: bgColor,
  1197. borderWidth: 2
  1198. }
  1199. },
  1200. labelLine: {
  1201. normal: {
  1202. length: 20,
  1203. length2: 120,
  1204. lineStyle: {
  1205. color: '#e6e6e6'
  1206. }
  1207. }
  1208. },
  1209. label: {
  1210. normal: {
  1211. show:false,
  1212. formatter: params => {
  1213. return params.name == 'A类'?params.name:''
  1214. },
  1215. padding: [0 , -100, 25, -100],
  1216. rich: {
  1217. icon: {
  1218. fontSize: 16
  1219. },
  1220. name: {
  1221. fontSize: 14,
  1222. padding: [0, 10, 0, 4],
  1223. color: '#666666'
  1224. },
  1225. value: {
  1226. fontSize: 18,
  1227. fontWeight: 'bold',
  1228. color: '#333333'
  1229. }
  1230. }
  1231. }
  1232. },
  1233. }]
  1234. };
  1235. myChart.setOption(option);
  1236. }
  1237. //缺陷列表渲染
  1238. function queList(data){
  1239. let strAll = '',tmp = `mm
  1240. <tr class="thead">
  1241. <td class="td01">排名</td>
  1242. <td class="td02">缺陷详情</td>
  1243. <td class="td03">数量</td>
  1244. <td class="td04">占比</td>
  1245. </tr>`
  1246. if(data.length == 0){
  1247. $(".qtable").css("display","none")
  1248. picEmptyData(".qtableEmpty")
  1249. return
  1250. }else{
  1251. $(".qtableEmpty").css("display","none")
  1252. $(".qtable").css("display","table")
  1253. }
  1254. for(let i = 0;i < data.length;i++){
  1255. strAll += `
  1256. <tr>
  1257. <td style="text-align:center;"><i style="background:${i < 3?'#ECB22E':'#526186'};color:${i < 3?'#fff':'#B7BDCC'};">${i+1}</i></td>
  1258. <td><p class="td02name">${data[i].name}</p></td>
  1259. <td>${data[i].num}</td>
  1260. <td>${data[i].percentStr}</td>
  1261. </tr>
  1262. `
  1263. }
  1264. $(".qtable").html(tmp+strAll)
  1265. }
  1266. //饼图列表注释渲染
  1267. function panDetail(data){
  1268. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  1269. let strAll = '';
  1270. for(let i = 0;i < data.length;i++){
  1271. strAll += `
  1272. <tr class="explainLi" data-dept="${data[i].name}" dept-id="${data[i].id}">
  1273. <td class="deptName" title="${data[i].name}">
  1274. <p class="smp"><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
  1275. </td>
  1276. <td class="deptNum">${data[i].num}</td>
  1277. <td class="percent">(${data[i].percentStr})</td>
  1278. </tr>
  1279. `
  1280. }
  1281. $(".explainPanT table").html(strAll);
  1282. $(".explainPanT .explainLi").click(function(){
  1283. let deptName = $(this).attr("data-dept")
  1284. let deptId = $(this).attr("dept-id")
  1285. focusMenuItem("YH-ZKK-GKSQXZB_XQ");
  1286. $(parent.document).find("#contentIframe").attr("src","quexianDetailControl.html?shijian"+dateType+"&deptName="+deptName)
  1287. })
  1288. }
  1289. function panDetailB(data){
  1290. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  1291. let strAll = '';
  1292. for(let i = 0;i < data.length;i++){
  1293. strAll += `
  1294. <tr class="explainLi">
  1295. <td class="deptName" title="${data[i].name}">
  1296. <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
  1297. </td>
  1298. <td class="deptNum">${data[i].num}</td>
  1299. <td class="percent">(${data[i].percentStr})</td>
  1300. </tr>
  1301. `
  1302. }
  1303. $(".explainPanB table").html(strAll);
  1304. $(".explainPan").css({
  1305. marginTop:-($(".explainPan").height()/2-20)+'px'
  1306. })
  1307. }
  1308. //时间获取
  1309. function getTimeDetail(){
  1310. const d = new Date();
  1311. const days = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
  1312. let sec = d.getSeconds()
  1313. let min = d.getMinutes()
  1314. let hour = d.getHours()
  1315. 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}`
  1316. $(".dateDetail").html(str)
  1317. }