永城市12345 (县级市)- 来源于虞城县12345 - 所有县级统一API

receiptDepartment.js 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. $(function() {
  2. laydate.render({
  3. elem: '#phone_time',
  4. eventElem:'.data-input-icon1',
  5. trigger:'click',
  6. range: '~',
  7. theme: '#114a97',
  8. done: function(value, date) {
  9. partTwo(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1]);
  10. partThree(value && value.split(' ~ ')[0]);
  11. }
  12. });
  13. Ajax();
  14. $("#dep").change(function() {
  15. partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1])
  16. })
  17. })
  18. //part 1 //工单状态统计 对接完毕
  19. var phoneTimeCount = echarts.init(document.getElementById('phoneTimeCount'));
  20. phoneTimeCount.setOption({
  21. color: ['#69e1a9', '#6a91e0', '#ceba5f', '#f06e84', '#569d4e', '#7d55ba', '#ce5aba', '#345cdd', '#569d4e'],
  22. tooltip: {
  23. trigger: 'axis',
  24. axisPointer: {
  25. type: 'cross',
  26. label: {
  27. show: true,
  28. backgroundColor: '#333'
  29. }
  30. }
  31. },
  32. grid: {
  33. left: '2%',
  34. right: '5%',
  35. bottom: '6%',
  36. containLabel: true
  37. },
  38. legend: {
  39. top: 'top',
  40. left: '180px',
  41. data: [],
  42. textStyle: {
  43. color: '#00e9ff'
  44. }
  45. },
  46. xAxis: {
  47. name: '月份',
  48. data: [],
  49. axisLine: {
  50. lineStyle: {
  51. color: '#3061a2'
  52. }
  53. },
  54. axisTick: {
  55. alignWithLabel: true,
  56. show: false
  57. },
  58. axisLabel: { //横轴字体颜色
  59. show: true,
  60. textStyle: {
  61. color: '#eff0f4'
  62. }
  63. }
  64. },
  65. yAxis: {
  66. name: '(数量)',
  67. splitLine: {
  68. show: false
  69. },
  70. axisLine: {
  71. lineStyle: {
  72. color: '#3061a2'
  73. }
  74. },
  75. axisLabel: { //横轴字体颜色
  76. show: true,
  77. textStyle: {
  78. color: '#eff0f4'
  79. }
  80. }
  81. },
  82. series: []
  83. });
  84. function partOne() {
  85. $.ajax({
  86. type: "get",
  87. url: huayi.config.callcenter_url + "info/GetStateCountMonthByDate",
  88. async: true,
  89. dataType: 'json',
  90. success: function(data) {
  91. if(data.state.toLowerCase() == 'success') {
  92. // layer.close(index);
  93. var con = data.data;
  94. // var jieDans = result.data.a;
  95. var counts = con.counts;
  96. var sers = [];
  97. $(counts).each(function(i, n) {
  98. var obj = {};
  99. obj.name = con.cols[i];
  100. obj.type = "line";
  101. obj.smooth = true;
  102. obj.showAllSymbol = true;
  103. obj.symbol = "emptyCircle";
  104. obj.symbolSize = 10;
  105. obj.data = n;
  106. sers.push(obj)
  107. });
  108. phoneTimeCount.setOption({
  109. xAxis: {
  110. data: con.months
  111. },
  112. legend: {
  113. data: con.cols
  114. },
  115. series: sers
  116. });
  117. }
  118. }
  119. });
  120. }
  121. //part 2 //各部门工单情况
  122. //部门下拉框
  123. $.getJSON(huayi.config.callcenter_url + "info/GetDeptList ", function(result) {
  124. if(result.state.toLowerCase() == "success") {
  125. goodslist = result.data;
  126. bindseat($("#dep"));
  127. }
  128. });
  129. //下拉框
  130. function bindseat(obj) {
  131. obj.empty();
  132. obj.append('<option value="" >请选择部门</option>');
  133. $(goodslist).each(function(i, n) {
  134. obj.append('<option value="' + n.F_DeptId + '">' + n.F_DeptName + '</option>');
  135. })
  136. }
  137. function partTwo(starts, ends) {
  138. $.ajax({
  139. type: "get",
  140. url: huayi.config.callcenter_url + "Info/GetDeptCountByDateNew",
  141. dataType: 'json',
  142. async: true,
  143. data: {
  144. start: starts,
  145. end: ends,
  146. deptid: $('#dep').val()
  147. },
  148. success: function(data) {
  149. if(data.state.toLowerCase() == 'success') {
  150. $('.thead tr').html('');
  151. $('#scroll_table tbody').html('');
  152. var con = data.data;
  153. var thead = con[0];
  154. $.each(thead, function(k, val) {
  155. $('<td>' + k + '</td>').appendTo('.thead tr');
  156. })
  157. $(con).each(function(j, n) {
  158. var str = '<tr>'
  159. $.each(thead, function(j, m) {
  160. console.log();
  161. $.each(n, function(k, val) {
  162. if(j == k) {
  163. if(val == '') {
  164. val = 0;
  165. }
  166. str += '<td>' + val + '</td>'
  167. }
  168. })
  169. })
  170. str += '</tr>';
  171. $('#scroll_table tbody').append(str);
  172. })
  173. $("#scroll_table").Scroll({
  174. line: 1,
  175. speed: 500,
  176. timer: 2000
  177. });
  178. }
  179. }
  180. });
  181. }
  182. // part3 工单处理时间分布
  183. var sitProportion = echarts.init(document.getElementById('sitProportion')); //坐席闲忙比例
  184. sitProportion.setOption({
  185. color: ['#4ab7c7', '#2484d9', '#2e39c1'],
  186. tooltip: {
  187. trigger: 'axis',
  188. axisPointer: {
  189. type: 'shadow',
  190. label: {
  191. show: true,
  192. backgroundColor: '#333'
  193. }
  194. },
  195. formatter: function(datas) {
  196. var res = datas[0].name + '<br/>',
  197. val;
  198. for(var i = 0, length = datas.length; i < length; i++) {
  199. // val = (datas[i].value) + '%';
  200. val = (datas[i].value);
  201. res += datas[i].seriesName + ':' + val + '<br/>';
  202. }
  203. return res;
  204. }
  205. },
  206. legend: {
  207. top: 'top',
  208. left: '165px',
  209. data: ['受理工单数', '处理工单数'],
  210. textStyle: {
  211. color: '#00e9ff'
  212. }
  213. },
  214. grid: {
  215. left: '2%',
  216. right: '5%',
  217. bottom: '5%',
  218. containLabel: true
  219. },
  220. xAxis: {
  221. name: '时',
  222. data: [],
  223. axisLine: {
  224. lineStyle: {
  225. color: '#3061a2'
  226. }
  227. },
  228. axisTick: {
  229. alignWithLabel: true,
  230. show: false
  231. },
  232. axisLabel: { //横轴字体颜色
  233. show: true,
  234. textStyle: {
  235. color: '#eff0f4'
  236. }
  237. }
  238. },
  239. yAxis: {
  240. name: '(数量)',
  241. splitLine: {
  242. show: false
  243. },
  244. axisLine: {
  245. lineStyle: {
  246. color: '#3061a2'
  247. }
  248. },
  249. axisLabel: { //横轴字体颜色
  250. show: true,
  251. textStyle: {
  252. color: '#eff0f4'
  253. }
  254. }
  255. },
  256. series: [{
  257. name: '受理工单数',
  258. type: 'bar',
  259. barGap: 0,
  260. data: []
  261. }, {
  262. name: '处理工单数',
  263. type: 'bar',
  264. data: []
  265. }]
  266. });
  267. function partThree(starts, ends) {
  268. $.ajax({
  269. type: "get",
  270. url: huayi.config.callcenter_url + "info/GetDealDate",
  271. dataType: 'json',
  272. async: true,
  273. data: {
  274. start: starts,
  275. end: ends,
  276. },
  277. success: function(data) {
  278. if(data.state.toLowerCase() == 'success') {
  279. var con = data.data;
  280. sitProportion.setOption({
  281. xAxis: {
  282. data: con.hours
  283. },
  284. series: [{
  285. data: con.acounts
  286. }, {
  287. data: con.fcounts
  288. }]
  289. });
  290. }
  291. }
  292. });
  293. }
  294. function Ajax() {
  295. partOne()
  296. partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1]);
  297. partThree($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1]);
  298. }