商丘12345 前端

Usercode-Census.html 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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 goodslist;
  106. //本周图表
  107. //本月
  108. mui.plusReady(function() {
  109. var wv = plus.webview.currentWebview();
  110. var index = wv.index;
  111. console.log(index);
  112. plus.nativeUI.closeWaiting();
  113. //显示当前页面
  114. mui.currentWebview.show();
  115. //下拉框
  116. $.ajax({
  117. type: "get",
  118. url: huayi.config.callcenter_url + '/APP/GetSeatList',
  119. async: false,
  120. dataType: 'json',
  121. data: {
  122. usercode: 8000,
  123. id:2
  124. },
  125. success: function(data) {
  126. console.log(data.state);
  127. if(data.state == "success") {
  128. goodslist = data.data;
  129. bindseat($(".mui-select"));
  130. }
  131. },
  132. error: function(data) {
  133. console.log(data.message);
  134. }
  135. });
  136. //下拉框
  137. function bindseat(obj) {
  138. obj.empty();
  139. obj.append('<option value="" selected="true">所有坐席</option>');
  140. $(goodslist).each(function(i, n) {
  141. obj.append('<option value="' + n.F_UserCode + '">' + n.F_UserName + '</option>');
  142. })
  143. }
  144. //日期
  145. var dates = new Date();
  146. var time = dates.getFullYear() + "-" + (dates.getMonth() + 1) + '-' + dates.getDate();
  147. $("#demo1").val(time);
  148. //下拉框
  149. $(".mui-select").on('change', function() {
  150. console.log($('.mui-select').val());
  151. Usercode();
  152. })
  153. Usercode();
  154. //时间选择
  155. var btns = mui('.btns');
  156. btns.each(function(i, btn) {  
  157. btn.addEventListener('tap', function() {   
  158. var dtPicker = new mui.DtPicker({    
  159. type: "date", //设置日历初始视图模式
  160.   
  161. });  
  162. dtPicker.show(function(e) {
  163. $("#demo1").val(e);
  164. Usercode();
  165. }); 
  166. }, false);
  167. })
  168. var btn = mui('.btn');
  169. btn.each(function(i, btn) {  
  170. btn.addEventListener('tap', function() {   
  171. var dtPicker = new mui.DtPicker({    
  172. type: "date", //设置日历初始视图模式
  173.   
  174. });  
  175. dtPicker.show(function(e) {
  176. $("#demo2").val(e);
  177. Usercode();
  178. }); 
  179. }, false);
  180. })
  181. //本周
  182. function Usercode(){
  183. $.ajax({
  184. type: "get",
  185. url: huayi.config.callcenter_url + '/APP/GetAPPSeatReport',
  186. async: true,
  187. dataType: 'json',
  188. data: {
  189. usercode: 8000,
  190. sdate:$("#demo1").val(),
  191. edate: $("#demo2").val(),
  192. seatcode:$('.mui-select').val()
  193. },
  194. success: function(data) {
  195. console.log(data.state);
  196. if(data.state == "success") {
  197. var xAxis = [];
  198. var yAxis_1 = [];
  199. var yAxis_2 = [];
  200. var yAxis_3 = [];
  201. var yAxis_4 = [];
  202. var yAxis_5 = [];
  203. var yAxis_6 = [];
  204. var yAxis_7 = [];
  205. var yAxis_8 = [];
  206. // console.log(data.data.APPSeatReport[0].djblcount);
  207. var a=0,b=0,c=0,d=0,e=0,f=0,g=0;
  208. if(data.data.APPSeatReport.length>1){
  209. xAxis.push('所有坐席');
  210. }else{
  211. xAxis.push(data.data.APPSeatReport[0].username);
  212. }
  213. for(var i = 0; i < data.data.APPSeatReport.length; i++) {
  214. a+=data.data.APPSeatReport[i].djblcount;
  215. b+=data.data.APPSeatReport[i].hfcount;
  216. c+=data.data.APPSeatReport[i].jtcount;
  217. d+=data.data.APPSeatReport[i].jtgdcount;
  218. e+=data.data.APPSeatReport[i].sdgdcount;
  219. f+=data.data.APPSeatReport[i].wlzbcount;
  220. g+=data.data.APPSeatReport[i].zgdcount;
  221. }
  222. yAxis_1.push(a);
  223. yAxis_2.push(b);
  224. yAxis_3.push(c);
  225. yAxis_4.push(d);
  226. yAxis_5.push(e);
  227. yAxis_6.push(f);
  228. yAxis_7.push(g);
  229. var option = {
  230. grid: {
  231. x: '3%',
  232. x2: '3%',
  233. y: '25%',
  234. y2: 25,
  235. borderWidth: 0
  236. },
  237. toolbox: {
  238. show: false,
  239. feature: {
  240. mark: {
  241. show: true
  242. },
  243. dataView: {
  244. show: true,
  245. readOnly: false
  246. },
  247. magicType: {
  248. show: true,
  249. type: ['line']
  250. },
  251. restore: {
  252. show: true
  253. },
  254. saveAsImage: {
  255. show: true
  256. }
  257. }
  258. },
  259. legend: {
  260. top: 0,
  261. data: ['当即办理量','回访量', '接听量','通话成单量', '手工制单量', '网络转办量', '制单量' ]
  262. },
  263. calculable: false,
  264. xAxis: [{
  265. axisLabel: {
  266. interval: 0
  267. },
  268. splitArea: {
  269. show: false,
  270. },
  271. splitLine: {
  272. show: false
  273. }, //去除网格线
  274. type: 'category',
  275. data: xAxis
  276. }],
  277. yAxis: [{
  278. show: false,
  279. splitLine: {
  280. show: false
  281. }, //去除网格线
  282. type: 'value',
  283. splitArea: {
  284. show: false,
  285. }
  286. }],
  287. series: [{
  288. name: '当即办理量',
  289. type: 'bar',
  290. barWidth: 20, //柱图宽度
  291. itemStyle: {
  292. normal: {
  293. label: {
  294. show: true
  295. }
  296. }
  297. },
  298. data: yAxis_1
  299. }, {
  300. name: '回访量',
  301. type: 'bar',
  302. barWidth: 20, //柱图宽度
  303. itemStyle: {
  304. normal: {
  305. label: {
  306. show: true
  307. }
  308. }
  309. },
  310. data: yAxis_2
  311. }, {
  312. name: '接听量',
  313. type: 'bar',
  314. itemStyle: {
  315. normal: {
  316. label: {
  317. show: true
  318. }
  319. }
  320. },
  321. data: yAxis_3
  322. }, {
  323. name: '通话成单量',
  324. type: 'bar',
  325. itemStyle: {
  326. normal: {
  327. label: {
  328. show: true
  329. }
  330. }
  331. },
  332. data: yAxis_4
  333. }, {
  334. name: '手工制单量',
  335. type: 'bar',
  336. itemStyle: {
  337. normal: {
  338. label: {
  339. show: true
  340. }
  341. }
  342. },
  343. data: yAxis_5
  344. }, {
  345. name: '网络转办量',
  346. type: 'bar',
  347. itemStyle: {
  348. normal: {
  349. label: {
  350. show: true
  351. }
  352. }
  353. },
  354. data: yAxis_6
  355. }, {
  356. name: '制单量',
  357. type: 'bar',
  358. itemStyle: {
  359. normal: {
  360. label: {
  361. show: true
  362. }
  363. }
  364. },
  365. data: yAxis_7
  366. }]
  367. };
  368. echartsPie = echarts.init(document.getElementById('pieChart'));
  369. echartsPie.clear();
  370. echartsPie.setOption(option,true);
  371. }
  372. },
  373. error: function(data) {
  374. console.log(data.message);
  375. }
  376. });
  377. }
  378. //本月
  379. //部门
  380. // $.ajax({
  381. // type: "get",
  382. // url: huayi.config.callcenter_url + 'WorkOrder/GetReportByDept',
  383. // async: true,
  384. // dataType: 'json',
  385. // data: {
  386. // openid: 'oKOqcv31fh76rtNmJDjKc39oIsfA'
  387. // },
  388. // success: function(data) {
  389. // console.log(data.state);
  390. // if(data.state == "success") {
  391. // console.log(data.data[0].unfinish);
  392. // var xAxis_fl = [];
  393. // var yAxis_ = [];
  394. // var yAxiss_ = [];
  395. // // $("#Workfinish").text(data.data[7].finish);
  396. // // $("#Workunfinifh").text(data.data[7].unfinish);
  397. // // $("#WorkTotal").text(data.data[7].finish + data.data[0].unfinish);
  398. // for(var i = 0; i < data.data.length; i++) {
  399. // xAxis_fl.push(data.data[i].dept);
  400. // yAxis_.push(data.data[i].unfinish);
  401. // yAxiss_.push(data.data[i].finish)
  402. // }
  403. //
  404. // var option = {
  405. // grid: {
  406. // x: 35,
  407. // x2: 10,
  408. // y: 30,
  409. // y2: 50,
  410. // borderWidth: 0
  411. // },
  412. // toolbox: {
  413. // show: false,
  414. // feature: {
  415. // mark: {
  416. // show: true
  417. // },
  418. // dataView: {
  419. // show: true,
  420. // readOnly: false
  421. // },
  422. // magicType: {
  423. // show: true,
  424. // type: ['line', 'bar']
  425. // },
  426. // restore: {
  427. // show: true
  428. // },
  429. // saveAsImage: {
  430. // show: true
  431. // }
  432. // }
  433. // },
  434. // legend: {
  435. // top: 20,
  436. // data: ['已完成', '未完成', ]
  437. // },
  438. //
  439. // calculable: false,
  440. // xAxis: [{
  441. // axisLabel: {
  442. // interval: 0
  443. // },
  444. // axisLabel: {
  445. // rotate: 40, //字体倾斜度数
  446. // interval: 0, //interval 是指间隔多少个类别画栅格,为 0 时则每个数据都画,为 1 时间隔 1 个画,以此类推
  447. // textStyle: {
  448. // color: "red", //字体颜色
  449. // fontSize: 10 //字体大小
  450. // }
  451. // },
  452. // splitArea: {
  453. // show: false,
  454. // },
  455. // splitLine: {
  456. // show: false
  457. // }, //去除网格线
  458. // type: 'category',
  459. // data: xAxis_fl
  460. // }],
  461. // yAxis: [{
  462. // show: false,
  463. // splitLine: {
  464. // show: false
  465. // }, //去除网格线
  466. // type: 'value',
  467. // splitArea: {
  468. // show: false,
  469. // }
  470. // }],
  471. // series: [{
  472. // name: '已完成',
  473. // type: 'bar',
  474. // barWidth: 10, //柱图宽度
  475. // itemStyle: {
  476. // normal: {
  477. // label: {
  478. // show: true
  479. // }
  480. // }
  481. // },
  482. // data: yAxis_
  483. // }, {
  484. // name: '未完成',
  485. // type: 'bar',
  486. // barWidth: 10, //柱图宽度
  487. // itemStyle: {
  488. // normal: {
  489. // label: {
  490. // show: true
  491. // }
  492. // }
  493. // },
  494. // data: yAxiss_
  495. // }]
  496. // };
  497. // echartsPie = echarts.init(document.getElementById('bar-Chart2'));
  498. // echartsPie.setOption(option);
  499. // }
  500. //
  501. // },
  502. // error: function(data) {
  503. // console.log(data.message);
  504. // }
  505. // });
  506. //获取区域
  507. });
  508. </script>
  509. </body>
  510. </html>