虞城12345_前端

Unit-Census.html 13KB

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