Keine Beschreibung

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