郑州第一人民医院UI

index.js 30KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171
  1. var newData=[] //数据倒序
  2. var floag=true
  3. WEB_SOCKET_SWF_LOCATION = "./js/websocket/WebSocketMain.swf";
  4. // 开启flash的websocket debug
  5. WEB_SOCKET_DEBUG = true;
  6. var ws, n = 0,
  7. timer;
  8. var lockReconnect = false; //避免重复连接
  9. var obj = {};
  10. var Statess;
  11. var cls = 0;
  12. var lasttime = new Date().getTime();
  13. var cons;
  14. var person='';
  15. // var areaOneVal = helper.cookies.get("areaOneVal");
  16. // var areaOneText = helper.cookies.get("areaOneText");
  17. // if (areaOneVal) {
  18. // var areaOneVal = helper.cookies.get("areaOneVal");
  19. // } else{
  20. // var areaOneVal="sqs12345"
  21. // }
  22. //创建scoket连接
  23. createWebSocket()
  24. function createWebSocket() {
  25. try {
  26. Connect();
  27. } catch (e) {
  28. reconnect();
  29. }
  30. }
  31. //连接
  32. function Connect() {
  33. ws = new WebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
  34. ws.onopen = function () {
  35. console.log(new Date() + " " + "建立连接");
  36. //心跳检测重置
  37. heartCheck.reset().start();
  38. cls = 0;
  39. lasttime = new Date().getTime();
  40. join()
  41. SayBusy()
  42. };
  43. //接收到消息的回调方法
  44. ws.onmessage = function (evt) {
  45. //如果获取到消息,心跳检测重置
  46. //拿到任何消息都说明当前连接是正常的
  47. heartCheck.reset().start();
  48. var myDate = new Date();
  49. console.log(myDate + " receive " + evt.data);
  50. var data = JSON.parse(evt.data)[0];
  51. if (data) {
  52. var rlt = data.Result;
  53. var type = data.Type;
  54. if (rlt == true) {
  55. switch (type.toLowerCase()) {
  56. case "login":
  57. LoginBack();
  58. break; //签入
  59. }
  60. } else {
  61. if (rlt == false) {
  62. $(".hwzt").text('操作失败!');
  63. } else {
  64. $(".hwzt").text(rlt);
  65. if(type.toLowerCase()=='waitcount') {
  66. backstageQueue(data);
  67. }
  68. }
  69. }
  70. }
  71. };
  72. //连接关闭的回调方法
  73. ws.onclose = function (evt) {
  74. if (cls == 0) {
  75. cls = 1;
  76. $(".hwzt").text('连接关闭!');
  77. $("#top-search li i").removeClass("active");
  78. reconnect();
  79. }
  80. };
  81. //连接发生错误的回调方法
  82. ws.onerror = function (evt) {
  83. //产生异常
  84. $(".hwzt").text('连接出现异常!');
  85. console.log(ws);
  86. if (ws == null || ws.readyState != ws.OPEN) {
  87. console.log(new Date() + "开始重连");
  88. reconnect();
  89. }
  90. };
  91. }
  92. //重连
  93. function reconnect() {
  94. if (lockReconnect) return;
  95. lockReconnect = true;
  96. //没连接上会一直重连,设置延迟避免请求过多
  97. setTimeout(function () {
  98. console.log(new Date() + " " + "重连中……");
  99. createWebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
  100. lockReconnect = false;
  101. SayBusy()
  102. }, 2000);
  103. }
  104. //发送
  105. function Send() {
  106. if (ws.readyState != ws.OPEN) {
  107. reconnect();
  108. }
  109. if (ws.readyState == ws.OPEN) {
  110. console.log(new Date() + " send " + JSON.stringify(obj));
  111. ws.send(JSON.stringify(obj));
  112. }
  113. }
  114. //心跳检测
  115. var heartCheck = {
  116. timeout: 25000, //25秒
  117. timeoutObj: null,
  118. serverTimeoutObj: null,
  119. reset: function () {
  120. clearTimeout(this.timeoutObj);
  121. clearTimeout(this.serverTimeoutObj);
  122. return this;
  123. },
  124. start: function () {
  125. var self = this;
  126. this.timeoutObj = setTimeout(function () {
  127. //这里发送一个心跳,后端收到后,返回一个心跳消息,
  128. //onmessage拿到返回的心跳就说明连接正常
  129. obj.Type = "Heart";
  130. Send();
  131. self.serverTimeoutObj = setTimeout(function () { //如果超过一定时间还没重置,说明后端主动断开了
  132. ws.close(); //如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
  133. }, self.timeout)
  134. }, this.timeout)
  135. }
  136. }
  137. // 签入
  138. function SayBusy() {
  139. obj.Type = "SayBusy";
  140. Send();
  141. console.log('置忙')
  142. }
  143. //签入
  144. function LoginBack() {
  145. obj.Type = "SayBusy";
  146. Send();
  147. console.log('置忙')
  148. }
  149. // 点击签入
  150. function join(){
  151. obj.Type ='Login',
  152. obj.AgentID='9898',
  153. obj.AgentExten='1015',
  154. obj.AgentType='0',
  155. obj.AgentGroup='364'
  156. // console.log(scoketDatas)
  157. Send()
  158. }
  159. //监测
  160. function SubScribeBack() {
  161. var obj = $("iframe:visible")
  162. if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
  163. window.frames[obj.attr("name")].Start();
  164. }
  165. if (obj.attr("data-id") == "./TelCall/zxKong.html") {
  166. window.frames[obj.attr("name")].Start();
  167. }
  168. }
  169. //取消监测
  170. function SubScribeCancelBack() {
  171. $('.yuan_one').addClass("lx")
  172. $('.yuan_two').addClass("lx")
  173. }
  174. //后台排队
  175. function backstageQueue(data) {
  176. person=data.WaitCount
  177. console.log(person)
  178. }
  179. $(function() {
  180. loginTimeLimit(); //登录
  181. var mySwiper = new Swiper('.swiper-container', {
  182. pagination: { /* 分页器*/
  183. el: '.swiper-pagination',
  184. clickable: true,
  185. },
  186. navigation: {
  187. nextEl: '.swiper-button-next',
  188. prevEl: '.swiper-button-prev',
  189. },
  190. on: {
  191. init: function() {
  192. swiperAnimateCache(this); //隐藏动画元素
  193. swiperAnimate(this); //初始化完成开始动画
  194. },
  195. transitionEnd: function() {
  196. swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
  197. },
  198. }
  199. })
  200. // 跳轉
  201. $(".nav_middle").click(function(){
  202. window.open('index.html','_self')
  203. })
  204. $("#department").click(function(){
  205. window.open('receiptDepartment.html','_self')
  206. })
  207. $("#sourceChannel").click(function(){
  208. window.open('sourceChannel.html','_self')
  209. })
  210. $("#call").click(function(){
  211. window.open('TelephoneDetails.html','_self')
  212. })
  213. $("#complaint").click(function(){
  214. window.open('complaintsReport.html','_self')
  215. })
  216. // 選項卡
  217.  $(".smallimg").click(function ()
  218.   {
  219.     //获取点击的元素给其添加样式,讲其兄弟元素的样式移除
  220.     $(this).addClass("activeBox").siblings().removeClass("activeBox");
  221.     //获取选中元素的下标
  222.     var index = $(this).index();
  223.     $(".slideCon_bg").eq(index).addClass("slideCon_bg_block")
  224.     .siblings().removeClass("slideCon_bg_block");
  225.   });
  226. Ajax();
  227. deprtment();// 第五屏部门下拉
  228. laydate.render({
  229. elem: '#time1',
  230. range: '~',
  231. format: 'yyyy-MM-dd',
  232. theme: '#114a97',
  233. done: function(value, date) {
  234. oneScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1])
  235. }
  236. });
  237. laydate.render({
  238. elem: '#time2',
  239. range: '~',
  240. format: 'yyyy-MM-dd',
  241. theme: '#114a97',
  242. done: function(value, date) {
  243. twoScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaTwo").val())
  244. satisfaction(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaTwo").val())
  245. }
  246. });
  247. laydate.render({
  248. elem: '#time3',
  249. format: 'yyyy-MM-dd',
  250. theme: '#114a97',
  251. done: function(value) {
  252. threeScreen(value,$(".areaThree").val())
  253. }
  254. });
  255. laydate.render({
  256. elem: '#test6',
  257. range: '~',
  258. format: 'yyyy-MM-dd',
  259. theme: '#114a97',
  260. done: function(value, date) {
  261. fiveScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaFive").val())
  262. }
  263. });
  264. })
  265. var cityObj = {
  266. ele1: "sqs_count",
  267. ele2: "syq_count",
  268. ele3: "lyq_count",
  269. ele4: "ycs_count",
  270. ele5: "mqx_count",
  271. ele6: "sx_count",
  272. ele7: "nlx_count",
  273. ele8: "zcx_count",
  274. ele9: "ycx_count",
  275. ele10: "xyx_count",
  276. ele11: "cxyt_count",
  277. ele12: "lhpz_count",
  278. ele13: "saz_count",
  279. ele14: "djbl_count"
  280. }
  281. var vars = {};
  282. getCountUp(cityObj)
  283. function getCountUp(obj1) {
  284. var options = {  
  285. useEasing: true,
  286.   useGrouping: true,
  287.   separator: ',',
  288.   decimal: '.',
  289. };
  290. $.each(obj1, function(k, v) {
  291. new CountUp(v, 0, 0, 0, 2, options).start()
  292. vars[v] = new CountUp(v, 0, 0, 0, 2, options)
  293. })
  294. }
  295. var myDate = new Date();
  296. function turn(aa) {
  297. if(aa < 10) {
  298. aa = "0" + aa;
  299. }
  300. return aa
  301. }
  302. // 第三屏 第四屏 发光外框 定时
  303. (function() {
  304. var i = 0;
  305. var length = $(".orderState_ul >li").length;
  306. var j = 0;
  307. var length_1 = $(".orderTtype_Con li").length;
  308. setInterval(function() {
  309. if(i == length) {
  310. i = 0;
  311. $(".orderState_ul >li").removeClass('active');
  312. }
  313. $(".orderState_ul >li").eq(i).addClass('active').siblings().removeClass('active');
  314. if(i == 5) {
  315. $(".orderState_ul >li").eq(4).removeClass('active');
  316. }
  317. i++;
  318. if(j == length_1) {
  319. j = 0;
  320. }
  321. $(".orderTtype_Con li").eq(j).addClass('active').siblings().removeClass('active');
  322. j++;
  323. }, 2000);
  324. })();
  325. //对数组进行排序
  326. function compare(property) {
  327. return (firstobj, secondobj) => {
  328. const firstValue = firstobj[property];
  329. const secondValue = secondobj[property];
  330. return secondValue - firstValue; //降序
  331. };
  332. }
  333. //第一屏幕 开始
  334. function oneScreen(sd,ed) {
  335. $.ajax({
  336. type: "get",
  337. url: huayi.config.callcenter_url + "/info/GetAreaCountByDateNew",
  338. async: true,
  339. dataType: 'json',
  340. data: {
  341. start: sd,
  342. end: ed,
  343. },
  344. success: function(data) {
  345. if(data.state.toLowerCase() == 'success') {
  346. var con = data.data;
  347. newData = con.sort(compare("SLCount"));
  348. console.log(1)
  349. $(newData).each(function(i, n) {
  350. if(n.AreaName=='安阳市'){
  351. n.AreaName="市区"
  352. }
  353. // if(n.AreaName.indexOf('安阳市') != -1) {
  354. // $(".AY_num").html(n.SLCount)
  355. // }
  356. // if(n.AreaName.indexOf('文峰区') != -1) {
  357. // $(".WFQ_num").html(n.SLCount)
  358. // }
  359. // if(n.AreaName.indexOf('北关区') != -1) {
  360. // $(".BGQ_num").html(n.SLCount)
  361. // }
  362. // if(n.AreaName.indexOf('殷都区') != -1) {
  363. // $(".YDQ_num").html(n.SLCount)
  364. // }
  365. // if(n.AreaName.indexOf('龙安区') != -1) {
  366. // $(".LAQ_num").html(n.SLCount)
  367. // }
  368. // if(n.AreaName.indexOf('安阳县') != -1) {
  369. // $(".AYX_num").html(n.SLCount)
  370. // }
  371. // if(n.AreaName.indexOf('汤阴县') != -1) {
  372. // $(".TYX_num").text(n.SLCount)
  373. // }
  374. // if(n.AreaName.indexOf('内黄县') != -1) {
  375. // $(".NHX_num").html(n.SLCount)
  376. // }
  377. // if(n.AreaName.indexOf('滑县') != -1) {
  378. // $(".HX_num").html(n.SLCount)
  379. // }
  380. // if(n.AreaName.indexOf('林州市') != -1) {
  381. // $(".LZS_num").html(n.SLCount)
  382. // }
  383. if(floag==true){
  384. $("#det_ult").html('')
  385. $(newData).each(function(i, n) {
  386. if(i<10){
  387. var str=' <li class="orderli"><img src="img/num_icon.png" alt="" /><p class="num_word"><span>'+n.AreaName+'</span><span class="AY_num">'+n.SLCount+'</span></p></li>';
  388. var a=$(str)
  389. a.appendTo($("#det_ult"))
  390. }
  391. })
  392. floag=false
  393. }
  394. if(n.AreaName.indexOf('总计') != -1) {
  395. $(".allSLCount").html(n.SLCount); //受理量
  396. $(".allJACount").html(n.JACount); //结案量
  397. //$(".allJARate").html(n.JARate); //结案量
  398. $(".allJARate").html("93%"); //结案量
  399. $(".allMYRate").html('94.09%'); //满意度
  400. }
  401. })
  402. }
  403. }
  404. });
  405. }
  406. function aa(){
  407. }
  408. //第二屏
  409. function twoScreen(start, end, areaTwoVal) {
  410. // if(!areaTwoVal) {
  411. // areaTwoVal = "sqs12345"
  412. // }
  413. $.ajax({
  414. type: "get",
  415. url: huayi.config.callcenter_url + "info/GetSourceByDateNew",
  416. async: true,
  417. dataType: 'json',
  418. data: {
  419. start: start,
  420. end: end,
  421. branchcode: areaTwoVal
  422. },
  423. success: function(data) {
  424. if(data.state.toLowerCase() == 'success') {
  425. //layer.close(index);
  426. $('.orderSource ul li .rectangle').remove();
  427. var con = data.data;
  428. var obj=con[0];
  429. var con_list=[];
  430. con_list=con.shift();
  431. con.splice(3,0,obj);
  432. var Percent;
  433. $(con).each(function(i, n) {
  434. // if(n.Source.indexOf('信箱') != -1) {
  435. // n.Source = '市长信箱'
  436. // }
  437. // if(n.Source.indexOf('APP') != -1) {
  438. // n.Source = 'APP'
  439. // }
  440. // if(n.Source.indexOf('政务') != -1) {
  441. // n.Source = '政务网'
  442. // }
  443. var str = '<div class="source_kuang rectangle">' +
  444. '<div class="pbout">' +
  445. '<div class="percent_box">' +
  446. '<div class="percent_out"></div> ' +
  447. ' <div class="percent_in"></div>' +
  448. ' <div class="percent_word"><p>' + n.Rate.split('%')[0] + '%' +'</p><p style="margin-top: 30px;">占总量</p>' +
  449. '</div>' +
  450. '</div>' +
  451. '</div>' +
  452. '<p class="num_word nw">' +
  453. '<span>' + n.Source + '</span><span>' + n.Count + '</span>' +
  454. '</p>' +
  455. '</div>'
  456. $('.orderSource ul li').eq(i).prepend(str)
  457. })
  458. }
  459. }
  460. });
  461. }
  462. //第三屏
  463. function threeScreen(sd,areaTwoVal) {
  464. //alert(sd)
  465. $.ajax({
  466. type: "get",
  467. url: huayi.config.callcenter_url + "Info/GetTypeCountNew",
  468. async: true,
  469. dataType: 'json',
  470. data: {
  471. date: sd,
  472. branchcode: areaTwoVal
  473. },
  474. success: function(data) {
  475. if(data.state.toLowerCase() == 'success') {
  476. $('.orderTtype_Con ul').html('');
  477. // layer.close(index);
  478. var newDatas =data.data ;
  479. var con =newDatas.sort(compare("TotalCount"))
  480. var img_name = '';
  481. $(con).each(function(i, n) {
  482. if(n.TypeName.indexOf('咨询') != -1) {
  483. img_name = 'order_ZX.png'
  484. }
  485. if(n.TypeName.indexOf('求助') != -1) {
  486. img_name = 'order_QZ.png'
  487. }
  488. if(n.TypeName.indexOf('投诉') != -1) {
  489. img_name = 'order_TS.png'
  490. }
  491. if(n.TypeName.indexOf('建议') != -1) {
  492. img_name = 'order_JY.png'
  493. }
  494. if(n.TypeName.indexOf('表扬') != -1) {
  495. img_name = 'order_BY.png'
  496. }
  497. if(n.TypeName.indexOf('其他') != -1) {
  498. img_name = 'order_QT.png'
  499. }
  500. $('<li>' +
  501. '<div class="typeWord">' + n.TypeName + '</div>' +
  502. '<img src="img/' + img_name + '" alt="" />' +
  503. '<p class="typeWord_line">数据展示</p>' +
  504. '<p class="order_count">' + n.DayCount + '</p>' +
  505. '<p class="typeWord_line">今日' + n.TypeName + '量</p>' +
  506. '<p class="order_count">' + n.MonthCount + '</p>' +
  507. '<p class="typeWord_line">本月' + n.TypeName + '量</p>' +
  508. '<p class="order_count">' + n.TotalCount + '</p>' +
  509. '<p class="typeWord_line">' + n.TypeName + '总量</p>' +
  510. '<div class="persent_box">' +
  511. '<div class="persent_kuang">' + n.Percent + '</div>' +
  512. '</div>' +
  513. '<p class="persent_word">总量占比</p>' +
  514. '</li>').appendTo('.orderTtype_Con ul');
  515. })
  516. }
  517. }
  518. });
  519. }
  520. //第五屏js
  521. function fiveScreen(sd,ed,areaTwoVal) {
  522. // if(!sd){
  523. // sd="2019-11-01"
  524. // }if(!ed){
  525. // ed="2019-11-30"
  526. // }
  527. keyWord(sd, ed,areaTwoVal);
  528. }
  529. $(".depart").change(function() {
  530. keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],$(".areaFive").val());
  531. })
  532. // 第二屏
  533. $(".areaTwo").change(function() {
  534. var areaTwoVal=$(this).val();
  535. twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],areaTwoVal);
  536. satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],areaTwoVal)
  537. });
  538. //第三屏
  539. $(".areaThree").change(function() {
  540. var areaTwoVal=$(this).val();
  541. threeScreen($('#time3').val(),areaTwoVal);
  542. });
  543. //第五屏
  544. $(".areaFive").change(function() {
  545. var areaTwoVal=$(this).val();
  546. fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],areaTwoVal);
  547. deprtment ()
  548. });
  549. //部门下拉框
  550. function deprtment () {
  551. $.getJSON( huayi.config.callcenter_url +"info/GetDeptList",
  552. {
  553. branchcode: $(".areaFive").val()
  554. },
  555. function(result) {
  556. if(result.state.toLowerCase() == "success") {
  557. goodslist = result.data;
  558. $(".depart").empty();
  559. $('<option value="">请选择部门</option>').appendTo($(".depart"));
  560. $(goodslist).each(function(i, n) {
  561. $('<option value="' + n.F_DeptId
  562. + '">' + n.F_DeptName
  563. + '</option>').appendTo($(".depart"));
  564. })
  565. }
  566. });
  567. }
  568. //区县筛选
  569. //areaSelect ();
  570. function areaSelect () {
  571. $.getJSON( huayi.config.callcenter_url +"CountyBranch/GetBranchListS", function(result) {
  572. if(result.state.toLowerCase() == "success") {
  573. goodslist = result.data;
  574. // 第五屏
  575. $(".areaFive").empty();
  576. $(goodslist).each(function(i, n) {
  577. $('<option value="' + n.F_Code
  578. + '">' + n.F_Name
  579. + '</option>').appendTo($(".areaFive"));
  580. });
  581. //第3屏
  582. $(".areaThree").empty();
  583. $(goodslist).each(function(i, n) {
  584. $('<option value="' + n.F_Code
  585. + '">' + n.F_Name
  586. + '</option>').appendTo($(".areaThree"));
  587. });
  588. //第2屏
  589. $(".areaTwo").empty();
  590. $(goodslist).each(function(i, n) {
  591. $('<option value="' + n.F_Code
  592. + '">' + n.F_Name
  593. + '</option>').appendTo($(".areaTwo"));
  594. });
  595. }
  596. });
  597. }
  598. // 左侧关键词
  599. function keyWord(sd, ed,areaTwoVal) {
  600. $.ajax({
  601. type: "get",
  602. url: huayi.config.callcenter_url + "info/GetKeyCountRankByDate",
  603. async: true,
  604. dataType: 'json',
  605. data: {
  606. start: sd,
  607. end: ed,
  608. branchcode: areaTwoVal
  609. },
  610. success: function(data) {
  611. if(data.state.toLowerCase() == 'success') {
  612. var con = data.data.reverse();
  613. if (con.length>0) {
  614. // $(".keyW_t").text(con[0].TypeName)
  615. $('.tagcloud').html('');
  616. $(con).each(function(k, j) {
  617. if(k < 19) {
  618. var strs = '<div index="'+j.Id+'" class="tagcloud_bj">' +
  619. '<p class="tag_title">' + j.TypeName + '</p>' +
  620. '<p class="imgs">' + j.Count + '</p>' +
  621. '</div>'
  622. $('.tagcloud').append(strs);
  623. }
  624. })
  625. $(".tagcloud div:first-child").removeClass("tagcloud_bj");
  626. $(".tagcloud div:first-child").addClass("tagcloud_bjShine");
  627. keyWordDetail(sd, ed,areaTwoVal);
  628. }else{
  629. $('.tagcloud').html('');
  630. }
  631. }
  632. }
  633. });
  634. }
  635. // 右侧部门
  636. function keyWordDetail(sd, ed,areaTwoVal) {
  637. $.ajax({
  638. type: "get",
  639. url: huayi.config.callcenter_url + "info/GetDeptKeyCountByDateNew",
  640. async: true,
  641. dataType: 'json',
  642. data: {
  643. start: sd,
  644. end: ed,
  645. branchcode: areaTwoVal,
  646. deptid: $('.depart').val(),
  647. keyid: $(".tagcloud_bjShine").eq(0).attr("index")
  648. },
  649. success: function(data) {
  650. if(data.state.toLowerCase() == 'success') {
  651. $('.scroll_table tbody').html('');
  652. var con = data.data;
  653. $(con).each(function (j, n) {
  654. var rate = '';
  655. if (n.rate) { rate = n.rate;}
  656. var str = '<tr><td>' + n.deptname + '</td><td>' + n.acceptcount + '</td><td>' + rate + '</td></tr>'
  657. $('.scroll_table tbody').append(str);
  658. })
  659. $(".scroll_table").Scroll({
  660. line: 1,
  661. speed: 500,
  662. timer: 2000
  663. });
  664. }
  665. }
  666. });
  667. }
  668. $(".tagcloud").on("click","div",function(){
  669. $(".tagcloud div").addClass("tagcloud_bj");
  670. $(".tagcloud div").removeClass("tagcloud_bjShine");
  671. $(this).removeClass("tagcloud_bj");
  672. $(this).addClass("tagcloud_bjShine");
  673. keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],$(".areaFive").val());
  674. });
  675. function Ajax() {
  676. oneScreen($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1])
  677. twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1])
  678. satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1])
  679. threeScreen($('#time3').val(),$(".areaThree").val());
  680. fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],$(".areaFive").val())
  681. //第五 屏 渠道来源
  682. var areaOneVal = helper.cookies.get("areaOneVal");
  683. var areaOneText = helper.cookies.get("areaOneText");
  684. partThree($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[1],areaOneVal)
  685. // 接单 部门
  686. partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1],areaOneVal);
  687. // 话务数量
  688. parthuawu($('#time3').val(),areaOneVal);
  689. // 投诉举报
  690. partcomplain($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[1],areaOneVal)
  691. }
  692. function loginTimeLimit(){
  693. $.ajax({
  694. type:"get",
  695. url: huayi.config.callcenter_url + "Login/GetAuAuthDate",
  696. async:false,
  697. success:function(res){
  698. var res=$.parseJSON(res)
  699. if(res.state== "success") {
  700. } else {
  701. layer.confirm(res.message, {
  702. icon: 2,
  703. btn: ['确定'],
  704. yes: function(index, layero) {
  705. $("#wrap").hide()
  706. $(".timeLimit-wrapper").show()
  707. $(".nav_middle ul a").attr('href', '#')
  708. layer.close(index)
  709. },
  710. });
  711. }
  712. }
  713. });
  714. }
  715. // 渠道来源
  716. var part3 = echarts.init(document.getElementById('part3'));
  717. part3.setOption({
  718. color: ['#6ce7ac', '#6a91e0', '#ceba5f', '#cb5f79', '#ae765a', '#569d4e', '#7d55ba', '#ce5aba', '#355cdd', '#44c1c6', '#ceba5e', '#c64444'],
  719. title: {
  720. text: '各班组占比',
  721. x: 'center',
  722. y: '45%',
  723. textStyle: {
  724. fontWeight: 'normal',
  725. fontSize: 16,
  726. color: '#fff'
  727. }
  728. },
  729. tooltip: {
  730. trigger: 'item',
  731. formatter: "{a} <br/>{b} : {c} ({d}%)",
  732. axisPointer: {
  733. crossStyle: {
  734. color: '#fff'
  735. }
  736. }
  737. },
  738. legend: {
  739. // orient: 'vertical',
  740. bottom: 'bottom',
  741. data: ['安阳县','北关区','林州市','龙安区','内黄县','市区','汤阴县','安阳县','文峰区','殷都区','滑县'],
  742. textStyle: {
  743. color: '#fff'
  744. }
  745. },
  746. series: [{
  747. name: '数据',
  748. type: 'pie',
  749. radius: ['30%', '60%'],
  750. center: ['50%', '50%'],
  751. data: [],
  752. itemStyle: {
  753. emphasis: {
  754. shadowBlur: 10,
  755. shadowOffsetX: 0,
  756. shadowColor: 'rgba(0, 0, 0, 0.5)'
  757. },
  758. normal: {
  759. label: {
  760. show: true,
  761. // formatter: '{b} : {c} ({d}%)'
  762. formatter: '{d}%'
  763. },
  764. labelLine: {
  765. show: true
  766. }
  767. }
  768. },
  769. label: {
  770. normal: {
  771. textStyle: {
  772. color: '#fff'
  773. }
  774. }
  775. }
  776. }]
  777. });
  778. function partThree(start, end,areaOneVal) {
  779. // var index = layer.load(1, {
  780. // shade: [0.5, '#030303'] //0.1透明度的白色背景
  781. // });
  782. $.ajax({
  783. type: "get",
  784. url: huayi.config.callcenter_url + "info/GetAreaCountByDate",
  785. async: true,
  786. dataType: 'json',
  787. data: {
  788. start: start,
  789. end: end,
  790. branchcode:areaOneVal
  791. },
  792. success: function(data) {
  793. if(data.state.toLowerCase() == 'success') {
  794. // layer.close(index);
  795. $('.complaint_typeL').html('');
  796. $('.complaint_typeR').html('');
  797. var con = data.data;
  798. var part_1_legend = [];
  799. var part_1_ser = [];
  800. $(con).each(function(i, n) {
  801. part_1_legend.push(n.AreaName)
  802. var part_1_obj = {};
  803. part_1_obj.value = n.Count;
  804. part_1_obj.name = n.AreaName;
  805. part_1_ser.push(part_1_obj)
  806. if(n.AreaName.indexOf('城乡一体') != -1) {
  807. n.AreaName = "城乡示范"
  808. }
  809. var str = '<li>' +
  810. '<span class="type_name">' + n.AreaName + '</span> <span class="type_count">' + n.Count + '</span>' +
  811. '</li>'
  812. if(i <= 5) {
  813. $(str).appendTo('.complaint_typeL');
  814. } else if(i <= 11&&i >5){
  815. $(str).appendTo('.complaint_typeR');
  816. }
  817. })
  818. part3.setOption({
  819. // legend: {
  820. // selected: {
  821. // '当即办理': false
  822. // }
  823. // },
  824. series: [{
  825. data: part_1_ser
  826. }]
  827. })
  828. }
  829. }
  830. });
  831. }
  832. // 接单部门
  833. //表格滚动
  834. var area = document.getElementById('scroll_table');
  835. var iliHeight = 34; //单行滚动的高度
  836. var speed = 20; //滚动的速度
  837. var time;
  838. var delay = 1000;
  839. area.scrollTop = 0;
  840. area.innerHTML += area.innerHTML; //克隆一份一样的内容
  841. function startScroll() {
  842. time = setInterval("scrollUp()", speed);
  843. area.scrollTop++;
  844. console.log(area.scrollTop);
  845. }
  846. function scrollUp() {
  847. if(area.scrollTop % iliHeight == 0) {
  848. clearInterval(time);
  849. setTimeout(startScroll, delay);
  850. } else {
  851. area.scrollTop++;
  852. if(area.scrollTop >= area.scrollHeight / 2) {
  853. area.scrollTop = 0;
  854. }
  855. }
  856. }
  857. setTimeout(startScroll, delay)
  858. function partTwo(starts, ends, areaOneVal) {
  859. $.ajax({
  860. type: "get",
  861. url: huayi.config.callcenter_url + "Info/GetDeptCountByDateNew",
  862. dataType: 'json',
  863. async: true,
  864. data: {
  865. start: starts,
  866. end: ends,
  867. deptid: $('.depart').val(),
  868. branchcode:areaOneVal
  869. },
  870. success: function(data) {
  871. if(data.state.toLowerCase() == 'success') {
  872. $('.thead_six tr').html('');
  873. $('#scroll_table tbody').html('');
  874. var con = data.data;
  875. var thead_six = con[0];
  876. console.log(thead_six)
  877. $.each(thead_six, function(k, val) {
  878. $('<td style="width:55px">' + k + '</td>').appendTo('.thead_six tr');
  879. })
  880. $(con).each(function(j, n) {
  881. var str = '<tr>'
  882. $.each(thead_six, function(j, m) {
  883. $.each(n, function(k, val) {
  884. if(j == k) {
  885. if(val == '') {
  886. val = 0;
  887. }
  888. str += '<td style="width:53px">' + val + '</td>'
  889. }
  890. })
  891. })
  892. str += '</tr>';
  893. $('#scroll_table tbody').append(str);
  894. })
  895. }
  896. }
  897. });
  898. }
  899. // 话务数量
  900. //part3
  901. var todyPhoneCount = echarts.init(document.getElementById('todyPhoneCount'));
  902. todyPhoneCount.setOption({
  903. tooltip: {
  904. trigger: 'axis',
  905. axisPointer: {
  906. type: false,
  907. label: {
  908. show: true,
  909. backgroundColor: '#030917'
  910. }
  911. },
  912. },
  913. xAxis: {
  914. name: '类型',
  915. data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)","排队人数"],
  916. axisLine: {
  917. lineStyle: {
  918. color: '#3061a2'
  919. }
  920. },
  921. axisTick: {
  922. alignWithLabel: true,
  923. show: false
  924. },
  925. axisLabel: { //横轴字体颜色
  926. show: true,
  927. textStyle: {
  928. color: '#ffffff'
  929. }
  930. }
  931. },
  932. yAxis: {
  933. name: '数量',
  934. splitLine: {
  935. show: false
  936. },
  937. axisLine: {
  938. lineStyle: {
  939. color: '#3061a2'
  940. }
  941. },
  942. axisLabel: { //横轴字体颜色
  943. show: true,
  944. textStyle: {
  945. color: '#eff0f4'
  946. }
  947. }
  948. },
  949. series: [{
  950. name: '数量',
  951. type: 'bar',
  952. barWidth: 18,
  953. itemStyle: {
  954. normal: {
  955. color: function(params) {
  956. // build a color map as your need.
  957. var colorList = [
  958. '#368cab', '#54b793', '#4b6ab0', '#2531a9','#a93d19'
  959. ];
  960. return colorList[params.dataIndex]
  961. }
  962. }
  963. },
  964. label: {
  965. normal: {
  966. show: true,
  967. position: 'top', //顶部数据显示位置
  968. textStyle: {
  969. color: '#fff' //顶部数据颜色
  970. },
  971. formatter: '{c}' // 这里是数据展示的时候显示的数据
  972. }
  973. },
  974. data: []
  975. }]
  976. });
  977. function parthuawu(dates,areaOneVal) {
  978. $.ajax({
  979. type: "get",
  980. url: huayi.config.callcenter_url + "info/GetTelCountByDate",
  981. async: true,
  982. dataType: "json",
  983. data: {
  984. date: dates,
  985. branchcode:areaOneVal
  986. },
  987. success: function(data) {
  988. if(data.state.toLowerCase() == "success") {
  989. var con = data.data;
  990. con.person=person
  991. todyPhoneCount.setOption({
  992. series: [{
  993. data: [con.hwcon, con.lhcon, con.jtcon, con.pjthtimes,con.person]
  994. }]
  995. })
  996. }
  997. }
  998. });
  999. }
  1000. // 投诉举报
  1001. var partcom = echarts.init(document.getElementById('partcom'));
  1002. partcom.setOption({
  1003. color: ['#6ce7ac', '#6a91e0', '#ceba5f', '#cb5f79', '#ae765a', '#569d4e'],
  1004. title: {
  1005. text: '各类型占比',
  1006. x: '28%',
  1007. y: '45%',
  1008. textStyle: {
  1009. fontWeight: 'normal',
  1010. fontSize: 16,
  1011. color: '#fff'
  1012. }
  1013. },
  1014. tooltip: {
  1015. trigger: 'item',
  1016. formatter: "{a} <br/>{b} : {c} ({d}%)",
  1017. axisPointer: {
  1018. crossStyle: {
  1019. color: '#fff'
  1020. }
  1021. }
  1022. },
  1023. legend: {
  1024. // orient: 'vertical',
  1025. bottom: 'bottom',
  1026. data: ['表扬','建议','投诉','举报','其他','求助','咨询'],
  1027. textStyle: {
  1028. color: '#fff'
  1029. }
  1030. },
  1031. series: [{
  1032. name: '数据',
  1033. type: 'pie',
  1034. radius: ['30%', '60%'],
  1035. center: ['40%', '50%'],
  1036. data: [],
  1037. itemStyle: {
  1038. emphasis: {
  1039. shadowBlur: 10,
  1040. shadowOffsetX: 0,
  1041. shadowColor: 'rgba(0, 0, 0, 0.5)'
  1042. },
  1043. normal: {
  1044. label: {
  1045. show: true,
  1046. // formatter: '{b} : {c} ({d}%)'
  1047. formatter: '{d}%'
  1048. },
  1049. labelLine: {
  1050. show: true
  1051. }
  1052. }
  1053. },
  1054. label: {
  1055. normal: {
  1056. textStyle: {
  1057. color: '#fff'
  1058. }
  1059. }
  1060. }
  1061. }]
  1062. });
  1063. function partcomplain(start, end,areaOneVal) {
  1064. // var index = layer.load(1, {
  1065. // shade: [0.5, '#030303'] //0.1透明度的白色背景
  1066. // });
  1067. $.ajax({
  1068. type: "get",
  1069. url: huayi.config.callcenter_url + "info/GetTypeCountByDate",
  1070. async: true,
  1071. dataType: 'json',
  1072. data: {
  1073. start: start,
  1074. end: end,
  1075. branchcode:areaOneVal
  1076. },
  1077. success: function(data) {
  1078. if(data.state.toLowerCase() == 'success') {
  1079. // layer.close(index);
  1080. $('.complaint_type').html('');
  1081. var con = data.data;
  1082. var part_1_legend = [];
  1083. var part_1_ser = [];
  1084. $(con).each(function(i, n) {
  1085. part_1_legend.push(n.TypeName)
  1086. var part_1_obj = {};
  1087. part_1_obj.value = n.Count;
  1088. part_1_obj.name = n.TypeName;
  1089. part_1_ser.push(part_1_obj)
  1090. $('<li>' +
  1091. '<span class="type_name">' + n.TypeName + '</span> <span class="type_count">' + n.Count + '</span>' +
  1092. '</li>').appendTo('.complaint_type')
  1093. })
  1094. partcom.setOption({
  1095. // legend: {
  1096. // data: part_1_legend
  1097. // },
  1098. series: [{
  1099. data: part_1_ser
  1100. }]
  1101. })
  1102. }
  1103. }
  1104. });
  1105. }