user_default.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. {Template header}
  2. <body>
  3. <div class="warp">
  4. <div class="title default" style="margin-bottom:20px;">工作预览&nbsp;&nbsp;<input id="timetk" value="{date('Y-m-d',time()-29*24*3600)} 0:00" name="timetk" type="text" onclick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})">
  5. 至&nbsp;&nbsp;&nbsp;&nbsp; <input id="timetj" value="{date('Y-m-d',time()+24*3600)} 0:00" name="timetj" type="text" onclick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"><span>确 定</span></div>
  6. <div id="order" style="width:70%;height:40%;float:left;"></div>
  7. <ul id="untreated" style="width:30%">
  8. <li><em><span></span></em><p><b></b> 待处理订单</p></li>
  9. <li><em><span></span></em><p><b></b> 待出库订单</p></li>
  10. </ul>
  11. <div id="container" style="width:100%;height:40%;float:left"></div>
  12. </div>
  13. <script src="{$theme}js/echarts.min.js?v=201911220005"></script>
  14. <script type="text/javascript">
  15. $(".default span").click(function() {
  16. defaultgo();
  17. });
  18. $(document).ready(function() {
  19. defaultgo();
  20. })
  21. function defaultgo() {
  22. $.ajax({
  23. url: "/user/default/",
  24. data: "timek="+$("#timetk").val()+"&timej="+$("#timetj").val(),
  25. type: "POST",
  26. dataType: "json",
  27. success: function(a) {
  28. if (a && a.success) {
  29. $("#untreated li:eq(0) span").animate({width:a.snuz},1000);
  30. $("#untreated li:eq(1) span").animate({width:a.lnuz},1000);
  31. $("#untreated li:eq(0) b").text(a.snu);
  32. $("#untreated li:eq(1) b").text(a.lnu);
  33. // 基于准备好的dom,初始化echarts实例
  34. var myChart = echarts.init(document.getElementById('order'));
  35. // 指定图表的配置项和数据
  36. var option = {
  37. tooltip: {},
  38. legend: {
  39. data:['近7日销量']
  40. },
  41. xAxis: {
  42. data: a.time
  43. },
  44. yAxis: {},
  45. series: [{
  46. name: '近7日销量',
  47. type: 'bar',
  48. label: {
  49. normal: {
  50. show: true,
  51. position: 'inside'
  52. }
  53. },
  54. data: a.num
  55. }]
  56. };
  57. // 使用刚指定的配置项和数据显示图表。
  58. myChart.setOption(option);
  59. var dom = document.getElementById("container");
  60. var myChart = echarts.init(dom);
  61. var app = {};
  62. option = null;
  63. option = {
  64. tooltip: {
  65. trigger: 'axis'
  66. },
  67. legend: {
  68. data:['预计可得金额','实际可得金额']
  69. },
  70. toolbox: {
  71. show: true,
  72. feature: {
  73. dataZoom: {
  74. yAxisIndex: 'none'
  75. },
  76. dataView: {readOnly: false},
  77. magicType: {type: ['line', 'bar']},
  78. restore: {},
  79. saveAsImage: {}
  80. }
  81. },
  82. xAxis: {
  83. type: 'category',
  84. boundaryGap: false,
  85. data: a.time
  86. },
  87. yAxis: {
  88. type: 'value',
  89. axisLabel: {
  90. formatter: '{value} 元 '
  91. }
  92. },
  93. series: [
  94. {
  95. name:'预计可得金额',
  96. type:'line',
  97. data: a.ymoney,
  98. markPoint: {
  99. data: [
  100. {type: 'max', name: '最大值'},
  101. {type: 'min', name: '最小值'}
  102. ]
  103. },
  104. markLine: {
  105. data: [
  106. {type: 'average', name: '平均值'}
  107. ]
  108. }
  109. },
  110. {
  111. name:'实际可得金额',
  112. type:'line',
  113. data: a.money,
  114. markLine: {
  115. data: [
  116. {type: 'average', name: '平均值'},
  117. [{
  118. symbol: 'none',
  119. x: '90%',
  120. yAxis: 'max'
  121. }, {
  122. symbol: 'circle',
  123. label: {
  124. normal: {
  125. position: 'start',
  126. formatter: '最大值'
  127. }
  128. },
  129. type: 'max',
  130. name: '最高点'
  131. }]
  132. ]
  133. }
  134. }
  135. ]
  136. };
  137. ;
  138. if (option && typeof option === "object") {
  139. myChart.setOption(option, true);
  140. }
  141. }
  142. }
  143. });
  144. };
  145. </script>
  146. <script type="text/javascript" src="{$theme}js/laydate.js"></script>
  147. {Template footer}