虞城12345_前端

TelephoneDetails.js 7.7KB

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