123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- {Template header}
- <body>
- <div class="warp">
- <div class="title default" style="margin-bottom:20px;">工作预览 <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'})">
- 至 <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>
- <div id="order" style="width:70%;height:40%;float:left;"></div>
- <ul id="untreated" style="width:30%">
- <li><em><span></span></em><p><b></b> 待处理订单</p></li>
- <li><em><span></span></em><p><b></b> 待出库订单</p></li>
- </ul>
- <div id="container" style="width:100%;height:40%;float:left"></div>
- </div>
- <script src="{$theme}js/echarts.min.js?v=201911220005"></script>
- <script type="text/javascript">
- $(".default span").click(function() {
- defaultgo();
- });
- $(document).ready(function() {
- defaultgo();
- })
- function defaultgo() {
- $.ajax({
- url: "/user/default/",
- data: "timek="+$("#timetk").val()+"&timej="+$("#timetj").val(),
- type: "POST",
- dataType: "json",
- success: function(a) {
- if (a && a.success) {
- $("#untreated li:eq(0) span").animate({width:a.snuz},1000);
- $("#untreated li:eq(1) span").animate({width:a.lnuz},1000);
- $("#untreated li:eq(0) b").text(a.snu);
- $("#untreated li:eq(1) b").text(a.lnu);
- // 基于准备好的dom,初始化echarts实例
- var myChart = echarts.init(document.getElementById('order'));
- // 指定图表的配置项和数据
- var option = {
- tooltip: {},
- legend: {
- data:['近7日销量']
- },
- xAxis: {
- data: a.time
- },
- yAxis: {},
- series: [{
- name: '近7日销量',
- type: 'bar',
- label: {
- normal: {
- show: true,
- position: 'inside'
- }
- },
- data: a.num
- }]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
-
- var dom = document.getElementById("container");
- var myChart = echarts.init(dom);
- var app = {};
- option = null;
- option = {
- tooltip: {
- trigger: 'axis'
- },
- legend: {
- data:['预计可得金额','实际可得金额']
- },
- toolbox: {
- show: true,
- feature: {
- dataZoom: {
- yAxisIndex: 'none'
- },
- dataView: {readOnly: false},
- magicType: {type: ['line', 'bar']},
- restore: {},
- saveAsImage: {}
- }
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: a.time
- },
- yAxis: {
- type: 'value',
- axisLabel: {
- formatter: '{value} 元 '
- }
- },
- series: [
- {
- name:'预计可得金额',
- type:'line',
- data: a.ymoney,
- markPoint: {
- data: [
- {type: 'max', name: '最大值'},
- {type: 'min', name: '最小值'}
- ]
- },
- markLine: {
- data: [
- {type: 'average', name: '平均值'}
- ]
- }
- },
- {
- name:'实际可得金额',
- type:'line',
- data: a.money,
- markLine: {
- data: [
- {type: 'average', name: '平均值'},
- [{
- symbol: 'none',
- x: '90%',
- yAxis: 'max'
- }, {
- symbol: 'circle',
- label: {
- normal: {
- position: 'start',
- formatter: '最大值'
- }
- },
- type: 'max',
- name: '最高点'
- }]
- ]
- }
- }
- ]
- };
- ;
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- }
- }
- }
- });
- };
- </script>
- <script type="text/javascript" src="{$theme}js/laydate.js"></script>
- {Template footer}
|