Bez popisu

report.js 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. var openid = helper.cookies.get("openid");
  2. var DayType = "today"
  3. Ajax();
  4. //获取数据
  5. $(".order_deta dl dt").click(function() {
  6. // var num =$(this).index();
  7. // $(".itemdiv").empty();
  8. // $(".itemdiv").eq(num).fadeIn();
  9. DayType = $(this).attr('index');
  10. var num=$(this).index();
  11. var TitText=$(this).parent("dl").parent(".order_deta").siblings(".tit");
  12. var ThisText=$(this).text();
  13. TitText.text(ThisText+"已完成工单");
  14. Ajax();
  15. })
  16. $(".buttons a ").click(function() {
  17. $(".img_c").show();
  18. $(".img_h").hide();
  19. $(this).children(".img_c").hide();
  20. $(this).children(".img_h").show();
  21. })
  22. //$('.type_down').on('tap', function() {
  23. // window.location.href = "list.html";
  24. //
  25. //});
  26. $('.return').on('tap', function() {
  27. window.location.href = "../client-side/client_index.html";
  28. });
  29. function Ajax() {
  30. $.ajax({
  31. url: huayi.config.callcenter_url + '/WxReport/GetWordOrderFinishReport',
  32. data: {
  33. openid: openid, //微信openid,
  34. daytype: DayType
  35. },
  36. async: true,
  37. dataType: 'json',
  38. type: 'get', //HTTP请求类型
  39. success: function(data) {
  40. if(data.state.toLowerCase() == "success") {
  41. var finsh = data.data[0]
  42. $(".order_num").text(finsh.合计); //合计
  43. $(".complaint").text(finsh.投诉); //投诉
  44. $(".consulting").text(finsh.咨询); //咨询
  45. }
  46. },
  47. error: function(xhr, type, errorThrown) {
  48. //异常处理;
  49. }
  50. })
  51. }
  52. //区域的数据
  53. var DayType2 = 'today'
  54. AreaLs();
  55. //周报
  56. // 使用刚指定的配置项和数据显示图表。
  57. $(".area_deta dl dt").click(function() {
  58. // var num =$(this).index();
  59. // $(".itemdiv").empty();
  60. // $(".itemdiv").eq(num).fadeIn();
  61. DayType2 = $(this).attr('index');
  62. var TitText=$(this).parent("dl").parent(".area_deta").siblings(".tit");
  63. var ThisText=$(this).text();
  64. TitText.text(ThisText+"各区域统计");
  65. AreaLs();
  66. })
  67. function AreaLs() {
  68. $.ajax({
  69. type: "get",
  70. url: huayi.config.callcenter_url + '/WxReport/GetWordOrderAreaReport',
  71. dataType: 'json',
  72. data: {
  73. openid: openid, //微信openid,
  74. daytype: DayType2
  75. },
  76. success: function(data) {
  77. if(data.state == "success") {
  78. //alert(JSON.stringify(data.data[0]))
  79. var result = data.data[0];
  80. //图标二
  81. var myChart2 = echarts.init(document.getElementById('main2'));
  82. // 指定图表的配置项和数据
  83. option2 = {
  84. color:['#e3b2f7','#ffc2c2','#aab0fb','#87e1e8','#6dffc3','#00f4e0','#2ad5ee','#599fed','#ffc2c2','#ffc2c2'],
  85. title: {
  86. // text: '某站点用户访问来源',
  87. // subtext: '纯属虚构',
  88. x: 'center'
  89. },
  90. tooltip: {
  91. trigger: 'item',
  92. formatter: "{a} <br/>{b} : {c} ({d}%)"
  93. },
  94. legend: {
  95. orient: 'vertical',
  96. left: 'left',
  97. data: []
  98. // '空港城市公司', '山西区域中心', '第三区域中心', '第二区域中心', '第一区域中心', '第六区域中心', '新密城市公司', '第五区域中心', '第二区域中心', '第四区域中心'
  99. },
  100. series: [{
  101. name: '访问来源',
  102. type: 'pie',
  103. radius: '50%',
  104. center: ['50%', '60%'],
  105. data: [{
  106. value: result.空港城市公司,
  107. name: '空港城市'
  108. },
  109. {
  110. value: result.山西区域中心,
  111. name: '山西区域'
  112. },
  113. {
  114. value: result.第三区域中心,
  115. name: '第三区域'
  116. },
  117. {
  118. value: result.第二区域中心,
  119. name: '第二区域'
  120. },
  121. {
  122. value: result.第一区域中心,
  123. name: '第一区域'
  124. }, {
  125. value: result.第六区域中心,
  126. name: '第六区域'
  127. },
  128. {
  129. value: result.新密城市公司,
  130. name: '新密城市'
  131. },
  132. {
  133. value: result.第五区域中心,
  134. name: '第五区域'
  135. },
  136. {
  137. value: result.第二区域中心,
  138. name: '第二区域'
  139. },
  140. {
  141. value: result.第四区域中心,
  142. name: '第四区域'
  143. }
  144. ],
  145. itemStyle: {
  146. emphasis: {
  147. shadowBlur: 10,
  148. shadowOffsetX: 0,
  149. shadowColor: 'rgba(0, 0, 0, 0.5)'
  150. }
  151. }
  152. }]
  153. };
  154. myChart2.setOption(option2);
  155. }
  156. },
  157. error: function(data) {
  158. console.log(data.message);
  159. }
  160. });
  161. }
  162. //工单类型
  163. var DayType3 = 'today'
  164. Worktype();
  165. //获取数据
  166. $(".report_type dl dt").click(function() {
  167. // var num =$(this).index();
  168. // $(".itemdiv").empty();
  169. // $(".itemdiv").eq(num).fadeIn();
  170. DayType3 = $(this).attr('index');
  171. var TitText=$(this).parent("dl").parent(".type_deta").siblings(".tit");
  172. var ThisText=$(this).text();
  173. TitText.text(ThisText+"各类型工单");
  174. Worktype();
  175. })
  176. function Worktype() {
  177. $.ajax({
  178. url: huayi.config.callcenter_url + '/WxReport/GetWordOrderTypeReport',
  179. data: {
  180. openid: openid, //微信openid,
  181. daytype: DayType3
  182. },
  183. async: true,
  184. dataType: 'json',
  185. type: 'get', //HTTP请求类型
  186. success: function(data) {
  187. if(data.state.toLowerCase() == "success") {
  188. var finsh = data.data
  189. cq_rates:"0.00%"
  190. cqs:33
  191. dcl_rates:"7.69%"
  192. dcls:6
  193. djd_rates:"15.38%"
  194. djds:12
  195. dpd_rates:"20.51%"
  196. dpds:16
  197. ycl_rates:"14.10%"
  198. ycls:11
  199. $(".send_perc").text(finsh.dpd_rates); //待派单占比
  200. $(".send_num").text(finsh.dpds); //待派单数量
  201. $(".send_lengh").css("width",finsh.dpd_rates);
  202. $(".receiving_perc").text(finsh.djd_rates); //待接单占比
  203. $(".receiving_num").text(finsh.djds); //待接单占比
  204. $(".receiving_lengh").css("width",finsh.djd_rates);
  205. $(".unfinsh_perc").text(finsh.dcl_rates); //待完成占比
  206. $(".unfinsh_num").text(finsh.dcls); //待完成数量
  207. $(".unfinsh_lengh").css("width",finsh.dcl_rates);
  208. $(".finsh_perc").text(finsh.ycl_rates); //已完成占比
  209. $(".finsh_num").text(finsh.ycls); //已完成数量
  210. $(".finsh_lengh").css("width",finsh.ycl_rates);
  211. $(".overtime_perc").text(finsh.cq_rates); //超期工单占比
  212. $(".overtime_num").text(finsh.cqs); //超期工单数量
  213. $(".overtime_lengh").css("width",finsh.cq_rates);
  214. }
  215. },
  216. error: function(xhr, type, errorThrown) {
  217. //异常处理;
  218. }
  219. })
  220. }