Brak opisu

detail.js 16KB

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