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

receiptDepartment.js 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. //part 1 //工单状态统计 对接完毕
  77. var phoneTimeCount = echarts.init(document.getElementById('phoneTimeCount'));
  78. phoneTimeCount.setOption({
  79. color: ['#69e1a9', '#6a91e0', '#ceba5f', '#f06e84', '#569d4e', '#7d55ba', '#ce5aba', '#345cdd', '#569d4e'],
  80. tooltip: {
  81. trigger: 'axis',
  82. axisPointer: {
  83. type: 'cross',
  84. label: {
  85. show: true,
  86. backgroundColor: '#333'
  87. }
  88. }
  89. },
  90. grid: {
  91. left: '2%',
  92. right: '5%',
  93. bottom: '6%',
  94. containLabel: true
  95. },
  96. legend: {
  97. top: 'top',
  98. left: '180px',
  99. data: [],
  100. textStyle: {
  101. color: '#00e9ff'
  102. }
  103. },
  104. xAxis: {
  105. name: '月份',
  106. data: [],
  107. axisLine: {
  108. lineStyle: {
  109. color: '#3061a2'
  110. }
  111. },
  112. axisTick: {
  113. alignWithLabel: true,
  114. show: false
  115. },
  116. axisLabel: { //横轴字体颜色
  117. show: true,
  118. textStyle: {
  119. color: '#eff0f4'
  120. }
  121. }
  122. },
  123. yAxis: {
  124. name: '(数量)',
  125. splitLine: {
  126. show: false
  127. },
  128. axisLine: {
  129. lineStyle: {
  130. color: '#3061a2'
  131. }
  132. },
  133. axisLabel: { //横轴字体颜色
  134. show: true,
  135. textStyle: {
  136. color: '#eff0f4'
  137. }
  138. }
  139. },
  140. series: []
  141. });
  142. function partOne(areaOneVal) {
  143. // var index = layer.load(1, {
  144. // shade: [0.5, '#030303'] //0.1透明度的白色背景
  145. // });
  146. $.ajax({
  147. type: "get",
  148. url: huayi.config.callcenter_url + "info/GetStateCountMonthByDate",
  149. async: true,
  150. data:{
  151. branchcode:areaOneVal
  152. },
  153. dataType: 'json',
  154. success: function(data) {
  155. if(data.state.toLowerCase() == 'success') {
  156. // layer.close(index);
  157. var con = data.data;
  158. // var jieDans = result.data.a;
  159. var counts = con.counts;
  160. var sers = [];
  161. $(counts).each(function(i, n) {
  162. var obj = {};
  163. obj.name = con.cols[i];
  164. obj.type = "line";
  165. obj.smooth = true;
  166. obj.showAllSymbol = true;
  167. obj.symbol = "emptyCircle";
  168. obj.symbolSize = 10;
  169. obj.data = n;
  170. sers.push(obj)
  171. });
  172. phoneTimeCount.setOption({
  173. xAxis: {
  174. data: con.months
  175. },
  176. legend: {
  177. data: con.cols
  178. },
  179. series: sers
  180. });
  181. }
  182. }
  183. });
  184. }
  185. //part 2 //各部门工单情况
  186. function partTwo(starts, ends, areaOneVal) {
  187. $.ajax({
  188. type: "get",
  189. url: huayi.config.callcenter_url + "Info/GetDeptCountByDateNew",
  190. dataType: 'json',
  191. async: true,
  192. data: {
  193. start: starts,
  194. end: ends,
  195. deptid: $('.depart').val(),
  196. branchcode:areaOneVal
  197. },
  198. success: function(data) {
  199. if(data.state.toLowerCase() == 'success') {
  200. $('.thead tr').html('');
  201. $('#scroll_table tbody').html('');
  202. var con = data.data;
  203. var thead = con[0];
  204. $.each(thead, function(k, val) {
  205. $('<td>' + k + '</td>').appendTo('.thead tr');
  206. })
  207. $(con).each(function(j, n) {
  208. var str = '<tr>'
  209. $.each(thead, function(j, m) {
  210. $.each(n, function(k, val) {
  211. if(j == k) {
  212. if(val == '') {
  213. val = 0;
  214. }
  215. str += '<td>' + val + '</td>'
  216. }
  217. })
  218. })
  219. str += '</tr>';
  220. $('#scroll_table tbody').append(str);
  221. })
  222. }
  223. }
  224. });
  225. }
  226. // part3 工单处理时间分布
  227. var sitProportion = echarts.init(document.getElementById('sitProportion')); //坐席闲忙比例
  228. sitProportion.setOption({
  229. color: ['#4ab7c7', '#2484d9', '#2e39c1'],
  230. tooltip: {
  231. trigger: 'axis',
  232. axisPointer: {
  233. type: 'shadow',
  234. label: {
  235. show: true,
  236. backgroundColor: '#333'
  237. }
  238. },
  239. formatter: function(datas) {
  240. var res = datas[0].name + '<br/>',
  241. val;
  242. for(var i = 0, length = datas.length; i < length; i++) {
  243. // val = (datas[i].value) + '%';
  244. val = (datas[i].value);
  245. res += datas[i].seriesName + ':' + val + '<br/>';
  246. }
  247. return res;
  248. }
  249. },
  250. legend: {
  251. top: 'top',
  252. left: '165px',
  253. data: ['受理工单数', '处理工单数'],
  254. textStyle: {
  255. color: '#00e9ff'
  256. }
  257. },
  258. grid: {
  259. left: '2%',
  260. right: '5%',
  261. bottom: '5%',
  262. containLabel: true
  263. },
  264. xAxis: {
  265. name: '时',
  266. data: [],
  267. axisLine: {
  268. lineStyle: {
  269. color: '#3061a2'
  270. }
  271. },
  272. axisTick: {
  273. alignWithLabel: true,
  274. show: false
  275. },
  276. axisLabel: { //横轴字体颜色
  277. show: true,
  278. textStyle: {
  279. color: '#eff0f4'
  280. }
  281. }
  282. },
  283. yAxis: {
  284. name: '(数量)',
  285. splitLine: {
  286. show: false
  287. },
  288. axisLine: {
  289. lineStyle: {
  290. color: '#3061a2'
  291. }
  292. },
  293. axisLabel: { //横轴字体颜色
  294. show: true,
  295. textStyle: {
  296. color: '#eff0f4'
  297. }
  298. }
  299. },
  300. series: [{
  301. name: '受理工单数',
  302. type: 'bar',
  303. barGap: 0,
  304. data: []
  305. }, {
  306. name: '处理工单数',
  307. type: 'bar',
  308. data: []
  309. }]
  310. });
  311. function partThree(dates,areaOneVal) {
  312. $.ajax({
  313. type: "get",
  314. url: huayi.config.callcenter_url + "info/GetDealCount24ByDate",
  315. dataType: 'json',
  316. async: true,
  317. data: {
  318. date: dates,
  319. branchcode:areaOneVal
  320. },
  321. success: function(data) {
  322. if(data.state.toLowerCase() == 'success') {
  323. var con = data.data;
  324. sitProportion.setOption({
  325. xAxis: {
  326. data: con.hours
  327. },
  328. series: [{
  329. data: con.acounts
  330. }, {
  331. data: con.fcounts
  332. }]
  333. });
  334. }
  335. }
  336. });
  337. }
  338. //表格滚动
  339. var area = document.getElementById('scroll_table');
  340. var iliHeight = 34; //单行滚动的高度
  341. var speed = 20; //滚动的速度
  342. var time;
  343. var delay = 1000;
  344. area.scrollTop = 0;
  345. area.innerHTML += area.innerHTML; //克隆一份一样的内容
  346. function startScroll() {
  347. time = setInterval("scrollUp()", speed);
  348. area.scrollTop++;
  349. console.log(area.scrollTop);
  350. }
  351. function scrollUp() {
  352. if(area.scrollTop % iliHeight == 0) {
  353. clearInterval(time);
  354. setTimeout(startScroll, delay);
  355. } else {
  356. area.scrollTop++;
  357. if(area.scrollTop >= area.scrollHeight / 2) {
  358. area.scrollTop = 0;
  359. }
  360. }
  361. }
  362. setTimeout(startScroll, delay)
  363. function Ajax() {
  364. var areaOneVal = helper.cookies.get("areaOneVal");
  365. var areaOneText = helper.cookies.get("areaOneText");
  366. partOne(areaOneVal)
  367. partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val().split(' ~ ')[1],areaOneVal);
  368. partThree($('#tody_time').val(),areaOneVal);
  369. }