deptConsole.js 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154
  1. const $ = require('jquery');
  2. require("../css/reset.less")
  3. require("../css/deptConsole.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, initScroll, listenScroll } = require('../js/utils.js');
  13. let payMoney = [], behosDateStart = "", behosDateEnd = "", ownSelectDate = '', dayLis = [], dateType = 2, curDept = '', curDeptId = '', datafst = [], datasec = [], datatrd = [], datafour = [], dataFif = [], dataSix = [], hospital = getCookie("hospital");
  14. let isPlacefile = getCookie('isPlacefile') || 1
  15. $(function () {
  16. listenScroll(".deptConsole")
  17. if (!hasData('YH-KZT') && !hasData('YH-KZTKS')) {
  18. $("body").html('')
  19. }
  20. initConsole()//质控列表
  21. getOwnDept()
  22. dateChange()
  23. $(window).click(function () {
  24. window.parent.userActionHide()
  25. $(".toggleSlide ul").css("display", "none")
  26. })
  27. $(".toggleSlide p").click(function (e) {
  28. e.stopPropagation()
  29. $(this).next().slideToggle()
  30. })
  31. $(".part02").on("mouseenter", ".bingli li.sec", function () {
  32. $(this).find(".explainNum").css("color", "#00A1FF")
  33. })
  34. $(".part02").on("mouseleave", ".bingli li.sec", function () {
  35. $(this).find(".explainNum").css("color", "#A5ADBF")
  36. })
  37. if (isPlacefile == 0) {
  38. $(".circleBLis .circleB .title24").html('入院记录24h未完成').append(`<img class="detailGo" src="${require("../images/details.png")}" alt="">`)
  39. } else {
  40. $(".circleBLis .circleB .title24").html('病案首页合格率占比').append(`<img class="detailGo" src="${require("../images/details.png")}" alt="">`)
  41. }
  42. })
  43. function tiaomu(dateType) {
  44. $(".defect .partTitlePub").click(function () {
  45. focusMenuItem("YH-KSZR-GMKQXZB_XQ");
  46. $(parent.document).find("#contentIframe").attr("src", "mukuai.html?from=2&deptName=" + curDept + "&dateType=" + dateType + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
  47. });
  48. $(".homePageNo .title").click(function () {
  49. focusMenuItem("YH-KSZR-TMQXZB_XQ");
  50. $(parent.document).find("#contentIframe").attr("src", "singleVeto.html?from=2&deptName=" + curDept + "&shijian=" + dateType + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
  51. });
  52. $(".homePage .title").click(function () {
  53. if (isPlacefile == 0) {
  54. focusMenuItem("YH-KSZR-SXXXGTJ_XQ")
  55. $(parent.document).find("#contentIframe").attr("src", "uncorrectedCasesStatisticsDept.html?from=2&deptName=" + curDept + "&dateType=" + dateType + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
  56. } else {
  57. focusMenuItem("YH-KSZR-BASYHGLZB_XQ")
  58. $(parent.document).find("#contentIframe").attr("src", "partDetailControlDept.html?from=2&deptName=" + curDept + "&deptId=" + curDeptId + "&dateType=" + dateType + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
  59. }
  60. });
  61. $(".part02 .bingliLis").click(function () {
  62. focusMenuItem("YH-KSZR-KSQXZB_XQ");
  63. $(parent.document).find("#contentIframe").attr("src", "deptScoreDetailControlDept.html?from=2&deptName=" + curDept + "&dateType=" + dateType + "&curDeptId=" + curDeptId + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
  64. });
  65. $(".part01 .partTitlePub").click(function () {
  66. const txt = $(this).find(".name").text()
  67. if (txt == "入院人数统计") {
  68. focusMenuItem("YH-KSZR-RYRSTJ_XQ");
  69. $(parent.document).find("#contentIframe").attr("src", "qcListOutHospitalDept.html?from=2&deptName=" + curDept + "&dateType=" + dateType + "&curDeptId=" + curDeptId + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
  70. }
  71. });
  72. $(".part01").on('click', '.chuyuan .lis', function () {
  73. $(".container", parent.document).removeClass("console-cont")
  74. let txt = $(this).find(".explainNum").text(), type = "";
  75. if (txt == "死亡人数") {
  76. type = 1
  77. } else {
  78. type = 3
  79. }
  80. focusMenuItem("YH-KSZR-RYRSTJ_XQ");
  81. $(parent.document).find("#contentIframe").attr("src", "qcListOutHospitalDept.html?from=2&deptName=" + curDept + "&dateType=" + dateType + "&curDeptId=" + curDeptId + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd + '&outNum=' + txt + '&outNumType=' + type)
  82. });
  83. $(".part02").on("click", ".bingli li.sec", function () {
  84. focusMenuItem("YH-BLZK-ZKPFKS");
  85. let dataC = $(this).attr("data-c")
  86. let chengdu = dataC == 1 ? '甲' : dataC == 2 ? '乙' : '丙'
  87. $(parent.document).find("#contentIframe").attr("src", "./qcListDept.html?from=1&dateType=" + dateType + "&chengdu=" + chengdu + "&deptName=" + curDept + "&deptId=" + curDeptId + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd)
  88. });
  89. $("body").on("click", ".homegodetail", function () {
  90. let name = $(this).attr("data-name")
  91. focusMenuItem("YH-KSZR-TMQXZB_XQ");
  92. $(parent.document).find("#contentIframe").attr("src", "./singleVeto.html?from=2&special=1&shijian=" + dateType + "&model=" + name + "&startDateParam=" + behosDateStart + "&endDateParam=" + behosDateEnd + "&deptName=" + curDept)
  93. })
  94. }
  95. //判断有无某一权限
  96. function hasData(data) {
  97. let lis = JSON.parse(getCookie("codeLis")) || []
  98. if (lis.indexOf(data) > -1) {//有权限
  99. return true
  100. }
  101. return false;
  102. }
  103. function resizeBox() {
  104. $(".partWrap").css({
  105. height: $(window).height() - 38 + 'px'
  106. })
  107. }
  108. //所有数据切换日期筛选
  109. function dateChange() {
  110. $(".monthYear .mon").click(function () {
  111. $(this).css({
  112. backgroundColor: '#00A1FF',
  113. color: '#E9EBEF',
  114. "border-color": '#00A1FF'
  115. }).siblings().css({
  116. "border-color": '#A5ADBF',
  117. color: '#A5ADBF',
  118. backgroundColor: '#203463'
  119. })
  120. dateType = 1
  121. ownSelectDate = ''
  122. dateConsole(1, 1)
  123. })
  124. $(".monthYear .year").click(function () {
  125. $(this).css({
  126. backgroundColor: '#00A1FF',
  127. color: '#E9EBEF',
  128. "border-color": '#00A1FF'
  129. }).siblings().css({
  130. "border-color": '#A5ADBF',
  131. color: '#A5ADBF',
  132. backgroundColor: '#203463'
  133. })
  134. dateType = 2
  135. ownSelectDate = ''
  136. dateConsole(2, 1)
  137. })
  138. }
  139. //控制台数
  140. function initConsole(result) {
  141. let url = {
  142. '本月病历数': require("../images/icon6.png"),
  143. '本月不合格病历-机器': require("../images/icon7.png"),
  144. '本月质控数-机器': require("../images/icon10.png"),
  145. '本月甲级病历-机器': require("../images/icon8.png"),
  146. '本月乙级病历-机器': require("../images/icon9.png"),
  147. '本年病历数': require("../images/icon6.png"),
  148. '本年不合格病历-机器': require("../images/icon7.png"),
  149. '本年质控数-机器': require("../images/icon10.png"),
  150. '本年甲级病历-机器': require("../images/icon8.png"),
  151. '本年乙级病历-机器': require("../images/icon9.png"),
  152. }
  153. let dom = '';
  154. for (let i in result) {
  155. if (i.indexOf("人工") == -1) {
  156. let name = i.split("-")[0];
  157. let num = 0;
  158. if (name == '本月病历数' || name == '本年病历数') {
  159. num = result[i]
  160. } else {
  161. num = result[name + '-人工'] + result[i]
  162. }
  163. dom += `
  164. <li class="partLi">
  165. <div class="partIn">
  166. <p class="top">${name}</p>
  167. <p class="btm clearfix">
  168. <img src="${url[i]}" alt="">
  169. <span>${num}</span>
  170. </p>
  171. </div>
  172. </li>
  173. `
  174. }
  175. }
  176. $(".partAll").html(dom)
  177. }
  178. //获取科室列表
  179. function getOwnDept() {
  180. // if(hasData('FUNC000058')){
  181. post(api.getDept, {}).then((res) => {
  182. let data = res.data;
  183. if (data.code == 0) {
  184. let result = data.data
  185. renderDeptLis(result)//科室tab渲染
  186. curDept = result[0].deptName
  187. curDeptId = result[0].deptId
  188. $(".partTitle p i,.toggleSlide p span").html(curDept).attr({ "title": curDept, 'data-dept': curDept, 'dept-id': curDeptId })
  189. $(".partTitle .hosdept").html(hospital + curDept)
  190. getBarData(2)//图标数据获取
  191. } else {
  192. $(".partTitle p i,.toggleSlide p span").html('--')
  193. }
  194. }).catch(() => {
  195. $(".partTitle p i,.toggleSlide p span").html('--')
  196. })
  197. // }
  198. }
  199. function renderDeptLis(data) {
  200. let str = ''
  201. for (let i = 0; i < data.length; i++) {
  202. str += `
  203. <li title="${data[i].deptName}" dept-id="${data[i].deptId}" class="${i == 0 ? 'li0 toggleAverge toggleSlide1' : 'toggleAverge toggleSlide1'}" data-dept="${data[i].deptName}">${data[i].deptName}</li>
  204. `
  205. }
  206. $(".toggleSlide ul").html(str)
  207. $(".toggleSlide ul li").click(function () {
  208. let name = $(this).attr("data-dept")
  209. let did = $(this).attr("dept-id")
  210. curDept = name
  211. curDeptId = did
  212. $(this).parent().slideToggle().prev().find("span").html(name).attr({ "title": name, 'data-dept': curDept, 'dept-id': curDeptId })
  213. $(".partTitle p i").html(hospital + name).attr({ "title": name, 'data-dept': curDept, 'dept-id': curDeptId })
  214. $(".partTitle .hosdept").html(hospital + name)
  215. if (isPlacefile == 0) {
  216. enterHospital(dataFif[name] || [])
  217. } else {
  218. personNum(datafst[name] || [])
  219. }
  220. setNumDetail(datasec[name] || [])
  221. queList(datatrd[name] || [])
  222. getHomePageLevelStatisticsByDept()
  223. for (let i = 0; i < datafour[name].length; i++) {
  224. datafour[name][i].value = datafour[name][i].num
  225. }
  226. emptyCircleBc(datafour[name])
  227. panDetailBc(datafour[name])
  228. // if (hospital == "台州市立") {
  229. // emptyCircleB(datafour[name])
  230. // panDetailB(datafour[name])
  231. // } else {
  232. // emptyCircleBc(datafour[name])
  233. // panDetailBc(datafour[name])
  234. // }
  235. $(this).addClass("li0").siblings().removeClass("li0")
  236. })
  237. }
  238. //获取图表数据
  239. function getBarData(type) {
  240. if (hasData('FUNC000054') && isPlacefile == 1) {
  241. $(".part01 .name").html('出院人数统计')
  242. post(api.leaveHosCountByDept, {//出院人数统计
  243. "type": type || 1,//1月2年
  244. "startDate": behosDateStart,
  245. "endDate": behosDateEnd
  246. }).then((res) => {
  247. let data = res.data;
  248. if (data.code == 0) {
  249. let result = data.data[curDept] || []
  250. datafst = data.data
  251. personNum(result)
  252. }
  253. })
  254. }
  255. if (isPlacefile == 0) {//运行入院人数
  256. $(".part01 .name").html('入院人数统计').append(`<img class="detailGo" src="${require("../images/details.png")}" alt="">`)
  257. post(api.beHosCountByDept, {
  258. "type": type || 1,//1月2年
  259. "startDate": behosDateStart,
  260. "deptName": curDept,
  261. "deptClass": curDeptId,
  262. "endDate": behosDateEnd
  263. }).then((res) => {
  264. let data = res.data;
  265. if (data.code == 0) {
  266. let result = data.data[curDept] || []
  267. dataFif = data.data
  268. enterHospital(result)
  269. }
  270. })
  271. }
  272. if (hasData('FUNC000055')) {
  273. post(api.mrCountByDept, {//质控病历统计
  274. "type": type || 1,//1月2年
  275. "startDate": behosDateStart,
  276. "endDate": behosDateEnd
  277. }).then((res) => {
  278. let data = res.data
  279. if (data.code == 0) {
  280. let result3 = data.data[curDept] || []
  281. datasec = data.data
  282. setNumDetail(result3)
  283. }
  284. })
  285. }
  286. if (hasData('FUNC000056')) {
  287. post(api.entryCountGroupByCaseAndDept, {//各模块缺陷占比排行
  288. "type": type || 1,//1月2年
  289. "startDate": behosDateStart,
  290. "endDate": behosDateEnd
  291. }).then((res) => {
  292. let data = res.data;
  293. if (data.code == 0) {
  294. let result1 = data.data[curDept] || []
  295. datatrd = data.data
  296. queList(result1)
  297. }
  298. })
  299. }
  300. if (hasData('FUNC000057')) {
  301. post(api.entryCountGroupByEntryAndDept, {//条目缺陷占比
  302. "type": type || 1,//1月2年
  303. "startDate": behosDateStart,
  304. "endDate": behosDateEnd
  305. }).then((res) => {
  306. let data = res.data;
  307. if (data.code == 0) {
  308. let result3 = data.data[curDept] || []
  309. for (let i = 0; i < result3.length; i++) {
  310. result3[i].value = result3[i].num
  311. }
  312. datafour = data.data
  313. emptyCircleBc(result3)
  314. panDetailBc(result3)
  315. }
  316. })
  317. // if(hospital=="台州市立"){
  318. // post(api.entryCountGroupByEntryAndDept,{//条目缺陷占比
  319. // "type": type||1,//1月2年
  320. // "startDate":behosDateStart,
  321. // "endDate":behosDateEnd
  322. // }).then((res)=>{
  323. // let data = res.data;
  324. // if(data.code == 0){
  325. // let result3 = data.data[curDept]||[]
  326. // for(let i = 0;i < result3.length;i++){
  327. // result3[i].value = result3[i].num
  328. // }
  329. // datafour = data.data
  330. // emptyCircleB(result3)
  331. // panDetailB(result3)
  332. // }
  333. // })
  334. // }else{
  335. // post(api.entryCountGroupByEntryAndDept,{//条目缺陷占比
  336. // "type": type||1,//1月2年
  337. // "startDate":behosDateStart,
  338. // "endDate":behosDateEnd
  339. // }).then((res)=>{
  340. // let data = res.data;
  341. // if(data.code == 0){
  342. // let result3 = data.data[curDept]||[]
  343. // for(let i = 0;i < result3.length;i++){
  344. // result3[i].value = result3[i].num
  345. // }
  346. // datafour = data.data
  347. // emptyCircleBc(result3)
  348. // panDetailBc(result3)
  349. // }
  350. // })
  351. // }
  352. }
  353. getHomePageLevelStatisticsByDept(type)
  354. }
  355. function getHomePageLevelStatisticsByDept(type) {
  356. // if(hospital=="长兴医院"&&hasData("FUNC000076")){
  357. post(isPlacefile == 0 ? api.casesEntryStatisticsByDept : api.homePageLevelStatisticsByDept, {//病案首页
  358. "type": dateType || 2,//1月2年
  359. "deptName": curDept,
  360. "deptClass": curDeptId,
  361. "startDate": behosDateStart,
  362. "endDate": behosDateEnd
  363. }).then((res) => {
  364. let data = res.data;
  365. if (data.code == 0) {
  366. let result1 = isPlacefile == 0 ? data.data[curDept] || [] : data.data || []
  367. dataSix = data.data
  368. lineChartSpecial(result1)
  369. }
  370. })
  371. // }
  372. }
  373. function lineChartSpecial(result1) {
  374. let dataX = [], dataY = []
  375. for (let i = 0; i < result1.length; i++) {
  376. dataX.push(result1[i].doctorName)
  377. dataY.push(isPlacefile == 0 ? result1[i].num : result1[i].firstLevelPercentStr.replace('%', ''))
  378. }
  379. if (dataX.length == 0 && dataY.length == 0) {
  380. $(".emptyLineCircle").css("display", "none")
  381. picEmptyData('.emptyLineCircleEmpty')
  382. return
  383. } else {
  384. $(".emptyLineCircle").css("display", "block")
  385. $(".emptyLineCircleEmpty").css("display", "none")
  386. }
  387. var myCharts = echarts.init(document.getElementById('lineChart'));
  388. $(window).resize(function () {
  389. myCharts.resize()
  390. });
  391. option = {
  392. color: ['#37C4FC'],
  393. tooltip: {
  394. trigger: 'axis',
  395. position: 'right',
  396. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  397. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  398. },
  399. formatter: function (param) {
  400. 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>${isPlacefile == 0 ? '入院记录24h未完成' : '病案首页合格率'}:` + param[0].value + (isPlacefile == 0 ? "" : "%") + "<br>"
  401. '</div>'
  402. }
  403. },
  404. grid: {
  405. left: '3%',
  406. right: '4%',
  407. bottom: '3%',
  408. containLabel: true
  409. },
  410. xAxis: [
  411. {
  412. type: 'category',
  413. data: dataX,
  414. axisTick: {
  415. alignWithLabel: true
  416. },
  417. axisLabel: {//x轴刻度
  418. textStyle: {
  419. color: '#E9EBEF'
  420. },
  421. rotate: 45,
  422. formatter: function (value) {
  423. //x轴的文字改为竖版显示
  424. if (value.length > 7) {
  425. return value.slice(0, 7) + '...'
  426. }
  427. return value;
  428. }
  429. },
  430. axisLine: {//x轴
  431. lineStyle: {
  432. color: '#4A5D8E'
  433. }
  434. }
  435. }
  436. ],
  437. yAxis: [
  438. {
  439. type: 'value',
  440. axisLine: {//y轴
  441. show: false
  442. },
  443. axisTick: {
  444. show: false
  445. },
  446. axisLabel: {//y轴刻度
  447. textStyle: {
  448. color: '#E9EBEF'
  449. }
  450. },
  451. splitLine: {//分割线
  452. lineStyle: {
  453. color: '#344876'
  454. }
  455. }
  456. }
  457. ],
  458. title: [{
  459. text: isPlacefile == 0 ? '数量' : '合格率',
  460. top: 15,
  461. left: 10,
  462. textStyle: {
  463. fontSize: 14,
  464. color: '#fff',
  465. fontWeight: 400
  466. }
  467. }],
  468. series: [
  469. {
  470. name: isPlacefile == 0 ? '入院记录24h未完成' : '病案首页合格率',
  471. type: 'bar',
  472. barWidth: '23%',
  473. data: dataY
  474. }
  475. ]
  476. };
  477. myCharts.setOption(option);
  478. }
  479. //入院人数统计
  480. function enterHospital(result) {
  481. let dataX = [], dataY = []
  482. for (let i = 0; i < result.length; i++) {
  483. dataX.push(result[i].doctorName)
  484. dataY.push(result[i].num)
  485. }
  486. if (dataX.length == 0) {
  487. $(".chuyuan,.personNum").css("display", "none")
  488. picEmptyData(".chuyuanEmpty")
  489. return
  490. } else {
  491. $(".personNum").html("总人数:" + (dataY[0] || '--'))
  492. $(".chuyuanEmpty").css("display", "none")
  493. $(".chuyuan,.personNum").css("display", "block")
  494. }
  495. var myCharts = echarts.init(document.getElementById("chuyuan"));
  496. $(window).resize(function () {
  497. myCharts.resize()
  498. });
  499. option = {
  500. color: ['#37CBCB'],
  501. tooltip: {
  502. trigger: 'axis',
  503. position: 'right',
  504. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  505. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  506. },
  507. formatter: function (param) {
  508. 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>"
  509. '</div>'
  510. }
  511. },
  512. grid: {
  513. left: '3%',
  514. right: '4%',
  515. bottom: '3%',
  516. top: '25',
  517. containLabel: true
  518. },
  519. xAxis: [
  520. {
  521. type: 'category',
  522. data: dataX,
  523. axisTick: {
  524. alignWithLabel: true
  525. },
  526. axisLabel: {//x轴刻度
  527. textStyle: {
  528. color: '#E9EBEF'
  529. },
  530. rotate: 45,
  531. formatter: function (value) {//x轴的文字改为竖版显示
  532. if (value.length > 7) {
  533. return value.slice(0, 7) + '...'
  534. }
  535. return value;
  536. }
  537. },
  538. axisLine: {//x轴
  539. lineStyle: {
  540. color: '#4A5D8E'
  541. }
  542. }
  543. }
  544. ],
  545. yAxis: [
  546. {
  547. type: 'value',
  548. axisLine: {//y轴
  549. show: false
  550. },
  551. axisTick: {
  552. show: false
  553. },
  554. splitNumber: 3,
  555. axisLabel: {//y轴刻度
  556. textStyle: {
  557. color: '#E9EBEF'
  558. },
  559. formatter: function (value) {
  560. return value;
  561. }
  562. },
  563. splitLine: {//分割线
  564. lineStyle: {
  565. color: '#344876'
  566. }
  567. }
  568. }
  569. ],
  570. title: [{
  571. text: '数量',
  572. top: 0,
  573. left: 10,
  574. textStyle: {
  575. fontSize: 14,
  576. color: '#E9EBEF',
  577. fontWeight: 400
  578. }
  579. }],
  580. series: [
  581. {
  582. name: '病案首页合格率',
  583. type: 'bar',
  584. barWidth: '23%',
  585. data: dataY
  586. }
  587. ]
  588. };
  589. myCharts.setOption(option);
  590. }
  591. //part01
  592. function personNum(data) {
  593. let flg = JSON.stringify(data) !== '[]'
  594. if (data['总人数'] == 0) {
  595. $(".chuyuan,.personNum").css("display", "none")
  596. picEmptyData(".chuyuanEmpty")
  597. return
  598. } else {
  599. $(".chuyuanEmpty").css("display", "none")
  600. $(".chuyuan,.personNum").css("display", "block")
  601. }
  602. let str = `
  603. <ul class="clearfix" style="cursor: default;">
  604. <li>
  605. <div class="lis">
  606. <p class="numShow died">${flg ? data['死亡人数'] + '' || '--' : '--'}</p>
  607. <p class="explainNum">死亡人数</p>
  608. </div>
  609. </li>
  610. <li class="li03">
  611. <div class="lis li02">
  612. <p class="numShow patientNum">${flg ? data['手术病人数'] + '' || '--' : '--'}</p>
  613. <p class="explainNum">手术病人数</p>
  614. </div>
  615. </li>
  616. </ul>
  617. `
  618. $(".personNum").html("总人数:" + (data['总人数'] || '--'))
  619. $(".part01 .numCheck").css({ "cursor": "default" })
  620. $(".chuyuan").html(str)
  621. }
  622. //part02
  623. function setNumDetail(data) {
  624. if (data.length == 0) {
  625. $(".pingfendengji").css("display", "block")
  626. $(".bldjs").css("display", "none")
  627. picEmptyData(".pingfendengjiEmpty")
  628. return
  629. } else {
  630. $(".bldjs").css("display", "block")
  631. $(".pingfendengji").css("display", "none")
  632. }
  633. let str = ''
  634. for (let i = 0; i < data.length; i++) {
  635. str += `
  636. <li class="${i == 0 ? 'fst' : i == data.length - 1 ? ' four sec' : 'sec'}" data-c="${i}">
  637. <p class="numShow">${data[i].num}</p>
  638. <p class="explainNum">${data[i].name}</p>
  639. </li>
  640. `
  641. if (data[i].name == '甲级病历') {
  642. let tmp = []
  643. data[i].value = data[i].num
  644. tmp.push(data[i])
  645. tmp.push({ percentStr: (1 - data[i].percent) * 100 + '%', value: data[i].totleNum - data[i].num })
  646. part02pan(tmp, 'fen01')
  647. }
  648. if (data[i].name == '乙级病历') {
  649. let tmp = []
  650. data[i].value = data[i].num
  651. tmp.push(data[i])
  652. tmp.push({ percentStr: (1 - data[i].percent) * 100 + '%', value: data[i].totleNum - data[i].num })
  653. part02pan(tmp, 'fen02')
  654. }
  655. if (data[i].name == '丙级病历') {
  656. let tmp = []
  657. data[i].value = data[i].num
  658. tmp.push(data[i])
  659. tmp.push({ percentStr: (1 - data[i].percent) * 100 + '%', value: data[i].totleNum - data[i].num })
  660. part02pan(tmp, 'fen03')
  661. }
  662. }
  663. $('.bingli').html(str)
  664. }
  665. //part02pan
  666. function part02pan(data, dom) {
  667. dom = echarts.init(document.getElementById(dom));
  668. $(window).resize(function () {
  669. dom.resize()
  670. });
  671. let bgColor = '#fff';
  672. let title = '总量';
  673. let color = ['#3fffd1', '#4c5c82'];
  674. let echartData = data;
  675. option = {
  676. // backgroundColor: bgColor,
  677. color: color,
  678. title: [{
  679. text: '{val|' + echartData[0].percentStr + '}',
  680. top: 'center',
  681. left: 'center',
  682. textStyle: {
  683. rich: {
  684. val: {
  685. fontSize: 14,
  686. color: '#E9EBEF',
  687. fontWeight: 'bold',
  688. padding: [10, 0]
  689. },
  690. name: {
  691. fontSize: 12,
  692. fontWeight: 'normal',
  693. color: '#E9EBEF',
  694. }
  695. }
  696. }
  697. }],
  698. series: [{
  699. name: '',
  700. type: 'pie',
  701. radius: ['70%', '90%'],
  702. data: echartData,
  703. hoverAnimation: true,
  704. hoverOffset: 3,
  705. itemStyle: {
  706. normal: {
  707. borderColor: '#203463',
  708. borderWidth: 3
  709. }
  710. },
  711. label: {
  712. normal: {
  713. show: false,
  714. }
  715. },
  716. }]
  717. };
  718. dom.setOption(option);
  719. }
  720. //柱状图住院日期
  721. function emptyCircleB(data) {
  722. if (data.length == 0) {
  723. $(".emptyCircleBData").css("'display", "none !important")
  724. picEmptyData(".emptyCircleBWrap")
  725. } else {
  726. $(".emptyCircleBData").css("'display", "block")
  727. $(".emptyCircleBWrap").css("display", "none")
  728. }
  729. if (!document.getElementById('emptyCircleB')) return
  730. var myChart = echarts.init(document.getElementById('emptyCircleB'));
  731. $(window).resize(function () {
  732. myChart.resize()
  733. });
  734. let bgColor = '#fff';
  735. let title = '总量';
  736. let color = ['#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336', '#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336'];
  737. let echartData = data;
  738. let total = echartData.length > 0 ? echartData[0].totleNum : 0;
  739. option = {
  740. // backgroundColor: bgColor,
  741. color: color,
  742. title: [{
  743. text: data.length > 0 ? '{val|' + total + '}\n{name|' + title + '}' : '',
  744. top: 'center',
  745. left: 'center',
  746. textStyle: {
  747. rich: {
  748. val: {
  749. fontSize: 24,
  750. color: '#E9EBEF',
  751. fontWeight: 'bold',
  752. padding: [10, 0]
  753. },
  754. name: {
  755. fontSize: 12,
  756. fontWeight: 'normal',
  757. color: '#E9EBEF',
  758. }
  759. }
  760. }
  761. }],
  762. tooltip: {
  763. trigger: 'item',
  764. position: 'right',
  765. // formatter: '{b} : {c} ({d}%)',
  766. formatter: function (item) {
  767. const { name, num, percentStr } = item.data
  768. return `${name} : ${num} (${percentStr})`
  769. }
  770. },
  771. series: [{
  772. name: '',
  773. type: 'pie',
  774. radius: ['70%', '90%'],
  775. data: echartData,
  776. hoverAnimation: true,
  777. hoverOffset: 5,
  778. itemStyle: {
  779. normal: {
  780. // borderColor: bgColor,
  781. borderWidth: 3
  782. }
  783. },
  784. labelLine: {
  785. normal: {
  786. length: 20,
  787. length2: 120,
  788. lineStyle: {
  789. color: '#e6e6e6'
  790. }
  791. }
  792. },
  793. label: {
  794. normal: {
  795. show: false,
  796. formatter: params => {
  797. return params.name == 'A类' ? params.name : ''
  798. },
  799. padding: [0, -100, 25, -100],
  800. rich: {
  801. icon: {
  802. fontSize: 16
  803. },
  804. name: {
  805. fontSize: 14,
  806. padding: [0, 10, 0, 4],
  807. color: '#666666'
  808. },
  809. value: {
  810. fontSize: 18,
  811. fontWeight: 'bold',
  812. color: '#333333'
  813. }
  814. }
  815. }
  816. },
  817. }]
  818. };
  819. myChart.setOption(option);
  820. }
  821. function emptyCircleBc(data) {
  822. if (data.length == 0) {
  823. $(".emptyCircleBDatas").css("'display", "none !important")
  824. picEmptyData(".emptyCircleBWraps")
  825. } else {
  826. $(".emptyCircleBDatas").css("'display", "block")
  827. $(".emptyCircleBWraps").css("display", "none")
  828. }
  829. var myChart = echarts.init(document.getElementById('emptyCircleBc'));
  830. $(window).resize(function () {
  831. myChart.resize()
  832. });
  833. let bgColor = '#fff';
  834. let title = '总量';
  835. let color = ['#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336', '#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336'];
  836. let echartData = data;
  837. let total = echartData.length > 0 ? echartData[0].totleNum : 0;
  838. option = {
  839. // backgroundColor: bgColor,
  840. color: color,
  841. title: [{
  842. text: data.length > 0 ? '{val|' + total + '}\n{name|' + title + '}' : '',
  843. top: 'center',
  844. left: 'center',
  845. textStyle: {
  846. rich: {
  847. val: {
  848. fontSize: 24,
  849. color: '#E9EBEF',
  850. fontWeight: 'bold',
  851. padding: [10, 0]
  852. },
  853. name: {
  854. fontSize: 12,
  855. fontWeight: 'normal',
  856. color: '#E9EBEF',
  857. }
  858. }
  859. }
  860. }],
  861. tooltip: {
  862. trigger: 'item',
  863. position: 'right',
  864. // formatter: '{b} : {c} ({d}%)',
  865. formatter: function (item) {
  866. const { name, num, percentStr } = item.data
  867. return `${name} : ${num} (${percentStr})`
  868. }
  869. },
  870. series: [{
  871. name: '',
  872. type: 'pie',
  873. radius: ['70%', '90%'],
  874. data: echartData,
  875. hoverAnimation: true,
  876. hoverOffset: 5,
  877. itemStyle: {
  878. normal: {
  879. borderColor: '#203463',
  880. borderWidth: 3
  881. }
  882. },
  883. labelLine: {
  884. normal: {
  885. length: 20,
  886. length2: 120,
  887. lineStyle: {
  888. color: '#fff'
  889. }
  890. }
  891. },
  892. label: {
  893. normal: {
  894. show: false,
  895. formatter: params => {
  896. return params.name == 'A类' ? params.name : ''
  897. },
  898. padding: [0, -100, 25, -100],
  899. rich: {
  900. icon: {
  901. fontSize: 16
  902. },
  903. name: {
  904. fontSize: 14,
  905. padding: [0, 10, 0, 4],
  906. color: '#fff'
  907. },
  908. value: {
  909. fontSize: 18,
  910. fontWeight: 'bold',
  911. color: '#fff'
  912. }
  913. }
  914. }
  915. },
  916. }]
  917. };
  918. myChart.setOption(option);
  919. }
  920. //缺陷列表渲染
  921. function queList(data) {
  922. let strAll = '', tmp = `mm
  923. <tr class="thead">
  924. <td class="td01">排名</td>
  925. <td class="td02">模块名称</td>
  926. <td class="td04">缺陷占比</td>
  927. </tr>`
  928. if (data.length == 0) {
  929. $(".qtable").css("display", "none")
  930. picEmptyData(".qtableEmpty")
  931. return
  932. } else {
  933. $(".qtableEmpty").css("display", "none")
  934. $(".qtable").css("display", "table")
  935. }
  936. for (let i = 0; i < data.length; i++) {
  937. strAll += `
  938. <tr>
  939. <td style="text-align:center;"><i style="background:${i < 3 ? '#ECB22E' : '#526186'};color:${i < 3 ? '#fff' : '#B7BDCC'};">${i + 1}</i></td>
  940. <td class="homegodetail" data-name="${data[i].name}"><p class="td02name ellipsis">${data[i].name}</p></td>
  941. <td>${data[i].percentStr}</td>
  942. </tr>
  943. `
  944. }
  945. $(".qtable").html(tmp + strAll)
  946. // initScroll("list","Y",2)
  947. }
  948. //饼图列表注释渲染
  949. function panDetailB(data) {
  950. let color = ['#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336', '#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336'];
  951. let strAll = '';
  952. for (let i = 0; i < data.length; i++) {
  953. strAll += `
  954. <tr class="explainLi">
  955. <td class="deptName" title="${data[i].name}">
  956. <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
  957. </td>
  958. <td class="deptNum">${data[i].num}</td>
  959. <td class="percent">(${data[i].percentStr})</td>
  960. </tr>
  961. `
  962. }
  963. $(".explainPanB table").html(strAll);
  964. $(".explainPan").css({
  965. marginTop: -($(".explainPan").height() / 2 - 20) + 'px'
  966. })
  967. // initScroll("explainPanB","Y",2)
  968. }
  969. function panDetailBc(data) {
  970. let color = ['#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336', '#F2637B', '#975FE4', '#399FFF', '#37CBCB', '#4CCB73', '#FAD336'];
  971. let strAll = '';
  972. for (let i = 0; i < data.length; i++) {
  973. strAll += `
  974. <tr class="explainLi" data-dept="${data[i].name}">
  975. <td class="deptName" title="${data[i].name}">
  976. <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
  977. </td>
  978. <td class="deptNum">${data[i].num}</td>
  979. <td class="percent">(${data[i].percentStr})</td>
  980. </tr>
  981. `
  982. }
  983. $(".explainPanBc table").html(strAll);
  984. $(".explainPan").css({
  985. marginTop: -($(".explainPanc").height() / 2 - 20) + 'px'
  986. })
  987. // $(".homePageNo .explainPanBc .explainLi").click(function(){
  988. // let deptName = $(this).attr("data-dept")
  989. // focusMenuItem("YH-BLZK-ZKPFKS");
  990. // $(parent.document).find("#contentIframe").attr("src","./qcList.html?from=1&dateType="+dateType+"&deptName="+deptName)
  991. // })
  992. }
  993. //时间获取
  994. function getTimeDetail() {
  995. const d = new Date();
  996. const days = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
  997. let sec = d.getSeconds()
  998. let min = d.getMinutes()
  999. let hour = d.getHours()
  1000. 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}`
  1001. $(".dateDetail").html(str)
  1002. }
  1003. $(".sureDate").click(function () {
  1004. if (!getStaticDate()) {
  1005. return
  1006. }
  1007. $(".monthYear .year").css({
  1008. "border-color": '#A5ADBF',
  1009. color: '#A5ADBF',
  1010. backgroundColor: '#203463'
  1011. })
  1012. $(".monthYear .mon").css({
  1013. "border-color": '#A5ADBF',
  1014. color: '#A5ADBF',
  1015. backgroundColor: '#203463'
  1016. })
  1017. setCookieAction(behosDateStart.split(" ")[0], behosDateEnd.split(" ")[0])
  1018. ownSelectDate = 3
  1019. getBarData(dateType)
  1020. tiaomu(ownSelectDate || dateType)
  1021. })
  1022. //日期联动
  1023. function dateConsole(dateType, flg) {
  1024. let startDate = "", endDate = new Date()
  1025. let year = new Date().getFullYear()
  1026. let month = new Date().getMonth() + 1
  1027. if (dateType == '1') {
  1028. startDate = new Date(`${year}-${month}-01`)
  1029. } else if (dateType == '2') {
  1030. startDate = new Date(`${year}-01-01`)
  1031. } else {
  1032. startDate = "-1m"
  1033. }
  1034. if (getCookie("behosDateStart") && !flg) {
  1035. ownSelectDate = 3
  1036. startDate = new Date(getCookie("behosDateStart"))
  1037. endDate = new Date(getCookie("behosDateEnd"))
  1038. $(".monthYear .year").css({
  1039. "border-color": '#A5ADBF',
  1040. color: '#A5ADBF',
  1041. backgroundColor: '#203463'
  1042. })
  1043. $(".monthYear .mon").css({
  1044. "border-color": '#A5ADBF',
  1045. color: '#A5ADBF',
  1046. backgroundColor: '#203463'
  1047. })
  1048. }
  1049. $("#datepicker").datepicker({
  1050. yearRange: "2015:" + year,
  1051. changeMonth: true,
  1052. changeYear: true,
  1053. dateFormat: "yy/mm/dd",
  1054. }).datepicker("setDate", startDate);
  1055. $("#datepicker2").datepicker({
  1056. yearRange: "2015:" + year,
  1057. changeMonth: true,
  1058. changeYear: true,
  1059. dateFormat: "yy/mm/dd"
  1060. }).datepicker("setDate", endDate);
  1061. getStaticDate(flg)
  1062. tiaomu(ownSelectDate || dateType)
  1063. }
  1064. function setCookieAction(startDate, endDate) {
  1065. setCookie('behosDateStart', startDate)
  1066. setCookie('behosDateEnd', endDate)
  1067. }
  1068. function getStaticDate(flg) {
  1069. behosDateStart = $("#datepicker").val().trim()
  1070. behosDateEnd = $("#datepicker2").val().trim()
  1071. const start = new Date(behosDateStart).getTime()
  1072. const end = new Date(behosDateEnd).getTime()
  1073. if (!getCookie("behosDateEnd")) {
  1074. setCookie('behosDateStart', behosDateStart)
  1075. setCookie('behosDateEnd', behosDateEnd)
  1076. }
  1077. if (start > end) {
  1078. $.alerModal({ "message": '开始时间不能大于结束时间~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  1079. return false
  1080. }
  1081. if (flg) {
  1082. setCookieAction(behosDateStart, behosDateEnd)
  1083. }
  1084. if (behosDateStart) {
  1085. behosDateStart = behosDateStart.replace(/\//g, '-') + ' 00:00:00'
  1086. }
  1087. if (behosDateEnd) {
  1088. behosDateEnd = behosDateEnd.replace(/\//g, '-') + ' 23:59:59'
  1089. }
  1090. getBarData(dateType)
  1091. return true
  1092. }
  1093. $(function () {
  1094. const iconCalenBlue = require("./../images/darkDate.png")
  1095. const iconCalenGrey = require("./../images/icon_calen_grey.png")
  1096. $.datepicker.regional['zh-CN'] = {
  1097. clearText: '清除',
  1098. clearStatus: '清除已选e799bee5baa6e59b9ee7ad9431333361303131日期',
  1099. closeText: '关闭',
  1100. closeStatus: '不改变当前选择',
  1101. prevText: '<上月',
  1102. prevStatus: '显示上月',
  1103. prevBigText: '<<',
  1104. prevBigStatus: '显示上一年',
  1105. nextText: '下月>',
  1106. nextStatus: '显示下月',
  1107. nextBigText: '>>',
  1108. nextBigStatus: '显示下一年',
  1109. currentText: '今天',
  1110. currentStatus: '显示本月',
  1111. monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  1112. monthNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  1113. yearNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  1114. monthStatus: '选择月份',
  1115. yearStatus: '选择年份',
  1116. weekHeader: '周',
  1117. weekStatus: '年内周次',
  1118. dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
  1119. dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
  1120. dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
  1121. dayStatus: '设置 DD 为一周起始',
  1122. dateStatus: '选择 m月 d日, DD',
  1123. dateFormat: 'yy-mm-dd',
  1124. firstDay: 1,
  1125. initStatus: '请选择日期',
  1126. isRTL: false
  1127. };
  1128. $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
  1129. dateConsole(dateType)
  1130. $('.iconCalen').on("mouseenter", function (e) {
  1131. $(this).attr("src", iconCalenBlue)
  1132. })
  1133. $('.iconCalen').on("mouseleave", function (e) {
  1134. $(this).attr("src", iconCalenGrey)
  1135. })
  1136. $('.iconCalen').on("click", function (e) {
  1137. $(this).parent().find("input").focus()
  1138. })
  1139. // initScroll("partWrap","Y",2)
  1140. // initScroll("console","X",2)
  1141. });