商丘市柘城县——前端

Usercode-Census.html 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. <!doctype html>
  2. <html lang="en" class="feedback">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  6. <title>数据统计</title>
  7. <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
  8. <link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
  9. <style>
  10. .mui-control-content {
  11. background-color: white;
  12. min-height: 215px;
  13. }
  14. .mui-control-content .mui-loading {
  15. margin-top: 50px;
  16. }
  17. .chart {
  18. height: 260px;
  19. margin: 0px;
  20. padding: 0px;
  21. }
  22. .mui-slider .mui-slider-group {
  23. height: 500px;
  24. }
  25. #CS {
  26. position: absolute;
  27. right: 0;
  28. height: 100%;
  29. padding: 0;
  30. padding-left: 5px;
  31. border: none;
  32. z-index: 30;
  33. width: 100%;
  34. }
  35. .mui-scroll {
  36. height: 100%;
  37. }
  38. #lineChart {
  39. position: absolute;
  40. top: 0;
  41. right: 0;
  42. bottom: 0;
  43. left: 0;
  44. padding: 10px;
  45. -webkit-box-sizing: border-box;
  46. box-sizing: border-box;
  47. }
  48. .mui-grid-bottom {
  49. height: 2px;
  50. background-color: #57cebf;
  51. display: block;
  52. width: 20px;
  53. margin: 0 auto;
  54. }
  55. </style>
  56. </head>
  57. <body>
  58. <header class="mui-bar mui-bar-nav">
  59. <h1 id="title" class="mui-title">坐席统计报表</h1>
  60. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color: #fff;"></a>
  61. </header>
  62. <div class="mui-content ">
  63. <form id='login-form' class="mui-input-group">
  64. <!--logo-->
  65. <div class="mui-input-row">
  66. <label>坐席:</label>
  67. <select name="" class="mui-select">
  68. </select>
  69. </div>
  70. <div class="mui-input-row mui-password">
  71. <label>开始时间:</label>
  72. <!--<input id='password' type="datetime-local" class=" mui-input" >-->
  73. <input id='demo1' data-options='{}' type="text" class="mui-input-clear btns contact" />
  74. </div>
  75. <div class="mui-input-row mui-password">
  76. <label>结束时间:</label>
  77. <!--<input id='password' type="datetime-local" class=" mui-input" >-->
  78. <input id='demo2' data-options='{}' type="text" class="mui-input-clear btn contact" />
  79. </div>
  80. </form>
  81. <div id="slider" class="mui-slider" >
  82. <div class="mui-slider-group">
  83. <div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
  84. <div id="scroll1" class="mui-scroll-wrapper">
  85. <div class="mui-scroll" style="margin-top: 20px;">
  86. <div class="chart" id="pieChart"></div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <script src="../js/zepto.js"></script>
  94. <script src="../js/mui.min.js"></script>
  95. <script src="../js/echarts-all.js"></script>
  96. <script src="../js/huayi.config.js"></script>
  97. <script src="../js/mui.picker.min.js"></script>
  98. <script type="text/javascript">
  99. mui.init();
  100. window.onload = function() {
  101. mui('.mui-scroll-wrapper').scroll({
  102. deceleration: 0.0005 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
  103. });
  104. }
  105. var usercode = localStorage.getItem("user"); //获取本地存储
  106. var goodslist;
  107. //本周图表
  108. //本月
  109. mui.plusReady(function() {
  110. var wv = plus.webview.currentWebview();
  111. var index = wv.index;
  112. console.log(index);
  113. plus.nativeUI.closeWaiting();
  114. //显示当前页面
  115. mui.currentWebview.show();
  116. //下拉框
  117. $.ajax({
  118. type: "get",
  119. url: huayi.config.callcenter_url + '/APP/GetSeatList',
  120. async: false,
  121. dataType: 'json',
  122. data: {
  123. usercode: usercode,
  124. id:2
  125. },
  126. success: function(data) {
  127. console.log(data.state);
  128. if(data.state == "success") {
  129. goodslist = data.data;
  130. bindseat($(".mui-select"));
  131. }
  132. },
  133. error: function(data) {
  134. console.log(data.message);
  135. }
  136. });
  137. //下拉框
  138. function bindseat(obj) {
  139. obj.empty();
  140. obj.append('<option value="" selected="true">所有坐席</option>');
  141. $(goodslist).each(function(i, n) {
  142. obj.append('<option value="' + n.F_UserCode + '">' + n.F_UserName + '</option>');
  143. })
  144. }
  145. //日期
  146. var dates = new Date();
  147. var time = dates.getFullYear() + "-" + (dates.getMonth() + 1) + '-' + dates.getDate();
  148. $("#demo1").val(time);
  149. //下拉框
  150. $(".mui-select").on('change', function() {
  151. console.log($('.mui-select').val());
  152. Usercode();
  153. })
  154. Usercode();
  155. //时间选择
  156. var btns = mui('.btns');
  157. btns.each(function(i, btn) {  
  158. btn.addEventListener('tap', function() {   
  159. var dtPicker = new mui.DtPicker({    
  160. type: "date", //设置日历初始视图模式
  161.   
  162. });  
  163. dtPicker.show(function(e) {
  164. $("#demo1").val(e);
  165. Usercode();
  166. }); 
  167. }, false);
  168. })
  169. var btn = mui('.btn');
  170. btn.each(function(i, btn) {  
  171. btn.addEventListener('tap', function() {   
  172. var dtPicker = new mui.DtPicker({    
  173. type: "date", //设置日历初始视图模式
  174.   
  175. });  
  176. dtPicker.show(function(e) {
  177. $("#demo2").val(e);
  178. Usercode();
  179. }); 
  180. }, false);
  181. })
  182. //本周
  183. function Usercode(){
  184. $.ajax({
  185. type: "get",
  186. url: huayi.config.callcenter_url + '/APP/GetAPPSeatReport',
  187. async: true,
  188. dataType: 'json',
  189. data: {
  190. usercode: usercode,
  191. sdate:$("#demo1").val(),
  192. edate: $("#demo2").val(),
  193. seatcode:$('.mui-select').val()
  194. },
  195. success: function(data) {
  196. console.log(data.state);
  197. if(data.state == "success") {
  198. var xAxis = [];
  199. var yAxis_1 = [];
  200. var yAxis_2 = [];
  201. var yAxis_3 = [];
  202. var yAxis_4 = [];
  203. var yAxis_5 = [];
  204. var yAxis_6 = [];
  205. var yAxis_7 = [];
  206. var yAxis_8 = [];
  207. // console.log(data.data.APPSeatReport[0].djblcount);
  208. var a=0,b=0,c=0,d=0,e=0,f=0,g=0;
  209. if(data.data.APPSeatReport.length>1){
  210. xAxis.push('所有坐席');
  211. }else{
  212. xAxis.push(data.data.APPSeatReport[0].username);
  213. }
  214. for(var i = 0; i < data.data.APPSeatReport.length; i++) {
  215. a+=data.data.APPSeatReport[i].djblcount;
  216. b+=data.data.APPSeatReport[i].hfcount;
  217. c+=data.data.APPSeatReport[i].jtcount;
  218. d+=data.data.APPSeatReport[i].jtgdcount;
  219. e+=data.data.APPSeatReport[i].sdgdcount;
  220. f+=data.data.APPSeatReport[i].wlzbcount;
  221. g+=data.data.APPSeatReport[i].zgdcount;
  222. }
  223. yAxis_1.push(a);
  224. yAxis_2.push(b);
  225. yAxis_3.push(c);
  226. yAxis_4.push(d);
  227. yAxis_5.push(e);
  228. yAxis_6.push(f);
  229. yAxis_7.push(g);
  230. var option = {
  231. grid: {
  232. x: '3%',
  233. x2: '3%',
  234. y: '25%',
  235. y2: 25,
  236. borderWidth: 0
  237. },
  238. toolbox: {
  239. show: false,
  240. feature: {
  241. mark: {
  242. show: true
  243. },
  244. dataView: {
  245. show: true,
  246. readOnly: false
  247. },
  248. magicType: {
  249. show: true,
  250. type: ['line']
  251. },
  252. restore: {
  253. show: true
  254. },
  255. saveAsImage: {
  256. show: true
  257. }
  258. }
  259. },
  260. legend: {
  261. top: 0,
  262. data: ['当即办理量','回访量', '接听量','通话成单量', '手工制单量', '网络转办量', '制单量' ]
  263. },
  264. calculable: false,
  265. xAxis: [{
  266. axisLabel: {
  267. interval: 0
  268. },
  269. splitArea: {
  270. show: false,
  271. },
  272. splitLine: {
  273. show: false
  274. }, //去除网格线
  275. type: 'category',
  276. data: xAxis
  277. }],
  278. yAxis: [{
  279. show: false,
  280. splitLine: {
  281. show: false
  282. }, //去除网格线
  283. type: 'value',
  284. splitArea: {
  285. show: false,
  286. }
  287. }],
  288. series: [{
  289. name: '当即办理量',
  290. type: 'bar',
  291. barWidth: 20, //柱图宽度
  292. itemStyle: {
  293. normal: {
  294. label: {
  295. show: true
  296. }
  297. }
  298. },
  299. data: yAxis_1
  300. }, {
  301. name: '回访量',
  302. type: 'bar',
  303. barWidth: 20, //柱图宽度
  304. itemStyle: {
  305. normal: {
  306. label: {
  307. show: true
  308. }
  309. }
  310. },
  311. data: yAxis_2
  312. }, {
  313. name: '接听量',
  314. type: 'bar',
  315. itemStyle: {
  316. normal: {
  317. label: {
  318. show: true
  319. }
  320. }
  321. },
  322. data: yAxis_3
  323. }, {
  324. name: '通话成单量',
  325. type: 'bar',
  326. itemStyle: {
  327. normal: {
  328. label: {
  329. show: true
  330. }
  331. }
  332. },
  333. data: yAxis_4
  334. }, {
  335. name: '手工制单量',
  336. type: 'bar',
  337. itemStyle: {
  338. normal: {
  339. label: {
  340. show: true
  341. }
  342. }
  343. },
  344. data: yAxis_5
  345. }, {
  346. name: '网络转办量',
  347. type: 'bar',
  348. itemStyle: {
  349. normal: {
  350. label: {
  351. show: true
  352. }
  353. }
  354. },
  355. data: yAxis_6
  356. }, {
  357. name: '制单量',
  358. type: 'bar',
  359. itemStyle: {
  360. normal: {
  361. label: {
  362. show: true
  363. }
  364. }
  365. },
  366. data: yAxis_7
  367. }]
  368. };
  369. echartsPie = echarts.init(document.getElementById('pieChart'));
  370. echartsPie.clear();
  371. echartsPie.setOption(option,true);
  372. }
  373. },
  374. error: function(data) {
  375. console.log(data.message);
  376. }
  377. });
  378. }
  379. //本月
  380. //部门
  381. // $.ajax({
  382. // type: "get",
  383. // url: huayi.config.callcenter_url + 'WorkOrder/GetReportByDept',
  384. // async: true,
  385. // dataType: 'json',
  386. // data: {
  387. // openid: 'oKOqcv31fh76rtNmJDjKc39oIsfA'
  388. // },
  389. // success: function(data) {
  390. // console.log(data.state);
  391. // if(data.state == "success") {
  392. // console.log(data.data[0].unfinish);
  393. // var xAxis_fl = [];
  394. // var yAxis_ = [];
  395. // var yAxiss_ = [];
  396. // // $("#Workfinish").text(data.data[7].finish);
  397. // // $("#Workunfinifh").text(data.data[7].unfinish);
  398. // // $("#WorkTotal").text(data.data[7].finish + data.data[0].unfinish);
  399. // for(var i = 0; i < data.data.length; i++) {
  400. // xAxis_fl.push(data.data[i].dept);
  401. // yAxis_.push(data.data[i].unfinish);
  402. // yAxiss_.push(data.data[i].finish)
  403. // }
  404. //
  405. // var option = {
  406. // grid: {
  407. // x: 35,
  408. // x2: 10,
  409. // y: 30,
  410. // y2: 50,
  411. // borderWidth: 0
  412. // },
  413. // toolbox: {
  414. // show: false,
  415. // feature: {
  416. // mark: {
  417. // show: true
  418. // },
  419. // dataView: {
  420. // show: true,
  421. // readOnly: false
  422. // },
  423. // magicType: {
  424. // show: true,
  425. // type: ['line', 'bar']
  426. // },
  427. // restore: {
  428. // show: true
  429. // },
  430. // saveAsImage: {
  431. // show: true
  432. // }
  433. // }
  434. // },
  435. // legend: {
  436. // top: 20,
  437. // data: ['已完成', '未完成', ]
  438. // },
  439. //
  440. // calculable: false,
  441. // xAxis: [{
  442. // axisLabel: {
  443. // interval: 0
  444. // },
  445. // axisLabel: {
  446. // rotate: 40, //字体倾斜度数
  447. // interval: 0, //interval 是指间隔多少个类别画栅格,为 0 时则每个数据都画,为 1 时间隔 1 个画,以此类推
  448. // textStyle: {
  449. // color: "red", //字体颜色
  450. // fontSize: 10 //字体大小
  451. // }
  452. // },
  453. // splitArea: {
  454. // show: false,
  455. // },
  456. // splitLine: {
  457. // show: false
  458. // }, //去除网格线
  459. // type: 'category',
  460. // data: xAxis_fl
  461. // }],
  462. // yAxis: [{
  463. // show: false,
  464. // splitLine: {
  465. // show: false
  466. // }, //去除网格线
  467. // type: 'value',
  468. // splitArea: {
  469. // show: false,
  470. // }
  471. // }],
  472. // series: [{
  473. // name: '已完成',
  474. // type: 'bar',
  475. // barWidth: 10, //柱图宽度
  476. // itemStyle: {
  477. // normal: {
  478. // label: {
  479. // show: true
  480. // }
  481. // }
  482. // },
  483. // data: yAxis_
  484. // }, {
  485. // name: '未完成',
  486. // type: 'bar',
  487. // barWidth: 10, //柱图宽度
  488. // itemStyle: {
  489. // normal: {
  490. // label: {
  491. // show: true
  492. // }
  493. // }
  494. // },
  495. // data: yAxiss_
  496. // }]
  497. // };
  498. // echartsPie = echarts.init(document.getElementById('bar-Chart2'));
  499. // echartsPie.setOption(option);
  500. // }
  501. //
  502. // },
  503. // error: function(data) {
  504. // console.log(data.message);
  505. // }
  506. // });
  507. //获取区域
  508. });
  509. </script>
  510. </body>
  511. </html>