console.js 70 KB

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