| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243 |
- /**
- * 报修平台
- * */
- var zydata = [];
- var mzdata = [];
- var hzdata = [];
- var showdatas = [];
- var len = "";
- var state = ""; // state tab页的 data-index(工单状态参数);
- var stateVal = ""; //默认为所有,”day”今天,”week”本周,”month”本月,”year”本年
- $(document).ready(function () {
- getdatas();
- $(".tool_bars").authorizeButton();
- //搜索
- $("#sc_btns").click(function () {
- getdatas();
- // getdatastwo()
- // initTable1();
- });
- $("#HY_seeMore").click(function () {
- $(".moreCondition").toggleClass("show");
- });
- $("#sc_statebtn")
- .find('input[type="radio"]')
- .on("change", function () {
- stateVal = $(this).val();
- initTable1();
- });
- //时间
- laydate.render({
- elem: "#startTime",
- theme: "#249fea",
- range: "~",
- });
- function getPreDatetime(pdate) {
- var start = new Date();
- start.setTime(start.getTime() - pdate);
- start.getYear(); // 获取当前年份(2位)
- var YY = start.getFullYear(); // 获取完整的年份(4位,1970-????)
- var MM = start.getMonth() + 1; // 获取当前月份(0-11,0代表1月)
- MM = MM > 9 ? MM : "0" + MM;
- var DD = start.getDate(); // 获取当前日(1-31)
- DD = DD > 9 ? DD : "0" + DD;
- var lastmonth = YY + "-" + MM + "-" + DD;
- return lastmonth;
- }
- if ($("#startTime").val() == "") {
- function p(s) {
- return s < 10 ? "0" + s : s;
- }
- var currentYear = new Date().getFullYear();
- var currentMonth = new Date().getMonth() + 1;
- var currentDate = new Date().getDate();
- var prevCurrentYear = 0;
- var prevCurrentMonth = 0;
- if (currentMonth == 1) {
- prevCurrentYear = currentYear - 1;
- prevCurrentMonth = 12;
- } else {
- prevCurrentYear = currentYear;
- prevCurrentMonth = currentMonth - 1;
- }
- var current =
- currentYear + "-" + p(currentMonth) + "-" + p(currentDate);
- // var lastmonth = prevCurrentYear + "-" + p(prevCurrentMonth) + "-" + p(currentDate)
- var a = getPreDatetime(3600 * 1000 * 24 * 30);
- $("#startTime").val(
- getPreDatetime(3600 * 1000 * 24 * 30) + " ~ " + current
- );
- getdatas();
- initTable1();
- }
- // initTable1();
- // getdatastwo()
- });
- function getdatas() {
- $.ajax({
- type: "get",
- url:
- huayi.config.callcenter_url +
- "testusertypeapi/api/Test/getzysfallbbinfolist", //获取数据的Servlet地址
- async: true,
- dataType: "json",
- data: {
- stime:
- $("#startTime").val() && $("#startTime").val().split(" ~ ")[0], //开始时间
- etime:
- $("#startTime").val() && $("#startTime").val().split(" ~ ")[1], //结束时间
- },
- success: function (data) {
- if (data.state.toLowerCase() == "success") {
- for (var i = 0; i < data.data.length; i++) {
- delete data.data[i].sendlosecount;
- delete data.data[i].hzallcount;
- }
- zydata = data.data;
- console.log(zydata);
- initTable1();
- }
- },
- });
- }
- // function getdatastwo() {
- // $.ajax({
- // type: "get",
- // url: huayi.config.callcenter_url + "testusertypeapi/api/Test/getmzsfallbbinfolist", //获取数据的Servlet地址
- // async: true,
- // dataType: 'json',
- // data: {
- // stime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[0], //开始时间
- // etime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[1], //结束时间
- // },
- // success: function(data) {
- // if (data.state.toLowerCase() == 'success') {
- // for(var i=0;i<data.data.length;i++){
- // delete data.data[i].sendlosecount
- // delete data.data[i].hzallcount
- // }
- // mzdata = data.data
- // console.log(mzdata)
- // }
- // }
- // });
- // }
- function initTable1() {
- //先销毁表格
- $("#table1").bootstrapTable("destroy");
- //初始化表格,动态从服务器加载数据
- $("#table1").bootstrapTable({
- method: "get", //使用get请求到服务器获取数据
- url:
- huayi.config.callcenter_url +
- "testusertypeapi/api/Test/getmzsfallbbinfolist", //获取数据的Servlet地址
- contentType: "application/x-www-form-urlencoded",
- striped: true, //表格显示条纹
- smartDisplay: false,
- // pagination: false, //启动分页
- // pageSize: 10, //每页显示的记录数
- // pageNumber: 1, //当前第几页
- // pageList: [10, 20, 50, 100], //记录数可选列表
- search: false, //是否启用查询
- showColumns: false, //显示下拉框勾选要显示的列
- showRefresh: false, //显示刷新按钮
- sidePagination: "server", //表示服务端请求
- //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
- //设置为limit可以获取limit, offset, search, sort, order
- queryParamsType: "undefined",
- queryParams: function queryParams(params) {
- //设置查询参数
- var param = {
- stime:
- $("#startTime").val() &&
- $("#startTime").val().split(" ~ ")[0], //开始时间
- etime:
- $("#startTime").val() &&
- $("#startTime").val().split(" ~ ")[1], //结束时间
- };
- return param;
- },
- responseHandler: function (res) {
- var ddata = {
- state: "success",
- message: "成功",
- data: [
- {
- deptname: "神经内科二病区",
- hzallcount: 0,
- sfallcount: "150",
- sendlosecount: -150,
- yhfcount: "14",
- whfcount: "136",
- mycount: "149",
- mycountbl: "",
- bycount: "1",
- bycountbl: "",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "98.00%",
- zhmydbfb: "0",
- },
- {
- deptname: "妇科病区",
- hzallcount: 0,
- sfallcount: "87",
- sendlosecount: -87,
- yhfcount: "5",
- whfcount: "82",
- mycount: "86",
- mycountbl: "98.85%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "1",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "消化内科二病区",
- hzallcount: 0,
- sfallcount: "105",
- sendlosecount: -105,
- yhfcount: "7",
- whfcount: "98",
- mycount: "103",
- mycountbl: "98.10%",
- bycount: "2",
- bycountbl: "1.90%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "呼吸内科一病区",
- hzallcount: 0,
- sfallcount: "95",
- sendlosecount: -95,
- yhfcount: "7",
- whfcount: "88",
- mycount: "93",
- mycountbl: "97.89%",
- bycount: "2",
- bycountbl: "2.11%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "消化内科一病区",
- hzallcount: 0,
- sfallcount: "161",
- sendlosecount: -161,
- yhfcount: "10",
- whfcount: "151",
- mycount: "158",
- mycountbl: "98.14%",
- bycount: "2",
- bycountbl: "1.24%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "1",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "神经内科五病区",
- hzallcount: 0,
- sfallcount: "127",
- sendlosecount: -127,
- yhfcount: "14",
- whfcount: "113",
- mycount: "123",
- mycountbl: "96.85%",
- bycount: "3",
- bycountbl: "2.36%",
- nomycount: "1",
- nomycountbl: "0.79%",
- othercount: "0",
- hfmydbl: "98.43%",
- zhmydbfb: "99.21%",
- },
- {
- deptname: "心血管内科一病区",
- hzallcount: 0,
- sfallcount: "144",
- sendlosecount: -144,
- yhfcount: "14",
- whfcount: "130",
- mycount: "141",
- mycountbl: "97.92%",
- bycount: "2",
- bycountbl: "1.39%",
- nomycount: "1",
- nomycountbl: "0.69%",
- othercount: "0",
- hfmydbl: "98.61%",
- zhmydbfb: "99.31%",
- },
- {
- deptname: "肾病科病区",
- hzallcount: 0,
- sfallcount: "51",
- sendlosecount: -51,
- yhfcount: "1",
- whfcount: "50",
- mycount: "51",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "普外科一病区",
- hzallcount: 0,
- sfallcount: "106",
- sendlosecount: -106,
- yhfcount: "9",
- whfcount: "97",
- mycount: "105",
- mycountbl: "99.06%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "1",
- hfmydbl: "98.10%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "泌尿外科病区",
- hzallcount: 0,
- sfallcount: "89",
- sendlosecount: -89,
- yhfcount: "8",
- whfcount: "81",
- mycount: "87",
- mycountbl: "97.75%",
- bycount: "1",
- bycountbl: "1.12%",
- nomycount: "1",
- nomycountbl: "1.12%",
- othercount: "0",
- hfmydbl: "98.88%",
- zhmydbfb: "98.88%",
- },
- {
- deptname: "骨科三病区",
- hzallcount: 0,
- sfallcount: "75",
- sendlosecount: -75,
- yhfcount: "7",
- whfcount: "68",
- mycount: "74",
- mycountbl: "98.67%",
- bycount: "1",
- bycountbl: "1.33%",
- nomycount: "0",
- nomycountbl: "0.00%",
- "o thercount": "0",
- hfmydbl: "98.67%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "神经内科六病区",
- hzallcount: 0,
- sfallcount: "94",
- sendlosecount: -94,
- yhfcount: "7",
- whfcount: "87",
- mycount: "94",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "烧伤科二病区",
- hzallcount: 0,
- sfallcount: "32",
- sendlosecount: -32,
- yhfcount: "4",
- whfcount: "28",
- mycount: "32",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "骨科二病区",
- hzallcount: 0,
- sfallcount: "53",
- sendlosecount: -53,
- yhfcount: "2",
- whfcount: "51",
- mycount: "52",
- mycountbl: "98.11%",
- bycount: "1",
- bycountbl: "1.89%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "肛肠外科病区",
- hzallcount: 0,
- sfallcount: "38",
- sendlosecount: -38,
- yhfcount: "2",
- whfcount: "36",
- mycount: "38",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "肛肠二病区",
- hzallcount: 0,
- sfallcount: "33",
- sendlosecount: -33,
- yhfcount: "2",
- whfcount: "31",
- mycount: "33",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "普外科二病区",
- hzallcount: 0,
- sfallcount: "57",
- sendlosecount: -57,
- yhfcount: "6",
- whfcount: "51",
- mycount: "56",
- mycountbl: "98.25%",
- bycount: "1",
- bycountbl: "1.75%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "中医科病区",
- hzallcount: 0,
- sfallcount: "56",
- sendlosecount: -56,
- yhfcount: "9",
- whfcount: "47",
- mycount: "55",
- mycountbl: "98.21%",
- bycount: "1",
- bycountbl: "1.79%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "烧伤科一病区",
- hzallcount: 0,
- sfallcount: "47",
- sendlosecount: -47,
- yhfcount: "5",
- whfcount: "42",
- mycount: "47",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "神经内科一病区",
- hzallcount: 0,
- sfallcount: "119",
- sendlosecount: -119,
- yhfcount: "11",
- whfcount: "108",
- mycount: "119",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "98.32%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "骨科一病区",
- hzallcount: 0,
- sfallcount: "26",
- sendlosecount: -26,
- yhfcount: "2",
- whfcount: "24",
- mycount: "24",
- mycountbl: "92.31%",
- bycount: "1",
- bycountbl: "3.85%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "1",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "内分泌科病区",
- hzallcount: 0,
- sfallcount: "69",
- sendlosecount: -69,
- yhfcount: "7",
- whfcount: "62",
- mycount: "68",
- mycountbl: "98.55%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "1",
- nomycountbl: "1.45%",
- othercount: "0",
- hfmydbl: "97.10%",
- zhmydbfb: "98.55%",
- },
- {
- deptname: "神经内科三病区",
- hzallcount: 0,
- sfallcount: "115",
- sendlosecount: -115,
- yhfcount: "9",
- whfcount: "106",
- mycount: "112",
- mycountbl: "97.39%",
- bycount: "1",
- bycountbl: "0.87%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "2",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "耳鼻咽喉科病区",
- hzallcount: 0,
- sfallcount: "46",
- sendlosecount: -46,
- yhfcount: "1",
- whfcount: "45",
- mycount: "46",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "皮肤科病区",
- hzallcount: 0,
- sfallcount: "42",
- sendlosecount: -42,
- yhfcount: "1",
- whfcount: "41",
- mycount: "42",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "肿瘤科病区",
- hzallcount: 0,
- sfallcount: "36",
- sendlosecount: -36,
- yhfcount: "1",
- whfcount: "35",
- mycount: "35",
- mycountbl: "97.22%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "1",
- nomycountbl: "2.78%",
- othercount: "0",
- hfmydbl: "97.22%",
- zhmydbfb: "97.22%",
- },
- {
- deptname: "外四科病区",
- hzallcount: 0,
- sfallcount: "23",
- sendlosecount: -23,
- yhfcount: "3",
- whfcount: "20",
- mycount: "23",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "烧伤科三病区",
- hzallcount: 0,
- sfallcount: "13",
- sendlosecount: -13,
- yhfcount: "1",
- whfcount: "12",
- mycount: "13",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "肿瘤血液科病区",
- hzallcount: 0,
- sfallcount: "104",
- sendlosecount: -104,
- yhfcount: "2",
- whfcount: "102",
- mycount: "103",
- mycountbl: "99.04%",
- bycount: "1",
- bycountbl: "0.96%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "产科二病区",
- hzallcount: 0,
- sfallcount: "84",
- sendlosecount: -84,
- yhfcount: "4",
- whfcount: "80",
- mycount: "84",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "儿科二病区",
- hzallcount: 0,
- sfallcount: "87",
- sendlosecount: -87,
- yhfcount: "4",
- whfcount: "83",
- mycount: "87",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "儿科三病区",
- hzallcount: 0,
- sfallcount: "94",
- sendlosecount: -94,
- yhfcount: "2",
- whfcount: "92",
- mycount: "94",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "眼科病区",
- hzallcount: 0,
- sfallcount: "7",
- sendlosecount: -7,
- yhfcount: "1",
- whfcount: "6",
- mycount: "7",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "85.71%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "胸外科病区",
- hzallcount: 0,
- sfallcount: "19",
- sendlosecount: -19,
- yhfcount: "2",
- whfcount: "17",
- mycount: "18",
- mycountbl: "94.74%",
- bycount: "1",
- bycountbl: "5.26%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "神经康复科病区",
- hzallcount: 0,
- sfallcount: "77",
- sendlosecount: -77,
- yhfcount: "10",
- whfcount: "67",
- mycount: "76",
- mycountbl: "98.70%",
- bycount: "1",
- bycountbl: "1.30%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "NICU病区",
- hzallcount: 0,
- sfallcount: "8",
- sendlosecount: -8,
- yhfcount: "1",
- whfcount: "7",
- mycount: "8",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "产科一病区",
- hzallcount: 0,
- sfallcount: "75",
- sendlosecount: -75,
- yhfcount: "3",
- whfcount: "72",
- mycount: "75",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "全科医学科病区",
- hzallcount: 0,
- sfallcount: "46",
- sendlosecount: -46,
- yhfcount: "2",
- whfcount: "44",
- mycount: "46",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "BICU病区",
- hzallcount: 0,
- sfallcount: "4",
- sendlosecount: -4,
- yhfcount: "0",
- whfcount: "4",
- mycount: "4",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "老年医学病区",
- hzallcount: 0,
- sfallcount: "3",
- sendlosecount: -3,
- yhfcount: "0",
- whfcount: "3",
- mycount: "3",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "神经外科一病区",
- hzallcount: 0,
- sfallcount: "42",
- sendlosecount: -42,
- yhfcount: "3",
- whfcount: "39",
- mycount: "41",
- mycountbl: "97.62%",
- bycount: "1",
- bycountbl: "2.38%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "97.62%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "儿童康复病区",
- hzallcount: 0,
- sfallcount: "7",
- sendlosecount: -7,
- yhfcount: "1",
- whfcount: "6",
- mycount: "7",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "SICU病区",
- hzallcount: 0,
- sfallcount: "5",
- sendlosecount: -5,
- yhfcount: "0",
- whfcount: "5",
- mycount: "5",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "创面修复科病区",
- hzallcount: 0,
- sfallcount: "20",
- sendlosecount: -20,
- yhfcount: "4",
- whfcount: "16",
- mycount: "20",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "疼痛科病区",
- hzallcount: 0,
- sfallcount: "12",
- sendlosecount: -12,
- yhfcount: "0",
- whfcount: "12",
- mycount: "12",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "新生儿病区",
- hzallcount: 0,
- sfallcount: "12",
- sendlosecount: -12,
- yhfcount: "0",
- whfcount: "12",
- mycount: "12",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "介入科病区",
- hzallcount: 0,
- sfallcount: "7",
- sendlosecount: -7,
- yhfcount: "0",
- whfcount: "7",
- mycount: "7",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "ICU病区",
- hzallcount: 0,
- sfallcount: "4",
- sendlosecount: -4,
- yhfcount: "0",
- whfcount: "4",
- mycount: "4",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "NCU病区",
- hzallcount: 0,
- sfallcount: "5",
- sendlosecount: -5,
- yhfcount: "2",
- whfcount: "3",
- mycount: "5",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "日间病房病区",
- hzallcount: 0,
- sfallcount: "3",
- sendlosecount: -3,
- yhfcount: "0",
- whfcount: "3",
- mycount: "3",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "全科医学科二病区",
- hzallcount: 0,
- sfallcount: "8",
- sendlosecount: -8,
- yhfcount: "1",
- whfcount: "7",
- mycount: "8",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "口腔二科病区",
- hzallcount: 0,
- sfallcount: "2",
- sendlosecount: -2,
- yhfcount: "0",
- whfcount: "2",
- mycount: "2",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- {
- deptname: "CCU1病区",
- hzallcount: 0,
- sfallcount: "2",
- sendlosecount: -2,
- yhfcount: "0",
- whfcount: "2",
- mycount: "2",
- mycountbl: "100.00%",
- bycount: "0",
- bycountbl: "0.00%",
- nomycount: "0",
- nomycountbl: "0.00%",
- othercount: "0",
- hfmydbl: "100.00%",
- zhmydbfb: "100.00%",
- },
- ],
- };
- for (var i = 0; i < ddata.data.length; i++) {
- delete ddata.data[i].sendlosecount;
- delete ddata.data[i].hzallcount;
- len = ddata.data.length;
- if (ddata.data[i].sfallcount == "") {
- ddata.data[i].sfallcount = 0;
- }
- if (ddata.data[i].yhfcount == "") {
- ddata.data[i].yhfcount = 0;
- }
- if (ddata.data[i].whfcount == "") {
- ddata.data[i].whfcount = 0;
- }
- if (ddata.data[i].mycount == "") {
- ddata.data[i].mycount = 0;
- }
- if (ddata.data[i].mycountbl == "") {
- ddata.data[i].mycountbl = 0;
- }
- if (ddata.data[i].bycount == "") {
- ddata.data[i].bycount = 0;
- }
- if (ddata.data[i].bycountbl == "") {
- ddata.data[i].bycountbl = 0;
- }
- if (ddata.data[i].nomycount == "") {
- ddata.data[i].nomycount = 0;
- }
- if (ddata.data[i].nomycountbl == "") {
- ddata.data[i].nomycountbl = 0;
- }
- if (ddata.data[i].othercount == "") {
- ddata.data[i].othercount = 0;
- }
- if (ddata.data[i].hfmydbl == "") {
- ddata.data[i].hfmydbl = 0;
- }
- if (ddata.data[i].zhmydbfb == "") {
- ddata.data[i].zhmydbfb = 0;
- }
- }
- mzdata = ddata.data;
- hzdata = zydata.concat(mzdata);
- var sfallcount = hzdata.reduce(
- (sum, e) => sum + parseInt(e.sfallcount),
- 0
- );
- var yhfcount = hzdata.reduce(
- (sum, e) => sum + parseInt(e.yhfcount),
- 0
- );
- var whfcount = hzdata.reduce(
- (sum, e) => sum + parseInt(e.whfcount),
- 0
- );
- var mycount = hzdata.reduce(
- (sum, e) => sum + parseInt(e.mycount),
- 0
- );
- var mycountbl = hzdata.reduce(
- (sum, e) => sum + parseInt(e.mycountbl),
- 0
- );
- var bycount = hzdata.reduce(
- (sum, e) => sum + parseInt(e.bycount),
- 0
- );
- var bycountbl = hzdata.reduce(
- (sum, e) => sum + parseInt(e.bycountbl),
- 0
- );
- var nomycount = hzdata.reduce(
- (sum, e) => sum + parseInt(e.nomycount),
- 0
- );
- var nomycountbl = hzdata.reduce(
- (sum, e) => sum + parseInt(e.nomycountbl),
- 0
- );
- var othercount = hzdata.reduce(
- (sum, e) => sum + parseInt(e.othercount),
- 0
- );
- var hfmydbl = hzdata.reduce(
- (sum, e) => sum + parseFloat(e.hfmydbl),
- 0
- );
- var zhmydbfb = hzdata.reduce(
- (sum, e) => sum + parseInt(e.zhmydbfb),
- 0
- );
- var newhzdata = [
- {
- deptname: "合计",
- sfallcount: sfallcount,
- yhfcount: yhfcount,
- whfcount: whfcount,
- mycount: mycount,
- mycountbl: (mycountbl / len).toFixed(2) + "%",
- bycount: bycount,
- bycountbl: (bycountbl / len).toFixed(2) + "%",
- nomycount: nomycount,
- nomycountbl: (nomycountbl / len).toFixed(2) + "%",
- othercount: othercount,
- hfmydbl: (hfmydbl / len).toFixed(2) + "%",
- zhmydbfb: (zhmydbfb / len).toFixed(2) + "%",
- },
- ];
- if (hzdata.length > 0) {
- showdatas = hzdata.concat(newhzdata);
- console.log(newhzdata);
- } else {
- showdatas = [];
- }
- //格式化数据
- return {
- rows: showdatas, //数据
- };
- },
- onLoadSuccess: function (res) {
- //加载成功时执行
- },
- onLoadError: function () {
- //加载失败时执行
- //layer.msg("加载数据失败", { time: 1500, icon: 2 });
- },
- });
- }
- //导出
- function btn_export() {
- // var stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0] //开始时间
- // var etime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1] //结束时间
- // window.location.href = huayi.config.callcenter_url + "testusertypeapi/api/Test/exportexcelsfallbb?stime=" + stime + "&etime=" + etime
- //要导出的json数据
- const jsonData = showdatas;
- //列标题,逗号隔开,每一个逗号就是隔开一个单元格
- var str = `科室,随访总数,已回复,未回复,满意,满意度,表扬,表扬度,不满意,不满意度,其他,回复满意度,综合满意度\n`;
- //增加\t为了不让表格显示科学计数法或者其他格式
- for (let i = 0; i < jsonData.length; i++) {
- for (let item in jsonData[i]) {
- str += `${jsonData[i][item] + "\t"},`;
- }
- str += "\n";
- }
- //encodeURIComponent解决中文乱码
- let uri =
- "data:text/csv/xls;charset=utf-8,\ufeff" + encodeURIComponent(str);
- //通过创建a标签实现
- let link = document.createElement("a");
- link.href = uri;
- //对下载的文件命名
- link.download = "总统计报表.xlsx";
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
- }
|