Nessuna descrizione

detail.js 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  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 num=0
  275. var sourceText = ['短信平台','连线政府','人民网','APP','省12345平台','市长电话','市长信箱','微信']
  276. $(con).each(function(i, n) {
  277. if(sourceText.indexOf(n.Source)===-1){
  278. return
  279. }
  280. var str = '<div class="source_kuang rectangle">' +
  281. '<div class="pbout">' +
  282. '<div class="percent_box">' +
  283. '<div class="percent_out"></div> ' +
  284. ' <div class="percent_in"></div>' +
  285. ' <div class="percent_word"><p>' + n.Rate.split('%')[0] + '%' + '</p><p style="margin-top: 30px;">占总量</p>' +
  286. '</div>' +
  287. '</div>' +
  288. '</div>' +
  289. '<p class="num_word nw">' +
  290. '<span>' + n.Source + '</span><span>' + n.Count + '</span>' +
  291. '</p>' +
  292. '</div>'
  293. $('.orderSource ul li').eq(num).prepend(str)
  294. num++
  295. })
  296. }
  297. }
  298. });
  299. }
  300. //第三屏
  301. function threeScreen(sd, areaTwoVal) {
  302. //alert(sd)
  303. $.ajax({
  304. type: "get",
  305. url: huayi.config.callcenter_url + "Info/GetTypeCountNew",
  306. async: true,
  307. dataType: 'json',
  308. data: {
  309. date: sd,
  310. branchcode: areaTwoVal
  311. },
  312. success: function(data) {
  313. if (data.state.toLowerCase() == 'success') {
  314. $('.orderTtype_Con ul').html('');
  315. // layer.close(index);
  316. var newDatas = data.data;
  317. var con = newDatas.sort(compare("TotalCount"))
  318. var img_name = '';
  319. $(con).each(function(i, n) {
  320. if (n.TypeName.indexOf('咨询') != -1) {
  321. img_name = 'order_ZX.png'
  322. }
  323. if (n.TypeName.indexOf('求助') != -1) {
  324. img_name = 'order_QZ.png'
  325. }
  326. if (n.TypeName.indexOf('投诉') != -1) {
  327. img_name = 'order_TS.png'
  328. }
  329. if (n.TypeName.indexOf('建议') != -1) {
  330. img_name = 'order_JY.png'
  331. }
  332. if (n.TypeName.indexOf('表扬') != -1) {
  333. img_name = 'order_BY.png'
  334. }
  335. if (n.TypeName.indexOf('其他') != -1) {
  336. img_name = 'order_QT.png'
  337. }
  338. $('<li>' +
  339. '<div class="typeWord">' + n.TypeName + '</div>' +
  340. '<img src="img/' + img_name + '" alt="" />' +
  341. '<p class="typeWord_line">数据展示</p>' +
  342. '<p class="order_count">' + n.DayCount + '</p>' +
  343. '<p class="typeWord_line">今日' + n.TypeName + '量</p>' +
  344. '<p class="order_count">' + n.MonthCount + '</p>' +
  345. '<p class="typeWord_line">本月' + n.TypeName + '量</p>' +
  346. '<p class="order_count">' + n.TotalCount + '</p>' +
  347. '<p class="typeWord_line">' + n.TypeName + '总量</p>' +
  348. '<div class="persent_box">' +
  349. '<div class="persent_kuang">' + n.Percent + '</div>' +
  350. '</div>' +
  351. '<p class="persent_word">总量占比</p>' +
  352. '</li>').appendTo('.orderTtype_Con ul');
  353. })
  354. }
  355. }
  356. });
  357. }
  358. //第五屏js
  359. function fiveScreen(sd, ed, areaTwoVal) {
  360. // if(!sd){
  361. // sd="2019-11-01"
  362. // }if(!ed){
  363. // ed="2019-11-30"
  364. // }
  365. keyWord(sd, ed, areaTwoVal);
  366. }
  367. $(".depart").change(function() {
  368. keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(
  369. ' ~ ')[1], $(".areaFive").val());
  370. })
  371. // 第二屏
  372. $(".areaTwo").change(function() {
  373. var areaTwoVal = $(this).val();
  374. twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[
  375. 1], areaTwoVal);
  376. satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(
  377. ' ~ ')[1], areaTwoVal)
  378. });
  379. //第三屏
  380. $(".areaThree").change(function() {
  381. var areaTwoVal = $(this).val();
  382. threeScreen($('#time3').val(), areaTwoVal);
  383. });
  384. //第五屏
  385. $(".areaFive").change(function() {
  386. var areaTwoVal = $(this).val();
  387. fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(
  388. ' ~ ')[1], areaTwoVal);
  389. deprtment()
  390. });
  391. //部门下拉框
  392. function deprtment() {
  393. $.getJSON(huayi.config.callcenter_url + "info/GetDeptList", {
  394. branchcode: $(".areaFive").val()
  395. },
  396. function(result) {
  397. if (result.state.toLowerCase() == "success") {
  398. goodslist = result.data;
  399. $(".depart").empty();
  400. $('<option value="">请选择部门</option>').appendTo($(".depart"));
  401. $(goodslist).each(function(i, n) {
  402. $('<option value="' + n.F_DeptId +
  403. '">' + n.F_DeptName +
  404. '</option>').appendTo($(".depart"));
  405. })
  406. }
  407. });
  408. }
  409. //区县筛选
  410. //areaSelect ();
  411. function areaSelect() {
  412. $.getJSON(huayi.config.callcenter_url + "CountyBranch/GetBranchListS", function(result) {
  413. if (result.state.toLowerCase() == "success") {
  414. goodslist = result.data;
  415. // 第五屏
  416. $(".areaFive").empty();
  417. $(goodslist).each(function(i, n) {
  418. $('<option value="' + n.F_Code +
  419. '">' + n.F_Name +
  420. '</option>').appendTo($(".areaFive"));
  421. });
  422. //第3屏
  423. $(".areaThree").empty();
  424. $(goodslist).each(function(i, n) {
  425. $('<option value="' + n.F_Code +
  426. '">' + n.F_Name +
  427. '</option>').appendTo($(".areaThree"));
  428. });
  429. //第2屏
  430. $(".areaTwo").empty();
  431. $(goodslist).each(function(i, n) {
  432. $('<option value="' + n.F_Code +
  433. '">' + n.F_Name +
  434. '</option>').appendTo($(".areaTwo"));
  435. });
  436. }
  437. });
  438. }
  439. // 左侧关键词
  440. function keyWord(sd, ed, areaTwoVal) {
  441. $.ajax({
  442. type: "get",
  443. url: huayi.config.callcenter_url + "info/GetKeyCountRankByDate",
  444. async: true,
  445. dataType: 'json',
  446. data: {
  447. start: sd,
  448. end: ed,
  449. branchcode: areaTwoVal
  450. },
  451. success: function(data) {
  452. if (data.state.toLowerCase() == 'success') {
  453. var con = data.data.reverse();
  454. if (con.length > 0) {
  455. // $(".keyW_t").text(con[0].TypeName)
  456. $('.tagcloud').html('');
  457. $(con).each(function(k, j) {
  458. if (k < 19) {
  459. var strs = '<div index="' + j.Id + '" class="tagcloud_bj">' +
  460. '<p class="tag_title">' + j.TypeName + '</p>' +
  461. '<p class="imgs">' + j.Count + '</p>' +
  462. '</div>'
  463. $('.tagcloud').append(strs);
  464. }
  465. })
  466. $(".tagcloud div:first-child").removeClass("tagcloud_bj");
  467. $(".tagcloud div:first-child").addClass("tagcloud_bjShine");
  468. keyWordDetail(sd, ed, areaTwoVal);
  469. } else {
  470. $('.tagcloud').html('');
  471. }
  472. }
  473. }
  474. });
  475. }
  476. // 右侧部门
  477. function keyWordDetail(sd, ed, areaTwoVal) {
  478. $.ajax({
  479. type: "get",
  480. url: huayi.config.callcenter_url + "info/GetDeptKeyCountByDateNew",
  481. async: true,
  482. dataType: 'json',
  483. data: {
  484. start: sd,
  485. end: ed,
  486. branchcode: areaTwoVal,
  487. deptid: $('.depart').val(),
  488. keyid: $(".tagcloud_bjShine").eq(0).attr("index")
  489. },
  490. success: function(data) {
  491. if (data.state.toLowerCase() == 'success') {
  492. $('.scroll_table tbody').html('');
  493. var con = data.data;
  494. $(con).each(function(j, n) {
  495. var rate = '';
  496. if (n.rate) {
  497. rate = n.rate;
  498. }
  499. var str = '<tr><td>' + n.deptname + '</td><td>' + n.acceptcount + '</td><td>' + rate + '</td></tr>'
  500. $('.scroll_table tbody').append(str);
  501. })
  502. $(".scroll_table").Scroll({
  503. line: 1,
  504. speed: 500,
  505. timer: 2000
  506. });
  507. }
  508. }
  509. });
  510. }
  511. $(".tagcloud").on("click", "div", function() {
  512. $(".tagcloud div").addClass("tagcloud_bj");
  513. $(".tagcloud div").removeClass("tagcloud_bjShine");
  514. $(this).removeClass("tagcloud_bj");
  515. $(this).addClass("tagcloud_bjShine");
  516. keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(
  517. ' ~ ')[1], $(".areaFive").val());
  518. });
  519. function Ajax() {
  520. oneScreen($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[
  521. 1])
  522. twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[
  523. 1])
  524. satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(
  525. ' ~ ')[1])
  526. threeScreen($('#time3').val(), $(".areaThree").val());
  527. fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[
  528. 1], $(".areaFive").val())
  529. // //第五 屏 渠道来源
  530. // var areaOneVal = helper.cookies.get("areaOneVal");
  531. // var areaOneText = helper.cookies.get("areaOneText");
  532. // partThree($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[
  533. // 1], areaOneVal)
  534. // // 接单 部门
  535. // partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val()
  536. // .split(' ~ ')[1], areaOneVal);
  537. // // 话务数量
  538. // parthuawu($('#time3').val(), areaOneVal);
  539. // // 投诉举报
  540. // partcomplain($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(
  541. // ' ~ ')[1], areaOneVal)
  542. }
  543. function loginTimeLimit() {
  544. $.ajax({
  545. type: "get",
  546. url: huayi.config.callcenter_url + "Login/GetAuAuthDate",
  547. async: false,
  548. success: function(res) {
  549. var res = $.parseJSON(res)
  550. if (res.state == "success") {} else {
  551. layer.confirm(res.message, {
  552. icon: 2,
  553. btn: ['确定'],
  554. yes: function(index, layero) {
  555. $("#wrap").hide()
  556. $(".timeLimit-wrapper").show()
  557. $(".nav_middle ul a").attr('href', '#')
  558. layer.close(index)
  559. },
  560. });
  561. }
  562. }
  563. });
  564. }