| | |
| | | <button id="btn3" onclick="queryCommission()">佣金</button> |
| | | </div> |
| | | <div> |
| | | <select class="col-lg-8" style="height: 25px"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | <input type="text" class="form-control layer-date" placeholder="请选择" id="insertTimeMonth"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="col-sm-3"></div> |
| | | <div class="initialLevel col-sm-4 control-label form-group" style="text-align: right"> |
| | | <select class="col-lg-12" id="year" style="height: 25px;border-radius: 5px"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | <input type="text" class="form-control layer-date" placeholder="请选择" id="insertTime"> |
| | | </div> |
| | | </div><br/> |
| | | <div id="chart1" style="height: 90%;width: 100%"></div> |
| | |
| | | |
| | | $(function (){ |
| | | loading() |
| | | orderByMonth() |
| | | orderByYear() |
| | | orderByMonth(new Date().getMonth() + 1) |
| | | orderByYear(new Date().getFullYear()) |
| | | queryOrderCount() |
| | | |
| | | }) |
| | | |
| | | function selectYear(e){ |
| | | orderByYear(e) |
| | | } |
| | | function selectMonth(e){ |
| | | // 查询排行榜 |
| | | if($('#btn1').val() != null && $('#btn1').val() != ''){ |
| | | console.log(11111) |
| | | getOrder($('#btn1').val(),e) |
| | | } |
| | | if($('#btn2').val() != null && $('#btn2').val() != ''){ |
| | | console.log(22222) |
| | | getOrder($('#btn2').val(),e) |
| | | } |
| | | if($('#btn3').val() != null && $('#btn3').val() != ''){ |
| | | console.log(33333) |
| | | getOrder($('#btn3').val(),e) |
| | | } |
| | | } |
| | | laydate.render({ |
| | | elem: '#insertTime', |
| | | range: false, |
| | | type: "year", |
| | | change:function(value,date) { |
| | | selectYear(value)// change 每点一次都会监听一遍 |
| | | } |
| | | }); |
| | | laydate.render({ |
| | | elem: '#insertTimeMonth', |
| | | range: false, |
| | | type: "month", |
| | | change:function(value,date) { |
| | | selectMonth(value)// change 每点一次都会监听一遍 |
| | | } |
| | | }); |
| | | |
| | | // 进度条加载 |
| | | function loading(){ |
| | |
| | | $('#btn1').val(1) |
| | | $('#btn2').val('') |
| | | $('#btn3').val('') |
| | | getOrder($('#btn1').val()) |
| | | getOrder($('#btn1').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | // 收入 |
| | | function queryIncome(){ |
| | |
| | | $('#btn1').val('') |
| | | $('#btn2').val(2) |
| | | $('#btn3').val('') |
| | | getOrder($('#btn2').val()) |
| | | getOrder($('#btn2').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | // 佣金 |
| | | function queryCommission(){ |
| | |
| | | $('#btn1').val('') |
| | | $('#btn2').val('') |
| | | $('#btn3').val(3) |
| | | getOrder($('#btn3').val()) |
| | | getOrder($('#btn3').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | |
| | | // 通过年查询订单数量(查询每月) |
| | | function orderByYear(){ |
| | | function orderByYear(e){ |
| | | var dom = document.getElementById('chart1'); |
| | | var ajax = new $ax(Feng.ctxPath+"/tHomePage/statisticsYearByAgentId",function(data){ |
| | | data = data.yearResp |
| | | var myChart = echarts.init(dom, null, { |
| | | renderer: 'canvas', |
| | | useDirtyRect: false |
| | | }); |
| | | var option; |
| | | option = { |
| | | tooltip: { |
| | | trigger: 'axis', //坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用 |
| | | axisPointer: {// 坐标轴指示器,坐标轴触发有效 |
| | | type: 'line' // 默认为直线,可选为:'line' | 'shadow' |
| | | }, |
| | | formatter: '日期: {b} <br/>订单数量 : {c}' |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: [data[0].month+'月',data[1].month+'月', data[2].month+'月', data[3].month+'月',data[4].month+'月',data[5].month+'月',data[6].month+'月',data[7].month+'月',data[8].month+'月',data[9].month+'月',data[10].month+'月',data[11].month+'月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: [data[0].orderCount,data[1].orderCount, data[2].orderCount, data[3].orderCount,data[4].orderCount,data[5].orderCount,data[6].orderCount,data[7].orderCount,data[8].orderCount,data[9].orderCount,data[10].orderCount,data[11].orderCount], |
| | | type: 'line', |
| | | color: '#00b7ee' |
| | | } |
| | | ] |
| | | }; |
| | | option && myChart.setOption(option); |
| | | }, function (data) { |
| | | data = data.yearResp |
| | | var myChart = echarts.init(dom, null, { |
| | | renderer: 'canvas', |
| | | useDirtyRect: false |
| | | }); |
| | | var option; |
| | | option = { |
| | | tooltip: { |
| | | trigger: 'axis', //坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用 |
| | | axisPointer: {// 坐标轴指示器,坐标轴触发有效 |
| | | type: 'line' // 默认为直线,可选为:'line' | 'shadow' |
| | | }, |
| | | formatter: '日期: {b} <br/>订单数量 : {c}' |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: [data[0].month+'月',data[1].month+'月', data[2].month+'月', data[3].month+'月',data[4].month+'月',data[5].month+'月',data[6].month+'月',data[7].month+'月',data[8].month+'月',data[9].month+'月',data[10].month+'月',data[11].month+'月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: [data[0].orderCount,data[1].orderCount, data[2].orderCount, data[3].orderCount,data[4].orderCount,data[5].orderCount,data[6].orderCount,data[7].orderCount,data[8].orderCount,data[9].orderCount,data[10].orderCount,data[11].orderCount], |
| | | type: 'line', |
| | | color: '#00b7ee' |
| | | } |
| | | ] |
| | | }; |
| | | option && myChart.setOption(option); |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentName").val()); |
| | | ajax.set("yearDate",$("#year").val()); |
| | | if(e==''){ |
| | | ajax.set("yearDate",$("#year").val()); |
| | | }else{ |
| | | ajax.set("yearDate",e); |
| | | } |
| | | |
| | | ajax.start(); |
| | | } |
| | | |
| | |
| | | ajax.start(); |
| | | } |
| | | |
| | | function getOrder(type){ |
| | | function getOrder(type,e){ |
| | | $.ajax({ |
| | | url: Feng.ctxPath + '/tHomePage/statisticsOrderByAgentId', |
| | | type: 'POST', |
| | | data: { |
| | | agentId: $("#agentName").val(), |
| | | monthDate: $("#monthDate").val(), |
| | | monthDate: e, |
| | | type: type |
| | | }, |
| | | success: function (res) { |
| | |
| | | // 查询月度报表 |
| | | orderByMonth() |
| | | // 通过年查询订单报表 |
| | | orderByYear() |
| | | orderByYear($('#insertTime').val()) |
| | | // 查询排行榜 |
| | | if($('#btn1').val() != null && $('#btn1').val() != ''){ |
| | | console.log(111) |
| | | getOrder($('#btn1').val()) |
| | | getOrder($('#btn1').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | if($('#btn2').val() != null && $('#btn2').val() != ''){ |
| | | console.log(222) |
| | | getOrder($('#btn2').val()) |
| | | getOrder($('#btn2').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | if($('#btn3').val() != null && $('#btn3').val() != ''){ |
| | | console.log(333) |
| | | getOrder($('#btn3').val()) |
| | | getOrder($('#btn3').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | }) |
| | | |