console.js 61 KB

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