郑州第一人民医院UI

generalStatisticsReport.js 47KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243
  1. /**
  2. * 报修平台
  3. * */
  4. var zydata = [];
  5. var mzdata = [];
  6. var hzdata = [];
  7. var showdatas = [];
  8. var len = "";
  9. var state = ""; // state tab页的 data-index(工单状态参数);
  10. var stateVal = ""; //默认为所有,”day”今天,”week”本周,”month”本月,”year”本年
  11. $(document).ready(function () {
  12. getdatas();
  13. $(".tool_bars").authorizeButton();
  14. //搜索
  15. $("#sc_btns").click(function () {
  16. getdatas();
  17. // getdatastwo()
  18. // initTable1();
  19. });
  20. $("#HY_seeMore").click(function () {
  21. $(".moreCondition").toggleClass("show");
  22. });
  23. $("#sc_statebtn")
  24. .find('input[type="radio"]')
  25. .on("change", function () {
  26. stateVal = $(this).val();
  27. initTable1();
  28. });
  29. //时间
  30. laydate.render({
  31. elem: "#startTime",
  32. theme: "#249fea",
  33. range: "~",
  34. });
  35. function getPreDatetime(pdate) {
  36. var start = new Date();
  37. start.setTime(start.getTime() - pdate);
  38. start.getYear(); // 获取当前年份(2位)
  39. var YY = start.getFullYear(); // 获取完整的年份(4位,1970-????)
  40. var MM = start.getMonth() + 1; // 获取当前月份(0-11,0代表1月)
  41. MM = MM > 9 ? MM : "0" + MM;
  42. var DD = start.getDate(); // 获取当前日(1-31)
  43. DD = DD > 9 ? DD : "0" + DD;
  44. var lastmonth = YY + "-" + MM + "-" + DD;
  45. return lastmonth;
  46. }
  47. if ($("#startTime").val() == "") {
  48. function p(s) {
  49. return s < 10 ? "0" + s : s;
  50. }
  51. var currentYear = new Date().getFullYear();
  52. var currentMonth = new Date().getMonth() + 1;
  53. var currentDate = new Date().getDate();
  54. var prevCurrentYear = 0;
  55. var prevCurrentMonth = 0;
  56. if (currentMonth == 1) {
  57. prevCurrentYear = currentYear - 1;
  58. prevCurrentMonth = 12;
  59. } else {
  60. prevCurrentYear = currentYear;
  61. prevCurrentMonth = currentMonth - 1;
  62. }
  63. var current =
  64. currentYear + "-" + p(currentMonth) + "-" + p(currentDate);
  65. // var lastmonth = prevCurrentYear + "-" + p(prevCurrentMonth) + "-" + p(currentDate)
  66. var a = getPreDatetime(3600 * 1000 * 24 * 30);
  67. $("#startTime").val(
  68. getPreDatetime(3600 * 1000 * 24 * 30) + " ~ " + current
  69. );
  70. getdatas();
  71. initTable1();
  72. }
  73. // initTable1();
  74. // getdatastwo()
  75. });
  76. function getdatas() {
  77. $.ajax({
  78. type: "get",
  79. url:
  80. huayi.config.callcenter_url +
  81. "testusertypeapi/api/Test/getzysfallbbinfolist", //获取数据的Servlet地址
  82. async: true,
  83. dataType: "json",
  84. data: {
  85. stime:
  86. $("#startTime").val() && $("#startTime").val().split(" ~ ")[0], //开始时间
  87. etime:
  88. $("#startTime").val() && $("#startTime").val().split(" ~ ")[1], //结束时间
  89. },
  90. success: function (data) {
  91. if (data.state.toLowerCase() == "success") {
  92. for (var i = 0; i < data.data.length; i++) {
  93. delete data.data[i].sendlosecount;
  94. delete data.data[i].hzallcount;
  95. }
  96. zydata = data.data;
  97. console.log(zydata);
  98. initTable1();
  99. }
  100. },
  101. });
  102. }
  103. // function getdatastwo() {
  104. // $.ajax({
  105. // type: "get",
  106. // url: huayi.config.callcenter_url + "testusertypeapi/api/Test/getmzsfallbbinfolist", //获取数据的Servlet地址
  107. // async: true,
  108. // dataType: 'json',
  109. // data: {
  110. // stime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[0], //开始时间
  111. // etime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[1], //结束时间
  112. // },
  113. // success: function(data) {
  114. // if (data.state.toLowerCase() == 'success') {
  115. // for(var i=0;i<data.data.length;i++){
  116. // delete data.data[i].sendlosecount
  117. // delete data.data[i].hzallcount
  118. // }
  119. // mzdata = data.data
  120. // console.log(mzdata)
  121. // }
  122. // }
  123. // });
  124. // }
  125. function initTable1() {
  126. //先销毁表格
  127. $("#table1").bootstrapTable("destroy");
  128. //初始化表格,动态从服务器加载数据
  129. $("#table1").bootstrapTable({
  130. method: "get", //使用get请求到服务器获取数据
  131. url:
  132. huayi.config.callcenter_url +
  133. "testusertypeapi/api/Test/getmzsfallbbinfolist", //获取数据的Servlet地址
  134. contentType: "application/x-www-form-urlencoded",
  135. striped: true, //表格显示条纹
  136. smartDisplay: false,
  137. // pagination: false, //启动分页
  138. // pageSize: 10, //每页显示的记录数
  139. // pageNumber: 1, //当前第几页
  140. // pageList: [10, 20, 50, 100], //记录数可选列表
  141. search: false, //是否启用查询
  142. showColumns: false, //显示下拉框勾选要显示的列
  143. showRefresh: false, //显示刷新按钮
  144. sidePagination: "server", //表示服务端请求
  145. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  146. //设置为limit可以获取limit, offset, search, sort, order
  147. queryParamsType: "undefined",
  148. queryParams: function queryParams(params) {
  149. //设置查询参数
  150. var param = {
  151. stime:
  152. $("#startTime").val() &&
  153. $("#startTime").val().split(" ~ ")[0], //开始时间
  154. etime:
  155. $("#startTime").val() &&
  156. $("#startTime").val().split(" ~ ")[1], //结束时间
  157. };
  158. return param;
  159. },
  160. responseHandler: function (res) {
  161. var ddata = {
  162. state: "success",
  163. message: "成功",
  164. data: [
  165. {
  166. deptname: "神经内科二病区",
  167. hzallcount: 0,
  168. sfallcount: "150",
  169. sendlosecount: -150,
  170. yhfcount: "14",
  171. whfcount: "136",
  172. mycount: "149",
  173. mycountbl: "",
  174. bycount: "1",
  175. bycountbl: "",
  176. nomycount: "0",
  177. nomycountbl: "0.00%",
  178. othercount: "0",
  179. hfmydbl: "98.00%",
  180. zhmydbfb: "0",
  181. },
  182. {
  183. deptname: "妇科病区",
  184. hzallcount: 0,
  185. sfallcount: "87",
  186. sendlosecount: -87,
  187. yhfcount: "5",
  188. whfcount: "82",
  189. mycount: "86",
  190. mycountbl: "98.85%",
  191. bycount: "0",
  192. bycountbl: "0.00%",
  193. nomycount: "0",
  194. nomycountbl: "0.00%",
  195. othercount: "1",
  196. hfmydbl: "100.00%",
  197. zhmydbfb: "100.00%",
  198. },
  199. {
  200. deptname: "消化内科二病区",
  201. hzallcount: 0,
  202. sfallcount: "105",
  203. sendlosecount: -105,
  204. yhfcount: "7",
  205. whfcount: "98",
  206. mycount: "103",
  207. mycountbl: "98.10%",
  208. bycount: "2",
  209. bycountbl: "1.90%",
  210. nomycount: "0",
  211. nomycountbl: "0.00%",
  212. othercount: "0",
  213. hfmydbl: "100.00%",
  214. zhmydbfb: "100.00%",
  215. },
  216. {
  217. deptname: "呼吸内科一病区",
  218. hzallcount: 0,
  219. sfallcount: "95",
  220. sendlosecount: -95,
  221. yhfcount: "7",
  222. whfcount: "88",
  223. mycount: "93",
  224. mycountbl: "97.89%",
  225. bycount: "2",
  226. bycountbl: "2.11%",
  227. nomycount: "0",
  228. nomycountbl: "0.00%",
  229. othercount: "0",
  230. hfmydbl: "100.00%",
  231. zhmydbfb: "100.00%",
  232. },
  233. {
  234. deptname: "消化内科一病区",
  235. hzallcount: 0,
  236. sfallcount: "161",
  237. sendlosecount: -161,
  238. yhfcount: "10",
  239. whfcount: "151",
  240. mycount: "158",
  241. mycountbl: "98.14%",
  242. bycount: "2",
  243. bycountbl: "1.24%",
  244. nomycount: "0",
  245. nomycountbl: "0.00%",
  246. othercount: "1",
  247. hfmydbl: "100.00%",
  248. zhmydbfb: "100.00%",
  249. },
  250. {
  251. deptname: "神经内科五病区",
  252. hzallcount: 0,
  253. sfallcount: "127",
  254. sendlosecount: -127,
  255. yhfcount: "14",
  256. whfcount: "113",
  257. mycount: "123",
  258. mycountbl: "96.85%",
  259. bycount: "3",
  260. bycountbl: "2.36%",
  261. nomycount: "1",
  262. nomycountbl: "0.79%",
  263. othercount: "0",
  264. hfmydbl: "98.43%",
  265. zhmydbfb: "99.21%",
  266. },
  267. {
  268. deptname: "心血管内科一病区",
  269. hzallcount: 0,
  270. sfallcount: "144",
  271. sendlosecount: -144,
  272. yhfcount: "14",
  273. whfcount: "130",
  274. mycount: "141",
  275. mycountbl: "97.92%",
  276. bycount: "2",
  277. bycountbl: "1.39%",
  278. nomycount: "1",
  279. nomycountbl: "0.69%",
  280. othercount: "0",
  281. hfmydbl: "98.61%",
  282. zhmydbfb: "99.31%",
  283. },
  284. {
  285. deptname: "肾病科病区",
  286. hzallcount: 0,
  287. sfallcount: "51",
  288. sendlosecount: -51,
  289. yhfcount: "1",
  290. whfcount: "50",
  291. mycount: "51",
  292. mycountbl: "100.00%",
  293. bycount: "0",
  294. bycountbl: "0.00%",
  295. nomycount: "0",
  296. nomycountbl: "0.00%",
  297. othercount: "0",
  298. hfmydbl: "100.00%",
  299. zhmydbfb: "100.00%",
  300. },
  301. {
  302. deptname: "普外科一病区",
  303. hzallcount: 0,
  304. sfallcount: "106",
  305. sendlosecount: -106,
  306. yhfcount: "9",
  307. whfcount: "97",
  308. mycount: "105",
  309. mycountbl: "99.06%",
  310. bycount: "0",
  311. bycountbl: "0.00%",
  312. nomycount: "0",
  313. nomycountbl: "0.00%",
  314. othercount: "1",
  315. hfmydbl: "98.10%",
  316. zhmydbfb: "100.00%",
  317. },
  318. {
  319. deptname: "泌尿外科病区",
  320. hzallcount: 0,
  321. sfallcount: "89",
  322. sendlosecount: -89,
  323. yhfcount: "8",
  324. whfcount: "81",
  325. mycount: "87",
  326. mycountbl: "97.75%",
  327. bycount: "1",
  328. bycountbl: "1.12%",
  329. nomycount: "1",
  330. nomycountbl: "1.12%",
  331. othercount: "0",
  332. hfmydbl: "98.88%",
  333. zhmydbfb: "98.88%",
  334. },
  335. {
  336. deptname: "骨科三病区",
  337. hzallcount: 0,
  338. sfallcount: "75",
  339. sendlosecount: -75,
  340. yhfcount: "7",
  341. whfcount: "68",
  342. mycount: "74",
  343. mycountbl: "98.67%",
  344. bycount: "1",
  345. bycountbl: "1.33%",
  346. nomycount: "0",
  347. nomycountbl: "0.00%",
  348. "o thercount": "0",
  349. hfmydbl: "98.67%",
  350. zhmydbfb: "100.00%",
  351. },
  352. {
  353. deptname: "神经内科六病区",
  354. hzallcount: 0,
  355. sfallcount: "94",
  356. sendlosecount: -94,
  357. yhfcount: "7",
  358. whfcount: "87",
  359. mycount: "94",
  360. mycountbl: "100.00%",
  361. bycount: "0",
  362. bycountbl: "0.00%",
  363. nomycount: "0",
  364. nomycountbl: "0.00%",
  365. othercount: "0",
  366. hfmydbl: "100.00%",
  367. zhmydbfb: "100.00%",
  368. },
  369. {
  370. deptname: "烧伤科二病区",
  371. hzallcount: 0,
  372. sfallcount: "32",
  373. sendlosecount: -32,
  374. yhfcount: "4",
  375. whfcount: "28",
  376. mycount: "32",
  377. mycountbl: "100.00%",
  378. bycount: "0",
  379. bycountbl: "0.00%",
  380. nomycount: "0",
  381. nomycountbl: "0.00%",
  382. othercount: "0",
  383. hfmydbl: "100.00%",
  384. zhmydbfb: "100.00%",
  385. },
  386. {
  387. deptname: "骨科二病区",
  388. hzallcount: 0,
  389. sfallcount: "53",
  390. sendlosecount: -53,
  391. yhfcount: "2",
  392. whfcount: "51",
  393. mycount: "52",
  394. mycountbl: "98.11%",
  395. bycount: "1",
  396. bycountbl: "1.89%",
  397. nomycount: "0",
  398. nomycountbl: "0.00%",
  399. othercount: "0",
  400. hfmydbl: "100.00%",
  401. zhmydbfb: "100.00%",
  402. },
  403. {
  404. deptname: "肛肠外科病区",
  405. hzallcount: 0,
  406. sfallcount: "38",
  407. sendlosecount: -38,
  408. yhfcount: "2",
  409. whfcount: "36",
  410. mycount: "38",
  411. mycountbl: "100.00%",
  412. bycount: "0",
  413. bycountbl: "0.00%",
  414. nomycount: "0",
  415. nomycountbl: "0.00%",
  416. othercount: "0",
  417. hfmydbl: "100.00%",
  418. zhmydbfb: "100.00%",
  419. },
  420. {
  421. deptname: "肛肠二病区",
  422. hzallcount: 0,
  423. sfallcount: "33",
  424. sendlosecount: -33,
  425. yhfcount: "2",
  426. whfcount: "31",
  427. mycount: "33",
  428. mycountbl: "100.00%",
  429. bycount: "0",
  430. bycountbl: "0.00%",
  431. nomycount: "0",
  432. nomycountbl: "0.00%",
  433. othercount: "0",
  434. hfmydbl: "100.00%",
  435. zhmydbfb: "100.00%",
  436. },
  437. {
  438. deptname: "普外科二病区",
  439. hzallcount: 0,
  440. sfallcount: "57",
  441. sendlosecount: -57,
  442. yhfcount: "6",
  443. whfcount: "51",
  444. mycount: "56",
  445. mycountbl: "98.25%",
  446. bycount: "1",
  447. bycountbl: "1.75%",
  448. nomycount: "0",
  449. nomycountbl: "0.00%",
  450. othercount: "0",
  451. hfmydbl: "100.00%",
  452. zhmydbfb: "100.00%",
  453. },
  454. {
  455. deptname: "中医科病区",
  456. hzallcount: 0,
  457. sfallcount: "56",
  458. sendlosecount: -56,
  459. yhfcount: "9",
  460. whfcount: "47",
  461. mycount: "55",
  462. mycountbl: "98.21%",
  463. bycount: "1",
  464. bycountbl: "1.79%",
  465. nomycount: "0",
  466. nomycountbl: "0.00%",
  467. othercount: "0",
  468. hfmydbl: "100.00%",
  469. zhmydbfb: "100.00%",
  470. },
  471. {
  472. deptname: "烧伤科一病区",
  473. hzallcount: 0,
  474. sfallcount: "47",
  475. sendlosecount: -47,
  476. yhfcount: "5",
  477. whfcount: "42",
  478. mycount: "47",
  479. mycountbl: "100.00%",
  480. bycount: "0",
  481. bycountbl: "0.00%",
  482. nomycount: "0",
  483. nomycountbl: "0.00%",
  484. othercount: "0",
  485. hfmydbl: "100.00%",
  486. zhmydbfb: "100.00%",
  487. },
  488. {
  489. deptname: "神经内科一病区",
  490. hzallcount: 0,
  491. sfallcount: "119",
  492. sendlosecount: -119,
  493. yhfcount: "11",
  494. whfcount: "108",
  495. mycount: "119",
  496. mycountbl: "100.00%",
  497. bycount: "0",
  498. bycountbl: "0.00%",
  499. nomycount: "0",
  500. nomycountbl: "0.00%",
  501. othercount: "0",
  502. hfmydbl: "98.32%",
  503. zhmydbfb: "100.00%",
  504. },
  505. {
  506. deptname: "骨科一病区",
  507. hzallcount: 0,
  508. sfallcount: "26",
  509. sendlosecount: -26,
  510. yhfcount: "2",
  511. whfcount: "24",
  512. mycount: "24",
  513. mycountbl: "92.31%",
  514. bycount: "1",
  515. bycountbl: "3.85%",
  516. nomycount: "0",
  517. nomycountbl: "0.00%",
  518. othercount: "1",
  519. hfmydbl: "100.00%",
  520. zhmydbfb: "100.00%",
  521. },
  522. {
  523. deptname: "内分泌科病区",
  524. hzallcount: 0,
  525. sfallcount: "69",
  526. sendlosecount: -69,
  527. yhfcount: "7",
  528. whfcount: "62",
  529. mycount: "68",
  530. mycountbl: "98.55%",
  531. bycount: "0",
  532. bycountbl: "0.00%",
  533. nomycount: "1",
  534. nomycountbl: "1.45%",
  535. othercount: "0",
  536. hfmydbl: "97.10%",
  537. zhmydbfb: "98.55%",
  538. },
  539. {
  540. deptname: "神经内科三病区",
  541. hzallcount: 0,
  542. sfallcount: "115",
  543. sendlosecount: -115,
  544. yhfcount: "9",
  545. whfcount: "106",
  546. mycount: "112",
  547. mycountbl: "97.39%",
  548. bycount: "1",
  549. bycountbl: "0.87%",
  550. nomycount: "0",
  551. nomycountbl: "0.00%",
  552. othercount: "2",
  553. hfmydbl: "100.00%",
  554. zhmydbfb: "100.00%",
  555. },
  556. {
  557. deptname: "耳鼻咽喉科病区",
  558. hzallcount: 0,
  559. sfallcount: "46",
  560. sendlosecount: -46,
  561. yhfcount: "1",
  562. whfcount: "45",
  563. mycount: "46",
  564. mycountbl: "100.00%",
  565. bycount: "0",
  566. bycountbl: "0.00%",
  567. nomycount: "0",
  568. nomycountbl: "0.00%",
  569. othercount: "0",
  570. hfmydbl: "100.00%",
  571. zhmydbfb: "100.00%",
  572. },
  573. {
  574. deptname: "皮肤科病区",
  575. hzallcount: 0,
  576. sfallcount: "42",
  577. sendlosecount: -42,
  578. yhfcount: "1",
  579. whfcount: "41",
  580. mycount: "42",
  581. mycountbl: "100.00%",
  582. bycount: "0",
  583. bycountbl: "0.00%",
  584. nomycount: "0",
  585. nomycountbl: "0.00%",
  586. othercount: "0",
  587. hfmydbl: "100.00%",
  588. zhmydbfb: "100.00%",
  589. },
  590. {
  591. deptname: "肿瘤科病区",
  592. hzallcount: 0,
  593. sfallcount: "36",
  594. sendlosecount: -36,
  595. yhfcount: "1",
  596. whfcount: "35",
  597. mycount: "35",
  598. mycountbl: "97.22%",
  599. bycount: "0",
  600. bycountbl: "0.00%",
  601. nomycount: "1",
  602. nomycountbl: "2.78%",
  603. othercount: "0",
  604. hfmydbl: "97.22%",
  605. zhmydbfb: "97.22%",
  606. },
  607. {
  608. deptname: "外四科病区",
  609. hzallcount: 0,
  610. sfallcount: "23",
  611. sendlosecount: -23,
  612. yhfcount: "3",
  613. whfcount: "20",
  614. mycount: "23",
  615. mycountbl: "100.00%",
  616. bycount: "0",
  617. bycountbl: "0.00%",
  618. nomycount: "0",
  619. nomycountbl: "0.00%",
  620. othercount: "0",
  621. hfmydbl: "100.00%",
  622. zhmydbfb: "100.00%",
  623. },
  624. {
  625. deptname: "烧伤科三病区",
  626. hzallcount: 0,
  627. sfallcount: "13",
  628. sendlosecount: -13,
  629. yhfcount: "1",
  630. whfcount: "12",
  631. mycount: "13",
  632. mycountbl: "100.00%",
  633. bycount: "0",
  634. bycountbl: "0.00%",
  635. nomycount: "0",
  636. nomycountbl: "0.00%",
  637. othercount: "0",
  638. hfmydbl: "100.00%",
  639. zhmydbfb: "100.00%",
  640. },
  641. {
  642. deptname: "肿瘤血液科病区",
  643. hzallcount: 0,
  644. sfallcount: "104",
  645. sendlosecount: -104,
  646. yhfcount: "2",
  647. whfcount: "102",
  648. mycount: "103",
  649. mycountbl: "99.04%",
  650. bycount: "1",
  651. bycountbl: "0.96%",
  652. nomycount: "0",
  653. nomycountbl: "0.00%",
  654. othercount: "0",
  655. hfmydbl: "100.00%",
  656. zhmydbfb: "100.00%",
  657. },
  658. {
  659. deptname: "产科二病区",
  660. hzallcount: 0,
  661. sfallcount: "84",
  662. sendlosecount: -84,
  663. yhfcount: "4",
  664. whfcount: "80",
  665. mycount: "84",
  666. mycountbl: "100.00%",
  667. bycount: "0",
  668. bycountbl: "0.00%",
  669. nomycount: "0",
  670. nomycountbl: "0.00%",
  671. othercount: "0",
  672. hfmydbl: "100.00%",
  673. zhmydbfb: "100.00%",
  674. },
  675. {
  676. deptname: "儿科二病区",
  677. hzallcount: 0,
  678. sfallcount: "87",
  679. sendlosecount: -87,
  680. yhfcount: "4",
  681. whfcount: "83",
  682. mycount: "87",
  683. mycountbl: "100.00%",
  684. bycount: "0",
  685. bycountbl: "0.00%",
  686. nomycount: "0",
  687. nomycountbl: "0.00%",
  688. othercount: "0",
  689. hfmydbl: "100.00%",
  690. zhmydbfb: "100.00%",
  691. },
  692. {
  693. deptname: "儿科三病区",
  694. hzallcount: 0,
  695. sfallcount: "94",
  696. sendlosecount: -94,
  697. yhfcount: "2",
  698. whfcount: "92",
  699. mycount: "94",
  700. mycountbl: "100.00%",
  701. bycount: "0",
  702. bycountbl: "0.00%",
  703. nomycount: "0",
  704. nomycountbl: "0.00%",
  705. othercount: "0",
  706. hfmydbl: "100.00%",
  707. zhmydbfb: "100.00%",
  708. },
  709. {
  710. deptname: "眼科病区",
  711. hzallcount: 0,
  712. sfallcount: "7",
  713. sendlosecount: -7,
  714. yhfcount: "1",
  715. whfcount: "6",
  716. mycount: "7",
  717. mycountbl: "100.00%",
  718. bycount: "0",
  719. bycountbl: "0.00%",
  720. nomycount: "0",
  721. nomycountbl: "0.00%",
  722. othercount: "0",
  723. hfmydbl: "85.71%",
  724. zhmydbfb: "100.00%",
  725. },
  726. {
  727. deptname: "胸外科病区",
  728. hzallcount: 0,
  729. sfallcount: "19",
  730. sendlosecount: -19,
  731. yhfcount: "2",
  732. whfcount: "17",
  733. mycount: "18",
  734. mycountbl: "94.74%",
  735. bycount: "1",
  736. bycountbl: "5.26%",
  737. nomycount: "0",
  738. nomycountbl: "0.00%",
  739. othercount: "0",
  740. hfmydbl: "100.00%",
  741. zhmydbfb: "100.00%",
  742. },
  743. {
  744. deptname: "神经康复科病区",
  745. hzallcount: 0,
  746. sfallcount: "77",
  747. sendlosecount: -77,
  748. yhfcount: "10",
  749. whfcount: "67",
  750. mycount: "76",
  751. mycountbl: "98.70%",
  752. bycount: "1",
  753. bycountbl: "1.30%",
  754. nomycount: "0",
  755. nomycountbl: "0.00%",
  756. othercount: "0",
  757. hfmydbl: "100.00%",
  758. zhmydbfb: "100.00%",
  759. },
  760. {
  761. deptname: "NICU病区",
  762. hzallcount: 0,
  763. sfallcount: "8",
  764. sendlosecount: -8,
  765. yhfcount: "1",
  766. whfcount: "7",
  767. mycount: "8",
  768. mycountbl: "100.00%",
  769. bycount: "0",
  770. bycountbl: "0.00%",
  771. nomycount: "0",
  772. nomycountbl: "0.00%",
  773. othercount: "0",
  774. hfmydbl: "100.00%",
  775. zhmydbfb: "100.00%",
  776. },
  777. {
  778. deptname: "产科一病区",
  779. hzallcount: 0,
  780. sfallcount: "75",
  781. sendlosecount: -75,
  782. yhfcount: "3",
  783. whfcount: "72",
  784. mycount: "75",
  785. mycountbl: "100.00%",
  786. bycount: "0",
  787. bycountbl: "0.00%",
  788. nomycount: "0",
  789. nomycountbl: "0.00%",
  790. othercount: "0",
  791. hfmydbl: "100.00%",
  792. zhmydbfb: "100.00%",
  793. },
  794. {
  795. deptname: "全科医学科病区",
  796. hzallcount: 0,
  797. sfallcount: "46",
  798. sendlosecount: -46,
  799. yhfcount: "2",
  800. whfcount: "44",
  801. mycount: "46",
  802. mycountbl: "100.00%",
  803. bycount: "0",
  804. bycountbl: "0.00%",
  805. nomycount: "0",
  806. nomycountbl: "0.00%",
  807. othercount: "0",
  808. hfmydbl: "100.00%",
  809. zhmydbfb: "100.00%",
  810. },
  811. {
  812. deptname: "BICU病区",
  813. hzallcount: 0,
  814. sfallcount: "4",
  815. sendlosecount: -4,
  816. yhfcount: "0",
  817. whfcount: "4",
  818. mycount: "4",
  819. mycountbl: "100.00%",
  820. bycount: "0",
  821. bycountbl: "0.00%",
  822. nomycount: "0",
  823. nomycountbl: "0.00%",
  824. othercount: "0",
  825. hfmydbl: "100.00%",
  826. zhmydbfb: "100.00%",
  827. },
  828. {
  829. deptname: "老年医学病区",
  830. hzallcount: 0,
  831. sfallcount: "3",
  832. sendlosecount: -3,
  833. yhfcount: "0",
  834. whfcount: "3",
  835. mycount: "3",
  836. mycountbl: "100.00%",
  837. bycount: "0",
  838. bycountbl: "0.00%",
  839. nomycount: "0",
  840. nomycountbl: "0.00%",
  841. othercount: "0",
  842. hfmydbl: "100.00%",
  843. zhmydbfb: "100.00%",
  844. },
  845. {
  846. deptname: "神经外科一病区",
  847. hzallcount: 0,
  848. sfallcount: "42",
  849. sendlosecount: -42,
  850. yhfcount: "3",
  851. whfcount: "39",
  852. mycount: "41",
  853. mycountbl: "97.62%",
  854. bycount: "1",
  855. bycountbl: "2.38%",
  856. nomycount: "0",
  857. nomycountbl: "0.00%",
  858. othercount: "0",
  859. hfmydbl: "97.62%",
  860. zhmydbfb: "100.00%",
  861. },
  862. {
  863. deptname: "儿童康复病区",
  864. hzallcount: 0,
  865. sfallcount: "7",
  866. sendlosecount: -7,
  867. yhfcount: "1",
  868. whfcount: "6",
  869. mycount: "7",
  870. mycountbl: "100.00%",
  871. bycount: "0",
  872. bycountbl: "0.00%",
  873. nomycount: "0",
  874. nomycountbl: "0.00%",
  875. othercount: "0",
  876. hfmydbl: "100.00%",
  877. zhmydbfb: "100.00%",
  878. },
  879. {
  880. deptname: "SICU病区",
  881. hzallcount: 0,
  882. sfallcount: "5",
  883. sendlosecount: -5,
  884. yhfcount: "0",
  885. whfcount: "5",
  886. mycount: "5",
  887. mycountbl: "100.00%",
  888. bycount: "0",
  889. bycountbl: "0.00%",
  890. nomycount: "0",
  891. nomycountbl: "0.00%",
  892. othercount: "0",
  893. hfmydbl: "100.00%",
  894. zhmydbfb: "100.00%",
  895. },
  896. {
  897. deptname: "创面修复科病区",
  898. hzallcount: 0,
  899. sfallcount: "20",
  900. sendlosecount: -20,
  901. yhfcount: "4",
  902. whfcount: "16",
  903. mycount: "20",
  904. mycountbl: "100.00%",
  905. bycount: "0",
  906. bycountbl: "0.00%",
  907. nomycount: "0",
  908. nomycountbl: "0.00%",
  909. othercount: "0",
  910. hfmydbl: "100.00%",
  911. zhmydbfb: "100.00%",
  912. },
  913. {
  914. deptname: "疼痛科病区",
  915. hzallcount: 0,
  916. sfallcount: "12",
  917. sendlosecount: -12,
  918. yhfcount: "0",
  919. whfcount: "12",
  920. mycount: "12",
  921. mycountbl: "100.00%",
  922. bycount: "0",
  923. bycountbl: "0.00%",
  924. nomycount: "0",
  925. nomycountbl: "0.00%",
  926. othercount: "0",
  927. hfmydbl: "100.00%",
  928. zhmydbfb: "100.00%",
  929. },
  930. {
  931. deptname: "新生儿病区",
  932. hzallcount: 0,
  933. sfallcount: "12",
  934. sendlosecount: -12,
  935. yhfcount: "0",
  936. whfcount: "12",
  937. mycount: "12",
  938. mycountbl: "100.00%",
  939. bycount: "0",
  940. bycountbl: "0.00%",
  941. nomycount: "0",
  942. nomycountbl: "0.00%",
  943. othercount: "0",
  944. hfmydbl: "100.00%",
  945. zhmydbfb: "100.00%",
  946. },
  947. {
  948. deptname: "介入科病区",
  949. hzallcount: 0,
  950. sfallcount: "7",
  951. sendlosecount: -7,
  952. yhfcount: "0",
  953. whfcount: "7",
  954. mycount: "7",
  955. mycountbl: "100.00%",
  956. bycount: "0",
  957. bycountbl: "0.00%",
  958. nomycount: "0",
  959. nomycountbl: "0.00%",
  960. othercount: "0",
  961. hfmydbl: "100.00%",
  962. zhmydbfb: "100.00%",
  963. },
  964. {
  965. deptname: "ICU病区",
  966. hzallcount: 0,
  967. sfallcount: "4",
  968. sendlosecount: -4,
  969. yhfcount: "0",
  970. whfcount: "4",
  971. mycount: "4",
  972. mycountbl: "100.00%",
  973. bycount: "0",
  974. bycountbl: "0.00%",
  975. nomycount: "0",
  976. nomycountbl: "0.00%",
  977. othercount: "0",
  978. hfmydbl: "100.00%",
  979. zhmydbfb: "100.00%",
  980. },
  981. {
  982. deptname: "NCU病区",
  983. hzallcount: 0,
  984. sfallcount: "5",
  985. sendlosecount: -5,
  986. yhfcount: "2",
  987. whfcount: "3",
  988. mycount: "5",
  989. mycountbl: "100.00%",
  990. bycount: "0",
  991. bycountbl: "0.00%",
  992. nomycount: "0",
  993. nomycountbl: "0.00%",
  994. othercount: "0",
  995. hfmydbl: "100.00%",
  996. zhmydbfb: "100.00%",
  997. },
  998. {
  999. deptname: "日间病房病区",
  1000. hzallcount: 0,
  1001. sfallcount: "3",
  1002. sendlosecount: -3,
  1003. yhfcount: "0",
  1004. whfcount: "3",
  1005. mycount: "3",
  1006. mycountbl: "100.00%",
  1007. bycount: "0",
  1008. bycountbl: "0.00%",
  1009. nomycount: "0",
  1010. nomycountbl: "0.00%",
  1011. othercount: "0",
  1012. hfmydbl: "100.00%",
  1013. zhmydbfb: "100.00%",
  1014. },
  1015. {
  1016. deptname: "全科医学科二病区",
  1017. hzallcount: 0,
  1018. sfallcount: "8",
  1019. sendlosecount: -8,
  1020. yhfcount: "1",
  1021. whfcount: "7",
  1022. mycount: "8",
  1023. mycountbl: "100.00%",
  1024. bycount: "0",
  1025. bycountbl: "0.00%",
  1026. nomycount: "0",
  1027. nomycountbl: "0.00%",
  1028. othercount: "0",
  1029. hfmydbl: "100.00%",
  1030. zhmydbfb: "100.00%",
  1031. },
  1032. {
  1033. deptname: "口腔二科病区",
  1034. hzallcount: 0,
  1035. sfallcount: "2",
  1036. sendlosecount: -2,
  1037. yhfcount: "0",
  1038. whfcount: "2",
  1039. mycount: "2",
  1040. mycountbl: "100.00%",
  1041. bycount: "0",
  1042. bycountbl: "0.00%",
  1043. nomycount: "0",
  1044. nomycountbl: "0.00%",
  1045. othercount: "0",
  1046. hfmydbl: "100.00%",
  1047. zhmydbfb: "100.00%",
  1048. },
  1049. {
  1050. deptname: "CCU1病区",
  1051. hzallcount: 0,
  1052. sfallcount: "2",
  1053. sendlosecount: -2,
  1054. yhfcount: "0",
  1055. whfcount: "2",
  1056. mycount: "2",
  1057. mycountbl: "100.00%",
  1058. bycount: "0",
  1059. bycountbl: "0.00%",
  1060. nomycount: "0",
  1061. nomycountbl: "0.00%",
  1062. othercount: "0",
  1063. hfmydbl: "100.00%",
  1064. zhmydbfb: "100.00%",
  1065. },
  1066. ],
  1067. };
  1068. for (var i = 0; i < ddata.data.length; i++) {
  1069. delete ddata.data[i].sendlosecount;
  1070. delete ddata.data[i].hzallcount;
  1071. len = ddata.data.length;
  1072. if (ddata.data[i].sfallcount == "") {
  1073. ddata.data[i].sfallcount = 0;
  1074. }
  1075. if (ddata.data[i].yhfcount == "") {
  1076. ddata.data[i].yhfcount = 0;
  1077. }
  1078. if (ddata.data[i].whfcount == "") {
  1079. ddata.data[i].whfcount = 0;
  1080. }
  1081. if (ddata.data[i].mycount == "") {
  1082. ddata.data[i].mycount = 0;
  1083. }
  1084. if (ddata.data[i].mycountbl == "") {
  1085. ddata.data[i].mycountbl = 0;
  1086. }
  1087. if (ddata.data[i].bycount == "") {
  1088. ddata.data[i].bycount = 0;
  1089. }
  1090. if (ddata.data[i].bycountbl == "") {
  1091. ddata.data[i].bycountbl = 0;
  1092. }
  1093. if (ddata.data[i].nomycount == "") {
  1094. ddata.data[i].nomycount = 0;
  1095. }
  1096. if (ddata.data[i].nomycountbl == "") {
  1097. ddata.data[i].nomycountbl = 0;
  1098. }
  1099. if (ddata.data[i].othercount == "") {
  1100. ddata.data[i].othercount = 0;
  1101. }
  1102. if (ddata.data[i].hfmydbl == "") {
  1103. ddata.data[i].hfmydbl = 0;
  1104. }
  1105. if (ddata.data[i].zhmydbfb == "") {
  1106. ddata.data[i].zhmydbfb = 0;
  1107. }
  1108. }
  1109. mzdata = ddata.data;
  1110. hzdata = zydata.concat(mzdata);
  1111. var sfallcount = hzdata.reduce(
  1112. (sum, e) => sum + parseInt(e.sfallcount),
  1113. 0
  1114. );
  1115. var yhfcount = hzdata.reduce(
  1116. (sum, e) => sum + parseInt(e.yhfcount),
  1117. 0
  1118. );
  1119. var whfcount = hzdata.reduce(
  1120. (sum, e) => sum + parseInt(e.whfcount),
  1121. 0
  1122. );
  1123. var mycount = hzdata.reduce(
  1124. (sum, e) => sum + parseInt(e.mycount),
  1125. 0
  1126. );
  1127. var mycountbl = hzdata.reduce(
  1128. (sum, e) => sum + parseInt(e.mycountbl),
  1129. 0
  1130. );
  1131. var bycount = hzdata.reduce(
  1132. (sum, e) => sum + parseInt(e.bycount),
  1133. 0
  1134. );
  1135. var bycountbl = hzdata.reduce(
  1136. (sum, e) => sum + parseInt(e.bycountbl),
  1137. 0
  1138. );
  1139. var nomycount = hzdata.reduce(
  1140. (sum, e) => sum + parseInt(e.nomycount),
  1141. 0
  1142. );
  1143. var nomycountbl = hzdata.reduce(
  1144. (sum, e) => sum + parseInt(e.nomycountbl),
  1145. 0
  1146. );
  1147. var othercount = hzdata.reduce(
  1148. (sum, e) => sum + parseInt(e.othercount),
  1149. 0
  1150. );
  1151. var hfmydbl = hzdata.reduce(
  1152. (sum, e) => sum + parseFloat(e.hfmydbl),
  1153. 0
  1154. );
  1155. var zhmydbfb = hzdata.reduce(
  1156. (sum, e) => sum + parseInt(e.zhmydbfb),
  1157. 0
  1158. );
  1159. var newhzdata = [
  1160. {
  1161. deptname: "合计",
  1162. sfallcount: sfallcount,
  1163. yhfcount: yhfcount,
  1164. whfcount: whfcount,
  1165. mycount: mycount,
  1166. mycountbl: (mycountbl / len).toFixed(2) + "%",
  1167. bycount: bycount,
  1168. bycountbl: (bycountbl / len).toFixed(2) + "%",
  1169. nomycount: nomycount,
  1170. nomycountbl: (nomycountbl / len).toFixed(2) + "%",
  1171. othercount: othercount,
  1172. hfmydbl: (hfmydbl / len).toFixed(2) + "%",
  1173. zhmydbfb: (zhmydbfb / len).toFixed(2) + "%",
  1174. },
  1175. ];
  1176. if (hzdata.length > 0) {
  1177. showdatas = hzdata.concat(newhzdata);
  1178. console.log(newhzdata);
  1179. } else {
  1180. showdatas = [];
  1181. }
  1182. //格式化数据
  1183. return {
  1184. rows: showdatas, //数据
  1185. };
  1186. },
  1187. onLoadSuccess: function (res) {
  1188. //加载成功时执行
  1189. },
  1190. onLoadError: function () {
  1191. //加载失败时执行
  1192. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  1193. },
  1194. });
  1195. }
  1196. //导出
  1197. function btn_export() {
  1198. // var stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0] //开始时间
  1199. // var etime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1] //结束时间
  1200. // window.location.href = huayi.config.callcenter_url + "testusertypeapi/api/Test/exportexcelsfallbb?stime=" + stime + "&etime=" + etime
  1201. //要导出的json数据
  1202. const jsonData = showdatas;
  1203. //列标题,逗号隔开,每一个逗号就是隔开一个单元格
  1204. var str = `科室,随访总数,已回复,未回复,满意,满意度,表扬,表扬度,不满意,不满意度,其他,回复满意度,综合满意度\n`;
  1205. //增加\t为了不让表格显示科学计数法或者其他格式
  1206. for (let i = 0; i < jsonData.length; i++) {
  1207. for (let item in jsonData[i]) {
  1208. str += `${jsonData[i][item] + "\t"},`;
  1209. }
  1210. str += "\n";
  1211. }
  1212. //encodeURIComponent解决中文乱码
  1213. let uri =
  1214. "data:text/csv/xls;charset=utf-8,\ufeff" + encodeURIComponent(str);
  1215. //通过创建a标签实现
  1216. let link = document.createElement("a");
  1217. link.href = uri;
  1218. //对下载的文件命名
  1219. link.download = "总统计报表.xlsx";
  1220. document.body.appendChild(link);
  1221. link.click();
  1222. document.body.removeChild(link);
  1223. }