Нет описания

detail.js 16KB

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