console.js 59 KB

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