index.jsp 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <!doctype html>
  3. <html>
  4. <head>
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>东旭营销平台</title>
  7. <meta name="keywords" content="东旭营销平台 Bate1.0">
  8. <meta name="description" content="东旭营销平台 Bate1.0">
  9. <%@ include file="common/head.jsp"%>
  10. <base href=" <%=basePath%>" />
  11. </head>
  12. <body class="gray-bg">
  13. <div class="wrapper wrapper-content">
  14. <div class="row">
  15. <div class="col-sm-3">
  16. <div class="ibox float-e-margins">
  17. <div class="ibox-title">
  18. <span class="label label-success pull-right">今天</span>
  19. <h5>成交总额</h5>
  20. </div>
  21. <div class="ibox-content">
  22. <h1 class="no-margins">${todayMapSuc.total}</h1>
  23. <div class="stat-percent font-bold text-success">分佣:${dayMap.commission}<i class="fa fa-bolt"></i>
  24. </div>
  25. <small>保单量:${todayMapSuc.cnt}</small>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="col-sm-3">
  30. <div class="ibox float-e-margins">
  31. <div class="ibox-title">
  32. <span class="label label-success pull-right">今天</span>
  33. <h5>利润总额</h5>
  34. </div>
  35. <div class="ibox-content">
  36. <h1 class="no-margins">${todayMapSuc.total-todayMapSuc.commission-todayMapSuc.policyAmount}</h1>
  37. <div class="stat-percent font-bold text-success">支出:${dayMap.commission+todayMapSuc.policyAmount}<i class="fa fa-bolt"></i>
  38. </div>
  39. <small>保单量:${todayMapSuc.cnt}</small>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="col-sm-3">
  44. <div class="ibox float-e-margins">
  45. <div class="ibox-title">
  46. <span class="label label-info pull-right">今天</span>
  47. <h5>未成交</h5>
  48. </div>
  49. <div class="ibox-content">
  50. <h1 class="no-margins">${todayMap.total-todayMapSuc.total}</h1>
  51. <div class="stat-percent font-bold text-info"><i class="fa fa-level-up"></i>
  52. </div>
  53. <small>未成交单数:${todayMap.cnt-todayMapSuc.cnt}</small>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="col-sm-3">
  58. <div class="ibox float-e-margins">
  59. <div class="ibox-title">
  60. <span class="label label-danger pull-right">近一个月</span>
  61. <h5>收入</h5>
  62. </div>
  63. <div class="ibox-content">
  64. <h1 class="no-margins">${monthSuc.total-monthSuc.commission-monthSuc.policyAmount}</h1>
  65. <div class="stat-percent font-bold text-navy">支出:${monthSuc.commission+monthSuc.policyAmount}<i class="fa fa-level-up"></i>
  66. </div>
  67. <small>保单量:${monthSuc.cnt}</small>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="row">
  73. <div class="col-sm-12">
  74. <div class="ibox float-e-margins">
  75. <div class="ibox-title">
  76. <h5>近一月订单量</h5>
  77. <%--<div class="pull-right">
  78. <div class="btn-group">
  79. <button type="button" class="btn btn-xs btn-white active">天</button>
  80. <button type="button" class="btn btn-xs btn-white">月</button>
  81. <button type="button" class="btn btn-xs btn-white">年</button>
  82. </div>
  83. </div>--%>
  84. </div>
  85. <div class="ibox-content" id="ibox-content_pt">
  86. <div class="row">
  87. <div class="col-sm-9">
  88. <div class="flot-chart">
  89. <div class="flot-chart-content" id="flot-dashboard-chart"></div>
  90. </div>
  91. </div>
  92. <div class="col-sm-3">
  93. <ul class="stat-list">
  94. <li>
  95. <h2 class="no-margins"></h2>
  96. <small>订单总数</small>
  97. <div class="stat-percent">
  98. </div>
  99. <div class="progress progress-mini">
  100. <div style="width: 100%;" class="progress-bar"></div>
  101. </div>
  102. </li>
  103. <li>
  104. <h2 class="no-margins "></h2>
  105. <small>最近一个月订单</small>
  106. <div class="stat-percent">
  107. </div>
  108. <div class="progress progress-mini">
  109. <div style="width: 0%;" class="progress-bar"></div>
  110. </div>
  111. </li>
  112. <li>
  113. <h2 class="no-margins "></h2>
  114. <small>最近一个月未付款订单</small>
  115. <div class="stat-percent">
  116. </div>
  117. <div class="progress progress-mini">
  118. <div style="width: 0%;" class="progress-bar"></div>
  119. </div>
  120. </li>
  121. </ul>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. <div class="row">
  129. <div class="col-sm-12">
  130. <div class="ibox float-e-margins">
  131. <div class="ibox-content" id="ibox-content_po">
  132. <div class="row" style="height: 280px;">
  133. <div class="col-sm-9">
  134. <div class="flot-chart">
  135. <div class="flot-chart-content" style="height: 280px;" id="echarts-sales"></div>
  136. </div>
  137. </div>
  138. <div class="col-sm-3">
  139. <ul class="stat-list">
  140. <li>
  141. <h2 class="no-margins"></h2>
  142. <small>总销售额(单位:元)</small>
  143. <div class="stat-percent">
  144. </div>
  145. <div class="progress progress-mini">
  146. <div style="width: 100%;" class="progress-bar"></div>
  147. </div>
  148. </li>
  149. <li>
  150. <h2 class="no-margins "></h2>
  151. <small>总收入(单位:元)</small>
  152. <div class="stat-percent">
  153. </div>
  154. <div class="progress progress-mini">
  155. <div style="width: 0%;" class="progress-bar"></div>
  156. </div>
  157. </li>
  158. <li>
  159. <h2 class="no-margins "></h2>
  160. <small>最近一个月销售额(单位:元)</small>
  161. <div class="stat-percent">
  162. </div>
  163. <div class="progress progress-mini">
  164. <div style="width: 100%;" class="progress-bar"></div>
  165. </div>
  166. </li>
  167. <li>
  168. <h2 class="no-margins "></h2>
  169. <small>最近一个月收入额(单位:元)</small>
  170. <div class="stat-percent">
  171. </div>
  172. <div class="progress progress-mini">
  173. <div style="width: 0%;" class="progress-bar"></div>
  174. </div>
  175. </li>
  176. </ul>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <!-- 全局js -->
  185. <!-- <script src="js/jquery.min.js?v=2.1.4"></script> -->
  186. <!-- <script src="js/bootstrap.min.js?v=3.3.6"></script> -->
  187. <!-- Flot -->
  188. <script src="res/js/plugins/flot/jquery.flot.js"></script>
  189. <script src="res/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
  190. <script src="res/js/plugins/flot/jquery.flot.spline.js"></script>
  191. <script src="res/js/plugins/flot/jquery.flot.resize.js"></script>
  192. <script src="res/js/plugins/flot/jquery.flot.pie.js"></script>
  193. <script src="res/js/plugins/flot/jquery.flot.symbol.js"></script>
  194. <!-- Peity -->
  195. <script src="res/js/plugins/peity/jquery.peity.min.js"></script>
  196. <script src="res/js/demo/peity-demo.js"></script>
  197. <!-- 自定义js -->
  198. <script src="res/js/content.js?v=1.0.0"></script>
  199. <!-- jQuery UI -->
  200. <script src="res/js/plugins/jquery-ui/jquery-ui.min.js"></script>
  201. <!-- Jvectormap -->
  202. <script src="res/js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
  203. <script src="res/js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
  204. <!-- EayPIE -->
  205. <script src="res/js/plugins/easypiechart/jquery.easypiechart.js"></script>
  206. <!-- Sparkline -->
  207. <script src="res/js/plugins/sparkline/jquery.sparkline.min.js"></script>
  208. <!-- Sparkline demo data -->
  209. <script src="res/js/demo/sparkline-demo.js"></script>
  210. <script src="res/js/plugins/echarts/echarts-all.js"></script>
  211. <script>
  212. $(document).ready(function () {
  213. function gd(year, month, day) {
  214. return new Date(year, month - 1, day).getTime();
  215. }
  216. var dataset = [];
  217. var options = { };
  218. var xAxisData = [];
  219. var yAxisOrderAmount = [];
  220. var yAxisPayAmount = [];
  221. var yAxisIncomeAmount = [];
  222. var url1='<%=basePath%>statistics/orderByMonth.cs';
  223. $.get(url1, function(result, status) {
  224. var dataAllOrder = [];
  225. var dataSucOrder = [];
  226. var listAll = result.listAll;
  227. var listSuc = result.listSuc;
  228. var orderAllCnt = 0;
  229. var orderSucCnt = 0;
  230. var orderMonthTotal = 0;
  231. var orderMonthIncome = 0;
  232. var maxOrderCnt = 0;
  233. for(var i=0; i < listAll.length; i++){
  234. if(maxOrderCnt < parseInt(listAll[i]['cnt'])){
  235. maxOrderCnt = parseInt(listAll[i]['cnt']);
  236. }
  237. var cdate = listAll[i]['createdate'].split("-");
  238. var myArray=new Array()
  239. myArray[0]=gd(cdate[0],cdate[1],cdate[2]);
  240. myArray[1]=listAll[i]['cnt'];
  241. dataAllOrder[i]=myArray;
  242. orderAllCnt += parseInt(listAll[i]['cnt']);
  243. }
  244. for(var j = 0; j < listSuc.length; j++){
  245. if(maxOrderCnt < parseInt(listSuc[j]['cnt'])){
  246. maxOrderCnt = parseInt(listSuc[j]['cnt']);
  247. }
  248. var cdate = listSuc[j]['createdate'].split("-");
  249. var myArray=new Array()
  250. myArray[0]=gd(cdate[0],cdate[1],cdate[2]);
  251. myArray[1]=listSuc[j]['cnt'];
  252. dataSucOrder[j]=myArray;
  253. orderSucCnt += parseInt(listSuc[j]['cnt']);
  254. xAxisData[j] = listSuc[j]['createdate'];
  255. yAxisOrderAmount[j] = listSuc[j]['total'];
  256. yAxisPayAmount[j] = listSuc[j]['commission']+listSuc[j]['policyAmount'];
  257. yAxisIncomeAmount[j] = listSuc[j]['total']-listSuc[j]['commission']-listSuc[j]['policyAmount'];
  258. orderMonthTotal += yAxisOrderAmount[j];
  259. orderMonthIncome += yAxisIncomeAmount[j];
  260. }
  261. maxOrderCnt += 10;
  262. dataset = [
  263. {
  264. label: "订单总数",
  265. data: dataAllOrder,
  266. color: "#1ab394",
  267. bars: {
  268. show: true,
  269. align: "center",
  270. barWidth: 24 * 60 * 60 * 600,
  271. numbers: {
  272. show: true
  273. },
  274. lineWidth: 0
  275. }
  276. }, {
  277. label: "付款数",
  278. data: dataSucOrder,
  279. yaxis: 1,
  280. color: "#464f88",
  281. lines: {
  282. lineWidth: 1,
  283. show: true,
  284. fill: true,
  285. fillColor: {
  286. colors: [{
  287. opacity: 0.2
  288. }, {
  289. opacity: 0.2
  290. }]
  291. }
  292. },
  293. splines: {
  294. show: false,
  295. tension: 0.6,
  296. lineWidth: 1,
  297. fill: 0.1
  298. },
  299. }
  300. ];
  301. options = {
  302. xaxis: {
  303. mode: "time",
  304. tickSize: [1, "day"],
  305. tickLength: 0,
  306. axisLabel: "Date",
  307. axisLabelUseCanvas: true,
  308. axisLabelFontSizePixels: 12,
  309. axisLabelFontFamily: 'Arial',
  310. axisLabelPadding: 10,
  311. color: "#838383"
  312. },
  313. yaxes: [{
  314. position: "left",
  315. max: maxOrderCnt,
  316. color: "#838383",
  317. axisLabelUseCanvas: true,
  318. axisLabelFontSizePixels: 12,
  319. axisLabelFontFamily: 'Arial',
  320. axisLabelPadding: 3
  321. }, {
  322. position: "right",
  323. clolor: "#838383",
  324. axisLabelUseCanvas: true,
  325. axisLabelFontSizePixels: 12,
  326. axisLabelFontFamily: ' Arial',
  327. axisLabelPadding: 67
  328. }
  329. ],
  330. legend: {
  331. noColumns: 1,
  332. labelBoxBorderColor: "#000000",
  333. position: "nw"
  334. },
  335. grid: {
  336. hoverable: false,
  337. borderWidth: 0,
  338. color: '#838383'
  339. }
  340. };
  341. $.plot($("#flot-dashboard-chart"), dataset, options);
  342. //百度echarts*************/
  343. var myChart = echarts.init(document.getElementById('echarts-sales'));
  344. var option = {
  345. title : {
  346. text: '近一个月销售变化'
  347. },
  348. tooltip : {
  349. trigger: 'axis'
  350. },
  351. legend: {
  352. data:['销售总额','支出额','收入额']
  353. },
  354. toolbox: {
  355. show : true,
  356. feature : {
  357. // mark : {show: true},
  358. // dataView : {show: true, readOnly: false},
  359. magicType : {show: true, type: ['line', 'bar']},
  360. restore : {show: true},
  361. saveAsImage : {show: true}
  362. }
  363. },
  364. calculable : true,
  365. xAxis : [
  366. {
  367. type : 'category',
  368. boundaryGap : false,
  369. data : xAxisData
  370. }
  371. ],
  372. yAxis : [
  373. {
  374. type : 'value',
  375. axisLabel : {
  376. formatter: '{value}'
  377. }
  378. }
  379. ],
  380. series : [
  381. {
  382. name:'销售总额',
  383. type:'line',
  384. data: yAxisOrderAmount,
  385. markPoint : {
  386. data : [
  387. {type : 'max', name: '最大值'},
  388. {type : 'min', name: '最小值'}
  389. ]
  390. },
  391. markLine : {
  392. data : [
  393. {type : 'average', name: '平均值'}
  394. ]
  395. }
  396. },
  397. {
  398. name:'支出额',
  399. type:'line',
  400. data:yAxisPayAmount,
  401. markPoint : {
  402. data : [
  403. {type : 'max', name: '最大值'},
  404. {type : 'min', name: '最小值'}
  405. ]
  406. },
  407. markLine : {
  408. data : [
  409. {type : 'average', name : '平均值'}
  410. ]
  411. }
  412. },
  413. {
  414. name:'收入额',
  415. type:'line',
  416. data:yAxisIncomeAmount,
  417. markPoint : {
  418. data : [
  419. {type : 'max', name: '最大值'},
  420. {type : 'min', name: '最小值'}
  421. ]
  422. },
  423. markLine : {
  424. data : [
  425. {type : 'average', name : '平均值'}
  426. ]
  427. }
  428. }
  429. ]
  430. }
  431. myChart.setOption(option);
  432. window.addEventListener('resize', function () {
  433. myChart.resize();
  434. });
  435. //******************* echarts end*********************/
  436. $("#ibox-content_pt ul li").each(function (index) {
  437. if(index==0){
  438. $(this).find('.no-margins').html(orderAllCnt);
  439. }else if(index==1){
  440. $(this).find('.no-margins').html(orderSucCnt);
  441. $(this).find('.progress-bar').css("width", (100*(orderSucCnt/orderAllCnt))+"%");
  442. }else{
  443. $(this).find('.no-margins').html(orderAllCnt - orderSucCnt);
  444. $(this).find('.progress-bar').css("width", (100*((orderAllCnt - orderSucCnt)/orderAllCnt))+"%");
  445. }
  446. });
  447. //ibox-content_po
  448. $("#ibox-content_po ul li").each(function (index) {
  449. if(index==0){
  450. $(this).find('.no-margins').html(result.orderAmount['total']);
  451. }else if(index==1){
  452. $(this).find('.no-margins').html(result.orderAmount['income']);
  453. $(this).find('.progress-bar').css("width", (100*(result.orderAmount['income']/result.orderAmount['total']))+"%");
  454. }else if(index==2){
  455. $(this).find('.no-margins').html(orderMonthTotal);
  456. }else{
  457. $(this).find('.no-margins').html(orderMonthIncome);
  458. $(this).find('.progress-bar').css("width", (100*(orderMonthIncome/orderMonthTotal))+"%");
  459. }
  460. });
  461. });
  462. $.plot($("#flot-dashboard-chart"), dataset, options);
  463. });
  464. </script>
  465. </body>
  466. </html>