商丘12345 前端

zhongxin.js 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. $(document).ready(function(){
  2. laydate.render({
  3. elem: '#time0',
  4. theme: '#00a1cb'
  5. });
  6. laydate.render({
  7. elem: '#time1',
  8. theme: '#00a1cb'
  9. });
  10. laydate.render({
  11. elem: '#time2',
  12. theme: '#00a1cb'
  13. });
  14. laydate.render({
  15. elem: '#time3',
  16. theme: '#00a1cb'
  17. });
  18. laydate.render({
  19. elem: '#time4',
  20. theme: '#00a1cb'
  21. });
  22. laydate.render({
  23. elem: '#time5',
  24. theme: '#00a1cb'
  25. });
  26. //part1
  27. function partOne(){
  28. $('.gdmap-l ul').html('');
  29. var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  30. });
  31. $.ajax({
  32. type:"get",
  33. url:huayi.config.callcenter_url + "info/GetCenterTypeCountByDate ",
  34. async:true,
  35. dataType:'json',
  36. success:function(data){
  37. if(data.state.toLowerCase()=='success'){
  38. layer.close(index);
  39. var con=data.data;
  40. $(con).each(function(i,n){
  41. if(n.TypeName.indexOf('总计')!=-1){
  42. $('#total').html(n.Count);
  43. }if(n.TypeName.indexOf('受理')!=-1){
  44. $('#today').html(n.Count);
  45. }if(n.TypeName.indexOf('交办')!=-1){
  46. $('#jiaoBan').html(n.Count);
  47. }
  48. if(!(n.TypeName.indexOf('总计')!=-1||n.TypeName.indexOf('今日')!=-1)){
  49. $('<li>'+
  50. '<div>'+n.TypeName +':<span>'+n.Count +'</span></div>'+
  51. // '<span>'+n.Count +'</span>'+
  52. '</li>').appendTo('.gdmap-l ul');
  53. }
  54. })
  55. }
  56. }
  57. });
  58. }
  59. function partOne_right(){
  60. $('.gdmap-r ul').html('');
  61. var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  62. });
  63. $.ajax({
  64. type:"get",
  65. url:huayi.config.callcenter_url + "info/GetAreaCountByDate",
  66. async:true,
  67. dataType:'json',
  68. data:{
  69. start:$('#time0').val(),
  70. end:$('#time1').val(),
  71. },
  72. success:function(data){
  73. if(data.state.toLowerCase()=='success'){
  74. layer.close(index);
  75. var con=data.data;
  76. var color=["z","l","a","t","y","g","w","b","1","2","3"];
  77. var dindex=Math.floor(Math.random()*10+1);
  78. $(con).each(function(i,n){
  79. var html="";
  80. var dindex=Math.floor(Math.random()*10+1);
  81. if(n.AreaName.indexOf('商丘')!=-1){
  82. html = '<li>' +
  83. '<i class="xe-'+ color[dindex] +'"></i>'+
  84. // '<span>'+n.AreaName+'</span>'+
  85. '<span>市直单位:</span>'+
  86. '<span>'+ n.Count+'</span>'+
  87. '<div class="tool_count"><div class="tooltips clearfix">'+
  88. '<div class="toolsTitle">市直单位:'+ n.Count +'</div>'
  89. $(n.Item).each(function(i, n) {
  90. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  91. })
  92. html += '</div>' +
  93. '</div>' +
  94. '</li>';
  95. $('.gdmap-r ul').append(html)
  96. }if(n.AreaName.indexOf('虞城')!=-1){
  97. html = '<li>' +
  98. '<i class="yuc"></i>'+
  99. '<span>'+n.AreaName+':</span>'+
  100. '<span>'+ n.Count+'</span>'+
  101. '<div class="tool_count"><div class="tooltips clearfix">'+
  102. '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  103. $(n.Item).each(function(i, n) {
  104. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  105. })
  106. html += '</div>' +
  107. '</div>' +
  108. '</li>';
  109. $('.gdmap-r ul').append(html)
  110. }if(n.AreaName.indexOf('民权')!=-1){
  111. html = '<li>' +
  112. '<i class="mq"></i>'+
  113. '<span>'+n.AreaName+':</span>'+
  114. '<span>'+ n.Count+'</span>'+
  115. '<div class="tool_count"><div class="tooltips clearfix">'+
  116. '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  117. $(n.Item).each(function(i, n) {
  118. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  119. })
  120. html += '</div>' +
  121. '</div>' +
  122. '</li>';
  123. $('.gdmap-r ul').append(html)
  124. }if(n.AreaName.indexOf('睢县')!=-1){
  125. html = '<li>' +
  126. '<i class="sx"></i>'+
  127. '<span>'+n.AreaName+':</span>'+
  128. '<span>'+ n.Count+'</span>'+
  129. '<div class="tool_count"><div class="tooltips clearfix">'+
  130. '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  131. $(n.Item).each(function(i, n) {
  132. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  133. })
  134. html += '</div>' +
  135. '</div>' +
  136. '</li>';
  137. $('.gdmap-r ul').append(html)
  138. }if(n.AreaName.indexOf('宁陵')!=-1){
  139. html = '<li>' +
  140. '<i class="nl"></i>'+
  141. '<span>'+n.AreaName+':</span>'+
  142. '<span>'+ n.Count+'</span>'+
  143. '<div class="tool_count"><div class="tooltips clearfix">'+
  144. '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  145. $(n.Item).each(function(i, n) {
  146. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  147. })
  148. html += '</div>' +
  149. '</div>' +
  150. '</li>';
  151. $('.gdmap-r ul').append(html)
  152. }if(n.AreaName.indexOf('梁园')!=-1){
  153. html = '<li>' +
  154. '<i class="lyq"></i>'+
  155. '<span>'+n.AreaName+':</span>'+
  156. '<span>'+ n.Count+'</span>'+
  157. '<div class="tool_count"><div class="tooltips clearfix">'+
  158. '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  159. $(n.Item).each(function(i, n) {
  160. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  161. })
  162. html += '</div>' +
  163. '</div>' +
  164. '</li>';
  165. $('.gdmap-r ul').append(html)
  166. }if(n.AreaName.indexOf('睢阳')!=-1){
  167. html = '<li>' +
  168. '<i class="syq"></i>'+
  169. '<span>'+n.AreaName+':</span>'+
  170. '<span>'+ n.Count+'</span>'+
  171. '<div class="tool_count"><div class="tooltips clearfix">'+
  172. '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  173. $(n.Item).each(function(i, n) {
  174. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  175. })
  176. html += '</div>' +
  177. '</div>' +
  178. '</li>';
  179. $('.gdmap-r ul').append(html)
  180. }if(n.AreaName.indexOf('柘城')!=-1){
  181. html = '<li>' +
  182. '<i class="zc"></i>'+
  183. '<span>'+n.AreaName+':</span>'+
  184. '<span>'+ n.Count+'</span>'+
  185. '<div class="tool_count"><div class="tooltips clearfix">'+
  186. '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  187. $(n.Item).each(function(i, n) {
  188. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  189. })
  190. html += '</div>' +
  191. '</div>' +
  192. '</li>';
  193. $('.gdmap-r ul').append(html)
  194. }if(n.AreaName.indexOf('夏邑')!=-1){
  195. html = '<li>' +
  196. '<i class="xy"></i>'+
  197. '<span>'+n.AreaName+':</span>'+
  198. '<span>'+ n.Count+'</span>'+
  199. '<div class="tool_count"><div class="tooltips clearfix">'+
  200. '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  201. $(n.Item).each(function(i, n) {
  202. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  203. })
  204. html += '</div>' +
  205. '</div>' +
  206. '</li>';
  207. $('.gdmap-r ul').append(html)
  208. }if(n.AreaName.indexOf('永城')!=-1){
  209. html = '<li>' +
  210. '<i class="yongc"></i>'+
  211. '<span>'+n.AreaName+':</span>'+
  212. '<span>'+ n.Count+'</span>'+
  213. '<div class="tool_count"><div class="tooltips clearfix">'+
  214. '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  215. $(n.Item).each(function(i, n) {
  216. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  217. })
  218. html += '</div>' +
  219. '</div>' +
  220. '</li>';
  221. $('.gdmap-r ul').append(html)
  222. }if(n.AreaName.indexOf('城乡一体化')!=-1){
  223. html = '<li>' +
  224. '<i class="xe-'+ color[dindex] +'"></i>'+
  225. '<span>'+n.AreaName+':</span>'+
  226. '<span>'+ n.Count+'</span>'+
  227. '<div class="tool_count"><div class="tooltips clearfix">'+
  228. '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  229. $(n.Item).each(function(i, n) {
  230. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  231. })
  232. html += '</div>' +
  233. '</div>' +
  234. '</li>';
  235. $('.gdmap-r ul').append(html)
  236. }
  237. // if(n.AreaName.indexOf('当即')!=-1){
  238. //
  239. // html = '<li>' +
  240. // '<i class="xe-'+ color[dindex] +'"></i>'+
  241. // '<span>'+n.AreaName+':</span>'+
  242. // '<span>'+ n.Count+'</span>'+
  243. // '<div class="tool_count"><div class="tooltips clearfix">'+
  244. // '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  245. // $(n.Item).each(function(i, n) {
  246. // html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  247. // })
  248. // html += '</div>' +
  249. // '</div>' +
  250. // '</li>';
  251. // $('.gdmap-r ul').append(html)
  252. // }
  253. })
  254. }
  255. }
  256. });
  257. }
  258. $('.gdmap-r ul').on('click', 'li', function() {
  259. if($(this).find(".tooltips").css("display") == 'none') {
  260. $(this).find(".tooltips").show();
  261. $(this).siblings().find(".tooltips").hide();
  262. } else {
  263. $(this).find(".tooltips").hide()
  264. }
  265. })
  266. $('.part1Btn').click(function(){
  267. partOne_right()
  268. })
  269. //类型工单统计 part2
  270. var slhw = echarts.init(document.getElementById('slhw'));
  271. slhw.setOption({
  272. title: {
  273. text: '工单类型统计',
  274. x: 'center',
  275. textStyle: {
  276. color: '#fff',
  277. fontSize: 18,
  278. fontWeight: 'normal'
  279. }
  280. },
  281. legend: {
  282. // orient: 'vertical',
  283. bottom: 'bottom',
  284. data: [],
  285. textStyle: {
  286. color: '#fff'
  287. }
  288. },
  289. tooltip: {
  290. trigger: 'item',
  291. formatter: "{a} <br/>{b} : {c} ({d}%)"
  292. },
  293. series: [{
  294. name: '工单类型',
  295. type: 'pie',
  296. radius: '60%',
  297. center: ['50%', '55%'],
  298. data: [],
  299. itemStyle: {
  300. emphasis: {
  301. shadowBlur: 10,
  302. shadowOffsetX: 0,
  303. shadowColor: 'rgba(0, 0, 0, 0.5)'
  304. },
  305. normal:{
  306. label:{
  307. show: true,
  308. formatter: '{b} : {c} ({d}%)'
  309. },
  310. labelLine :{show:true}
  311. }
  312. },
  313. label: {
  314. normal: {
  315. textStyle: {
  316. color: '#fff'
  317. }
  318. }
  319. }
  320. }]
  321. });
  322. function partTwo(){
  323. var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  324. });
  325. $.ajax({
  326. type:"get",
  327. url:huayi.config.callcenter_url + "info/GetTypeCountByDate",
  328. async:true,
  329. dataType:'json',
  330. data:{
  331. start:$('#time2').val(),
  332. end:$('#time3').val()
  333. },
  334. success:function(data){
  335. if(data.state.toLowerCase()=='success'){
  336. layer.close(index);
  337. var con=data.data;
  338. var part2_legend = [];
  339. var part2_ser = [];
  340. $(con).each(function(i,n){
  341. var obj={};
  342. if(i==0){
  343. obj.value=n.Count;
  344. obj.name=n.TypeName;
  345. obj.selected=true;
  346. }else{
  347. obj.value=n.Count;
  348. obj.name=n.TypeName;
  349. }
  350. part2_legend.push(n.TypeName);
  351. part2_ser.push(obj);
  352. })
  353. slhw.setOption({
  354. legend: {
  355. data: part2_legend
  356. },
  357. series: [{
  358. data: part2_ser
  359. }]
  360. })
  361. }
  362. }
  363. });
  364. }
  365. $('.part2Btn').click(function(){
  366. partTwo();
  367. })
  368. //接通率报表part3
  369. var jtv = echarts.init(document.getElementById('jtv_num'));
  370. jtv.setOption({
  371. title: {
  372. text: '接通率统计',
  373. x: 'center',
  374. textStyle: {
  375. color: '#fff',
  376. fontSize: 18,
  377. fontWeight: 'normal'
  378. }
  379. },
  380. tooltip: {
  381. trigger: 'axis',
  382. axisPointer: {
  383. type: 'shadow',
  384. label: {
  385. show: true,
  386. backgroundColor: '#333'
  387. }
  388. },
  389. formatter: function(datas)
  390. {
  391. var res = datas[0].name + '<br/>', val;
  392. for(var i = 0, length = datas.length; i < length; i++) {
  393. val = (datas[i].value) + '%';
  394. res += datas[i].seriesName + ':' + val + '<br/>';
  395. }
  396. return res;
  397. }
  398. },
  399. legend: {
  400. // top: 30,
  401. bottom:'bottom',
  402. data: ['接通率'],
  403. textStyle: {
  404. color: '#fff'
  405. }
  406. },
  407. xAxis: {
  408. name: '时',
  409. data: [],
  410. axisLine: {
  411. lineStyle: {
  412. color: '#ccc'
  413. }
  414. },
  415. },
  416. yAxis: {
  417. name: '比率',
  418. splitLine: {
  419. show: false
  420. },
  421. axisLine: {
  422. lineStyle: {
  423. color: '#ccc'
  424. }
  425. }
  426. },
  427. series: [{
  428. name: '接通率',
  429. type: 'bar',
  430. barWidth: 8,
  431. itemStyle: {
  432. normal: {
  433. color: new echarts.graphic.LinearGradient(
  434. 0, 0, 0, 1, [{
  435. offset: 0,
  436. color: '#14c8d4'
  437. },
  438. {
  439. offset: 1,
  440. color: '#43eec6'
  441. }
  442. ]
  443. )
  444. }
  445. },
  446. data: []
  447. }]
  448. });
  449. function partThree(){
  450. var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  451. });
  452. $.ajax({
  453. type:"get",
  454. url:huayi.config.callcenter_url + "info/GetTelRate24ByDate",
  455. async:true,
  456. dataType:'json',
  457. data:{
  458. date:$('#time4').val()
  459. },
  460. success:function(data){
  461. if(data.state.toLowerCase()=='success'){
  462. layer.close(index);
  463. var con=data.data;
  464. // var part3=data.data.b;
  465. jtv.setOption({
  466. xAxis: {
  467. data:con.hours
  468. },
  469. series: [{
  470. data:con.rates
  471. }]
  472. })
  473. }
  474. }
  475. });
  476. }
  477. $('.part3Btn').click(function(){
  478. partThree();
  479. })
  480. //通话时长part4
  481. var th_nums = echarts.init(document.getElementById('th_nums'));
  482. th_nums.setOption({
  483. title: {
  484. text: '通话时长统计',
  485. x: 'center',
  486. textStyle: {
  487. color: '#fff',
  488. fontSize: 18,
  489. fontWeight: 'normal'
  490. }
  491. },
  492. tooltip: {
  493. trigger: 'axis',
  494. axisPointer: {
  495. type: 'shadow',
  496. label: {
  497. show: true,
  498. backgroundColor: '#333'
  499. }
  500. }
  501. },
  502. legend: {
  503. bottom:'bottom',
  504. data: ['平均通话时长'],
  505. textStyle: {
  506. color: '#fff'
  507. }
  508. },
  509. xAxis: {
  510. name: '时',
  511. data: [],
  512. axisLine: {
  513. lineStyle: {
  514. color: '#ccc'
  515. }
  516. },
  517. },
  518. yAxis: {
  519. name: '秒',
  520. splitLine: {
  521. show: false
  522. },
  523. axisLine: {
  524. lineStyle: {
  525. color: '#ccc'
  526. }
  527. }
  528. },
  529. series: [{
  530. name: '平均通话时长',
  531. type: 'line',
  532. smooth:true,
  533. showAllSymbol:true,
  534. symbol :"emptyCircle",
  535. symbolSize: 10,
  536. data: []
  537. }]
  538. });
  539. function partFour(){
  540. var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  541. });
  542. $.ajax({
  543. type:"get",
  544. url:huayi.config.callcenter_url + "info/GetAvgTelTime24ByDate",
  545. async:true,
  546. dataType:'json',
  547. data:{
  548. date:$('#time5').val()
  549. },
  550. success:function(data){
  551. if(data.state.toLowerCase()=='success'){
  552. layer.close(index);
  553. var con=data.data;
  554. th_nums.setOption({
  555. xAxis: {
  556. data:con.hours
  557. },
  558. series: [{
  559. data:con.avgtimes
  560. }]
  561. })
  562. }
  563. }
  564. });
  565. }
  566. $('.part4Btn').click(function(){
  567. partFour();
  568. })
  569. Ajax();
  570. function Ajax(){
  571. partOne();
  572. partOne_right()
  573. partTwo();
  574. partThree();
  575. partFour();
  576. }
  577. setInterval(Ajax, huayi.config.indextime);//Ajax调用函数
  578. })