No Description

index.js 14KB

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