暫無描述

receiptDepartment.js 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  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: '#phone_time',
  11. range: '~',
  12. theme: '#114a97',
  13. done: function(value, date) {
  14. var areaOneVal=$(".areaOne").val();
  15. partTwo(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1],areaOneVal);
  16. }
  17. });
  18. laydate.render({
  19. elem: '#tody_time',
  20. theme: '#114a97',
  21. done: function(value, date) {
  22. var areaOneVal=$(".areaOne").val();
  23. partThree(value,areaOneVal);
  24. }
  25. });
  26. Ajax();
  27. $(".areaOne").change(function() {
  28. var areaOneVal=$(this).val();
  29. var areaOneText=$(".areaOne").find("option:selected").text();
  30. helper.cookies.set("areaOneVal", areaOneVal, 7);
  31. helper.cookies.set("areaOneText", areaOneText, 7);
  32. partOne(areaOneVal);
  33. partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('phone_time').val().split(' ~ ')[1],areaOneVal);
  34. partThree($('#tody_time').val(), areaOneVal);
  35. });
  36. $(".depart").change(function() {
  37. var areaOneVal = helper.cookies.get("areaOneVal");
  38. partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1],areaOneVal);
  39. })
  40. deprtment ();
  41. //部门下拉框
  42. function deprtment () {
  43. $.getJSON( huayi.config.callcenter_url +"info/GetDeptList",{token: $.cookie("token"),}, function(result) {
  44. if(result.state.toLowerCase() == "success") {
  45. goodslist = result.data;
  46. $(".depart").empty();
  47. $('<option value="">请选择部门</option>').appendTo($(".depart"));
  48. $(goodslist).each(function(i, n) {
  49. $('<option value="' + n.F_DeptId
  50. + '">' + n.F_DeptName
  51. + '</option>').appendTo($(".depart"));
  52. })
  53. }
  54. });
  55. }
  56. })
  57. //区县筛选
  58. //deprtment ();
  59. function deprtment () {
  60. $.getJSON( huayi.config.callcenter_url +"CountyBranch/GetBranchListS",{token: $.cookie("token"),}, function(result) {
  61. if(result.state.toLowerCase() == "success") {
  62. goodslist = result.data;
  63. // 第五屏
  64. $(".areaOne").empty();
  65. $(goodslist).each(function(i, n) {
  66. $('<option value="' + n.F_Code
  67. + '">' + n.F_Name
  68. + '</option>').appendTo($(".areaOne"));
  69. });
  70. if (areaOneVal) {
  71. $(".areaOne").val(areaOneVal);
  72. }
  73. }
  74. });
  75. }
  76. // 跳轉
  77. $(".index").click(function(){
  78. window.open('detail.html','_self')
  79. })
  80. $(".second").click(function(){
  81. window.open('second.html','_self')
  82. })
  83. $(".third").click(function(){
  84. window.open('third.html','_self')
  85. })
  86. $(".fourth").click(function(){
  87. window.open('fourth.html','_self')
  88. })
  89. $(".nav_middle").click(function(){
  90. window.open('index.html','_self')
  91. })
  92. // $("#department").click(function(){
  93. // window.open('receiptDepartment.html','_self')
  94. // })
  95. $("#sourceChannel").click(function(){
  96. window.open('sourceChannel.html','_self')
  97. })
  98. $("#call").click(function(){
  99. window.open('TelephoneDetails.html','_self')
  100. })
  101. $("#complaint").click(function(){
  102. window.open('complaintsReport.html','_self')
  103. })
  104. //part 1 //工单状态统计 对接完毕
  105. var phoneTimeCount = echarts.init(document.getElementById('phoneTimeCount'));
  106. phoneTimeCount.setOption({
  107. color: ['#69e1a9', '#6a91e0', '#ceba5f', '#f06e84', '#569d4e', '#7d55ba', '#ce5aba', '#345cdd', '#569d4e'],
  108. tooltip: {
  109. trigger: 'axis',
  110. axisPointer: {
  111. type: 'cross',
  112. label: {
  113. show: true,
  114. backgroundColor: '#333'
  115. }
  116. }
  117. },
  118. grid: {
  119. left: '2%',
  120. right: '5%',
  121. bottom: '6%',
  122. containLabel: true
  123. },
  124. legend: {
  125. top: 'top',
  126. left: '180px',
  127. data: [],
  128. textStyle: {
  129. color: '#00e9ff'
  130. }
  131. },
  132. xAxis: {
  133. name: '月份',
  134. data: [],
  135. axisLine: {
  136. lineStyle: {
  137. color: '#3061a2'
  138. }
  139. },
  140. axisTick: {
  141. alignWithLabel: true,
  142. show: false
  143. },
  144. axisLabel: { //横轴字体颜色
  145. show: true,
  146. textStyle: {
  147. color: '#eff0f4'
  148. }
  149. }
  150. },
  151. yAxis: {
  152. name: '(数量)',
  153. splitLine: {
  154. show: false
  155. },
  156. axisLine: {
  157. lineStyle: {
  158. color: '#3061a2'
  159. }
  160. },
  161. axisLabel: { //横轴字体颜色
  162. show: true,
  163. textStyle: {
  164. color: '#eff0f4'
  165. }
  166. }
  167. },
  168. series: []
  169. });
  170. function partOne(areaOneVal) {
  171. // var index = layer.load(1, {
  172. // shade: [0.5, '#030303'] //0.1透明度的白色背景
  173. // });
  174. $.ajax({
  175. type: "get",
  176. url: huayi.config.callcenter_url + "info/GetStateCountMonthByDate",
  177. async: true,
  178. data:{
  179. token: $.cookie("token"),
  180. branchcode:areaOneVal
  181. },
  182. dataType: 'json',
  183. success: function(data) {
  184. if(data.state.toLowerCase() == 'success') {
  185. // layer.close(index);
  186. var con = data.data;
  187. // var jieDans = result.data.a;
  188. var counts = con.counts;
  189. var sers = [];
  190. $(counts).each(function(i, n) {
  191. var obj = {};
  192. obj.name = con.cols[i];
  193. obj.type = "line";
  194. obj.smooth = true;
  195. obj.showAllSymbol = true;
  196. obj.symbol = "emptyCircle";
  197. obj.symbolSize = 10;
  198. obj.data = n;
  199. sers.push(obj)
  200. });
  201. phoneTimeCount.setOption({
  202. xAxis: {
  203. data: con.months
  204. },
  205. legend: {
  206. data: con.cols
  207. },
  208. series: sers
  209. });
  210. }
  211. }
  212. });
  213. }
  214. //part 2 //各部门工单情况
  215. function partTwo(starts, ends, areaOneVal) {
  216. $.ajax({
  217. type: "get",
  218. url: huayi.config.callcenter_url + "Info/GetDeptCountByDateNew",
  219. dataType: 'json',
  220. async: true,
  221. data: {
  222. token: $.cookie("token"),
  223. start: starts,
  224. end: ends,
  225. deptid: $('.depart').val(),
  226. branchcode:areaOneVal
  227. },
  228. success: function(data) {
  229. if(data.state.toLowerCase() == 'success') {
  230. $('.thead tr').html('');
  231. $('#scroll_table tbody').html('');
  232. var con = data.data;
  233. var thead = con[0];
  234. $.each(thead, function(k, val) {
  235. $('<td>' + k + '</td>').appendTo('.thead tr');
  236. })
  237. $(con).each(function(j, n) {
  238. var str = '<tr>'
  239. $.each(thead, function(j, m) {
  240. $.each(n, function(k, val) {
  241. if(j == k) {
  242. if(val == '') {
  243. val = 0;
  244. }
  245. str += '<td>' + val + '</td>'
  246. }
  247. })
  248. })
  249. str += '</tr>';
  250. $('#scroll_table tbody').append(str);
  251. })
  252. }
  253. }
  254. });
  255. }
  256. // part3 工单处理时间分布
  257. var sitProportion = echarts.init(document.getElementById('sitProportion')); //坐席闲忙比例
  258. sitProportion.setOption({
  259. color: ['#4ab7c7', '#2484d9', '#2e39c1'],
  260. tooltip: {
  261. trigger: 'axis',
  262. axisPointer: {
  263. type: 'shadow',
  264. label: {
  265. show: true,
  266. backgroundColor: '#333'
  267. }
  268. },
  269. formatter: function(datas) {
  270. var res = datas[0].name + '<br/>',
  271. val;
  272. for(var i = 0, length = datas.length; i < length; i++) {
  273. // val = (datas[i].value) + '%';
  274. val = (datas[i].value);
  275. res += datas[i].seriesName + ':' + val + '<br/>';
  276. }
  277. return res;
  278. }
  279. },
  280. legend: {
  281. top: 'top',
  282. left: '165px',
  283. data: ['受理工单数', '处理工单数'],
  284. textStyle: {
  285. color: '#00e9ff'
  286. }
  287. },
  288. grid: {
  289. left: '2%',
  290. right: '5%',
  291. bottom: '5%',
  292. containLabel: true
  293. },
  294. xAxis: {
  295. name: '时',
  296. data: [],
  297. axisLine: {
  298. lineStyle: {
  299. color: '#3061a2'
  300. }
  301. },
  302. axisTick: {
  303. alignWithLabel: true,
  304. show: false
  305. },
  306. axisLabel: { //横轴字体颜色
  307. show: true,
  308. textStyle: {
  309. color: '#eff0f4'
  310. }
  311. }
  312. },
  313. yAxis: {
  314. name: '(数量)',
  315. splitLine: {
  316. show: false
  317. },
  318. axisLine: {
  319. lineStyle: {
  320. color: '#3061a2'
  321. }
  322. },
  323. axisLabel: { //横轴字体颜色
  324. show: true,
  325. textStyle: {
  326. color: '#eff0f4'
  327. }
  328. }
  329. },
  330. series: [{
  331. name: '受理工单数',
  332. type: 'bar',
  333. barGap: 0,
  334. data: []
  335. }, {
  336. name: '处理工单数',
  337. type: 'bar',
  338. data: []
  339. }]
  340. });
  341. // 跳轉
  342. $(".index").click(function(){
  343. window.open('detail.html','_self')
  344. })
  345. $(".second").click(function(){
  346. window.open('second.html','_self')
  347. })
  348. $(".third").click(function(){
  349. window.open('third.html','_self')
  350. })
  351. $(".fourth").click(function(){
  352. window.open('fourth.html','_self')
  353. })
  354. $(".nav_middle").click(function(){
  355. window.open('index.html','_self')
  356. })
  357. function partThree(dates,areaOneVal) {
  358. $.ajax({
  359. type: "get",
  360. url: huayi.config.callcenter_url + "info/GetDealCount24ByDate",
  361. dataType: 'json',
  362. async: true,
  363. data: {
  364. token: $.cookie("token"),
  365. date: dates,
  366. branchcode:areaOneVal
  367. },
  368. success: function(data) {
  369. if(data.state.toLowerCase() == 'success') {
  370. var con = data.data;
  371. sitProportion.setOption({
  372. xAxis: {
  373. data: con.hours
  374. },
  375. series: [{
  376. data: con.acounts
  377. }, {
  378. data: con.fcounts
  379. }]
  380. });
  381. }
  382. }
  383. });
  384. }
  385. //表格滚动
  386. var area = document.getElementById('scroll_table');
  387. var iliHeight = 34; //单行滚动的高度
  388. var speed = 20; //滚动的速度
  389. var time;
  390. var delay = 1000;
  391. area.scrollTop = 0;
  392. area.innerHTML += area.innerHTML; //克隆一份一样的内容
  393. function startScroll() {
  394. time = setInterval("scrollUp()", speed);
  395. area.scrollTop++;
  396. console.log(area.scrollTop);
  397. }
  398. function scrollUp() {
  399. if(area.scrollTop % iliHeight == 0) {
  400. clearInterval(time);
  401. setTimeout(startScroll, delay);
  402. } else {
  403. area.scrollTop++;
  404. if(area.scrollTop >= area.scrollHeight / 2) {
  405. area.scrollTop = 0;
  406. }
  407. }
  408. }
  409. setTimeout(startScroll, delay)
  410. function Ajax() {
  411. var areaOneVal = helper.cookies.get("areaOneVal");
  412. var areaOneText = helper.cookies.get("areaOneText");
  413. partOne(areaOneVal)
  414. partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1],areaOneVal);
  415. partThree($('#tody_time').val(),areaOneVal);
  416. }