商丘12345 前端

index.js 13KB

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