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