console.js 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793
  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. require('./../resource/jquery-ui/jquery-ui.min.js');
  10. require('./../resource/jquery-ui/jquery-ui.min.css');
  11. const {post,setCookie,delCookie,getCookie,focusMenuItem,picEmptyData} = require('../js/utils.js');
  12. let payMoney = [],behosDateStart="",behosDateEnd="",dayLis = [],dateType = 2,slideType = 1,hospital=getCookie("hospital"),deptType="内科",deptId="",level="甲",lineType="合格率",lineType1=[],lineType2=[],lineType3=[],lineType4=[];
  13. $(function(){
  14. if(!hasData('YH-KZT')){
  15. $("body").html('')
  16. }
  17. // if(hospital == "台州市立"){
  18. // $(".part03 .partTitlePub .name").html('各科室甲级病例占比')
  19. // $(".innerOuter").css("display","block")
  20. // }else{
  21. // $(".part03 .partTitlePub .name").html('病案首页合格率')
  22. // $(".innerOuter").css("display","none")
  23. // }
  24. $(".partTitle p span").html(hospital)
  25. // setInterval(() => {
  26. // getTimeDetail()
  27. // }, 1000);
  28. resizeBox()
  29. initConsole()//质控列表
  30. // getBarData(2)//图标数据获取
  31. dateChange()
  32. $(window).resize(function(){
  33. resizeBox()
  34. })
  35. $(window).click(function(){
  36. window.parent.userActionHide()
  37. $(".toggleSlide ul").css("display","none")
  38. })
  39. let sildeIS = true
  40. if(!hasData('FUNC000045')&&!hasData('FUNC000046')){
  41. $(".toggleSlide").css("opacity","0.5")
  42. sildeIS = false
  43. }
  44. $(".toggleSlide p").click(function(e){
  45. if(!sildeIS)return
  46. e.stopPropagation()
  47. $(this).next().slideToggle()
  48. })
  49. $(".toggleSlide li").click(function(){
  50. let str = $(this).attr("data-str"),type = $(this).attr("data-type")
  51. if(type == 1){
  52. // if(!hasData('FUNC000045')){
  53. // return
  54. // }
  55. slideType = 1
  56. level = "甲"
  57. getEveryDeptLevel()
  58. // $(".pubEchart .title span").html("科室平均住院天数柱状图")
  59. // barChart(dayLis,dateType)
  60. $(this).parent().slideToggle().prev().find("span").html(str)
  61. }else if(type == 2){
  62. // if(!hasData('FUNC000046')){
  63. // return
  64. // }
  65. slideType = 2
  66. level = "乙"
  67. getEveryDeptLevel()
  68. // $(".pubEchart .title span").html("科室平均住院花费柱状图")
  69. // barChart(payMoney,dateType)
  70. $(this).parent().slideToggle().prev().find("span").html(str)
  71. }else if(type == 6){
  72. // if(!hasData('FUNC000046')){
  73. // return
  74. // }
  75. slideType = 6
  76. level = "丙"
  77. getEveryDeptLevel()
  78. // $(".pubEchart .title span").html("科室平均住院花费柱状图")
  79. // barChart(payMoney,dateType)
  80. $(this).parent().slideToggle().prev().find("span").html(str)
  81. }else if(type == 3){//科室平均分内科
  82. if(!hasData('FUNC000091')){
  83. return
  84. }
  85. deptType="内科"
  86. getAverageScoreLis()
  87. $(this).parent().slideToggle().prev().find("span").html(str+"系统")
  88. }else if(type == 4){//科室平均分外科
  89. if(!hasData('FUNC000091')){
  90. return
  91. }
  92. deptType="外科"
  93. getAverageScoreLis()
  94. $(this).parent().slideToggle().prev().find("span").html(str+"系统")
  95. }else if(type == 7){//病案首页
  96. lineType="合格率"
  97. lineChartHome(lineType4,lineType1)
  98. $(this).parent().slideToggle().prev().find("span").html(str)
  99. }else if(type == 8){//病案首页
  100. lineType = "完整率"
  101. lineChartHome(lineType4,lineType2)
  102. $(this).parent().slideToggle().prev().find("span").html(str)
  103. }else if(type == 9){//病案首页
  104. lineType = "完善率"
  105. lineChartHome(lineType4,lineType3)
  106. $(this).parent().slideToggle().prev().find("span").html(str)
  107. }
  108. })
  109. $(".part02").on("mouseenter",".bingli li.sec",function(){
  110. $(this).find(".explainNum").css("color","#00A1FF")
  111. })
  112. $(".part02").on("mouseleave",".bingli li.sec",function(){
  113. $(this).find(".explainNum").css("color","#A5ADBF")
  114. })
  115. getDetails()
  116. getEveryDeptLevel()
  117. })
  118. function getDetails(){
  119. $(".pubEchartB.paymoney .title").click(function(){
  120. focusMenuItem("YH-ZKK-GKSQXZB_XQ");
  121. $(parent.document).find("#contentIframe").attr("src","./deptScoreDetailControl.html?from=1&dateType="+dateType+"&deptType="+deptType)
  122. })
  123. $(".part02 .bingliLis").click(function(){
  124. focusMenuItem("YH-ZKK-GKSQXZB_XQ");
  125. $(parent.document).find("#contentIframe").attr("src","./deptScoreDetailControl.html?from=1&dateType="+dateType)
  126. })
  127. $(".part03 .circle .title").click(function(){
  128. focusMenuItem("YH-ZKK-TMQXZB_XQ");
  129. $(parent.document).find("#contentIframe").attr("src","./singleVeto.html?from=1&shijian="+dateType+"&qxName=&selectReject=1")
  130. })
  131. $(".part02").on("click",".bingli li.sec",function(){
  132. focusMenuItem("YH-BLZK-ZKPF");
  133. let dataC = $(this).attr("data-c")
  134. let chengdu = dataC == 1?'甲':dataC==2?'乙':'丙'
  135. $(parent.document).find("#contentIframe").attr("src","./qcList.html?from=1&dateType="+dateType+"&chengdu="+chengdu)
  136. })
  137. $(".part03 .partTitlePub").click(function(){
  138. // if(hospital=="台州市立"){
  139. // focusMenuItem("YH-ZKK-GKSJJBLZB_XQ")
  140. // $(parent.document).find("#contentIframe").attr("src","./jiaji.html?from=1&dateType="+dateType)
  141. // }else{
  142. // focusMenuItem("YH-ZKK-BASYHGLZB_XQ");
  143. // $(parent.document).find("#contentIframe").attr("src","./partDetailControl.html?from=1&dateType="+dateType)
  144. // }
  145. focusMenuItem("YH-ZKK-BASYHGLZB_XQ");
  146. $(parent.document).find("#contentIframe").attr("src","./partDetailControl.html?from=1&dateType="+dateType+"&lineType="+lineType)
  147. })
  148. $(".paymoney.pubEchart .title").click(function(){
  149. // if($(this).text().indexOf("花费")!==-1){
  150. // focusMenuItem("YH-ZKK-KSPJZYHF_XQ");
  151. // $(parent.document).find("#contentIframe").attr("src","./payDetail.html?from=1&dateType="+dateType)
  152. // }else{
  153. // focusMenuItem("YH-ZKK-KSPJZYTS_XQ");
  154. // $(parent.document).find("#contentIframe").attr("src","./dayDetail.html?from=1&dateType="+dateType)
  155. // }
  156. focusMenuItem("YH-ZKK-GKSQXZB_XQ");
  157. $(parent.document).find("#contentIframe").attr("src","./deptScoreDetailControl.html?from=1&dateType="+dateType)
  158. })
  159. $(".defect .partTitlePub").click(function(){ //from 1 console / 2 deptConsole
  160. focusMenuItem("YH-ZKK-GMKQXZB_XQ");
  161. $(parent.document).find("#contentIframe").attr("src","./mukuaiControl.html?from=1&dateType="+dateType)
  162. })
  163. $(".circleB .title").click(function(){
  164. focusMenuItem("YH-ZKK-TMQXZB_XQ");
  165. $(parent.document).find("#contentIframe").attr("src","./singleVeto.html?from=1&special=1&shijian="+dateType)
  166. })
  167. }
  168. //判断有无某一权限
  169. function hasData(data){
  170. let lis = JSON.parse(getCookie("codeLis"))
  171. // console.log(lis)
  172. if(lis.indexOf(data)>-1){//有权限
  173. return true
  174. }
  175. return false;
  176. }
  177. function resizeBox(){
  178. $(".partWrap").css({
  179. height:$(window).height()-43+'px'
  180. })
  181. }
  182. //所有数据切换日期筛选
  183. function dateChange(){
  184. $(".monthYear .mon").click(function(){
  185. $(this).css({
  186. backgroundColor:'#00A1FF',
  187. color:'#E9EBEF',
  188. "border-color":'#00A1FF'
  189. }).siblings().css({
  190. "border-color":'#A5ADBF',
  191. color:'#A5ADBF',
  192. backgroundColor:'#203463'
  193. })
  194. dateType = 1
  195. dateConsole(1)
  196. })
  197. $(".monthYear .year").click(function(){
  198. $(this).css({
  199. backgroundColor:'#00A1FF',
  200. color:'#E9EBEF',
  201. "border-color":'#00A1FF'
  202. }).siblings().css({
  203. "border-color":'#A5ADBF',
  204. color:'#A5ADBF',
  205. backgroundColor:'#203463'
  206. })
  207. dateType = 2
  208. dateConsole(2)
  209. })
  210. }
  211. //控制台数
  212. function initConsole(result){
  213. let url = {
  214. '本月病历数':require("../images/icon6.png"),
  215. '本月不合格病历-机器':require("../images/icon7.png"),
  216. '本月质控数-机器':require("../images/icon10.png"),
  217. '本月甲级病历-机器':require("../images/icon8.png"),
  218. '本月乙级病历-机器':require("../images/icon9.png"),
  219. '本年病历数':require("../images/icon6.png"),
  220. '本年不合格病历-机器':require("../images/icon7.png"),
  221. '本年质控数-机器':require("../images/icon10.png"),
  222. '本年甲级病历-机器':require("../images/icon8.png"),
  223. '本年乙级病历-机器':require("../images/icon9.png"),
  224. }
  225. let dom = '';
  226. for(let i in result){
  227. if(i.indexOf("人工")==-1){
  228. let name = i.split("-")[0];
  229. let num = 0;
  230. if(name=='本月病历数'||name=='本年病历数'){
  231. num = result[i]
  232. }else{
  233. num = result[name+'-人工']+result[i]
  234. }
  235. dom += `
  236. <li class="partLi">
  237. <div class="partIn">
  238. <p class="top">${name}</p>
  239. <p class="btm clearfix">
  240. <img src="${url[i]}" alt="">
  241. <span>${num}</span>
  242. </p>
  243. </div>
  244. </li>
  245. `
  246. }
  247. }
  248. $(".partAll").html(dom)
  249. }
  250. //平均分
  251. function getAverageScoreLis(){
  252. let url = ''
  253. if(hospital=="台州市立"&&hasData('FUNC000091')){
  254. url = api.getAverageScoreByDeptClass
  255. }else if(hospital=="长兴医院"&&hasData('FUNC000047')){
  256. url = api.getAverageScore
  257. }else{
  258. return
  259. }
  260. post(url,{//各科室质控平均分
  261. "type": dateType||1,//1月2年
  262. "deptClass":deptType,
  263. "startDate":behosDateStart,
  264. "endDate":behosDateEnd
  265. }).then((res)=>{
  266. let data = res.data;
  267. if(data.code == 0){
  268. let result1 = (hospital=="台州市立"?data.data:data.data['各科室质控平均分'])||[]
  269. let dataX1=[],dataY1=[]
  270. for(let i = 0;i < result1.length;i++){
  271. dataX1.push(result1[i].name)
  272. dataY1.push(result1[i].averageValue)
  273. }
  274. barChartPay(dataX1,dataY1)
  275. }
  276. })
  277. }
  278. //获取各科室病历等级占比
  279. function getEveryDeptLevel(){
  280. if(1){//权限暂无
  281. post(api.qcResultLevelPercent,{//各科室病历等级占比
  282. "type": dateType||2,//1月2年
  283. "level":level,
  284. "startDate":behosDateStart,
  285. "endDate":behosDateEnd
  286. }).then((res)=>{
  287. let data = res.data;
  288. if(data.code == 0){
  289. let result1 = data.data||[]
  290. let dataX1=[],dataY1=[]
  291. for(let i = 0;i < result1.length;i++){
  292. dataX1.push(result1[i].deptName)
  293. dataY1.push(result1[i].percentStr.replace('%',''))
  294. }
  295. barChartLevel(dataX1,dataY1)
  296. }
  297. })
  298. }else{
  299. $(".toggleSlide1").css("opacity",0.5)
  300. }
  301. }
  302. //获取图表数据
  303. function getBarData(type){
  304. // if(hasData('FUNC000045')){
  305. // post(api.getAverageDayNum,{//平均住院天数
  306. // "type": type||1//1月2年
  307. // }).then((res)=>{
  308. // let data = res.data;
  309. // if(data.code == 0){
  310. // let result2 = data.data['平均住院日']||[]
  311. // dayLis = result2
  312. // if(slideType == 1){
  313. // barChart(result2,type||1)
  314. // }
  315. // }
  316. // })
  317. // }else{
  318. // $(".toggleSlide1").css("opacity",0.5)
  319. // }
  320. // if(hasData('FUNC000046')){
  321. // post(api.getAverageFee,{//平均住院费用
  322. // "type": type||1//1月2年
  323. // }).then((res)=>{
  324. // let data = res.data;
  325. // if(data.code == 0){
  326. // let result3 = data.data['平均住院费用']||[]
  327. // payMoney = result3;
  328. // if(slideType == 2){
  329. // barChart(result3,type||1)
  330. // }
  331. // }
  332. // })
  333. // }else{
  334. // $(".toggleSlide2").css("opacity",0.5)
  335. // }
  336. // if(hasData('FUNC000048')&&hospital=="台州市立"){
  337. // post(api.getLevelResultDept,{//各科室甲级占比
  338. // "type": type||1//1月2年
  339. // }).then((res)=>{
  340. // let data = res.data;
  341. // if(data.code == 0){
  342. // let result2 = data.data['各科室甲级病历占比']||[]
  343. // let dataX2=[],dataY2=[];
  344. // for(let i = 0;i < result2.length;i++){
  345. // dataX2.push(result2[i].deptName)
  346. // dataY2.push(result2[i].firstPercent.replace('%',''))
  347. // }
  348. // lineChart(dataX2,dataY2)
  349. // }
  350. // })
  351. // }
  352. // if(hasData('FUNC000075')&&hospital=="长兴医院"){
  353. // post(api.homePageLevelLimit,{//病案首页
  354. // "type": type||1//1月2年
  355. // }).then((res)=>{
  356. // let data = res.data;
  357. // if(data.code == 0){
  358. // let result1 = data.data||[]
  359. // let dataX1=[],dataY1=[]
  360. // for(let i = 0;i < result1.length;i++){
  361. // dataX1.push(result1[i].deptName)
  362. // dataY1.push(result1[i].firstLevelPercentStr.replace('%',''))
  363. // }
  364. // lineChartSpecial(dataX1,dataY1)
  365. // }
  366. // })
  367. // }
  368. if(hasData("FUNC000075")){
  369. post(api.homePageLevelLimit,{//病案首页
  370. "type": type||1,//1月2年
  371. "startDate":behosDateStart,
  372. "endDate":behosDateEnd
  373. }).then((res)=>{
  374. let data = res.data;
  375. if(data.code == 0){
  376. let result1 = data.data||[]
  377. let dataX=[],dataY1=[],dataY2=[],dataY3=[]
  378. for(let i = 0;i < result1.length;i++){
  379. dataX.push(result1[i].deptName)
  380. dataY1.push((result1[i].firstLevelPercentStr.replace('%','')-0))
  381. dataY2.push((result1[i].emptyPercentStr.replace('%','')-0))
  382. dataY3.push((result1[i].errorPercentStr.replace('%','')-0))
  383. }
  384. lineType1 = dataY1.sort(function(a, b){return b - a})
  385. lineType2 = dataY2.sort(function(a, b){return b - a})
  386. lineType3 = dataY3.sort(function(a, b){return b - a})
  387. lineType4 = dataX
  388. let datay = (lineType == "合格率")?lineType1:(lineType=="完整率"?lineType2:lineType3)
  389. lineChartHome(dataX,datay)
  390. }
  391. })
  392. }
  393. if(hasData('FUNC000049')){
  394. post(api.leaveHosCount,{//出院人数统计
  395. "type": type||1,//1月2年
  396. "startDate":behosDateStart,
  397. "endDate":behosDateEnd
  398. }).then((res)=>{
  399. let data = res.data;
  400. if(data.code == 0){
  401. // barChart(result2,type||1)
  402. // console.log(data)
  403. let result1 = data.data['出院人数统计']||[]
  404. personNum(result1)
  405. }
  406. })
  407. }
  408. if(hasData('FUNC000050')){
  409. post(api.mrCount,{//质控病历统计
  410. "type": type||1,//1月2年
  411. "startDate":behosDateStart,
  412. "endDate":behosDateEnd
  413. }).then((res)=>{
  414. let data = res.data
  415. if(data.code == 0){
  416. let result3 = data.data['病历数统计']||[]
  417. setNumDetail(result3)
  418. }
  419. })
  420. }
  421. if(hasData('FUNC000051')){
  422. post(api.entryCountGroupByCase,{//各模块缺陷占比排行
  423. "type": type||1,//1月2年
  424. "startDate":behosDateStart,
  425. "endDate":behosDateEnd
  426. }).then((res)=>{
  427. let data = res.data;
  428. if(data.code == 0){
  429. let result1 = data.data['各模块缺陷占比排行']||[];
  430. // result1.length>8?result1.length=8:"";
  431. queList(result1)
  432. }
  433. })
  434. }
  435. if(hasData('FUNC000052')){
  436. post(api.entryCountGroupByEntry,{//条目缺陷占比
  437. "type": type||1,//1月2年
  438. "startDate":behosDateStart,
  439. "endDate":behosDateEnd
  440. }).then((res)=>{
  441. let data = res.data;
  442. if(data.code == 0){
  443. let result3 = data.data['条目缺陷占比']||[]
  444. for(let i = 0;i < result3.length;i++){
  445. result3[i].value = result3[i].num
  446. }
  447. emptyCircleB(result3)
  448. panDetailB(result3)
  449. }
  450. })
  451. }
  452. // if(hasData('FUNC000053')){
  453. // post(api.entryByDept,{//各科室缺陷占比
  454. // "type": type||1//1月2年
  455. // }).then((res)=>{
  456. // let data = res.data;
  457. // if(data.code == 0){
  458. // let result2 = data.data['各科室缺陷占比']||[]
  459. // for(let i = 0;i < result2.length;i++){
  460. // result2[i].value = result2[i].num
  461. // }
  462. // emptyCircle(result2)
  463. // panDetail(result2)
  464. // }
  465. // })
  466. // }
  467. // if(1){
  468. post(api.entryRejectPercent,{//单项否决
  469. "type": type||2,//1月2年
  470. "deptClass": "",
  471. "level": "",
  472. "startDate":behosDateStart,
  473. "endDate":behosDateEnd
  474. }).then((res)=>{
  475. let data = res.data;
  476. if(data.code == 0){
  477. let result2 = data.data||[]
  478. for(let i = 0;i < result2.length;i++){
  479. result2[i].value = result2[i].num
  480. }
  481. emptyCircle(result2)
  482. panDetail(result2)
  483. }
  484. })
  485. // }
  486. }
  487. //part01
  488. function personNum(data){
  489. if(data['总人数']==0){
  490. $(".chuyuan,.personNum").css("display","none")
  491. picEmptyData(".chuyuanEmpty")
  492. return
  493. }else{
  494. $(".chuyuanEmpty").css("display","none")
  495. $(".chuyuan,.personNum").css("display","block")
  496. }
  497. $(".personNum").html("总人数:"+data['总人数'])
  498. $(".died").html(data['死亡人数'])
  499. $(".newborn").html(data['新生儿人数'])
  500. $(".patientNum").html(data['手术病人数'])
  501. }
  502. //part02
  503. function setNumDetail(data){
  504. // console.log(data,2222222222)
  505. if(data.length == 0){
  506. $(".pingfendengji").css("display","block")
  507. $(".bldjs").css("display","none")
  508. picEmptyData(".pingfendengjiEmpty")
  509. return
  510. }else{
  511. $(".bldjs").css("display","block")
  512. $(".pingfendengji").css("display","none")
  513. }
  514. let str = ''
  515. for(let i = 0;i < data.length;i++){
  516. str += `
  517. <li class="${i==0?'fst':'sec'}" data-c="${i}">
  518. <p class="numShow">${data[i].num}</p>
  519. <p class="explainNum">${data[i].name}</p>
  520. </li>
  521. `
  522. if(data[i].name == '甲级病历'){
  523. let tmp = []
  524. data[i].value = data[i].num
  525. tmp.push(data[i])
  526. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  527. part02pan(tmp,'fen01')
  528. }
  529. if(data[i].name == '乙级病历'){
  530. let tmp = []
  531. data[i].value = data[i].num
  532. tmp.push(data[i])
  533. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  534. part02pan(tmp,'fen02')
  535. }
  536. if(data[i].name == '丙级病历'){
  537. let tmp = []
  538. data[i].value = data[i].num
  539. tmp.push(data[i])
  540. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  541. part02pan(tmp,'fen03')
  542. }
  543. }
  544. $('.bingli').html(str)
  545. }
  546. //part02pan
  547. function part02pan(data,dom){
  548. // console.log(data,33333)
  549. dom = echarts.init(document.getElementById(dom));
  550. $(window).resize(function(){
  551. dom.resize()
  552. });
  553. let bgColor = '#fff';
  554. let title = '总量';
  555. let color = ['#3fffd1','#4c5c82'];
  556. let echartData = data;
  557. option = {
  558. //backgroundColor: bgColor,
  559. color: color,
  560. title: [{
  561. text:'{val|' + echartData[0].percentStr + '}',
  562. top: 'center',
  563. left: 'center',
  564. textStyle: {
  565. rich: {
  566. val: {
  567. fontSize: 12,
  568. color: '#E9EBEF',
  569. /*fontWeight: 'bold',*/
  570. padding: [10, 0]
  571. },
  572. name: {
  573. fontSize: 12,
  574. fontWeight: 'normal',
  575. color: '#E9EBEF',
  576. }
  577. }
  578. }
  579. }],
  580. series: [{
  581. name: '',
  582. type: 'pie',
  583. radius: ['65%', '95%'],
  584. data: echartData,
  585. hoverAnimation:true,
  586. hoverOffset:3,
  587. itemStyle: {
  588. normal: {
  589. borderColor: '#203463',
  590. borderWidth: 3
  591. }
  592. },
  593. label: {
  594. normal: {
  595. show:false,
  596. }
  597. },
  598. }]
  599. };
  600. dom.setOption(option);
  601. }
  602. //折现图各科室甲级病历占比(长兴)
  603. function lineChart(dataX,dataY){
  604. if(dataX.length==0&&dataY.length==0){
  605. $(".barChartLine").css("display","none")
  606. picEmptyData(".barChartLineEmpty")
  607. return
  608. }else{
  609. $(".barChartLine").css("display","block")
  610. $(".barChartLineEmpty").css("display","none")
  611. }
  612. var myCharts = echarts.init(document.getElementById('lineChart'));
  613. $(window).resize(function(){
  614. myCharts.resize()
  615. });
  616. option = {
  617. color:"#00A1FF",
  618. tooltip: {
  619. trigger: 'axis',
  620. color:'#fff',
  621. formatter: function(param) {
  622. return '<div style="color:#fff;"> '+ param[0].name + "<br>" +"甲级病历占比:"+ param[0].value+"%" + "<br>"
  623. '</div>'
  624. }
  625. },
  626. grid: {
  627. left: '3%',
  628. right: '5%',
  629. bottom: '3%',
  630. containLabel: true
  631. },
  632. title:[{
  633. text: dataX.length>0?'百分比':'',
  634. top: 15,
  635. left: 0,
  636. textStyle: {
  637. fontSize: 14,
  638. color:'#E9EBEF',
  639. fontWeight: 400
  640. }
  641. }],
  642. toolbox: {
  643. show: false,
  644. feature: {
  645. dataZoom: {
  646. yAxisIndex: 'none'
  647. },
  648. dataView: {readOnly: false},
  649. magicType: {type: ['line', 'bar']},
  650. restore: {
  651. },
  652. saveAsImage: {}
  653. },
  654. emphasis:{
  655. iconStyle:{
  656. color:'red'
  657. }
  658. },
  659. },
  660. xAxis: {
  661. type: 'category',
  662. boundaryGap: false,
  663. data: dataX,
  664. axisLabel: {//x轴刻度
  665. textStyle: {
  666. color: '#E9EBEF'
  667. },
  668. rotate:'45',
  669. formatter: function (value) {
  670. //x轴的文字改为竖版显示
  671. if(value.length>7){
  672. return value.slice(0,7)+'...'
  673. }
  674. return value;
  675. }
  676. },
  677. axisLine: {//x轴
  678. lineStyle:{
  679. color:'#4A5D8E'
  680. }
  681. }
  682. },
  683. yAxis: {
  684. type: 'value',
  685. axisLabel: {
  686. formatter: '{value} %',
  687. textStyle: {
  688. color: '#E9EBEF'
  689. }
  690. },
  691. axisLine: {//y轴
  692. show: false
  693. },
  694. axisTick: {
  695. show: false
  696. },
  697. splitLine:{//分割线
  698. lineStyle:{
  699. color:'#344876'
  700. }
  701. }
  702. },
  703. series: [
  704. {
  705. name: '甲级病历占比:',
  706. type: 'line',
  707. data: dataY,
  708. }
  709. ]
  710. };
  711. myCharts.setOption(option);
  712. }
  713. function lineChartSpecial(dataX,dataY){
  714. if(dataX.length==0&&dataY.length==0){
  715. $(".barChartLine").css("display","none")
  716. picEmptyData(".barChartLineEmpty")
  717. return
  718. }else{
  719. $(".barChartLine").css("display","block")
  720. $(".barChartLineEmpty").css("display","none")
  721. }
  722. var myCharts = echarts.init(document.getElementById('lineChart'));
  723. $(window).resize(function(){
  724. myCharts.resize()
  725. });
  726. option = {
  727. color: ['#37C4FC'],
  728. tooltip: {
  729. trigger: 'axis',
  730. position: 'right',
  731. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  732. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  733. },
  734. formatter: function(param) {
  735. 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>"
  736. '</div>'
  737. }
  738. },
  739. grid: {
  740. left: '3%',
  741. right: '4%',
  742. bottom: '3%',
  743. containLabel: true
  744. },
  745. xAxis: [
  746. {
  747. type: 'category',
  748. data: dataX,
  749. axisTick: {
  750. alignWithLabel: true
  751. },
  752. axisLabel: {//x轴刻度
  753. textStyle: {
  754. color: '#E9EBEF'
  755. },
  756. rotate:45,
  757. formatter: function (value) {
  758. //x轴的文字改为竖版显示
  759. if(value.length>7){
  760. return value.slice(0,7)+'...'
  761. }
  762. return value;
  763. }
  764. },
  765. axisLine: {//x轴
  766. lineStyle:{
  767. color:'#4A5D8E'
  768. }
  769. }
  770. }
  771. ],
  772. yAxis: [
  773. {
  774. type: 'value',
  775. axisLine: {//y轴
  776. show: false
  777. },
  778. axisTick: {
  779. show: false
  780. },
  781. axisLabel: {//y轴刻度
  782. textStyle: {
  783. color: '#E9EBEF'
  784. }
  785. },
  786. splitLine:{//分割线
  787. lineStyle:{
  788. color:'#344876'
  789. }
  790. }
  791. }
  792. ],
  793. title:[{
  794. text: '合格率',
  795. top: 15,
  796. left: 10,
  797. textStyle: {
  798. fontSize: 14,
  799. color:'#E9EBEF',
  800. fontWeight: 400
  801. }
  802. }],
  803. series: [
  804. {
  805. name: '病案首页合格率',
  806. type: 'bar',
  807. barWidth: '23%',
  808. data: dataY
  809. }
  810. ]
  811. };
  812. myCharts.setOption(option);
  813. }
  814. //折线图病案首页
  815. function lineChartHome(dataX,dataY){
  816. // console.log(dataX,dataY)
  817. if(dataX.length==0){
  818. $(".barChartLine").css("display","none")
  819. picEmptyData(".barChartLineEmpty")
  820. return
  821. }else{
  822. $(".barChartLine").css("display","block")
  823. $(".barChartLineEmpty").css("display","none")
  824. }
  825. var myCharts = echarts.init(document.getElementById('lineChart'));
  826. $(window).resize(function(){
  827. myCharts.resize()
  828. });
  829. option = {
  830. color:(lineType == "合格率")?'#00A1FF':(lineType=="完整率"?'#FF2B92':'#3EFFD1'),
  831. title: {
  832. text: '百分比',
  833. top: 15,
  834. left: 10,
  835. textStyle: {
  836. fontSize: 14,
  837. color:'#E9EBEF',
  838. fontWeight: 400
  839. }
  840. },
  841. tooltip: {
  842. trigger: 'axis',
  843. position: 'right',
  844. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  845. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  846. },
  847. formatter: function(param) {
  848. return `<div style="color:#fff;">${param[0].name}<br>
  849. <i style="background:${(lineType == "合格率")?'#00A1FF':(lineType=="完整率"?'#FF2B92':'#3EFFD1')};margin-right:5px;display:inline-block;width:8px;height:8px;border-radius:50%"></i>病案首页${lineType}:${param[0]&&param[0].value}%<br>
  850. </div>`
  851. }
  852. },
  853. // legend: {
  854. // selectedMode :false,
  855. // right:15,
  856. // top:15,
  857. // data: [
  858. // {
  859. // name: '合格率',
  860. // textStyle: {
  861. // color: '#A5ADBF'
  862. // }
  863. // },
  864. // {
  865. // name: '完整率',
  866. // textStyle: {
  867. // color: '#A5ADBF'
  868. // }
  869. // },
  870. // {
  871. // name: '完善率',
  872. // textStyle: {
  873. // color: '#A5ADBF'
  874. // }
  875. // }
  876. // ]
  877. // },
  878. grid: {
  879. left: '3%',
  880. right: '4%',
  881. bottom: '3%',
  882. containLabel: true
  883. },
  884. xAxis: {
  885. type: 'category',
  886. boundaryGap: false,
  887. data: dataX,
  888. axisTick: {
  889. alignWithLabel: true
  890. },
  891. axisLabel: {//x轴刻度
  892. textStyle: {
  893. color: '#E9EBEF'
  894. },
  895. rotate:45,
  896. formatter: function (value) {
  897. //x轴的文字改为竖版显示
  898. if(value.length>7){
  899. return value.slice(0,7)+'...'
  900. }
  901. return value;
  902. }
  903. },
  904. axisLine: {//x轴
  905. lineStyle:{
  906. color:'#4A5D8E'
  907. }
  908. }
  909. },
  910. yAxis: {
  911. type: 'value',
  912. min:0,
  913. max:100,
  914. boundaryGap: [0.01, 0.01],axisLabel: {
  915. show: true,
  916. },
  917. axisLine: {//y轴
  918. show: false
  919. },
  920. axisTick: {
  921. show: false
  922. },
  923. axisLabel: {//y轴刻度
  924. textStyle: {
  925. color: '#E9EBEF'
  926. },
  927. interval: 'auto',
  928. formatter: '{value} %'
  929. },
  930. splitLine:{//分割线
  931. lineStyle:{
  932. color:'#344876'
  933. }
  934. }
  935. },
  936. series: [
  937. {
  938. name: lineType,
  939. type: 'line',
  940. // stack: '总量',
  941. data: dataY
  942. },
  943. // {
  944. // name: '完整率',
  945. // type: 'line',
  946. // // stack: '总量',
  947. // data: dataY2
  948. // },
  949. // {
  950. // name: '完善率',
  951. // type: 'line',
  952. // // stack: '总量',
  953. // data: dataY3
  954. // }
  955. ]
  956. };
  957. myCharts.setOption(option);
  958. }
  959. //柱状图住院费用
  960. function barChartPay(dataX,dataY){
  961. // console.log(dataX,dataY,78787878)
  962. if(dataX.length==0&&dataY.length==0){
  963. $("#barChartPay,.innerOuter").css("display","none")
  964. picEmptyData('.barChartPayEmptys')
  965. return
  966. }else{
  967. if(hospital == "台州市立"){
  968. $(".innerOuter").css("display","block")
  969. }else{
  970. $(".innerOuter").css("display","none")
  971. }
  972. $("#barChartPay").css("display","block")
  973. $(".barChartPayEmptys").css("display","none")
  974. }
  975. var myCharts = echarts.init(document.getElementById('barChartPay'));
  976. $(window).resize(function(){
  977. myCharts.resize()
  978. });
  979. option = {
  980. color: ['#37C4FC'],
  981. tooltip: {
  982. trigger: 'axis',
  983. position: 'right',
  984. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  985. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  986. }
  987. },
  988. grid: {
  989. left: '3%',
  990. right: '4%',
  991. bottom: '3%',
  992. containLabel: true
  993. },
  994. xAxis: [
  995. {
  996. type: 'category',
  997. data: dataX,
  998. axisTick: {
  999. alignWithLabel: true
  1000. },
  1001. axisLabel: {//x轴刻度
  1002. textStyle: {
  1003. color: '#E9EBEF'
  1004. },
  1005. rotate:45,
  1006. formatter: function (value) {
  1007. //x轴的文字改为竖版显示
  1008. if(value.length>7){
  1009. return value.slice(0,7)+'...'
  1010. }
  1011. return value;
  1012. }
  1013. },
  1014. axisLine: {//x轴
  1015. lineStyle:{
  1016. color:'#4A5D8E'
  1017. }
  1018. }
  1019. }
  1020. ],
  1021. yAxis: [
  1022. {
  1023. type: 'value',
  1024. axisLine: {//y轴
  1025. show: false
  1026. },
  1027. axisTick: {
  1028. show: false
  1029. },
  1030. axisLabel: {//y轴刻度
  1031. textStyle: {
  1032. color: '#E9EBEF'
  1033. }
  1034. },
  1035. splitLine:{//分割线
  1036. lineStyle:{
  1037. color:'#344876'
  1038. }
  1039. }
  1040. }
  1041. ],
  1042. title:[{
  1043. text: dataX.length>0?'分数':'',
  1044. top: 15,
  1045. left: 10,
  1046. textStyle: {
  1047. fontSize: 14,
  1048. color:'#E9EBEF',
  1049. fontWeight: 400
  1050. }
  1051. }],
  1052. series: [
  1053. {
  1054. name: '质控平均分',
  1055. type: 'bar',
  1056. barWidth: '23%',
  1057. data: dataY
  1058. }
  1059. ]
  1060. };
  1061. myCharts.setOption(option);
  1062. }
  1063. //柱状图住院日期
  1064. function barChartLevel(dataX,dataY){
  1065. // console.log(dataX,dataY,7887878787)
  1066. if(dataX.length==0&&dataY.length==0){
  1067. $("#barChart,.innerOuter").css("display","none")
  1068. picEmptyData('.barChartPayEmpty')
  1069. return
  1070. }else{
  1071. $("#barChart").css("display","block")
  1072. $(".barChartPayEmpty").css("display","none")
  1073. }
  1074. var myCharts = echarts.init(document.getElementById('barChart'));
  1075. $(window).resize(function(){
  1076. myCharts.resize()
  1077. });
  1078. option = {
  1079. color: ['#37C4FC'],
  1080. tooltip: {
  1081. trigger: 'axis',
  1082. position: 'right',
  1083. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  1084. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  1085. },
  1086. formatter: function(param) {
  1087. return `<div style="color:#fff;">${param[0].name}<br>
  1088. <i style="background:#00A1FF;margin-right:5px;display:inline-block;width:8px;height:8px;border-radius:50%"></i>${level}级病历占比:${param[0]&&param[0].value}%<br>
  1089. </div>`
  1090. }
  1091. },
  1092. grid: {
  1093. left: '3%',
  1094. right: '4%',
  1095. bottom: '3%',
  1096. containLabel: true
  1097. },
  1098. xAxis: [
  1099. {
  1100. type: 'category',
  1101. data: dataX,
  1102. axisTick: {
  1103. alignWithLabel: true
  1104. },
  1105. axisLabel: {//x轴刻度
  1106. textStyle: {
  1107. color: '#E9EBEF'
  1108. },
  1109. rotate:45,
  1110. formatter: function (value) {
  1111. //x轴的文字改为竖版显示
  1112. if(value.length>7){
  1113. return value.slice(0,7)+'...'
  1114. }
  1115. return value;
  1116. }
  1117. },
  1118. axisLine: {//x轴
  1119. lineStyle:{
  1120. color:'#4A5D8E'
  1121. }
  1122. }
  1123. }
  1124. ],
  1125. yAxis: [
  1126. {
  1127. type: 'value',
  1128. axisLine: {//y轴
  1129. show: false
  1130. },
  1131. axisTick: {
  1132. show: false
  1133. },
  1134. axisLabel: {//y轴刻度
  1135. textStyle: {
  1136. color: '#E9EBEF'
  1137. },
  1138. interval: 'auto',
  1139. formatter: '{value} %'
  1140. },
  1141. splitLine:{//分割线
  1142. lineStyle:{
  1143. color:'#344876'
  1144. }
  1145. }
  1146. }
  1147. ],
  1148. title:[{
  1149. text: dataX.length>0?'百分比':'',
  1150. top: 15,
  1151. left: 10,
  1152. textStyle: {
  1153. fontSize: 14,
  1154. color:'#E9EBEF',
  1155. fontWeight: 400
  1156. }
  1157. }],
  1158. series: [
  1159. {
  1160. name: level+'级病历占比',
  1161. type: 'bar',
  1162. barWidth: '23%',
  1163. data: dataY
  1164. }
  1165. ]
  1166. };
  1167. myCharts.setOption(option);
  1168. }
  1169. function barChart(data,type){
  1170. // console.log(data,type,78787888787787)
  1171. if(data.length==0){
  1172. $(".toggleSlide,#barChart").css("display","none")
  1173. picEmptyData('.barChartPayEmpty')
  1174. return
  1175. }else{
  1176. $(".toggleSlide,#barChart").css("display","block")
  1177. $(".barChartPayEmpty").css("display","none")
  1178. }
  1179. var myChart = echarts.init(document.getElementById('barChart'));
  1180. $(window).resize(function(){
  1181. myChart.resize()
  1182. });
  1183. var posList = [
  1184. 'left', 'right', 'top', 'bottom',
  1185. 'inside',
  1186. 'insideTop', 'insideLeft', 'insideRight', 'insideBottom',
  1187. 'insideTopLeft', 'insideTopRight', 'insideBottomLeft', 'insideBottomRight'
  1188. ];
  1189. let app = {}
  1190. app.configParameters = {
  1191. rotate: {
  1192. min: -90,
  1193. max: 90
  1194. },
  1195. align: {
  1196. options: {
  1197. left: 'left',
  1198. center: 'center',
  1199. right: 'right'
  1200. }
  1201. },
  1202. verticalAlign: {
  1203. options: {
  1204. top: 'top',
  1205. middle: 'middle',
  1206. bottom: 'bottom'
  1207. }
  1208. },
  1209. position: {
  1210. options: echarts.util.reduce(posList, function (map, pos) {
  1211. map[pos] = pos;
  1212. return map;
  1213. }, {})
  1214. },
  1215. distance: {
  1216. min: 0,
  1217. max: 100
  1218. }
  1219. };
  1220. app.config = {
  1221. rotate: 90,
  1222. align: 'left',
  1223. verticalAlign: 'middle',
  1224. position: 'insideBottom',
  1225. distance: 15,
  1226. onChange: function () {
  1227. var labelOption = {
  1228. normal: {
  1229. rotate: app.config.rotate,
  1230. align: app.config.align,
  1231. verticalAlign: app.config.verticalAlign,
  1232. position: app.config.position,
  1233. distance: app.config.distance
  1234. }
  1235. };
  1236. myChart.setOption({
  1237. series: [{
  1238. label: labelOption
  1239. }, {
  1240. label: labelOption
  1241. }, {
  1242. label: labelOption
  1243. }, {
  1244. label: labelOption
  1245. }]
  1246. });
  1247. }
  1248. };
  1249. var labelOption = {
  1250. show: false,
  1251. position: app.config.position,
  1252. distance: app.config.distance,
  1253. align: app.config.align,
  1254. verticalAlign: app.config.verticalAlign,
  1255. rotate: app.config.rotate,
  1256. formatter: '{c} {name|{a}}',
  1257. fontSize: 12,
  1258. rich: {
  1259. name: {
  1260. textBorderColor: '#fff'
  1261. }
  1262. }
  1263. };
  1264. let dataX = []
  1265. let data1 = []
  1266. let data2 = []
  1267. let data3 = []
  1268. for(let i = 0;i < data.length;i++){
  1269. dataX.push(data[i].name)
  1270. data1.push(data[i].averageValue)//本月
  1271. data2.push(data[i].lastAverageValue)//本年
  1272. data3.push(data[i].lastYearAverageValue)//去年本月
  1273. }
  1274. option = {
  1275. color: ['#37CBCB','#5A8EEE', '#FAD336' ],
  1276. tooltip: {
  1277. trigger: 'axis',
  1278. axisPointer: {
  1279. type: 'shadow'
  1280. }
  1281. },
  1282. grid: {
  1283. left: '3%',
  1284. right: '4%',
  1285. bottom: '3%',
  1286. containLabel: true
  1287. },
  1288. title:[{
  1289. text: dataX.length>0?(slideType==1?'天数':'元'):'',
  1290. top: 15,
  1291. left: 10,
  1292. textStyle: {
  1293. fontSize: 14,
  1294. color:'#E9EBEF',
  1295. fontWeight: 400
  1296. }
  1297. }],
  1298. legend: {
  1299. itemWidth :10,
  1300. itemHeight :10,
  1301. right:15,
  1302. top:15,
  1303. selectedMode:false,
  1304. textStyle:{
  1305. color:'#E9EBEF'
  1306. },
  1307. formatter: function (name) {
  1308. return name;
  1309. }
  1310. },
  1311. toolbox: {
  1312. show: false,
  1313. orient: 'vertical',
  1314. left: 'right',
  1315. top: 'center',
  1316. feature: {
  1317. mark: {show: true},
  1318. dataView: {show: true, readOnly: false},
  1319. magicType: {show: true, type: ['line', 'bar', 'stack', 'tiled']},
  1320. restore: {show: true},
  1321. saveAsImage: {show: true}
  1322. }
  1323. },
  1324. xAxis: [
  1325. {
  1326. type: 'category',
  1327. axisTick: {show: false},
  1328. data: dataX,
  1329. axisLabel: {//x轴刻度
  1330. textStyle: {
  1331. color: '#E9EBEF'
  1332. },
  1333. rotate:'45',
  1334. formatter: function (value) {
  1335. //x轴的文字改为竖版显示
  1336. if(value.length>7){
  1337. return value.slice(0,7)+'...'
  1338. }
  1339. return value;
  1340. }
  1341. },
  1342. axisLine: {//x轴
  1343. lineStyle:{
  1344. color:'#4A5D8E'
  1345. }
  1346. },
  1347. }
  1348. ],
  1349. yAxis: [
  1350. {
  1351. type: 'value',
  1352. axisLine: {//y轴
  1353. show: false
  1354. },
  1355. axisTick: {
  1356. show: false
  1357. },
  1358. axisLabel: {//y轴刻度
  1359. textStyle: {
  1360. color: '#E9EBEF'
  1361. }
  1362. },
  1363. splitLine:{//分割线
  1364. lineStyle:{
  1365. color:'#344876'
  1366. }
  1367. }
  1368. }
  1369. ],
  1370. series: [
  1371. {
  1372. name: type==1?'上月':'',
  1373. type: 'bar',
  1374. barGap: 0,
  1375. label: labelOption,
  1376. barWidth: '15%',
  1377. data: type==1?data2:[]
  1378. },
  1379. {
  1380. name: type==1?'去年本月':'去年',
  1381. type: 'bar',
  1382. label: labelOption,
  1383. barWidth: '15%',
  1384. data: data3
  1385. },
  1386. {
  1387. name: type==1?'本月':'本年',
  1388. type: 'bar',
  1389. label: labelOption,
  1390. barWidth: '15%',
  1391. data: data1
  1392. }
  1393. ]
  1394. };
  1395. myChart.setOption(option);
  1396. }
  1397. //空心饼图
  1398. function emptyCircle(data){
  1399. // console.log(data,1111111111)
  1400. var myChart = echarts.init(document.getElementById('emptyCircle'));
  1401. $(window).resize(function(){
  1402. myChart.resize()
  1403. });
  1404. if(data.length == 0){
  1405. $(".emptyCircleWrap").css("'display","none !important")
  1406. picEmptyData("#emptyCircleWrapEmpty")
  1407. }else{
  1408. $(".emptyCircleWrap").css("'display","block")
  1409. $(".console #emptyCircleWrapEmpty").html('')
  1410. }
  1411. let bgColor = '#203463';
  1412. let title = '总量';
  1413. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  1414. let echartData = data;
  1415. let total = echartData.length>0?echartData[0].totleNum:0;
  1416. option = {
  1417. /*backgroundColor: bgColor,*/
  1418. color: color,
  1419. title: [{
  1420. text: data.length>0?'{val|' + total + '}\n{name|' + title + '}':'',
  1421. top: 'center',
  1422. left: 'center',
  1423. textStyle: {
  1424. rich: {
  1425. val: {
  1426. fontSize: 24,
  1427. color: '#E9EBEF',
  1428. fontWeight: 'bold',
  1429. padding: [10, 0]
  1430. },
  1431. name: {
  1432. fontSize: 12,
  1433. fontWeight: 'normal',
  1434. color: '#E9EBEF',
  1435. }
  1436. }
  1437. }
  1438. }],
  1439. tooltip: {
  1440. trigger: 'item',
  1441. // formatter: '{b} : {c} ({d}%)',
  1442. formatter:function(item){
  1443. const {name, num, percentStr} = item.data
  1444. return `${name} : ${num} (${percentStr})`
  1445. }
  1446. },
  1447. series: [{
  1448. name: '',
  1449. type: 'pie',
  1450. radius: ['70%', '90%'],
  1451. data: echartData,
  1452. hoverAnimation:true,
  1453. hoverOffset:5,
  1454. itemStyle: {
  1455. normal: {
  1456. borderColor: bgColor,
  1457. borderWidth: 2
  1458. }
  1459. },
  1460. labelLine: {
  1461. normal: {
  1462. length: 20,
  1463. length2: 120,
  1464. lineStyle: {
  1465. color: '#e6e6e6'
  1466. }
  1467. }
  1468. },
  1469. label: {
  1470. normal: {
  1471. show:false,
  1472. formatter: params => {
  1473. return params.name == 'A类'?params.name:''
  1474. },
  1475. padding: [0 , -100, 25, -100],
  1476. rich: {
  1477. icon: {
  1478. fontSize: 16
  1479. },
  1480. name: {
  1481. fontSize: 14,
  1482. padding: [0, 10, 0, 4],
  1483. color: '#666666'
  1484. },
  1485. value: {
  1486. fontSize: 18,
  1487. fontWeight: 'bold',
  1488. color: '#333333'
  1489. }
  1490. }
  1491. }
  1492. },
  1493. }]
  1494. };
  1495. myChart.setOption(option);
  1496. }
  1497. function emptyCircleB(data){
  1498. if(data.length == 0){
  1499. $(".emptyCircleBData,.emptyCircle").css("'display","none !important")
  1500. picEmptyData(".emptyCircleBWrap")
  1501. }else{
  1502. $(".emptyCircleBData").css("'display","block")
  1503. $(".emptyCircleBWrap").css("display","none")
  1504. }
  1505. var myChart = echarts.init(document.getElementById('emptyCircleB'));
  1506. $(window).resize(function(){
  1507. myChart.resize()
  1508. });
  1509. let bgColor = '#203463';
  1510. let title = '总量';
  1511. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  1512. let echartData = data;
  1513. let total = echartData.length>0?echartData[0].totleNum:0;
  1514. option = {
  1515. /*backgroundColor: bgColor,*/
  1516. color: color,
  1517. title: [{
  1518. text: data.length>0?'{val|' + total + '}\n{name|' + title + '}':'',
  1519. top: 'center',
  1520. left: 'center',
  1521. textStyle: {
  1522. rich: {
  1523. val: {
  1524. fontSize: 24,
  1525. color: '#E9EBEF',
  1526. fontWeight: 'bold',
  1527. padding: [10, 0]
  1528. },
  1529. name: {
  1530. fontSize: 12,
  1531. fontWeight: 'normal',
  1532. color: '#E9EBEF',
  1533. }
  1534. }
  1535. }
  1536. }],
  1537. tooltip: {
  1538. trigger: 'item',
  1539. position: 'right',
  1540. // formatter: '{b} : {c} ({d}%)',
  1541. formatter:function(item){
  1542. const {name, num, percentStr} = item.data
  1543. return `${name} : ${num} (${percentStr})`
  1544. }
  1545. },
  1546. series: [{
  1547. name: '',
  1548. type: 'pie',
  1549. radius: ['70%', '90%'],
  1550. data: echartData,
  1551. hoverAnimation:true,
  1552. hoverOffset:5,
  1553. itemStyle: {
  1554. normal: {
  1555. borderColor: bgColor,
  1556. borderWidth: 2
  1557. }
  1558. },
  1559. labelLine: {
  1560. normal: {
  1561. length: 20,
  1562. length2: 120,
  1563. lineStyle: {
  1564. color: '#e6e6e6'
  1565. }
  1566. }
  1567. },
  1568. label: {
  1569. normal: {
  1570. show:false,
  1571. formatter: params => {
  1572. return params.name == 'A类'?params.name:''
  1573. },
  1574. padding: [0 , -100, 25, -100],
  1575. rich: {
  1576. icon: {
  1577. fontSize: 16
  1578. },
  1579. name: {
  1580. fontSize: 14,
  1581. padding: [0, 10, 0, 4],
  1582. color: '#666666'
  1583. },
  1584. value: {
  1585. fontSize: 18,
  1586. fontWeight: 'bold',
  1587. color: '#333333'
  1588. }
  1589. }
  1590. }
  1591. },
  1592. }]
  1593. };
  1594. myChart.setOption(option);
  1595. }
  1596. //缺陷列表渲染
  1597. function queList(data){
  1598. let strAll = '',tmp = `mm
  1599. <tr class="thead">
  1600. <td class="td01">排名</td>
  1601. <td class="td02">缺陷详情</td>
  1602. <td class="td04">错误率</td>
  1603. </tr>`
  1604. if(data.length == 0){
  1605. $(".qtable").css("display","none")
  1606. picEmptyData(".qtableEmpty")
  1607. return
  1608. }else{
  1609. $(".qtableEmpty").css("display","none")
  1610. $(".qtable").css("display","table")
  1611. }
  1612. for(let i = 0;i < data.length;i++){
  1613. strAll += `
  1614. <tr>
  1615. <td style="text-align:center;"><i style="background:${i < 3?'#ECB22E':'#526186'};color:${i < 3?'#fff':'#B7BDCC'};">${i+1}</i></td>
  1616. <td class="homegodetail" data-name="${data[i].name}"><p class="td02name ellipsis">${data[i].name}</p></td>
  1617. <td>${data[i].percentStr}</td>
  1618. </tr>
  1619. `
  1620. }
  1621. $(".qtable").html(tmp+strAll)
  1622. $(".homegodetail").click(function(){
  1623. let name = $(this).attr("data-name")
  1624. focusMenuItem("YH-ZKK-TMQXZB_XQ");
  1625. $(parent.document).find("#contentIframe").attr("src","./singleVeto.html?from=1&special=1&shijian="+dateType+"&model="+name)
  1626. })
  1627. }
  1628. //饼图列表注释渲染
  1629. function panDetail(data){
  1630. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  1631. let strAll = '';
  1632. for(let i = 0;i < data.length;i++){
  1633. strAll += `
  1634. <tr class="explainLi" data-dept="${data[i].name}" dept-id="${data[i].id}">
  1635. <td class="deptName" title="${data[i].name}">
  1636. <p class="smp"><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
  1637. </td>
  1638. <td class="deptNum">${data[i].num}</td>
  1639. <td class="percent">(${data[i].percentStr})</td>
  1640. </tr>
  1641. `
  1642. }
  1643. $(".explainPanT table").html(strAll);
  1644. $(".explainPanT .explainLi").click(function(){
  1645. let deptName = $(this).attr("data-dept")
  1646. let deptId = $(this).attr("dept-id")
  1647. focusMenuItem("YH-ZKK-TMQXZB_XQ");
  1648. $(parent.document).find("#contentIframe").attr("src","singleVeto.html?from=1&shijian="+dateType+"&qxName="+deptName)
  1649. })
  1650. }
  1651. function panDetailB(data){
  1652. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  1653. let strAll = '';
  1654. for(let i = 0;i < data.length;i++){
  1655. strAll += `
  1656. <tr class="explainLi">
  1657. <td class="deptName" title="${data[i].name}">
  1658. <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
  1659. </td>
  1660. <td class="deptNum">${data[i].num}</td>
  1661. <td class="percent">(${data[i].percentStr})</td>
  1662. </tr>
  1663. `
  1664. }
  1665. $(".explainPanB table").html(strAll);
  1666. $(".explainPan").css({
  1667. marginTop:-($(".explainPan").height()/2-20)+'px'
  1668. })
  1669. }
  1670. //时间获取
  1671. function getTimeDetail(){
  1672. const d = new Date();
  1673. const days = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
  1674. let sec = d.getSeconds()
  1675. let min = d.getMinutes()
  1676. let hour = d.getHours()
  1677. 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}`
  1678. $(".dateDetail").html(str)
  1679. }
  1680. $(".sureDate").click(function(){
  1681. getStaticDate()
  1682. getAverageScoreLis()
  1683. getBarData(dateType)
  1684. getEveryDeptLevel()
  1685. })
  1686. //日期联动
  1687. function dateConsole(dateType){
  1688. let startDate = "", endDate=new Date()
  1689. let year = new Date().getFullYear()
  1690. let month = new Date().getMonth() + 1
  1691. if(dateType == '1'){
  1692. startDate = new Date(`${year}-${month}-01`)
  1693. }else if(dateType == '2'){
  1694. startDate = new Date(`${year}-01-01`)
  1695. } else {
  1696. startDate = "-1m"
  1697. }
  1698. $( "#datepicker" ).datepicker({
  1699. yearRange: "2015:"+year,
  1700. changeMonth: true,
  1701. changeYear: true,
  1702. dateFormat:"yy/mm/dd",
  1703. }).datepicker( "setDate", startDate);
  1704. $( "#datepicker2" ).datepicker({
  1705. yearRange: "2015:"+year,
  1706. changeMonth: true,
  1707. changeYear: true,
  1708. dateFormat:"yy/mm/dd"
  1709. }).datepicker( "setDate",endDate);
  1710. getStaticDate()
  1711. getAverageScoreLis()
  1712. getBarData(dateType)
  1713. getEveryDeptLevel()
  1714. }
  1715. function getStaticDate(){
  1716. behosDateStart = $("#datepicker").val().trim()
  1717. behosDateEnd = $("#datepicker2").val().trim()
  1718. const start = new Date(behosDateStart).getTime()
  1719. const end = new Date(behosDateEnd).getTime()
  1720. if(start > end){
  1721. $.alerModal({"message":'开始时间不能大于结束时间~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  1722. return
  1723. }
  1724. if(behosDateStart){
  1725. behosDateStart = behosDateStart.replace(/\//g,'-') + ' 00:00:00'
  1726. }
  1727. if(behosDateEnd){
  1728. behosDateEnd = behosDateEnd.replace(/\//g,'-') + ' 23:59:59'
  1729. }
  1730. }
  1731. $(function() {
  1732. const iconCalenBlue= require("./../images/darkDate.png")
  1733. const iconCalenGrey= require("./../images/icon_calen_grey.png")
  1734. $.datepicker.regional['zh-CN'] = {
  1735. clearText: '清除',
  1736. clearStatus: '清除已选e799bee5baa6e59b9ee7ad9431333361303131日期',
  1737. closeText: '关闭',
  1738. closeStatus: '不改变当前选择',
  1739. prevText: '<上月',
  1740. prevStatus: '显示上月',
  1741. prevBigText: '<<',
  1742. prevBigStatus: '显示上一年',
  1743. nextText: '下月>',
  1744. nextStatus: '显示下月',
  1745. nextBigText: '>>',
  1746. nextBigStatus: '显示下一年',
  1747. currentText: '今天',
  1748. currentStatus: '显示本月',
  1749. monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
  1750. monthNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
  1751. yearNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
  1752. monthStatus: '选择月份',
  1753. yearStatus: '选择年份',
  1754. weekHeader: '周',
  1755. weekStatus: '年内周次',
  1756. dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
  1757. dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
  1758. dayNamesMin: ['日','一','二','三','四','五','六'],
  1759. dayStatus: '设置 DD 为一周起始',
  1760. dateStatus: '选择 m月 d日, DD',
  1761. dateFormat: 'yy-mm-dd',
  1762. firstDay: 1,
  1763. initStatus: '请选择日期',
  1764. isRTL: false};
  1765. $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
  1766. dateConsole(dateType)
  1767. // $(".filter").click(); //初始查询
  1768. $('.iconCalen').on("mouseenter", function(e){
  1769. $(this).attr("src", iconCalenBlue)
  1770. })
  1771. $('.iconCalen').on("mouseleave", function(e){
  1772. $(this).attr("src", iconCalenGrey)
  1773. })
  1774. $('.iconCalen').on("click", function(e){
  1775. $(this).parent().find("input").focus()
  1776. })
  1777. });