Bez popisu

index.js 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. var newData=[] //数据倒序
  2. var floag=true
  3. $(function() {
  4. loginTimeLimit(); //登录
  5. var mySwiper = new Swiper('.swiper-container', {
  6. // loop: true,
  7. // autoplay: {
  8. // delay: 60000,
  9. // },
  10. pagination: { /* 分页器*/
  11. el: '.swiper-pagination',
  12. clickable: true,
  13. },
  14. navigation: {
  15. nextEl: '.swiper-button-next',
  16. prevEl: '.swiper-button-prev',
  17. },
  18. // followFinger : false,
  19. // speed:800,
  20. on: {
  21. init: function() {
  22. swiperAnimateCache(this); //隐藏动画元素
  23. swiperAnimate(this); //初始化完成开始动画
  24. },
  25. transitionEnd: function() {
  26. swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
  27. },
  28. }
  29. })
  30. // 跳轉
  31. $(".nav_middle").click(function(){
  32. window.open('index.html','_self')
  33. })
  34. $("#department").click(function(){
  35. window.open('receiptDepartment.html','_self')
  36. })
  37. $("#sourceChannel").click(function(){
  38. window.open('sourceChannel.html','_self')
  39. })
  40. $("#call").click(function(){
  41. window.open('TelephoneDetails.html','_self')
  42. })
  43. $("#complaint").click(function(){
  44. window.open('complaintsReport.html','_self')
  45. })
  46. // 選項卡
  47.  $(".smallimg").click(function ()
  48.   {
  49.     //获取点击的元素给其添加样式,讲其兄弟元素的样式移除
  50.     $(this).addClass("activeBox").siblings().removeClass("activeBox");
  51.     //获取选中元素的下标
  52.     var index = $(this).index();
  53.     $(".slideCon_bg").eq(index).addClass("slideCon_bg_block")
  54.     .siblings().removeClass("slideCon_bg_block");
  55.   });
  56. Ajax();
  57. deprtment();// 第五屏部门下拉
  58. laydate.render({
  59. elem: '#time1',
  60. range: '~',
  61. format: 'yyyy-MM-dd',
  62. theme: '#114a97',
  63. done: function(value, date) {
  64. oneScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1])
  65. }
  66. });
  67. laydate.render({
  68. elem: '#time2',
  69. range: '~',
  70. format: 'yyyy-MM-dd',
  71. theme: '#114a97',
  72. done: function(value, date) {
  73. twoScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaTwo").val())
  74. satisfaction(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaTwo").val())
  75. }
  76. });
  77. laydate.render({
  78. elem: '#time3',
  79. format: 'yyyy-MM-dd',
  80. theme: '#114a97',
  81. done: function(value) {
  82. threeScreen(value,$(".areaThree").val())
  83. }
  84. });
  85. laydate.render({
  86. elem: '#test6',
  87. range: '~',
  88. format: 'yyyy-MM-dd',
  89. theme: '#114a97',
  90. done: function(value, date) {
  91. fiveScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaFive").val())
  92. }
  93. });
  94. })
  95. var cityObj = {
  96. ele1: "sqs_count",
  97. ele2: "syq_count",
  98. ele3: "lyq_count",
  99. ele4: "ycs_count",
  100. ele5: "mqx_count",
  101. ele6: "sx_count",
  102. ele7: "nlx_count",
  103. ele8: "zcx_count",
  104. ele9: "ycx_count",
  105. ele10: "xyx_count",
  106. ele11: "cxyt_count",
  107. ele12: "lhpz_count",
  108. ele13: "saz_count",
  109. ele14: "djbl_count"
  110. }
  111. var vars = {};
  112. getCountUp(cityObj)
  113. function getCountUp(obj1) {
  114. var options = {  
  115. useEasing: true,
  116.   useGrouping: true,
  117.   separator: ',',
  118.   decimal: '.',
  119. };
  120. $.each(obj1, function(k, v) {
  121. new CountUp(v, 0, 0, 0, 2, options).start()
  122. vars[v] = new CountUp(v, 0, 0, 0, 2, options)
  123. })
  124. }
  125. var myDate = new Date();
  126. function turn(aa) {
  127. if(aa < 10) {
  128. aa = "0" + aa;
  129. }
  130. return aa
  131. }
  132. // 第三屏 第四屏 发光外框 定时
  133. (function() {
  134. var i = 0;
  135. var length = $(".orderState_ul >li").length;
  136. var j = 0;
  137. var length_1 = $(".orderTtype_Con li").length;
  138. setInterval(function() {
  139. if(i == length) {
  140. i = 0;
  141. $(".orderState_ul >li").removeClass('active');
  142. }
  143. $(".orderState_ul >li").eq(i).addClass('active').siblings().removeClass('active');
  144. if(i == 5) {
  145. $(".orderState_ul >li").eq(4).removeClass('active');
  146. }
  147. i++;
  148. if(j == length_1) {
  149. j = 0;
  150. }
  151. $(".orderTtype_Con li").eq(j).addClass('active').siblings().removeClass('active');
  152. j++;
  153. }, 2000);
  154. })();
  155. //对数组进行排序
  156. function compare(property) {
  157. return (firstobj, secondobj) => {
  158. const firstValue = firstobj[property];
  159. const secondValue = secondobj[property];
  160. return secondValue - firstValue; //降序
  161. };
  162. }
  163. //第一屏幕 开始
  164. function oneScreen(sd,ed) {
  165. $.ajax({
  166. type: "get",
  167. url: huayi.config.callcenter_url + "/info/GetAreaCountByDateNew",
  168. async: true,
  169. dataType: 'json',
  170. data: {
  171. start: sd,
  172. end: ed,
  173. },
  174. success: function(data) {
  175. if(data.state.toLowerCase() == 'success') {
  176. var con = data.data;
  177. newData = con.sort(compare("SLCount"));
  178. $(newData).each(function(i, n) {
  179. if(n.AreaName=='安阳市'){
  180. n.AreaName="市区"
  181. }
  182. // if(n.AreaName.indexOf('安阳市') != -1) {
  183. // $(".AY_num").html(n.SLCount)
  184. // }
  185. // if(n.AreaName.indexOf('文峰区') != -1) {
  186. // $(".WFQ_num").html(n.SLCount)
  187. // }
  188. // if(n.AreaName.indexOf('北关区') != -1) {
  189. // $(".BGQ_num").html(n.SLCount)
  190. // }
  191. // if(n.AreaName.indexOf('殷都区') != -1) {
  192. // $(".YDQ_num").html(n.SLCount)
  193. // }
  194. // if(n.AreaName.indexOf('龙安区') != -1) {
  195. // $(".LAQ_num").html(n.SLCount)
  196. // }
  197. // if(n.AreaName.indexOf('安阳县') != -1) {
  198. // $(".AYX_num").html(n.SLCount)
  199. // }
  200. // if(n.AreaName.indexOf('汤阴县') != -1) {
  201. // $(".TYX_num").text(n.SLCount)
  202. // }
  203. // if(n.AreaName.indexOf('内黄县') != -1) {
  204. // $(".NHX_num").html(n.SLCount)
  205. // }
  206. // if(n.AreaName.indexOf('滑县') != -1) {
  207. // $(".HX_num").html(n.SLCount)
  208. // }
  209. // if(n.AreaName.indexOf('林州市') != -1) {
  210. // $(".LZS_num").html(n.SLCount)
  211. // }
  212. if(floag==true){
  213. $("#det_ult").html('')
  214. $(newData).each(function(i, n) {
  215. 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>';
  216. var a=$(str)
  217. a.appendTo($("#det_ult"))
  218. })
  219. floag=false
  220. }
  221. if(n.AreaName.indexOf('总计') != -1) {
  222. $(".allSLCount").html(n.SLCount); //受理量
  223. $(".allJACount").html(n.JACount); //结案量
  224. //$(".allJARate").html(n.JARate); //结案量
  225. $(".allJARate").html("93%"); //结案量
  226. $(".allMYRate").html('94.09%'); //满意度
  227. }
  228. })
  229. }
  230. }
  231. });
  232. }
  233. function aa(){
  234. }
  235. //第二屏
  236. function twoScreen(start, end, areaTwoVal) {
  237. // if(!areaTwoVal) {
  238. // areaTwoVal = "sqs12345"
  239. // }
  240. $.ajax({
  241. type: "get",
  242. url: huayi.config.callcenter_url + "info/GetSourceByDateNew",
  243. async: true,
  244. dataType: 'json',
  245. data: {
  246. start: start,
  247. end: end,
  248. branchcode: areaTwoVal
  249. },
  250. success: function(data) {
  251. if(data.state.toLowerCase() == 'success') {
  252. //layer.close(index);
  253. $('.orderSource ul li .rectangle').remove();
  254. var con = data.data;
  255. var obj=con[0];
  256. var con_list=[];
  257. con_list=con.shift();
  258. con.splice(3,0,obj);
  259. var Percent;
  260. $(con).each(function(i, n) {
  261. // if(n.Source.indexOf('信箱') != -1) {
  262. // n.Source = '市长信箱'
  263. // }
  264. // if(n.Source.indexOf('APP') != -1) {
  265. // n.Source = 'APP'
  266. // }
  267. // if(n.Source.indexOf('政务') != -1) {
  268. // n.Source = '政务网'
  269. // }
  270. var str = '<div class="source_kuang rectangle">' +
  271. '<div class="pbout">' +
  272. '<div class="percent_box">' +
  273. '<div class="percent_out"></div> ' +
  274. ' <div class="percent_in"></div>' +
  275. ' <div class="percent_word"><p>' + n.Rate.split('%')[0] + '</p>%<p style="margin-top: 16px;">占总量</p>' +
  276. '</div>' +
  277. '</div>' +
  278. '</div>' +
  279. '<p class="num_word">' +
  280. '<span>' + n.Source + '</span><span>' + n.Count + '</span>' +
  281. '</p>' +
  282. '</div>'
  283. $('.orderSource ul li').eq(i).prepend(str)
  284. })
  285. }
  286. }
  287. });
  288. }
  289. //第三屏
  290. function threeScreen(sd,areaTwoVal) {
  291. //alert(sd)
  292. $.ajax({
  293. type: "get",
  294. url: huayi.config.callcenter_url + "Info/GetTypeCountNew",
  295. async: true,
  296. dataType: 'json',
  297. data: {
  298. date: sd,
  299. branchcode: areaTwoVal
  300. },
  301. success: function(data) {
  302. if(data.state.toLowerCase() == 'success') {
  303. $('.orderTtype_Con ul').html('');
  304. // layer.close(index);
  305. var con = data.data;
  306. var img_name = '';
  307. $(con).each(function(i, n) {
  308. if(n.TypeName.indexOf('咨询') != -1) {
  309. img_name = 'order_ZX.png'
  310. }
  311. if(n.TypeName.indexOf('求助') != -1) {
  312. img_name = 'order_QZ.png'
  313. }
  314. if(n.TypeName.indexOf('投诉') != -1) {
  315. img_name = 'order_TS.png'
  316. }
  317. if(n.TypeName.indexOf('建议') != -1) {
  318. img_name = 'order_JY.png'
  319. }
  320. if(n.TypeName.indexOf('表扬') != -1) {
  321. img_name = 'order_BY.png'
  322. }
  323. if(n.TypeName.indexOf('其他') != -1) {
  324. img_name = 'order_QT.png'
  325. }
  326. $('<li>' +
  327. '<div class="typeWord">' + n.TypeName + '</div>' +
  328. '<img src="img/' + img_name + '" alt="" />' +
  329. '<p class="typeWord_line">数据展示</p>' +
  330. '<p class="order_count">' + n.DayCount + '</p>' +
  331. '<p class="typeWord_line">今日' + n.TypeName + '量</p>' +
  332. '<p class="order_count">' + n.MonthCount + '</p>' +
  333. '<p class="typeWord_line">本月' + n.TypeName + '量</p>' +
  334. '<p class="order_count">' + n.TotalCount + '</p>' +
  335. '<p class="typeWord_line">' + n.TypeName + '总量</p>' +
  336. '<div class="persent_box">' +
  337. '<div class="persent_kuang">' + n.Percent + '</div>' +
  338. '</div>' +
  339. '<p class="persent_word">总计类型占比</p>' +
  340. '</li>').appendTo('.orderTtype_Con ul');
  341. })
  342. }
  343. }
  344. });
  345. }
  346. //第五屏js
  347. function fiveScreen(sd,ed,areaTwoVal) {
  348. // if(!sd){
  349. // sd="2019-11-01"
  350. // }if(!ed){
  351. // ed="2019-11-30"
  352. // }
  353. keyWord(sd, ed,areaTwoVal);
  354. }
  355. $(".depart").change(function() {
  356. keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],$(".areaFive").val());
  357. })
  358. // 第二屏
  359. $(".areaTwo").change(function() {
  360. var areaTwoVal=$(this).val();
  361. twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],areaTwoVal);
  362. satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],areaTwoVal)
  363. });
  364. //第三屏
  365. $(".areaThree").change(function() {
  366. var areaTwoVal=$(this).val();
  367. threeScreen($('#time3').val(),areaTwoVal);
  368. });
  369. //第五屏
  370. $(".areaFive").change(function() {
  371. var areaTwoVal=$(this).val();
  372. fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],areaTwoVal);
  373. deprtment ()
  374. });
  375. //部门下拉框
  376. function deprtment () {
  377. $.getJSON( huayi.config.callcenter_url +"info/GetDeptList",
  378. {
  379. branchcode: $(".areaFive").val()
  380. },
  381. function(result) {
  382. if(result.state.toLowerCase() == "success") {
  383. goodslist = result.data;
  384. $(".depart").empty();
  385. $('<option value="">请选择部门</option>').appendTo($(".depart"));
  386. $(goodslist).each(function(i, n) {
  387. $('<option value="' + n.F_DeptId
  388. + '">' + n.F_DeptName
  389. + '</option>').appendTo($(".depart"));
  390. })
  391. }
  392. });
  393. }
  394. //区县筛选
  395. //areaSelect ();
  396. function areaSelect () {
  397. $.getJSON( huayi.config.callcenter_url +"CountyBranch/GetBranchListS", function(result) {
  398. if(result.state.toLowerCase() == "success") {
  399. goodslist = result.data;
  400. // 第五屏
  401. $(".areaFive").empty();
  402. $(goodslist).each(function(i, n) {
  403. $('<option value="' + n.F_Code
  404. + '">' + n.F_Name
  405. + '</option>').appendTo($(".areaFive"));
  406. });
  407. //第3屏
  408. $(".areaThree").empty();
  409. $(goodslist).each(function(i, n) {
  410. $('<option value="' + n.F_Code
  411. + '">' + n.F_Name
  412. + '</option>').appendTo($(".areaThree"));
  413. });
  414. //第2屏
  415. $(".areaTwo").empty();
  416. $(goodslist).each(function(i, n) {
  417. $('<option value="' + n.F_Code
  418. + '">' + n.F_Name
  419. + '</option>').appendTo($(".areaTwo"));
  420. });
  421. }
  422. });
  423. }
  424. // 左侧关键词
  425. function keyWord(sd, ed,areaTwoVal) {
  426. $.ajax({
  427. type: "get",
  428. url: huayi.config.callcenter_url + "info/GetKeyCountRankByDate",
  429. async: true,
  430. dataType: 'json',
  431. data: {
  432. start: sd,
  433. end: ed,
  434. branchcode: areaTwoVal
  435. },
  436. success: function(data) {
  437. if(data.state.toLowerCase() == 'success') {
  438. var con = data.data;
  439. if (con.length>0) {
  440. // $(".keyW_t").text(con[0].TypeName)
  441. $('.tagcloud').html('');
  442. $(con).each(function(k, j) {
  443. if(k < 12) {
  444. var strs = '<div index="'+j.Id+'" class="tagcloud_bj">' +
  445. '<p class="tag_title">' + j.TypeName + '</p>' +
  446. '<p class="imgs">' + j.Count + '</p>' +
  447. '</div>'
  448. $('.tagcloud').append(strs);
  449. }
  450. })
  451. $(".tagcloud div:first-child").removeClass("tagcloud_bj");
  452. $(".tagcloud div:first-child").addClass("tagcloud_bjShine");
  453. keyWordDetail(sd, ed,areaTwoVal);
  454. }else{
  455. $('.tagcloud').html('');
  456. }
  457. }
  458. }
  459. });
  460. }
  461. // 右侧部门
  462. function keyWordDetail(sd, ed,areaTwoVal) {
  463. $.ajax({
  464. type: "get",
  465. url: huayi.config.callcenter_url + "info/GetDeptKeyCountByDateNew",
  466. async: true,
  467. dataType: 'json',
  468. data: {
  469. start: sd,
  470. end: ed,
  471. branchcode: areaTwoVal,
  472. deptid: $('.depart').val(),
  473. keyid: $(".tagcloud_bjShine").eq(0).attr("index")
  474. },
  475. success: function(data) {
  476. if(data.state.toLowerCase() == 'success') {
  477. $('.scroll_table tbody').html('');
  478. var con = data.data;
  479. $(con).each(function (j, n) {
  480. var rate = '';
  481. if (n.rate) { rate = n.rate;}
  482. var str = '<tr><td>' + n.deptname + '</td><td>' + n.acceptcount + '</td><td>' + rate + '</td></tr>'
  483. $('.scroll_table tbody').append(str);
  484. })
  485. $(".scroll_table").Scroll({
  486. line: 1,
  487. speed: 500,
  488. timer: 2000
  489. });
  490. }
  491. }
  492. });
  493. }
  494. $(".tagcloud").on("click","div",function(){
  495. $(".tagcloud div").addClass("tagcloud_bj");
  496. $(".tagcloud div").removeClass("tagcloud_bjShine");
  497. $(this).removeClass("tagcloud_bj");
  498. $(this).addClass("tagcloud_bjShine");
  499. keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],$(".areaFive").val());
  500. });
  501. function Ajax() {
  502. oneScreen($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1])
  503. twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1])
  504. satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1])
  505. threeScreen($('#time3').val(),$(".areaThree").val());
  506. fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],$(".areaFive").val())
  507. }
  508. function loginTimeLimit(){
  509. $.ajax({
  510. type:"get",
  511. url: huayi.config.callcenter_url + "Login/GetAuAuthDate",
  512. async:false,
  513. success:function(res){
  514. var res=$.parseJSON(res)
  515. if(res.state== "success") {
  516. } else {
  517. layer.confirm(res.message, {
  518. icon: 2,
  519. btn: ['确定'],
  520. yes: function(index, layero) {
  521. $("#wrap").hide()
  522. $(".timeLimit-wrapper").show()
  523. $(".nav_middle ul a").attr('href', '#')
  524. layer.close(index)
  525. },
  526. });
  527. }
  528. }
  529. });
  530. }