説明なし

index.js 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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. partpaat(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. keyWordDetail(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. oneSel(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1])
  49. }
  50. });
  51. laydate.render({
  52. elem: '#time4',
  53. range: '~',
  54. format: 'yyyy-MM-dd',
  55. theme: '#114a97',
  56. done: function(value) {
  57. threeS(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],$(".areaTwo").val())
  58. }
  59. });
  60. })
  61. var myDate = new Date();
  62. var typeSelc;
  63. var oneType;
  64. function turn(aa) {
  65. if(aa < 10) {
  66. aa = "0" + aa;
  67. }
  68. return aa
  69. }
  70. // 第三屏 第四屏 发光外框 定时
  71. (function() {
  72. var i = 0;
  73. var length = $(".orderState_ul >li").length;
  74. var j = 0;
  75. var length_1 = $(".orderTtype_Con li").length;
  76. setInterval(function() {
  77. if(i == length) {
  78. i = 0;
  79. $(".orderState_ul >li").removeClass('active');
  80. }
  81. $(".orderState_ul >li").eq(i).addClass('active').siblings().removeClass('active');
  82. if(i == 5) {
  83. $(".orderState_ul >li").eq(4).removeClass('active');
  84. }
  85. i++;
  86. if(j == length_1) {
  87. j = 0;
  88. }
  89. $(".orderTtype_Con li").eq(j).addClass('active').siblings().removeClass('active');
  90. j++;
  91. }, 2000);
  92. })();
  93. function oneSel(sd,ed){
  94. $.ajax({
  95. type: "get",
  96. url: huayi.config.callcenter_url + 'WOReport/GetFeedbacklList',
  97. async: true,
  98. dataType: 'json',
  99. data: {
  100. stime: sd,
  101. endtime: ed
  102. },
  103. success: function(data) {
  104. if(data.state == "success") {
  105. var sorceData=data.rows;
  106. // 咨询
  107. $(".order_widt").html(sorceData[0].daynumber);
  108. $(".order_catiy").html(sorceData[0].mounthnumber);
  109. $(".order_catypa").html(sorceData[0].Totalnumber);
  110. $(".persent_lex").html(sorceData[0].Proportion);
  111. // 投诉
  112. $(".caluy1").html(sorceData[1].daynumber);
  113. $(".caluy2").html(sorceData[1].mounthnumber);
  114. $(".caluy3").html(sorceData[1].Totalnumber);
  115. $(".caluy4").html(sorceData[1].Proportion);
  116. // 抽检
  117. $(".cico1").html(sorceData[2].daynumber);
  118. $(".cico2").html(sorceData[2].mounthnumber);
  119. $(".cico3").html(sorceData[2].Totalnumber);
  120. $(".cico4").html(sorceData[2].Proportion);
  121. // 建议 pity4
  122. $(".outit1").html(sorceData[3].daynumber);
  123. $(".outit2").html(sorceData[3].mounthnumber);
  124. $(".outit3").html(sorceData[3].Totalnumber);
  125. $(".outit4").html(sorceData[3].Proportion);
  126. // 总计 pity4
  127. $(".pity1").html(sorceData[4].daynumber);
  128. $(".pity2").html(sorceData[4].mounthnumber);
  129. $(".pity3").html(sorceData[4].Totalnumber);
  130. $(".pity4").html(sorceData[4].Proportion);
  131. }
  132. }
  133. })
  134. }
  135. $(".oneScrClick ul li").click(function(){
  136. oneType=$(this).attr("index")
  137. oneSel($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[1]);
  138. })
  139. $(window).load(function(){
  140. $(".content>div").eq(0).show().siblings().hide();
  141. // $(".tabItems>span").remove();
  142. })
  143. $(".tabItems>li").click(function () {
  144. // alert('我被点击了')
  145. $(this).addClass("active").siblings().removeClass("active");
  146. var index = $(this).index();
  147. // $(this).css("cursor","pointer");
  148. $(".content>div").eq(index).show().siblings().hide();
  149. })
  150. //第二屏
  151. function twoScreen(start,end) {
  152. // keyWord(start, end)
  153. }
  154. keyWordDetail();
  155. // 右侧部门 WorkOrder/GetQuestionNameType
  156. function keyWordDetail(start,end) {
  157. $.ajax({
  158. type: "get",
  159. url: huayi.config.callcenter_url + "WOReport/GetComplainthandlList",
  160. async: true,
  161. dataType: 'json',
  162. data: {
  163. stime: start,
  164. endtime: end,
  165. questionName:$(".quesType").val(),
  166. product:$("#product_name").val(),//产品
  167. salesBase:$("#category").val(),//基地
  168. },
  169. success: function(data) {
  170. if(data.state.toLowerCase() == 'success') {
  171. $('.scroll_table tbody').html('');
  172. var con = data.rows;
  173. //alert(con.length)
  174. if(con.length==0){
  175. $('.tagcloud').html('');
  176. }else{
  177. $('.tagcloud').html('');
  178. //alert(con[0].worker.length)
  179. $(con[0].worker).each(function (k, j) {
  180. if(k < 3) {
  181. var strs = '<div index="" class="tagcloud_bj">' +
  182. '<p class="tag_title" style="margin-top:7px">'+
  183. '<span class="danhao">'+"工单编号" + '</span>'+
  184. '<span class="">'+j.F_WorkOrderCode + '</span>'+
  185. '<span class="Yichin">'+j.F_State + '</span>'+
  186. '</p>' +
  187. '<p class="tag_title">'+
  188. '<span class="danhao">'+"超期时间" + '</span>'+
  189. '<span class="">'+j.overtime + '</span>'+
  190. '</p>' +
  191. '<p class="tag_title" style="width:100%;height:117px;">'+
  192. '<span class="danhao washpa" style="float: left;">'+"问题描述" + '</span>'+
  193. '<span class="Wentimo" style="text-align: justify !important;float: left;">'+j.F_Description + '</span>'+
  194. '</p>' +
  195. '<p class="tag_title aacdu" style="margin-top:15px">'+
  196. '<span class="danhao">'+"责任科室" + '</span>'+
  197. '<span class="">'+j.F_Responsibility + '</span>'+
  198. '<span class="danhao" style="margin-left:0px;">'+"销售基地" + '</span>'+
  199. '<span class="">'+j.F_SalesBase + '</span>'+
  200. '</p>' +
  201. '</div>'
  202. $('.tagcloud').append(strs);
  203. }
  204. });
  205. }
  206. // position: absolute;top;0;
  207. $(con).each(function (j, n) {
  208. var rate = '';
  209. if (n.rate) { rate = n.rate;}
  210. var str = '<tr><td>'
  211. + n.name + '</td><td style="width:60px;">'
  212. + n.number + '</td><td style="width:90px;">'
  213. + n.ongesttime + '</td><td style="width:90px;">'
  214. + n.minimumtime + '</td><td style="width:90px;">'
  215. + n.averageTime + '</td><td style="width:75px;">'
  216. + n.median + '</td><td style="width:90px;">'
  217. + n.Overdue + '</td><td style="width:110px;">'
  218. + n.efficiency + '</td></tr>'
  219. $('.scroll_table tbody').append(str);
  220. });
  221. // keyWord();
  222. $(".scroll_table").Scroll({
  223. line: 1,
  224. speed: 500,
  225. timer: 2000
  226. });
  227. }
  228. }
  229. });
  230. }
  231. var Yname;
  232. $(".scroll_table tbody").on("click","tr",function(){
  233. $(".scroll_table tbody tr").removeClass("backg_cor");
  234. $(this).addClass("backg_cor");
  235. $(this).children("td").eq(0).addClass("bacg");
  236. // // alert($(".bacg").text());
  237. Yname =$(this).children("td").eq(0).text();
  238. $('.tagcloud').html('');
  239. textCon();
  240. });
  241. function textCon() {
  242. $.ajax({
  243. type: "get",
  244. url: huayi.config.callcenter_url + "WOReport/GetComplainthandlList",
  245. async: true,
  246. dataType: 'json',
  247. data: {
  248. stime: $('#time2').val() && $('#time2').val().split(' ~ ')[0],
  249. endtime: $('#time2').val() && $('#time2').val().split(' ~ ')[1],
  250. questionName:Yname
  251. },
  252. success: function(data) {
  253. if(data.state.toLowerCase() == 'success') {
  254. var con = data.rows;
  255. var arr;
  256. $.each(con, function(index, ele) {
  257. arr = con[index].worker; //console.log(allData);
  258. console.log(JSON.stringify(arr))
  259. console.log(arr.overtime)
  260. });
  261. if (arr) {
  262. $(arr).each(function(k, j) {
  263. if(k < 3) {
  264. var strs = '<div index="" class="tagcloud_bj">' +
  265. '<p class="tag_title" style="margin-top:7px">'+
  266. '<span class="danhao">'+"工单编号" + '</span>'+
  267. '<span class="">'+j.F_WorkOrderCode + '</span>'+
  268. '<span class="Yichin">'+j.F_State + '</span>'+
  269. '</p>' +
  270. '<p class="tag_title">'+
  271. '<span class="danhao">'+"超期时间" + '</span>'+
  272. '<span class="">'+j.overtime + '</span>'+
  273. '</p>' +
  274. '<p class="tag_title" style="width:100%;height:95px;">'+
  275. '<span class="danhao washpa" style="float: left;">'+"问题描述" + '</span>'+
  276. '<span class="Wentimo" style="text-align: justify !important;float: left;">'+j.F_Description + '</span>'+
  277. '</p>' +
  278. '<p class="tag_title aacdu" style="margin-top:50px">'+
  279. '<span class="danhao">'+"责任科室" + '</span>'+
  280. '<span class="">'+j.F_Responsibility + '</span>'+
  281. '<span class="danhao" style="margin-left:0px;">'+"销售基地" + '</span>'+
  282. '<span class="">'+j.F_SalesBase + '</span>'+
  283. '</p>' +
  284. '</div>'
  285. $('.tagcloud').append(strs);
  286. }
  287. })
  288. }else{
  289. $('.tagcloud').html('');
  290. }
  291. }
  292. }
  293. });
  294. }
  295. //time3
  296. $(".tagcloud").on("click","div",function(){
  297. $(".tagcloud div").addClass("tagcloud_bj");
  298. $(".tagcloud div").removeClass("tagcloud_bjShine");
  299. $(this).removeClass("tagcloud_bj");
  300. $(this).addClass("tagcloud_bjShine");
  301. //keyWordDetail($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1]);
  302. });
  303. quesTypeSel();
  304. $("#Product_Category").change(function() {
  305. partpaat($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1],$(".areaFive").val());
  306. })
  307. $("#customer_taxPointDes").change(function() {
  308. partpaat($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1],$(".areaFive").val());
  309. })
  310. $("#styqu").change(function() {
  311. partpaat($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1],$(".areaFive").val());
  312. })
  313. $("#customer_legalName").change(function() {
  314. partpaat($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1],$(".areaFive").val());
  315. })
  316. $("#customer_comaddress").change(function() {
  317. partpaat($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1],$(".areaFive").val());
  318. })
  319. $("#xiaoshou").change(function() {
  320. partpaat($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1],$(".areaFive").val());
  321. })
  322. // $("#time2").change(function() {
  323. // keyWordDetail($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],$(".areaFive").val());
  324. // })
  325. $("#time3").change(function() {
  326. oneSel(sd,ed);
  327. })
  328. $(".quesType").change(function() {
  329. keyWordDetail($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],$(".areaFive").val());
  330. })
  331. $("#product_name").change(function() {
  332. keyWordDetail($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],$(".areaFive").val());
  333. })
  334. $("#category").change(function() {
  335. keyWordDetail($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1],$(".areaFive").val());
  336. })
  337. //部门下拉框
  338. function quesTypeSel() {
  339. $.getJSON( huayi.config.callcenter_url +"WorkOrder/GetQuestionName",
  340. {
  341. branchcode: $(".areaFive").val()
  342. },
  343. function(result) {
  344. if(result.state.toLowerCase() == "success") {
  345. goodslist = result.data;
  346. $(".depart").empty();
  347. $('<option value="">问题类别</option>').appendTo($(".quesType"));
  348. $(goodslist).each(function(i, n) {
  349. $('<option value="' + n.F_QuestionName
  350. + '">' + n.F_QuestionName
  351. + '</option>').appendTo($(".quesType"));
  352. })
  353. }
  354. });
  355. }
  356. //第三屏
  357. function threeScreen(start, end) {
  358. // partOne();
  359. // partTwo();
  360. // partThree();
  361. // partFour();
  362. }
  363. $(".channelSel").change(function() {
  364. partFour();
  365. })
  366. function Ajax() {
  367. // oneScreen($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[1])
  368. oneSel($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[1])
  369. // twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1])
  370. threeScreen();
  371. }