console.js 58 KB

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