Няма описание

receiptDepartment.js 9.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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", 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", 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. branchcode:areaOneVal
  180. },
  181. dataType: 'json',
  182. success: function(data) {
  183. if(data.state.toLowerCase() == 'success') {
  184. // layer.close(index);
  185. var con = data.data;
  186. // var jieDans = result.data.a;
  187. var counts = con.counts;
  188. var sers = [];
  189. $(counts).each(function(i, n) {
  190. var obj = {};
  191. obj.name = con.cols[i];
  192. obj.type = "line";
  193. obj.smooth = true;
  194. obj.showAllSymbol = true;
  195. obj.symbol = "emptyCircle";
  196. obj.symbolSize = 10;
  197. obj.data = n;
  198. sers.push(obj)
  199. });
  200. phoneTimeCount.setOption({
  201. xAxis: {
  202. data: con.months
  203. },
  204. legend: {
  205. data: con.cols
  206. },
  207. series: sers
  208. });
  209. }
  210. }
  211. });
  212. }
  213. //part 2 //各部门工单情况
  214. function partTwo(starts, ends, areaOneVal) {
  215. $.ajax({
  216. type: "get",
  217. url: huayi.config.callcenter_url + "Info/GetDeptCountByDateNew",
  218. dataType: 'json',
  219. async: true,
  220. data: {
  221. start: starts,
  222. end: ends,
  223. deptid: $('.depart').val(),
  224. branchcode:areaOneVal
  225. },
  226. success: function(data) {
  227. if(data.state.toLowerCase() == 'success') {
  228. $('.thead tr').html('');
  229. $('#scroll_table tbody').html('');
  230. var con = data.data;
  231. var thead = con[0];
  232. $.each(thead, function(k, val) {
  233. $('<td>' + k + '</td>').appendTo('.thead tr');
  234. })
  235. $(con).each(function(j, n) {
  236. var str = '<tr>'
  237. $.each(thead, function(j, m) {
  238. $.each(n, function(k, val) {
  239. if(j == k) {
  240. if(val == '') {
  241. val = 0;
  242. }
  243. str += '<td>' + val + '</td>'
  244. }
  245. })
  246. })
  247. str += '</tr>';
  248. $('#scroll_table tbody').append(str);
  249. })
  250. }
  251. }
  252. });
  253. }
  254. // part3 工单处理时间分布
  255. var sitProportion = echarts.init(document.getElementById('sitProportion')); //坐席闲忙比例
  256. sitProportion.setOption({
  257. color: ['#4ab7c7', '#2484d9', '#2e39c1'],
  258. tooltip: {
  259. trigger: 'axis',
  260. axisPointer: {
  261. type: 'shadow',
  262. label: {
  263. show: true,
  264. backgroundColor: '#333'
  265. }
  266. },
  267. formatter: function(datas) {
  268. var res = datas[0].name + '<br/>',
  269. val;
  270. for(var i = 0, length = datas.length; i < length; i++) {
  271. // val = (datas[i].value) + '%';
  272. val = (datas[i].value);
  273. res += datas[i].seriesName + ':' + val + '<br/>';
  274. }
  275. return res;
  276. }
  277. },
  278. legend: {
  279. top: 'top',
  280. left: '165px',
  281. data: ['受理工单数', '处理工单数'],
  282. textStyle: {
  283. color: '#00e9ff'
  284. }
  285. },
  286. grid: {
  287. left: '2%',
  288. right: '5%',
  289. bottom: '5%',
  290. containLabel: true
  291. },
  292. xAxis: {
  293. name: '时',
  294. data: [],
  295. axisLine: {
  296. lineStyle: {
  297. color: '#3061a2'
  298. }
  299. },
  300. axisTick: {
  301. alignWithLabel: true,
  302. show: false
  303. },
  304. axisLabel: { //横轴字体颜色
  305. show: true,
  306. textStyle: {
  307. color: '#eff0f4'
  308. }
  309. }
  310. },
  311. yAxis: {
  312. name: '(数量)',
  313. splitLine: {
  314. show: false
  315. },
  316. axisLine: {
  317. lineStyle: {
  318. color: '#3061a2'
  319. }
  320. },
  321. axisLabel: { //横轴字体颜色
  322. show: true,
  323. textStyle: {
  324. color: '#eff0f4'
  325. }
  326. }
  327. },
  328. series: [{
  329. name: '受理工单数',
  330. type: 'bar',
  331. barGap: 0,
  332. data: []
  333. }, {
  334. name: '处理工单数',
  335. type: 'bar',
  336. data: []
  337. }]
  338. });
  339. // 跳轉
  340. $(".index").click(function(){
  341. window.open('detail.html','_self')
  342. })
  343. $(".second").click(function(){
  344. window.open('second.html','_self')
  345. })
  346. $(".third").click(function(){
  347. window.open('third.html','_self')
  348. })
  349. $(".fourth").click(function(){
  350. window.open('fourth.html','_self')
  351. })
  352. $(".nav_middle").click(function(){
  353. window.open('index.html','_self')
  354. })
  355. function partThree(dates,areaOneVal) {
  356. $.ajax({
  357. type: "get",
  358. url: huayi.config.callcenter_url + "info/GetDealCount24ByDate",
  359. dataType: 'json',
  360. async: true,
  361. data: {
  362. date: dates,
  363. branchcode:areaOneVal
  364. },
  365. success: function(data) {
  366. if(data.state.toLowerCase() == 'success') {
  367. var con = data.data;
  368. sitProportion.setOption({
  369. xAxis: {
  370. data: con.hours
  371. },
  372. series: [{
  373. data: con.acounts
  374. }, {
  375. data: con.fcounts
  376. }]
  377. });
  378. }
  379. }
  380. });
  381. }
  382. //表格滚动
  383. var area = document.getElementById('scroll_table');
  384. var iliHeight = 34; //单行滚动的高度
  385. var speed = 20; //滚动的速度
  386. var time;
  387. var delay = 1000;
  388. area.scrollTop = 0;
  389. area.innerHTML += area.innerHTML; //克隆一份一样的内容
  390. function startScroll() {
  391. time = setInterval("scrollUp()", speed);
  392. area.scrollTop++;
  393. console.log(area.scrollTop);
  394. }
  395. function scrollUp() {
  396. if(area.scrollTop % iliHeight == 0) {
  397. clearInterval(time);
  398. setTimeout(startScroll, delay);
  399. } else {
  400. area.scrollTop++;
  401. if(area.scrollTop >= area.scrollHeight / 2) {
  402. area.scrollTop = 0;
  403. }
  404. }
  405. }
  406. setTimeout(startScroll, delay)
  407. function Ajax() {
  408. var areaOneVal = helper.cookies.get("areaOneVal");
  409. var areaOneText = helper.cookies.get("areaOneText");
  410. partOne(areaOneVal)
  411. partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1],areaOneVal);
  412. partThree($('#tody_time').val(),areaOneVal);
  413. }