Geen omschrijving

index.js 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. $(function() {
  2. var mySwiper = new Swiper('.swiper-container', {
  3. pagination: { /* 分页器*/
  4. el: '.swiper-pagination',
  5. clickable: true,
  6. },
  7. navigation: {
  8. nextEl: '.swiper-button-next',
  9. prevEl: '.swiper-button-prev',
  10. },
  11. on: {
  12. init: function() {
  13. swiperAnimateCache(this); //隐藏动画元素
  14. swiperAnimate(this); //初始化完成开始动画
  15. },
  16. transitionEnd: function() {
  17. swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
  18. },
  19. }
  20. })
  21. Ajax();
  22. laydate.render({
  23. elem: '#time1',
  24. range: '~',
  25. format: 'yyyy-MM-dd',
  26. theme: '#114a97',
  27. done: function(value, date) {
  28. oneScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1])
  29. oneSel(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1])
  30. }
  31. });
  32. laydate.render({
  33. elem: '#time2',
  34. range: '~',
  35. format: 'yyyy-MM-dd',
  36. theme: '#114a97',
  37. done: function(value, date) {
  38. twoScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaTwo").val())
  39. }
  40. });
  41. laydate.render({
  42. elem: '#time3',
  43. range: '~',
  44. format: 'yyyy-MM-dd',
  45. theme: '#114a97',
  46. done: function(value) {
  47. threeScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaTwo").val())
  48. }
  49. });
  50. })
  51. var myDate = new Date();
  52. var typeSelc;
  53. var oneType;
  54. function turn(aa) {
  55. if(aa < 10) {
  56. aa = "0" + aa;
  57. }
  58. return aa
  59. }
  60. // 第三屏 第四屏 发光外框 定时
  61. (function() {
  62. var i = 0;
  63. var length = $(".orderState_ul >li").length;
  64. var j = 0;
  65. var length_1 = $(".orderTtype_Con li").length;
  66. setInterval(function() {
  67. if(i == length) {
  68. i = 0;
  69. $(".orderState_ul >li").removeClass('active');
  70. }
  71. $(".orderState_ul >li").eq(i).addClass('active').siblings().removeClass('active');
  72. if(i == 5) {
  73. $(".orderState_ul >li").eq(4).removeClass('active');
  74. }
  75. i++;
  76. if(j == length_1) {
  77. j = 0;
  78. }
  79. $(".orderTtype_Con li").eq(j).addClass('active').siblings().removeClass('active');
  80. j++;
  81. }, 2000);
  82. })();
  83. //第一屏幕 开始
  84. function oneScreen(sd,ed) {
  85. if (oneType) {
  86. typeSelc=oneType;
  87. }else{
  88. typeSelc=5;
  89. }
  90. $.ajax({
  91. type: "get",
  92. url: huayi.config.callcenter_url + 'WOReport/GetFeedbacklList',
  93. async: true,
  94. dataType: 'json',
  95. data: {
  96. start: sd,
  97. end: ed,
  98. type: typeSelc
  99. },
  100. success: function(data) {
  101. if(data.state == "success") {
  102. var sorceData=data.rows;
  103. var option = {
  104. tooltip: {
  105. formatter: "{b} : {c} ({d}%)"
  106. },
  107. legend: {
  108. orient: 'vertical',
  109. top: 'middle',
  110. x: 'top',
  111. left: 10,
  112. top: 0,
  113. },
  114. series: [{
  115. type: 'pie',
  116. radius: '70%',
  117. selectedMode: 'single',
  118. center: ['50%', '50%'],
  119. label: {
  120. normal: {
  121. show: true,
  122. }
  123. },
  124. itemStyle: {
  125. normal: {
  126. color:'#159FE9',
  127. opacity:0.3,
  128. },
  129. emphasis: {
  130. opacity:1, opacity:1
  131. }
  132. },
  133. labelLine: {
  134. normal: {
  135. show: true,
  136. }
  137. },
  138. data: [{
  139. value: sorceData[0].number,
  140. name: sorceData[0].name,
  141. },
  142. {
  143. value: sorceData[1].number,
  144. name: sorceData[1].name,
  145. },
  146. {
  147. value: sorceData[2].number,
  148. name: sorceData[2].name,
  149. },
  150. {
  151. value: sorceData[3].number,
  152. name: sorceData[3].name,
  153. }
  154. ],
  155. }]
  156. };
  157. echartsPie = echarts.init(document.getElementById('oneScreenPie'));
  158. echartsPie.setOption(option);
  159. }
  160. },
  161. error: function(data) {
  162. console.log(data.message);
  163. }
  164. });
  165. }
  166. function oneSel(sd,ed){
  167. $.ajax({
  168. type: "get",
  169. url: huayi.config.callcenter_url + 'WOReport/GetFeedbacklList',
  170. async: true,
  171. dataType: 'json',
  172. data: {
  173. start: sd,
  174. end: ed
  175. },
  176. success: function(data) {
  177. if(data.state == "success") {
  178. var sorceData=data.rows;
  179. $(".onescreenText").html(sorceData[4].number);
  180. $(".twoscreenText").html(sorceData[3].number);
  181. $(".threescreenText").html(sorceData[2].number);
  182. $(".fourscreenText").html(sorceData[1].number);
  183. $(".fivescreenText").html(sorceData[0].number);
  184. }
  185. }
  186. })
  187. }
  188. $(".oneScrClick ul li").click(function(){
  189. oneType=$(this).attr("index")
  190. oneScreen($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1]);
  191. })
  192. //第二屏
  193. function twoScreen(start,end) {
  194. keyWord(start, end)
  195. }
  196. // 左侧关键词
  197. function keyWord(start, end) {
  198. $.ajax({
  199. type: "get",
  200. url: huayi.config.callcenter_url + "WOReport/GetComplainthandlList",
  201. async: true,
  202. dataType: 'json',
  203. data: {
  204. start: start,
  205. end: end
  206. },
  207. success: function(data) {
  208. if(data.state.toLowerCase() == 'success') {
  209. var con = data.rows;
  210. if (con.length>0) {
  211. $(".keyW_t").text(con[0].name)
  212. $('.tagcloud').html('');
  213. $(con).each(function(k, j) {
  214. if(k < 9) {
  215. var strs = '<div index="'+j.Id+'" class="tagcloud_bj">' +
  216. '<p class="tag_title">' + j.name + '</p>' +
  217. '<p class="imgs">' + j.number + '</p>' +
  218. '</div>'
  219. $('.tagcloud').append(strs);
  220. }
  221. })
  222. $(".tagcloud div:first-child").removeClass("tagcloud_bj");
  223. $(".tagcloud div:first-child").addClass("tagcloud_bjShine");
  224. keyWordDetail(start, end);
  225. }else{
  226. $('.tagcloud').html('');
  227. }
  228. }
  229. }
  230. });
  231. }
  232. // 右侧部门
  233. function keyWordDetail(start,end) {
  234. $.ajax({
  235. type: "get",
  236. url: huayi.config.callcenter_url + "WOReport/GetComplainthandlList",
  237. async: true,
  238. dataType: 'json',
  239. data: {
  240. stime: start,
  241. endtime: end,
  242. questionName:$(".quesType").val()
  243. },
  244. success: function(data) {
  245. if(data.state.toLowerCase() == 'success') {
  246. $('.scroll_table tbody').html('');
  247. var con = data.rows;
  248. $(con).each(function (j, n) {
  249. var rate = '';
  250. if (n.rate) { rate = n.rate;}
  251. var str = '<tr><td>'
  252. + n.name + '</td><td style="width:60px;">'
  253. + n.number + '</td><td style="width:90px;">'
  254. + n.ongesttime + '</td><td style="width:90px;">'
  255. + n.minimumtime + '</td><td style="width:90px;">'
  256. + n.averageTime + '</td><td style="width:75px;">'
  257. + n.median + '</td><td style="width:90px;">'
  258. + n.Overdue + '</td><td style="width:110px;">'
  259. + n.efficiency + '</td></tr>'
  260. $('.scroll_table tbody').append(str);
  261. })
  262. $(".scroll_table").Scroll({
  263. line: 1,
  264. speed: 500,
  265. timer: 2000
  266. });
  267. }
  268. }
  269. });
  270. }
  271. $(".tagcloud").on("click","div",function(){
  272. $(".tagcloud div").addClass("tagcloud_bj");
  273. $(".tagcloud div").removeClass("tagcloud_bjShine");
  274. $(this).removeClass("tagcloud_bj");
  275. $(this).addClass("tagcloud_bjShine");
  276. keyWordDetail($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1]);
  277. });
  278. quesTypeSel();
  279. $(".quesType").change(function() {
  280. keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[1],$(".areaFive").val());
  281. })
  282. //部门下拉框
  283. function quesTypeSel() {
  284. $.getJSON( huayi.config.callcenter_url +"WOReport/GetComplainthandlList",
  285. {
  286. branchcode: $(".areaFive").val()
  287. },
  288. function(result) {
  289. if(result.state.toLowerCase() == "success") {
  290. goodslist = result.rows;
  291. $(".depart").empty();
  292. $('<option value="">请选择部门</option>').appendTo($(".quesType"));
  293. $(goodslist).each(function(i, n) {
  294. $('<option value="' + n.name
  295. + '">' + n.name
  296. + '</option>').appendTo($(".quesType"));
  297. })
  298. }
  299. });
  300. }
  301. //第三屏
  302. function threeScreen(start, end) {
  303. partOne();
  304. partTwo();
  305. partThree();
  306. partFour();
  307. }
  308. $(".channelSel").change(function() {
  309. partFour();
  310. })
  311. function Ajax() {
  312. oneScreen($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1])
  313. oneSel($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1])
  314. twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1])
  315. threeScreen();
  316. }