console.js 60 KB

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