Keine Beschreibung

threeScreen.js 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. /**
  2. * 运维图形统计 报修 耗材 隐藏
  3. * */
  4. var stateVal = 0; //默认当天
  5. $(function() {
  6. //获取数据
  7. getPiedatas();
  8. initPies();
  9. });
  10. //获取数据
  11. function getPiedatas(start,end) {
  12. myChart0 = echarts.init(document.getElementById('pieChart0'));
  13. $.ajax({
  14. type: "get",
  15. url: huayi.config.callcenter_url + "WOReport/GetComplainthandlList",
  16. async: false,
  17. dataType: 'json',
  18. data: {
  19. stime: start,
  20. endtime: end,
  21. questionName:$(".quesType").val(),
  22. isEnd:$('#customer_exceed').val(),
  23. product:$("#product_name").val(),//产品
  24. salesBase:$("#category").val(),//基地
  25. },
  26. success: function(data) {
  27. if(data.state.toLowerCase() == "success") {
  28. data = data.rows;
  29. if(data.length>0) {
  30. leftHigh=data[0].number
  31. rightHigh=Math.round(data[0].ongesttime)
  32. quesTypeData=[];
  33. $(data).each(function(i, n) {
  34. //数据
  35. quesTypeData[i]=n.name;
  36. })
  37. //数量
  38. numberData = [];
  39. $(data).each(function(i, n) {
  40. numberData[i] = n.number;
  41. })
  42. if ($('#customer_exceed').val()==1) {
  43. //超期未完成
  44. endOverdueName="超期未完成";
  45. endOverdueData = [];
  46. $(data).each(function(i, n) {
  47. endOverdueData[i] = n.Overdue;
  48. })
  49. console.log(endOverdueData)
  50. }else if($('#customer_exceed').val()==2){
  51. //已回访数量
  52. endOverdueName="已回访"
  53. endOverdueData = [];
  54. $(data).each(function(i, n) {
  55. endOverdueData[i] = n.EndOverdue;
  56. })
  57. }
  58. //效率提升率
  59. efficiencyData = [];
  60. $(data).each(function(i, n) {
  61. efficiencyData[i] = n.efficiency.split('%')[0];
  62. })
  63. //平均用时
  64. averageData = [];
  65. $(data).each(function(i, n) {
  66. averageData[i] = n.averageTime.split('h')[0];
  67. })
  68. //中位数
  69. medianData = [];
  70. $(data).each(function(i, n) {
  71. medianData[i] = n.median.split('h')[0];
  72. })
  73. //用时最短
  74. minimumtimeData = [];
  75. $(data).each(function(i, n) {
  76. minimumtimeData[i] = n.minimumtime.split('h')[0];
  77. })
  78. //用时最长
  79. ongesttimeData = [];
  80. $(data).each(function(i, n) {
  81. ongesttimeData[i] = n.ongesttime.split('h')[0];
  82. })
  83. }else{
  84. //数据
  85. quesTypeData = []
  86. //数量
  87. numberData = []
  88. if ($('#customer_exceed').val()==1) {
  89. //超期未完成
  90. endOverdueName="超期未完成";
  91. endOverdueData = [];
  92. }else if($('#customer_exceed').val()==2){
  93. //已回访数量
  94. endOverdueName="已回访"
  95. endOverdueData = [];
  96. }
  97. //效率提升率
  98. efficiencyData = [];
  99. //平均用时
  100. averageData = [];
  101. //中位数
  102. medianData = [];
  103. //用时最短
  104. minimumtimeData = [];
  105. //用时最长
  106. ongesttimeData = [];
  107. }
  108. }
  109. }
  110. });
  111. }
  112. //初始化图形
  113. function initPies() {
  114. initPie0(); //初始化 工单数量统计
  115. }
  116. //初始化 工单数量统计
  117. function initPie0() {
  118. myChart0.on('click', function (params) {
  119. if(params.componentType == "xAxis"){
  120. }else{
  121. Yname =params.name;
  122. if (Yname=="合计") {
  123. Yname=""
  124. }
  125. $('.tagcloud').html('');
  126. textCon();
  127. }
  128. });
  129. myChart0.setOption({
  130. textStyle: {
  131. fontSize: 16 * getHeightScale,
  132. },
  133. tooltip: {
  134. trigger: 'axis',
  135. axisPointer: {
  136. type: 'cross',
  137. crossStyle: {
  138. color: '#999'
  139. }
  140. }
  141. },
  142. toolbox: {
  143. feature: {
  144. dataView: {
  145. show: false,
  146. readOnly: false
  147. },
  148. magicType: {
  149. show: false,
  150. type: ['line','bar']
  151. },
  152. restore: {
  153. show: false
  154. },
  155. saveAsImage: {
  156. show: false
  157. }
  158. }
  159. },
  160. legend: {
  161. data: quesTypeData
  162. },
  163. color: ['#2FCDCD','#1852B5','#D08065','#1852B5','#1852B5', '#1852B5', '#1852B5'],
  164. //color: ['#2F4554','#2F4554','#61A0A8','#D48265','#91C7AE','#749F83', '#CA8622', '#00e9ff'],
  165. xAxis: [{
  166. type: 'category',
  167. data: quesTypeData,
  168. triggerEvent:true,
  169. axisPointer: {
  170. type: 'shadow'
  171. },
  172. axisLine: { //这是x轴文字颜色
  173. lineStyle: {
  174. color: "#00e9ff",
  175. }
  176. },
  177. axisLabel: {
  178. textStyle: {
  179. fontSize: 16 * getHeightScale // 让字体变大
  180. }
  181. }
  182. }],
  183. yAxis: [{
  184. type: 'value',
  185. name: '数量',
  186. min: 0,
  187. max: leftHigh,
  188. interval: Math.ceil(leftHigh/10),
  189. splitLine: {    
  190. show: false  
  191. },
  192. axisLine: { //这是x轴文字颜色
  193. lineStyle: {
  194. color: "#00e9ff",
  195. }
  196. },
  197. axisLabel: {
  198. formatter: '{value}',
  199. textStyle: {
  200. fontSize: 16 * getHeightScale // 让字体变大
  201. }
  202. }
  203. },
  204. {
  205. type: 'value',
  206. name: '天',
  207. min: 0,
  208. max: rightHigh,
  209. interval: Math.ceil(rightHigh/10),
  210. splitLine: {    
  211. show: false  
  212. },
  213. axisLine: { //这是x轴文字颜色
  214. lineStyle: {
  215. color: "#00e9ff",
  216. }
  217. },
  218. axisLabel: {
  219. formatter: '{value} 天',
  220. textStyle: {
  221. fontSize: 16 * getHeightScale // 让字体变大
  222. }
  223. }
  224. }
  225. ],
  226. series: [
  227. {
  228. name: endOverdueName,
  229. type: 'bar',
  230. data: endOverdueData
  231. },
  232. {
  233. name: '总数',
  234. type: 'bar',
  235. data: numberData
  236. },
  237. {
  238. name: '平均用时',
  239. type: 'line',
  240. data: averageData,
  241. yAxisIndex: 1,
  242. smooth: true
  243. }
  244. ,
  245. {
  246. name: '中位数',
  247. type: 'line',
  248. symbolSize: 0, // symbol的大小设置为0
  249. showSymbol: false, // 不显示symbol
  250. lineStyle: {
  251. normal: {
  252. color: 'rgba(0, 0, 0, 0)', // 线的颜色是透明的
  253. width: 0
  254. }
  255. },
  256. data: medianData
  257. },
  258. {
  259. name: '效率提升率(%)',
  260. type: 'line',
  261. symbolSize: 0, // symbol的大小设置为0
  262. showSymbol: false, // 不显示symbol
  263. lineStyle: {
  264. normal: {
  265. color: 'rgba(0, 0, 0, 0)', // 线的颜色是透明的
  266. width: 0
  267. }
  268. },
  269. data: efficiencyData
  270. },
  271. {
  272. name: '用时最短',
  273. type: 'line',
  274. symbolSize: 0, // symbol的大小设置为0
  275. showSymbol: false, // 不显示symbol
  276. lineStyle: {
  277. normal: {
  278. color: 'rgba(0, 0, 0, 0)', // 线的颜色是透明的
  279. width: 0
  280. }
  281. },
  282. data: minimumtimeData
  283. },
  284. {
  285. name: '用时最长',
  286. type: 'line',
  287. symbolSize: 0, // symbol的大小设置为0
  288. showSymbol: false, // 不显示symbol
  289. lineStyle: {
  290. normal: {
  291. color: 'rgba(0, 0, 0, 0)', // 线的颜色是透明的
  292. width: 0
  293. }
  294. },
  295. data: ongesttimeData
  296. }
  297. ]
  298. })
  299. }