console.js 61 KB

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