console.js 39 KB

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