| | |
| | | <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 |
| | |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentName").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()) |
| | | } |
| | | }) |
| | | |