console.js 60 KB

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