商丘12345 前端

index.js 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. var areaFourVal="";
  2. var dayTime="";
  3. $(function() {
  4. laydate.render({
  5. elem: '#time2',
  6. format: 'yyyy-MM-dd',
  7. theme: '#114a97',
  8. done: function(value, date) {
  9. fourScreen(areaFourVal,value && value.split('-')[2]);
  10. dayTime=value.split('-')[2];
  11. }
  12. });
  13. var mySwiper = new Swiper('.swiper-container', {
  14. loop: true,
  15. autoplay: {
  16. delay: 60000,
  17. },
  18. pagination: { /* 分页器*/
  19. el: '.swiper-pagination',
  20. clickable: true,
  21. },
  22. navigation: {
  23. nextEl: '.swiper-button-next',
  24. prevEl: '.swiper-button-prev',
  25. },
  26. // followFinger : false,
  27. // speed:800,
  28. on: {
  29. init: function() {
  30. swiperAnimateCache(this); //隐藏动画元素
  31. swiperAnimate(this); //初始化完成开始动画
  32. },
  33. transitionEnd: function() {
  34. swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
  35. },
  36. }
  37. })
  38. Ajax();
  39. })
  40. var cityObj = {
  41. ele1: "sqs_count",
  42. ele2: "syq_count",
  43. ele3: "lyq_count",
  44. ele4: "ycs_count",
  45. ele5: "mqx_count",
  46. ele6: "sx_count",
  47. ele7: "nlx_count",
  48. ele8: "zcx_count",
  49. ele9: "ycx_count",
  50. ele10: "xyx_count",
  51. ele11: "cxyt_count",
  52. ele12: "djbl_count"
  53. }
  54. var vars = {};
  55. getCountUp(cityObj)
  56. function getCountUp(obj1) {
  57. var options = {  
  58. useEasing: true,
  59.   useGrouping: true,
  60.   separator: ',',
  61.   decimal: '.',
  62. };
  63. $.each(obj1, function(k, v) {
  64. new CountUp(v, 0, 100, 0, 2, options).start()
  65. vars[v] = new CountUp(v, 0, 100, 0, 2, options)
  66. })
  67. }
  68. var myDate = new Date();
  69. function turn(aa) {
  70. if(aa < 10) {
  71. aa = "0" + aa;
  72. }
  73. return aa
  74. }
  75. // 第三屏 第四屏 发光外框 定时
  76. (function() {
  77. var i = 0;
  78. var length = $(".orderState_ul >li").length;
  79. var j = 0;
  80. var length_1 = $(".orderTtype_Con li").length;
  81. setInterval(function() {
  82. if(i == length) {
  83. i = 0;
  84. $(".orderState_ul >li").removeClass('active');
  85. }
  86. $(".orderState_ul >li").eq(i).addClass('active').siblings().removeClass('active');
  87. if(i == 5) {
  88. $(".orderState_ul >li").eq(4).removeClass('active');
  89. }
  90. i++;
  91. if(j == length_1) {
  92. j = 0;
  93. }
  94. $(".orderTtype_Con li").eq(j).addClass('active').siblings().removeClass('active');
  95. j++;
  96. }, 2000);
  97. })();
  98. //第一屏幕 开始
  99. function oneScreen() {
  100. // $('.gdmap-r ul').html('');
  101. // var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  102. // });
  103. $.ajax({
  104. type: "get",
  105. url: huayi.config.callcenter_url + "info/GetAreaCountByDate",
  106. async: true,
  107. dataType: 'json',
  108. data: {
  109. start: myDate.getFullYear() + "-" + turn(myDate.getMonth() + 1) + "-" + turn(myDate.getDate()),
  110. end: myDate.getFullYear() + "-" + turn(myDate.getMonth() + 1) + "-" + turn(myDate.getDate()),
  111. },
  112. success: function(data) {
  113. if(data.state.toLowerCase() == 'success') {
  114. // layer.close(index);
  115. var con = data.data;
  116. $(con).each(function(i, n) {
  117. if(n.AreaName.indexOf('商丘') != -1) {
  118. vars.sqs_count.update(n.Count);
  119. }
  120. if(n.AreaName.indexOf('睢阳') != -1) {
  121. vars.syq_count.update(n.Count);
  122. }
  123. if(n.AreaName.indexOf('梁园') != -1) {
  124. vars.lyq_count.update(n.Count);
  125. }
  126. if(n.AreaName.indexOf('永城') != -1) {
  127. vars.ycs_count.update(n.Count);
  128. }
  129. if(n.AreaName.indexOf('民权') != -1) {
  130. vars.mqx_count.update(n.Count);
  131. }
  132. if(n.AreaName.indexOf('睢县') != -1) {
  133. vars.sx_count.update(n.Count);
  134. }
  135. if(n.AreaName.indexOf('宁陵') != -1) {
  136. vars.nlx_count.update(n.Count);
  137. }
  138. if(n.AreaName.indexOf('柘城') != -1) {
  139. vars.zcx_count.update(n.Count);
  140. }
  141. if(n.AreaName.indexOf('虞城') != -1) {
  142. vars.ycx_count.update(n.Count);
  143. }
  144. if(n.AreaName.indexOf('夏邑') != -1) {
  145. vars.xyx_count.update(n.Count);
  146. }
  147. if(n.AreaName.indexOf('城乡一体') != -1) {
  148. vars.cxyt_count.update(n.Count);
  149. }
  150. if(n.AreaName.indexOf('当即办理') != -1) {
  151. vars.djbl_count.update(n.Count);
  152. }
  153. })
  154. }
  155. }
  156. });
  157. }
  158. //第二屏
  159. function twoScreen(areaTwoVal) {
  160. $.ajax({
  161. type: "get",
  162. url: huayi.config.callcenter_url + "info/GetSourceByDate",
  163. async: true,
  164. dataType: 'json',
  165. data: {
  166. start: myDate.getFullYear() + "-" + turn(myDate.getMonth() + 1) + "-" + turn(myDate.getDate()),
  167. end: myDate.getFullYear() + "-" + turn(myDate.getMonth() + 1) + "-" + turn(myDate.getDate()),
  168. branchcode:areaTwoVal
  169. },
  170. success: function(data) {
  171. if(data.state.toLowerCase() == 'success') {
  172. // layer.close(index);
  173. $('.orderSource ul li .rectangle').remove();
  174. var con = data.data;
  175. $(con).each(function(i, n) {
  176. if(!n.Percent) {
  177. n.Percent = '0.00%'
  178. }
  179. if(n.Source.indexOf('信箱') != -1) {
  180. n.Source = '信箱'
  181. }
  182. if(n.Source.indexOf('APP') != -1) {
  183. n.Source = 'APP'
  184. }
  185. if(n.Source.indexOf('政务') != -1) {
  186. n.Source = '政务网'
  187. }
  188. var str = '<div class="source_kuang rectangle">' +
  189. '<div class="pbout">' +
  190. '<div class="percent_box">' +
  191. '<div class="percent_out"></div> ' +
  192. ' <div class="percent_in"></div>' +
  193. ' <div class="percent_word"><p>' + n.Percent.split('%')[0] + '</p>%<p style="margin-top: 16px;">占总量</p>' +
  194. '</div>' +
  195. '</div>' +
  196. '</div>' +
  197. '<p class="num_word">' +
  198. '<span>' + n.Source + '</span><span>' + n.Count + '</span>' +
  199. '</p>' +
  200. '</div>'
  201. $('.orderSource ul li').eq(i).prepend(str)
  202. })
  203. }
  204. }
  205. });
  206. }
  207. //第三屏
  208. function threeScreen(areaThreeVal) {
  209. $.ajax({
  210. type: "get",
  211. url: huayi.config.callcenter_url + "Info/GetTypeCountNew",
  212. data:{
  213. branchcode:areaThreeVal
  214. },
  215. async: true,
  216. dataType: 'json',
  217. success: function(data) {
  218. if(data.state.toLowerCase() == 'success') {
  219. $('.orderTtype_Con ul').html('');
  220. // layer.close(index);
  221. var con = data.data;
  222. var img_name = '';
  223. $(con).each(function(i, n) {
  224. if(n.TypeName.indexOf('咨询') != -1) {
  225. img_name = 'order_ZX.png'
  226. }
  227. if(n.TypeName.indexOf('求助') != -1) {
  228. img_name = 'order_QZ.png'
  229. }
  230. if(n.TypeName.indexOf('投诉') != -1) {
  231. img_name = 'order_TS.png'
  232. }
  233. if(n.TypeName.indexOf('建议') != -1) {
  234. img_name = 'order_JY.png'
  235. }
  236. if(n.TypeName.indexOf('表扬') != -1) {
  237. img_name = 'order_BY.png'
  238. }
  239. if(n.TypeName.indexOf('其他') != -1) {
  240. img_name = 'order_QT.png'
  241. }
  242. $('<li>' +
  243. '<div class="typeWord">' + n.TypeName + '</div>' +
  244. '<img src="img/' + img_name + '" alt="" />' +
  245. '<p class="typeWord_line">数据展示</p>' +
  246. '<p class="order_count">' + n.DayCount + '</p>' +
  247. '<p class="typeWord_line">今日' + n.TypeName + '量</p>' +
  248. '<p class="order_count">' + n.MonthCount + '</p>' +
  249. '<p class="typeWord_line">本月' + n.TypeName + '量</p>' +
  250. '<p class="order_count">' + n.TotalCount + '</p>' +
  251. '<p class="typeWord_line">' + n.TypeName + '总量</p>' +
  252. '<div class="persent_box">' +
  253. '<div class="persent_kuang">' + n.Percent + '</div>' +
  254. '</div>' +
  255. '<p class="persent_word">总计类型占比</p>' +
  256. '</li>').appendTo('.orderTtype_Con ul');
  257. })
  258. }
  259. }
  260. });
  261. }
  262. //第四屏 数字滚动
  263. function fourScreen(areaFourVal,dayTime) {
  264. $.ajax({
  265. type: "get",
  266. url: huayi.config.callcenter_url + "Info/GetStateCountByMonth",
  267. data:{
  268. branchcode:areaFourVal,
  269. day:dayTime
  270. },
  271. async: true,
  272. dataType: 'json',
  273. success: function(data) {
  274. if(data.state.toLowerCase() == 'success') {
  275. // layer.close(index);
  276. var con = data.data;
  277. $(con).each(function(i, n) {
  278. if(n.Name.indexOf('延时审核') != -1) {
  279. $("#state_yssh").rollNum({
  280. deVal: n.Count
  281. });
  282. }
  283. if(n.Name.indexOf('已办理') != -1) {
  284. $("#state_ybl").rollNum({
  285. deVal: n.Count
  286. });
  287. }
  288. if(n.Name.indexOf('已回访') != -1) {
  289. $("#state_yhf").rollNum({
  290. deVal: n.Count
  291. });
  292. }
  293. if(n.Name.indexOf('重办中') != -1) {
  294. $("#state_cbz").rollNum({
  295. deVal: n.Count
  296. });
  297. }
  298. if(n.Name.indexOf('已结案') != -1) {
  299. $("#state_yja").rollNum({
  300. deVal: n.Count
  301. });
  302. }
  303. if(n.Name.indexOf('新工单') != -1) {
  304. $("#state_xzgd").rollNum({
  305. deVal: n.Count
  306. });
  307. }
  308. if(n.Name.indexOf('待交办') != -1) {
  309. $("#state_djb").rollNum({
  310. deVal: n.Count
  311. });
  312. }
  313. if(n.Name.indexOf('待查收') != -1) {
  314. $("#state_dcs").rollNum({
  315. deVal: n.Count
  316. });
  317. }
  318. if(n.Name.indexOf('退回审核') != -1) {
  319. $("#state_thsh").rollNum({
  320. deVal: n.Count
  321. });
  322. }
  323. if(n.Name.indexOf('办理中') != -1) {
  324. $("#state_blz").rollNum({
  325. deVal: n.Count
  326. });
  327. }
  328. if(n.Name.indexOf('待审核') != -1) {
  329. $("#state_dsh").rollNum({
  330. deVal: n.Count
  331. });
  332. }
  333. if(n.Name.indexOf('重办待交办') != -1) {
  334. $("#state_cbdjb").rollNum({
  335. deVal: n.Count
  336. });
  337. }
  338. });
  339. }
  340. }
  341. });
  342. }
  343. //第五屏js
  344. function fiveScreen(areaFiveVal) {
  345. if(areaFiveVal){
  346. huawus(areaFiveVal);
  347. jtvs(areaFiveVal);
  348. keyWord(areaFiveVal);
  349. }else{
  350. areaFiveVal="sqs12345"
  351. huawus(areaFiveVal);
  352. jtvs(areaFiveVal);
  353. keyWord(areaFiveVal);
  354. }
  355. }
  356. function huawus(areaFiveVal) {
  357. $.ajax({
  358. type: "get",
  359. url: huayi.config.callcenter_url + "info/GetTelCountByDate",
  360. async: true,
  361. dataType: "json",
  362. data: {
  363. date: myDate.getFullYear() + "-" + turn(myDate.getMonth() + 1) + "-" + turn(myDate.getDate()),
  364. branchcode:areaFiveVal
  365. },
  366. success: function(data) {
  367. if(data.state.toLowerCase() == "success") {
  368. // layer.close(index);
  369. var con = data.data;
  370. huawu.setOption({
  371. series: [{
  372. data: [con.hwcon, con.lhcon, con.jtcon, con.pjthtimes]
  373. // data: [20, 100, 5, 80]
  374. }]
  375. })
  376. }
  377. }
  378. });
  379. }
  380. function jtvs(areaFiveVal) {
  381. $.ajax({
  382. type: "get",
  383. url: huayi.config.callcenter_url + "info/GetTelRate24ByDate",
  384. async: true,
  385. dataType: 'json',
  386. data: {
  387. // date:$('#time4').val()
  388. branchcode:areaFiveVal
  389. },
  390. success: function(data) {
  391. if(data.state.toLowerCase() == 'success') {
  392. // layer.close(index);
  393. var con = data.data;
  394. // var part3=data.data.b;
  395. jtv_num.setOption({
  396. xAxis: {
  397. data: con.hours
  398. },
  399. series: [{
  400. data: con.rates
  401. }]
  402. })
  403. }
  404. }
  405. });
  406. }
  407. // $(".depart").change(function() {
  408. // keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1]);
  409. // });
  410. // 第五屏
  411. $(".areaFive").change(function() {
  412. var areaFiveVal=$(this).val();
  413. fiveScreen(areaFiveVal);
  414. });
  415. // 第四屏
  416. $(".areaFour").change(function() {
  417. var areaFourVal=$(this).val();
  418. fourScreen(areaFourVal,dayTime)
  419. });
  420. // 第三屏
  421. $(".areaThree").change(function() {
  422. var areaThreeVal=$(this).val();
  423. threeScreen(areaThreeVal);
  424. });
  425. // 第二屏
  426. $(".areaTwo").change(function() {
  427. var areaTwoVal=$(this).val();
  428. twoScreen(areaTwoVal);
  429. });
  430. //区县筛选
  431. deprtment ();
  432. function deprtment () {
  433. $.getJSON( huayi.config.callcenter_data +"CountyBranch/GetBranchListS", function(result) {
  434. if(result.state.toLowerCase() == "success") {
  435. goodslist = result.data;
  436. // 第五屏
  437. $(".areaFive").empty();
  438. $(goodslist).each(function(i, n) {
  439. $('<option value="' + n.F_Code
  440. + '">' + n.F_Name
  441. + '</option>').appendTo($(".areaFive"));
  442. });
  443. //第4屏
  444. $(".areaFour").empty();
  445. $(goodslist).each(function(i, n) {
  446. $('<option value="' + n.F_Code
  447. + '">' + n.F_Name
  448. + '</option>').appendTo($(".areaFour"));
  449. });
  450. //第3屏
  451. $(".areaThree").empty();
  452. $(goodslist).each(function(i, n) {
  453. $('<option value="' + n.F_Code
  454. + '">' + n.F_Name
  455. + '</option>').appendTo($(".areaThree"));
  456. });
  457. //第2屏
  458. $(".areaTwo").empty();
  459. $(goodslist).each(function(i, n) {
  460. $('<option value="' + n.F_Code
  461. + '">' + n.F_Name
  462. + '</option>').appendTo($(".areaTwo"));
  463. });
  464. }
  465. });
  466. }
  467. function keyWord(areaFiveVal) {
  468. $.ajax({
  469. type: "get",
  470. url: huayi.config.callcenter_url + "info/GetKeyCountByDateNew",
  471. async: true,
  472. dataType: 'json',
  473. data: {
  474. // date:$('#time4').val()
  475. branchcode:areaFiveVal
  476. },
  477. success: function(data) {
  478. if(data.state.toLowerCase() == 'success') {
  479. // layer.close(index);
  480. var con = data.data;
  481. $('.tagcloud').html('');
  482. // var strs='<div class="tagcloud">'
  483. $(con).each(function(k, j) {
  484. if(k < 10) {
  485. var strs = '<div>' +
  486. '<p class="tag_title">' + j.关键字 + '</p>' +
  487. '<p class="imgs">' + j.投诉 + '</p>' +
  488. '<p class="ts_count">投诉量</p>' +
  489. '</div>'
  490. $('.tagcloud').append(strs);
  491. }
  492. })
  493. }
  494. },
  495. complete: function(XMLHttpRequest) {
  496. // setTimeout(function(){
  497. tagcloud({
  498. selector: ".tagcloud", //元素选择器
  499. fontsize: 16, //基本字体大小, 单位px
  500. radius: 150, //滚动半径, 单位px
  501. mspeed: "normal", //滚动最大速度, 取值: slow, normal(默认), fast
  502. ispeed: "normal", //滚动初速度, 取值: slow, normal(默认), fast
  503. direction: 135, //初始滚动方向, 取值角度(顺时针360): 0对应top, 90对应left, 135对应right-bottom(默认)...
  504. keep: false // 鼠标移出组件后是否继续随鼠标滚动, 取值: false, true(默认) 对应 减速至初速度滚动, 随鼠标滚动
  505. });
  506. // },100);
  507. }
  508. });
  509. }
  510. //第五屏图表js
  511. var huawu = echarts.init(document.getElementById('huawu_tody'));
  512. huawu.setOption({
  513. tooltip: {
  514. trigger: 'axis',
  515. axisPointer: {
  516. type: false,
  517. label: {
  518. show: true,
  519. backgroundColor: '#030917'
  520. }
  521. },
  522. },
  523. grid: {
  524. left: '2%',
  525. right: '8%',
  526. bottom: '6%',
  527. containLabel: true
  528. },
  529. xAxis: {
  530. name: '类型',
  531. data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)"],
  532. axisLine: {
  533. lineStyle: {
  534. color: '#038de2'
  535. }
  536. },
  537. axisTick: {
  538. alignWithLabel: true,
  539. show: false
  540. },
  541. axisLabel: { //横轴字体颜色
  542. show: true,
  543. textStyle: {
  544. color: '#00daf4'
  545. }
  546. }
  547. },
  548. yAxis: {
  549. name: '数量',
  550. splitLine: {
  551. show: false
  552. },
  553. axisLine: {
  554. lineStyle: {
  555. color: '#038de2'
  556. }
  557. }
  558. },
  559. series: [{
  560. name: '数量',
  561. type: 'bar',
  562. barWidth: 18,
  563. itemStyle: {
  564. normal: {
  565. color: new echarts.graphic.LinearGradient(
  566. 0, 0, 0, 1, [{
  567. offset: 0,
  568. color: '#0285ff'
  569. },
  570. {
  571. offset: 1,
  572. color: '#0385ff24'
  573. }
  574. ]
  575. )
  576. }
  577. },
  578. label: {
  579. normal: {
  580. show: true,
  581. position: 'top', //顶部数据显示位置
  582. textStyle: {
  583. color: '#fff' //顶部数据颜色
  584. },
  585. formatter: '{c}' // 这里是数据展示的时候显示的数据
  586. }
  587. },
  588. data: []
  589. }]
  590. });
  591. var jtv_num = echarts.init(document.getElementById('jtv_num'));
  592. jtv_num.setOption({
  593. // title: {
  594. // text: '接通率统计',
  595. // x: 'center',
  596. // textStyle: {
  597. // color: '#fff',
  598. // fontSize: 18,
  599. // fontWeight: 'normal'
  600. // }
  601. // },
  602. grid: {
  603. left: '6%',
  604. right: '8%',
  605. bottom: '6%',
  606. containLabel: true
  607. },
  608. tooltip: {
  609. trigger: 'axis',
  610. axisPointer: {
  611. type: 'shadow',
  612. label: {
  613. show: true,
  614. backgroundColor: '#333'
  615. }
  616. },
  617. formatter: function(datas) {
  618. var res = datas[0].name + '<br/>',
  619. val;
  620. for(var i = 0, length = datas.length; i < length; i++) {
  621. val = (datas[i].value) + '%';
  622. res += datas[i].seriesName + ':' + val + '<br/>';
  623. }
  624. return res;
  625. }
  626. },
  627. // legend: {
  628. //// top: 30,
  629. //bottom:'bottom',
  630. // data: ['接通率'],
  631. // textStyle: {
  632. // color: '#fff'
  633. // }
  634. // },
  635. xAxis: {
  636. name: '时',
  637. data: [],
  638. axisLine: {
  639. lineStyle: {
  640. color: '#038de2'
  641. }
  642. },
  643. axisTick: {
  644. alignWithLabel: true,
  645. show: false
  646. },
  647. axisLabel: { //横轴字体颜色
  648. show: true,
  649. textStyle: {
  650. color: '#00daf4'
  651. }
  652. }
  653. },
  654. yAxis: {
  655. name: '比率',
  656. splitLine: {
  657. show: false
  658. },
  659. axisLine: {
  660. lineStyle: {
  661. color: '#038de2'
  662. }
  663. }
  664. },
  665. series: [{
  666. name: '接通率',
  667. type: 'bar',
  668. barWidth: 8,
  669. itemStyle: {
  670. normal: {
  671. color: new echarts.graphic.LinearGradient(
  672. 0, 0, 0, 1, [{
  673. offset: 0,
  674. color: '#00e8fe'
  675. },
  676. {
  677. offset: 1,
  678. color: '#016fa4'
  679. }
  680. ]
  681. )
  682. }
  683. },
  684. // data: [500, 10, 25, 78, 85, 89, 56, 120, 20, 230, 52, 85, 45, 46, 12, 600, 15, 18, 95, 150, 28, 134, 146, 145]
  685. data: []
  686. }]
  687. });
  688. function Ajax() {
  689. oneScreen();
  690. twoScreen();
  691. threeScreen();
  692. fourScreen();
  693. fiveScreen()
  694. }