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

TelephoneDetails.js 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. $(function(){
  2. laydate.render({
  3. elem: '#time1',
  4. eventElem:'.data-input-icon1',
  5. trigger:'click',
  6. range: '~',
  7. theme: '#114a97',
  8. done: function(value, date) {
  9. partOne(value && value.split(' ~ ')[0],value && value.split(' ~ ')[1]);
  10. partTwo(value && value.split(' ~ ')[0]);
  11. partThree(value && value.split(' ~ ')[0]);
  12. }
  13. });
  14. Ajax();
  15. })
  16. var sitProportion = echarts.init(document.getElementById('sitProportion')); //坐席闲忙比例
  17. sitProportion.setOption({
  18. color: ['#4ab7c7', '#2484d9', '#2e39c1'],
  19. tooltip: {
  20. trigger: 'axis',
  21. axisPointer: {
  22. type: 'cross',
  23. label: {
  24. show: true,
  25. backgroundColor: '#333'
  26. }
  27. }
  28. },
  29. legend: {
  30. top: 'top',
  31. left: '135px',
  32. data: ['呼入量', '呼入接通量', '呼出','呼出接通量'],
  33. textStyle: {
  34. color: '#00e9ff'
  35. }
  36. },
  37. grid: {
  38. left: '1%',
  39. right: '3%',
  40. bottom: '5%',
  41. containLabel: true
  42. },
  43. xAxis: {
  44. name: '坐席',
  45. data: [],
  46. axisLine: {
  47. lineStyle: {
  48. color: '#3061a2'
  49. }
  50. },
  51. axisTick: {
  52. alignWithLabel: true,
  53. show: false
  54. },
  55. axisLabel: { //横轴字体颜色
  56. show: true,
  57. textStyle: {
  58. color: '#eff0f4'
  59. }
  60. }
  61. },
  62. yAxis: {
  63. name: '通',
  64. splitLine: {
  65. show: false
  66. },
  67. axisLine: {
  68. lineStyle: {
  69. color: '#3061a2'
  70. }
  71. },
  72. axisLabel: { //横轴字体颜色
  73. show: true,
  74. textStyle: {
  75. color: '#eff0f4'
  76. }
  77. }
  78. },
  79. series: [{
  80. name: '呼入量',
  81. type: 'line',
  82. smooth: true,
  83. showAllSymbol: true,
  84. symbol: "emptyCircle",
  85. symbolSize: 10,
  86. data: []
  87. }, {
  88. name: '呼入接通量',
  89. type: 'line',
  90. smooth: true,
  91. showAllSymbol: true,
  92. symbol: "emptyCircle",
  93. symbolSize: 10,
  94. data: []
  95. }, {
  96. name: '呼出',
  97. type: 'line',
  98. smooth: true,
  99. showAllSymbol: true,
  100. symbol: "emptyCircle",
  101. symbolSize: 10,
  102. data: []
  103. }, {
  104. name: '呼出接通量',
  105. type: 'line',
  106. smooth: true,
  107. showAllSymbol: true,
  108. symbol: "emptyCircle",
  109. symbolSize: 10,
  110. data: []
  111. }]
  112. });
  113. function partOne(starts,ends) {
  114. $.ajax({
  115. type: "get",
  116. url: huayi.config.callcenter_url + "info/GetAgentTelCount",
  117. async: true,
  118. dataType: 'json',
  119. data: {
  120. start: starts,
  121. end:ends
  122. },
  123. success: function(data) {
  124. if(data.state.toLowerCase() == 'success') {
  125. // layer.close(index);
  126. var con = data.data;
  127. sitProportion.setOption({
  128. xAxis: {
  129. data: con.users
  130. },
  131. series: [{
  132. data: con.incount //呼入量
  133. },{
  134. data:con.inconnectcount //呼入接通量
  135. },{
  136. data:con.outcount //呼出
  137. },{
  138. data:con.outconnectcount //呼出接通量
  139. }]
  140. })
  141. }
  142. }
  143. });
  144. }
  145. //part 2
  146. var phoneTimeCount = echarts.init(document.getElementById('phoneTimeCount'));
  147. phoneTimeCount.setOption({
  148. color: ['#ceba5f', '#4da991', '#f06e84', '#6a91e0'],
  149. tooltip: {
  150. trigger: 'axis',
  151. axisPointer: {
  152. type: 'cross',
  153. label: {
  154. show: true,
  155. backgroundColor: '#333'
  156. }
  157. }
  158. },
  159. grid: {
  160. left: '2%',
  161. right: '5%',
  162. bottom: '6%',
  163. containLabel: true
  164. },
  165. legend: {
  166. top: 'top',
  167. left: '180px',
  168. data: ["来电数量", "接通数量", "放弃数量", "黑名单拒接数量"],
  169. textStyle: {
  170. color: '#00e9ff'
  171. }
  172. },
  173. xAxis: {
  174. name: '时',
  175. data: [],
  176. axisLine: {
  177. lineStyle: {
  178. color: '#3061a2'
  179. }
  180. },
  181. axisTick: {
  182. alignWithLabel: true,
  183. show: false
  184. },
  185. axisLabel: { //横轴字体颜色
  186. show: true,
  187. textStyle: {
  188. color: '#eff0f4'
  189. }
  190. }
  191. },
  192. yAxis: {
  193. name: '数量',
  194. splitLine: {
  195. show: false
  196. },
  197. axisLine: {
  198. lineStyle: {
  199. color: '#3061a2'
  200. }
  201. },
  202. axisLabel: { //横轴字体颜色
  203. show: true,
  204. textStyle: {
  205. color: '#eff0f4'
  206. }
  207. }
  208. },
  209. series: []
  210. });
  211. function partTwo(dates) {
  212. // var index = layer.load(1, {
  213. // shade: [0.5, '#030303'] //0.1透明度的白色背景
  214. // });
  215. $.ajax({
  216. type: "get",
  217. url: huayi.config.callcenter_url + "info/GetTelCount24ByDate",
  218. async: true,
  219. dataType: "json",
  220. data: {
  221. date: dates
  222. },
  223. success: function(data) {
  224. if(data.state.toLowerCase() == "success") {
  225. // layer.close(index);
  226. var con = data.data;
  227. phoneTimeCount.setOption({
  228. xAxis: {
  229. data: con.hours
  230. },
  231. series: [{
  232. name: "来电数量",
  233. type: "line",
  234. smooth: true,
  235. showAllSymbol: true,
  236. symbol: "emptyCircle",
  237. symbolSize: 10,
  238. data: con.rcounts
  239. }, {
  240. name: "接通数量",
  241. type: "line",
  242. smooth: true,
  243. showAllSymbol: true,
  244. symbol: "emptyCircle",
  245. symbolSize: 10,
  246. data: con.ccounts
  247. },
  248. {
  249. name: "放弃数量",
  250. type: "line",
  251. smooth: true,
  252. showAllSymbol: true,
  253. symbol: "emptyCircle",
  254. symbolSize: 10,
  255. data: con.gcounts
  256. },
  257. {
  258. name: "黑名单拒接数量",
  259. type: "line",
  260. smooth: true,
  261. showAllSymbol: true,
  262. symbol: "emptyCircle",
  263. symbolSize: 10,
  264. data: con.scounts
  265. }]
  266. })
  267. }
  268. }
  269. });
  270. }
  271. //part3
  272. var todyPhoneCount = echarts.init(document.getElementById('todyPhoneCount'));
  273. todyPhoneCount.setOption({
  274. tooltip: {
  275. trigger: 'axis',
  276. axisPointer: {
  277. type: false,
  278. label: {
  279. show: true,
  280. backgroundColor: '#030917'
  281. }
  282. },
  283. },
  284. xAxis: {
  285. name: '类型',
  286. data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)"],
  287. axisLine: {
  288. lineStyle: {
  289. color: '#3061a2'
  290. }
  291. },
  292. axisTick: {
  293. alignWithLabel: true,
  294. show: false
  295. },
  296. axisLabel: { //横轴字体颜色
  297. show: true,
  298. textStyle: {
  299. color: '#eff0f4'
  300. }
  301. }
  302. },
  303. yAxis: {
  304. name: '数量',
  305. splitLine: {
  306. show: false
  307. },
  308. axisLine: {
  309. lineStyle: {
  310. color: '#3061a2'
  311. }
  312. },
  313. axisLabel: { //横轴字体颜色
  314. show: true,
  315. textStyle: {
  316. color: '#eff0f4'
  317. }
  318. }
  319. },
  320. series: [{
  321. name: '数量',
  322. type: 'bar',
  323. barWidth: 18,
  324. itemStyle: {
  325. normal: {
  326. color: function(params) {
  327. // build a color map as your need.
  328. var colorList = [
  329. '#368cab','#54b793','#4b6ab0','#2531a9'];
  330. return colorList[params.dataIndex]
  331. }
  332. }
  333. },
  334. label: {
  335. normal: {
  336. show: true,
  337. position: 'top',//顶部数据显示位置
  338. textStyle: {
  339. color: '#fff' //顶部数据颜色
  340. },
  341. formatter: '{c}' // 这里是数据展示的时候显示的数据
  342. }
  343. },
  344. data: []
  345. }]
  346. });
  347. function partThree(dates) {
  348. $.ajax({
  349. type: "get",
  350. url: huayi.config.callcenter_url + "info/GetTelCountByDate",
  351. async: true,
  352. dataType: "json",
  353. data: {
  354. date: dates
  355. },
  356. success: function(data) {
  357. if(data.state.toLowerCase() == "success") {
  358. // layer.close(index);
  359. var con = data.data;
  360. todyPhoneCount.setOption({
  361. series: [{
  362. data: [con.hwcon, con.lhcon, con.jtcon, con.pjthtimes]
  363. }]
  364. })
  365. }
  366. }
  367. });
  368. }
  369. function Ajax(){
  370. partOne($('#time1').val() && $('#time1').val().split(' ~ ')[0],$('#time1').val() && $('#time1').val().split(' ~ ')[1]);
  371. partTwo($('#time1').val() && $('#time1').val().split(' ~ ')[0])
  372. partThree($('#time1').val() && $('#time1').val().split(' ~ ')[0]);
  373. }