Bez popisu

detail.js 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  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. token: $.cookie("token"),
  179. start: sd,
  180. end: ed,
  181. },
  182. success: function(data) {
  183. if (data.state.toLowerCase() == 'success') {
  184. var con = data.data;
  185. newData = con.sort(compare("SLCount"));
  186. console.log(newData)
  187. $(newData).each(function(i, n) {
  188. if (n.AreaName == '安阳市') {
  189. n.AreaName = "市区"
  190. }
  191. // if(n.AreaName.indexOf('安阳市') != -1) {
  192. // $(".AY_num").html(n.SLCount)
  193. // }
  194. // if(n.AreaName.indexOf('文峰区') != -1) {
  195. // $(".WFQ_num").html(n.SLCount)
  196. // }
  197. // if(n.AreaName.indexOf('北关区') != -1) {
  198. // $(".BGQ_num").html(n.SLCount)
  199. // }
  200. // if(n.AreaName.indexOf('殷都区') != -1) {
  201. // $(".YDQ_num").html(n.SLCount)
  202. // }
  203. // if(n.AreaName.indexOf('龙安区') != -1) {
  204. // $(".LAQ_num").html(n.SLCount)
  205. // }
  206. // if(n.AreaName.indexOf('安阳县') != -1) {
  207. // $(".AYX_num").html(n.SLCount)
  208. // }
  209. // if(n.AreaName.indexOf('汤阴县') != -1) {
  210. // $(".TYX_num").text(n.SLCount)
  211. // }
  212. // if(n.AreaName.indexOf('内黄县') != -1) {
  213. // $(".NHX_num").html(n.SLCount)
  214. // }
  215. // if(n.AreaName.indexOf('滑县') != -1) {
  216. // $(".HX_num").html(n.SLCount)
  217. // }
  218. // if(n.AreaName.indexOf('林州市') != -1) {
  219. // $(".LZS_num").html(n.SLCount)
  220. // }
  221. if (floag == true) {
  222. $("#det_ult").html('')
  223. $(".right_box").html('')
  224. $(newData).each(function(i, n) {
  225. console.log(n.SLCount)
  226. if (i < 5) {
  227. var str = ' <li class="orderli"><img src="img/num_icon.png" alt="" /><p class="num_word"><span>' + n.AreaName +
  228. '</span><span class="AY_num">' + n.SLCount + '</span></p></li>';
  229. var a = $(str)
  230. a.appendTo($("#det_ult"))
  231. }
  232. if (i >= 5) {
  233. var str = ' <li class="orderli"><img src="img/num_icon.png" alt="" /><p class="num_word"><span>' + n.AreaName +
  234. '</span><span class="AY_num">' + n.SLCount + '</span></p></li>';
  235. var a = $(str)
  236. a.appendTo($(".right_box"))
  237. }
  238. })
  239. floag = false
  240. }
  241. if (n.AreaName.indexOf('总计') != -1) {
  242. $(".allSLCount").html(n.SLCount); //受理量
  243. $(".allJACount").html(n.JACount); //结案量
  244. //$(".allJARate").html(n.JARate); //结案量
  245. $(".allJARate").html("93%"); //结案量
  246. $(".allMYRate").html('94.09%'); //满意度
  247. }
  248. })
  249. }
  250. }
  251. });
  252. }
  253. function aa() {
  254. }
  255. //第二屏
  256. function twoScreen(start, end, areaTwoVal) {
  257. // if(!areaTwoVal) {
  258. // areaTwoVal = "sqs12345"
  259. // }
  260. $.ajax({
  261. type: "get",
  262. url: huayi.config.callcenter_url + "info/GetSourceByDateNew",
  263. async: true,
  264. dataType: 'json',
  265. data: {
  266. token: $.cookie("token"),
  267. start: start,
  268. end: end,
  269. branchcode: areaTwoVal
  270. },
  271. success: function(data) {
  272. if (data.state.toLowerCase() == 'success') {
  273. //layer.close(index);
  274. $('.orderSource ul li .rectangle').remove();
  275. var con = data.data;
  276. var obj = con[0];
  277. var con_list = [];
  278. con_list = con.shift();
  279. con.splice(3, 0, obj);
  280. var Percent;
  281. $(con).each(function(i, n) {
  282. // if(n.Source.indexOf('信箱') != -1) {
  283. // n.Source = '市长信箱'
  284. // }
  285. // if(n.Source.indexOf('APP') != -1) {
  286. // n.Source = 'APP'
  287. // }
  288. // if(n.Source.indexOf('政务') != -1) {
  289. // n.Source = '政务网'
  290. // }
  291. var str = '<div class="source_kuang rectangle">' +
  292. '<div class="pbout">' +
  293. '<div class="percent_box">' +
  294. '<div class="percent_out"></div> ' +
  295. ' <div class="percent_in"></div>' +
  296. ' <div class="percent_word"><p>' + n.Rate.split('%')[0] + '%' + '</p><p style="margin-top: 30px;">占总量</p>' +
  297. '</div>' +
  298. '</div>' +
  299. '</div>' +
  300. '<p class="num_word nw">' +
  301. '<span>' + n.Source + '</span><span>' + n.Count + '</span>' +
  302. '</p>' +
  303. '</div>'
  304. $('.orderSource ul li').eq(i).prepend(str)
  305. })
  306. }
  307. }
  308. });
  309. }
  310. //第三屏
  311. function threeScreen(sd, areaTwoVal) {
  312. //alert(sd)
  313. $.ajax({
  314. type: "get",
  315. url: huayi.config.callcenter_url + "Info/GetTypeCountNew",
  316. async: true,
  317. dataType: 'json',
  318. data: {
  319. token: $.cookie("token"),
  320. date: sd,
  321. branchcode: areaTwoVal
  322. },
  323. success: function(data) {
  324. if (data.state.toLowerCase() == 'success') {
  325. $('.orderTtype_Con ul').html('');
  326. // layer.close(index);
  327. var newDatas = data.data;
  328. var con = newDatas.sort(compare("TotalCount"))
  329. var img_name = '';
  330. $(con).each(function(i, n) {
  331. if (n.TypeName.indexOf('咨询') != -1) {
  332. img_name = 'order_ZX.png'
  333. }
  334. if (n.TypeName.indexOf('求助') != -1) {
  335. img_name = 'order_QZ.png'
  336. }
  337. if (n.TypeName.indexOf('投诉') != -1) {
  338. img_name = 'order_TS.png'
  339. }
  340. if (n.TypeName.indexOf('建议') != -1) {
  341. img_name = 'order_JY.png'
  342. }
  343. if (n.TypeName.indexOf('表扬') != -1) {
  344. img_name = 'order_BY.png'
  345. }
  346. if (n.TypeName.indexOf('其他') != -1) {
  347. img_name = 'order_QT.png'
  348. }
  349. $('<li>' +
  350. '<div class="typeWord">' + n.TypeName + '</div>' +
  351. '<img src="img/' + img_name + '" alt="" />' +
  352. '<p class="typeWord_line">数据展示</p>' +
  353. '<p class="order_count">' + n.DayCount + '</p>' +
  354. '<p class="typeWord_line">今日' + n.TypeName + '量</p>' +
  355. '<p class="order_count">' + n.MonthCount + '</p>' +
  356. '<p class="typeWord_line">本月' + n.TypeName + '量</p>' +
  357. '<p class="order_count">' + n.TotalCount + '</p>' +
  358. '<p class="typeWord_line">' + n.TypeName + '总量</p>' +
  359. '<div class="persent_box">' +
  360. '<div class="persent_kuang">' + n.Percent + '</div>' +
  361. '</div>' +
  362. '<p class="persent_word">总量占比</p>' +
  363. '</li>').appendTo('.orderTtype_Con ul');
  364. })
  365. }
  366. }
  367. });
  368. }
  369. //第五屏js
  370. function fiveScreen(sd, ed, areaTwoVal) {
  371. // if(!sd){
  372. // sd="2019-11-01"
  373. // }if(!ed){
  374. // ed="2019-11-30"
  375. // }
  376. keyWord(sd, ed, areaTwoVal);
  377. }
  378. $(".depart").change(function() {
  379. keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(
  380. ' ~ ')[1], $(".areaFive").val());
  381. })
  382. // 第二屏
  383. $(".areaTwo").change(function() {
  384. var areaTwoVal = $(this).val();
  385. twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[
  386. 1], areaTwoVal);
  387. satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(
  388. ' ~ ')[1], areaTwoVal)
  389. });
  390. //第三屏
  391. $(".areaThree").change(function() {
  392. var areaTwoVal = $(this).val();
  393. threeScreen($('#time3').val(), areaTwoVal);
  394. });
  395. //第五屏
  396. $(".areaFive").change(function() {
  397. var areaTwoVal = $(this).val();
  398. fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(
  399. ' ~ ')[1], areaTwoVal);
  400. deprtment()
  401. });
  402. //部门下拉框
  403. function deprtment() {
  404. $.getJSON(huayi.config.callcenter_url + "info/GetDeptList", {
  405. token: $.cookie("token"),
  406. branchcode: $(".areaFive").val()
  407. },
  408. function(result) {
  409. if (result.state.toLowerCase() == "success") {
  410. goodslist = result.data;
  411. $(".depart").empty();
  412. $('<option value="">请选择部门</option>').appendTo($(".depart"));
  413. $(goodslist).each(function(i, n) {
  414. $('<option value="' + n.F_DeptId +
  415. '">' + n.F_DeptName +
  416. '</option>').appendTo($(".depart"));
  417. })
  418. }
  419. });
  420. }
  421. //区县筛选
  422. //areaSelect ();
  423. function areaSelect() {
  424. $.getJSON(huayi.config.callcenter_url + "CountyBranch/GetBranchListS",
  425. {token: $.cookie("token"),} function(result) {
  426. if (result.state.toLowerCase() == "success") {
  427. goodslist = result.data;
  428. // 第五屏
  429. $(".areaFive").empty();
  430. $(goodslist).each(function(i, n) {
  431. $('<option value="' + n.F_Code +
  432. '">' + n.F_Name +
  433. '</option>').appendTo($(".areaFive"));
  434. });
  435. //第3屏
  436. $(".areaThree").empty();
  437. $(goodslist).each(function(i, n) {
  438. $('<option value="' + n.F_Code +
  439. '">' + n.F_Name +
  440. '</option>').appendTo($(".areaThree"));
  441. });
  442. //第2屏
  443. $(".areaTwo").empty();
  444. $(goodslist).each(function(i, n) {
  445. $('<option value="' + n.F_Code +
  446. '">' + n.F_Name +
  447. '</option>').appendTo($(".areaTwo"));
  448. });
  449. }
  450. });
  451. }
  452. // 左侧关键词
  453. function keyWord(sd, ed, areaTwoVal) {
  454. $.ajax({
  455. type: "get",
  456. url: huayi.config.callcenter_url + "info/GetKeyCountRankByDate",
  457. async: true,
  458. dataType: 'json',
  459. data: {
  460. token: $.cookie("token"),
  461. start: sd,
  462. end: ed,
  463. branchcode: areaTwoVal
  464. },
  465. success: function(data) {
  466. if (data.state.toLowerCase() == 'success') {
  467. var con = data.data.reverse();
  468. if (con.length > 0) {
  469. // $(".keyW_t").text(con[0].TypeName)
  470. $('.tagcloud').html('');
  471. $(con).each(function(k, j) {
  472. if (k < 19) {
  473. var strs = '<div index="' + j.Id + '" class="tagcloud_bj">' +
  474. '<p class="tag_title">' + j.TypeName + '</p>' +
  475. '<p class="imgs">' + j.Count + '</p>' +
  476. '</div>'
  477. $('.tagcloud').append(strs);
  478. }
  479. })
  480. $(".tagcloud div:first-child").removeClass("tagcloud_bj");
  481. $(".tagcloud div:first-child").addClass("tagcloud_bjShine");
  482. keyWordDetail(sd, ed, areaTwoVal);
  483. } else {
  484. $('.tagcloud').html('');
  485. }
  486. }
  487. }
  488. });
  489. }
  490. // 右侧部门
  491. function keyWordDetail(sd, ed, areaTwoVal) {
  492. $.ajax({
  493. type: "get",
  494. url: huayi.config.callcenter_url + "info/GetDeptKeyCountByDateNew",
  495. async: true,
  496. dataType: 'json',
  497. data: {
  498. token: $.cookie("token"),
  499. start: sd,
  500. end: ed,
  501. branchcode: areaTwoVal,
  502. deptid: $('.depart').val(),
  503. keyid: $(".tagcloud_bjShine").eq(0).attr("index")
  504. },
  505. success: function(data) {
  506. if (data.state.toLowerCase() == 'success') {
  507. $('.scroll_table tbody').html('');
  508. var con = data.data;
  509. $(con).each(function(j, n) {
  510. var rate = '';
  511. if (n.rate) {
  512. rate = n.rate;
  513. }
  514. var str = '<tr><td>' + n.deptname + '</td><td>' + n.acceptcount + '</td><td>' + rate + '</td></tr>'
  515. $('.scroll_table tbody').append(str);
  516. })
  517. $(".scroll_table").Scroll({
  518. line: 1,
  519. speed: 500,
  520. timer: 2000
  521. });
  522. }
  523. }
  524. });
  525. }
  526. $(".tagcloud").on("click", "div", function() {
  527. $(".tagcloud div").addClass("tagcloud_bj");
  528. $(".tagcloud div").removeClass("tagcloud_bjShine");
  529. $(this).removeClass("tagcloud_bj");
  530. $(this).addClass("tagcloud_bjShine");
  531. keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(
  532. ' ~ ')[1], $(".areaFive").val());
  533. });
  534. function Ajax() {
  535. oneScreen($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[
  536. 1])
  537. twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[
  538. 1])
  539. satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(
  540. ' ~ ')[1])
  541. threeScreen($('#time3').val(), $(".areaThree").val());
  542. fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[
  543. 1], $(".areaFive").val())
  544. // //第五 屏 渠道来源
  545. // var areaOneVal = helper.cookies.get("areaOneVal");
  546. // var areaOneText = helper.cookies.get("areaOneText");
  547. // partThree($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[
  548. // 1], areaOneVal)
  549. // // 接单 部门
  550. // partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val()
  551. // .split(' ~ ')[1], areaOneVal);
  552. // // 话务数量
  553. // parthuawu($('#time3').val(), areaOneVal);
  554. // // 投诉举报
  555. // partcomplain($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(
  556. // ' ~ ')[1], areaOneVal)
  557. }
  558. function loginTimeLimit() {
  559. $.ajax({
  560. type: "get",
  561. url: huayi.config.callcenter_url + "Login/GetAuAuthDate",
  562. data: {token: $.cookie("token"),},
  563. async: false,
  564. success: function(res) {
  565. var res = $.parseJSON(res)
  566. if (res.state == "success") {} else {
  567. layer.confirm(res.message, {
  568. icon: 2,
  569. btn: ['确定'],
  570. yes: function(index, layero) {
  571. $("#wrap").hide()
  572. $(".timeLimit-wrapper").show()
  573. $(".nav_middle ul a").attr('href', '#')
  574. layer.close(index)
  575. },
  576. });
  577. }
  578. }
  579. });
  580. }