Sin descripción

TelephoneDetails.js 8.6KB

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