商丘12345 前端

jiedanbumen.js 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. function showTools(a){
  2. if($(a).find(".tooltips").css("display") == 'none') {
  3. $(a).find(".tooltips").show();
  4. $(a).parents('tr').siblings().find(".tooltips").hide();
  5. }else{
  6. $(a).find(".tooltips").hide();
  7. }
  8. }
  9. $(document).ready(function(){
  10. laydate.render({
  11. elem: '#time1',
  12. theme: '#00a1cb'
  13. });
  14. laydate.render({
  15. elem: '#time2',
  16. theme: '#00a1cb'
  17. });
  18. laydate.render({
  19. elem: '#time3',
  20. theme: '#00a1cb'
  21. });
  22. // 工单状态part1
  23. var jiedan = echarts.init(document.getElementById('jiedan1'));
  24. jiedan.setOption({
  25. tooltip: {
  26. trigger: 'axis',
  27. axisPointer: {
  28. type: 'cross',
  29. label: {
  30. show: true,
  31. backgroundColor: '#333'
  32. }
  33. }
  34. },
  35. legend: {
  36. bottom:'bottom',
  37. data: [],
  38. textStyle: {
  39. color: '#ccc'
  40. }
  41. },
  42. xAxis: {
  43. name: '月份',
  44. data: [],
  45. axisLine: {
  46. lineStyle: {
  47. color: '#ccc'
  48. }
  49. }
  50. },
  51. yAxis: {
  52. name: '数量',
  53. // min: 0,
  54. // max: 400,
  55. // interval: 50,
  56. splitLine: {
  57. show: false
  58. },
  59. axisLine: {
  60. lineStyle: {
  61. color: '#ccc'
  62. }
  63. }
  64. },
  65. series: []
  66. });
  67. function partOne(){
  68. var index = layer.load(1, {
  69. shade: [0.5, '#030303'] //0.1透明度的白色背景
  70. });
  71. $.ajax({
  72. type:"get",
  73. url: huayi.config.callcenter_url + "info/GetStateCountMonthByDate",
  74. async:true,
  75. dataType:'json',
  76. success:function(data){
  77. if(data.state.toLowerCase()=='success'){
  78. layer.close(index);
  79. var con=data.data;
  80. // var jieDans = result.data.a;
  81. var counts = con.counts;
  82. var sers = [];
  83. $(counts).each(function(i, n) {
  84. var obj = {};
  85. obj.name = con.cols[i];
  86. obj.type = "line";
  87. obj.smooth = true;
  88. obj.showAllSymbol = true;
  89. obj.symbol = "emptyCircle";
  90. obj.symbolSize = 10;
  91. obj.data = n;
  92. sers.push(obj)
  93. });
  94. jiedan.setOption({
  95. xAxis: {
  96. data: con.months
  97. },
  98. legend: {
  99. data: con.cols
  100. },
  101. series: sers
  102. });
  103. }
  104. }
  105. });
  106. }
  107. //受理渠道24小时统计 part2
  108. var part2 = echarts.init(document.getElementById('timefb'));
  109. part2.setOption({
  110. tooltip: {
  111. trigger: 'axis',
  112. axisPointer: {
  113. type: 'shadow',
  114. label: {
  115. show: true,
  116. backgroundColor: '#333'
  117. }
  118. },
  119. formatter: function(datas)
  120. {
  121. var res = datas[0].name + '<br/>', val;
  122. for(var i = 0, length = datas.length; i < length; i++) {
  123. val = (datas[i].value);
  124. res += datas[i].seriesName + ':' + val + '<br/>';
  125. }
  126. return res;
  127. }
  128. },
  129. legend: {
  130. // top: 30,
  131. // orient: 'vertical',
  132. bottom:'bottom',
  133. data: ['受理工单数','处理工单数'],
  134. textStyle: {
  135. color: '#fff'
  136. }
  137. },
  138. xAxis: {
  139. name: '时',
  140. data: [],
  141. axisLine: {
  142. lineStyle: {
  143. color: '#ccc'
  144. }
  145. },
  146. },
  147. yAxis: {
  148. name: '数量',
  149. splitLine: {
  150. show: false
  151. },
  152. axisLine: {
  153. lineStyle: {
  154. color: '#ccc'
  155. }
  156. }
  157. },
  158. series: [{
  159. name: '受理工单数',
  160. type: 'bar',
  161. barWidth: '20%',
  162. itemStyle: {
  163. normal: {
  164. color: new echarts.graphic.LinearGradient(
  165. 0, 0, 0, 1, [{offset: 0, color: '#83bff6'},
  166. {offset: 0.5, color: '#188df0'},
  167. {offset: 1, color: '#188df0'}
  168. ]
  169. )
  170. }
  171. },
  172. label: {
  173. normal: {
  174. show: true,
  175. position: 'top', //顶部数据显示位置
  176. formatter: '{c}' // 这里是数据展示的时候显示的数据
  177. }
  178. },
  179. data: []
  180. },{
  181. name: '处理工单数',
  182. type: 'bar',
  183. barWidth: '20%',
  184. itemStyle: {
  185. normal: {
  186. color: new echarts.graphic.LinearGradient(
  187. 0, 0, 0, 1, [{
  188. offset: 0,
  189. color: '#14c8d4'
  190. },
  191. {
  192. offset: 1,
  193. color: '#43eec6'
  194. }
  195. ]
  196. )
  197. }
  198. },
  199. label: {
  200. normal: {
  201. show: true,
  202. position: 'top', //顶部数据显示位置
  203. formatter: '{c}' // 这里是数据展示的时候显示的数据
  204. }
  205. },
  206. data: []
  207. }]
  208. });
  209. function partTwo(){
  210. var index = layer.load(1, {
  211. shade: [0.5, '#030303'] //0.1透明度的白色背景
  212. });
  213. $.ajax({
  214. type:"get",
  215. url: huayi.config.callcenter_url + "info/GetDealCount24ByDate",
  216. dataType: 'json',
  217. async: true,
  218. data:{
  219. date:$('#time1').val(),
  220. },
  221. success:function(data){
  222. if(data.state.toLowerCase()=='success'){
  223. layer.close(index);
  224. var con=data.data;
  225. // var qd_legend = [];
  226. // var qd_sers = [];
  227. // var ser_data = [];
  228. // var qd_label = {
  229. // normal: {
  230. // show: true,
  231. // position: 'inside',
  232. // formatter: '{c}%'
  233. // }
  234. // };
  235. part2.setOption({
  236. xAxis: {
  237. data:con.hours
  238. },
  239. series: [{
  240. data: con.acounts
  241. },{
  242. data:con.fcounts
  243. }]
  244. });
  245. }
  246. }
  247. });
  248. }
  249. $('.part1Btn').click(function(){
  250. partTwo();
  251. })
  252. //part 3
  253. //部门下拉框
  254. $.getJSON(huayi.config.callcenter_url + "info/GetDeptList ", function(result) {
  255. if(result.state.toLowerCase() == "success") {
  256. goodslist = result.data;
  257. bindseat($("#dep"));
  258. }
  259. });
  260. //下拉框
  261. function bindseat(obj) {
  262. obj.empty();
  263. obj.append('<option value="" >请选择</option>');
  264. $(goodslist).each(function(i, n) {
  265. obj.append('<option value="' + n.F_DeptId + '">' + n.F_DeptName + '</option>');
  266. })
  267. }
  268. partThree();
  269. function partThree(){
  270. var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  271. });
  272. $('.table1 tbody').html('');
  273. $.ajax({
  274. type:"get",
  275. url:huayi.config.callcenter_url + "info/GetDeptCountByDate",
  276. async:true,
  277. dataType:'json',
  278. data:{
  279. start:$('#time2').val(),
  280. end:$('#time3').val(),
  281. deptid:$('#dep').val()
  282. },
  283. success:function(data){
  284. if(data.state.toLowerCase()=='success'){
  285. layer.close(index);
  286. var con=data.data;
  287. $(con).each(function(i,n){
  288. var html="";
  289. // $('<tr>'+
  290. // '<td>1</td>'+
  291. // '<td>' + n.AreaName + '</td>'+
  292. // '<td>' + n.Count + '</td>'+
  293. // '</tr>').appendTo('.table1 tbody');
  294. html = '<tr><td>' +
  295. '<div class="tool_count" onClick="showTools(this)">' + n.AreaName + '<div class="tooltips clearfix">'+
  296. '<div class="toolsTitle">'+ n.AreaName +'</div>'
  297. $(n.Item).each(function(j, m) {
  298. html += '<p>' + m.TypeName + ':' + m.Count + '</p>'
  299. })
  300. html += '</div>' +
  301. '</div>' +
  302. '</td>' +
  303. '<td>' + n.Count + '</td>' +
  304. '</tr>';
  305. $('.table1 tbody').append(html);
  306. })
  307. }
  308. }
  309. });
  310. }
  311. $('.part3Btn').click(function(){
  312. partThree();
  313. })
  314. Ajax();
  315. function Ajax(){
  316. partOne()
  317. partTwo();
  318. partThree();
  319. }
  320. setInterval(Ajax, huayi.config.indextime);//Ajax调用函数
  321. })