| | |
| | | </style> |
| | | <script type="text/javascript"> |
| | | |
| | | $(function (){ |
| | | $(function (){ |
| | | |
| | | $('#mapDiv').hide() |
| | | $('#orderDiv').hide() |
| | | loading() |
| | | orderByMonth(new Date().getMonth() + 1) |
| | | orderByYear(new Date().getFullYear()) |
| | | queryOrderCount() |
| | | $('#mapDiv').hide() |
| | | $('#orderDiv').hide() |
| | | loading() |
| | | orderByMonth(new Date().getMonth() + 1) |
| | | orderByYear(new Date().getFullYear()) |
| | | queryOrderCount() |
| | | |
| | | var first = $('.breadcrumb').children('li:first').children('a'); |
| | | first.css({ |
| | | 'color': '#AB2626' |
| | | }) |
| | | var className = first.attr('class'); |
| | | $('.content').hide(); |
| | | $('#' + className + 'Div').show(); |
| | | var first = $('.breadcrumb').children('li:first').children('a'); |
| | | first.css({ |
| | | 'color': '#AB2626' |
| | | }) |
| | | var className = first.attr('class'); |
| | | $('.content').hide(); |
| | | $('#' + className + 'Div').show(); |
| | | |
| | | $('.breadcrumb').find('a').on('click', function () { |
| | | $('.breadcrumb').children('li').each(function () { |
| | | $(this).children('a').removeAttr('style'); |
| | | }) |
| | | $('.breadcrumb').find('a').on('click', function () { |
| | | $('.breadcrumb').children('li').each(function () { |
| | | $(this).children('a').removeAttr('style'); |
| | | }) |
| | | |
| | | $(this).css({ |
| | | 'color': '#AB2626' |
| | | }); |
| | | var className = $(this).attr('class'); |
| | | $('.content').hide(); |
| | | $('#' + className + "Div").show(); |
| | | switch (className) { |
| | | case "statistics": |
| | | $('#mapDiv').hide() |
| | | $('#orderDiv').hide() |
| | | loading() |
| | | orderByMonth(new Date().getMonth() + 1) |
| | | orderByYear(new Date().getFullYear()) |
| | | queryOrderCount() |
| | | break; |
| | | case "map": |
| | | map("",102.709,25.0635); |
| | | break; |
| | | case "order": |
| | | mapOrder(""); |
| | | getOrderData(); |
| | | break; |
| | | } |
| | | $(this).css({ |
| | | 'color': '#AB2626' |
| | | }); |
| | | var className = $(this).attr('class'); |
| | | $('.content').hide(); |
| | | $('#' + className + "Div").show(); |
| | | switch (className) { |
| | | case "statistics": |
| | | $('#mapDiv').hide() |
| | | $('#orderDiv').hide() |
| | | loading() |
| | | orderByMonth(new Date().getMonth() + 1) |
| | | orderByYear(new Date().getFullYear()) |
| | | queryOrderCount() |
| | | break; |
| | | case "map": |
| | | map("",113.264434,23.129162); |
| | | break; |
| | | case "order": |
| | | mapOrder(""); |
| | | getOrderData(); |
| | | break; |
| | | } |
| | | |
| | | }) |
| | | // $('#mapDiv').hide() |
| | | // $('#orderDiv').hide() |
| | | // loading() |
| | | // orderByMonth(new Date().getMonth() + 1) |
| | | // orderByYear(new Date().getFullYear()) |
| | | // queryOrderCount() |
| | | }) |
| | | }) |
| | | // $('#mapDiv').hide() |
| | | // $('#orderDiv').hide() |
| | | // loading() |
| | | // orderByMonth(new Date().getMonth() + 1) |
| | | // orderByYear(new Date().getFullYear()) |
| | | // queryOrderCount() |
| | | setInterval(function () { |
| | | console.log(1111111111) |
| | | getData() |
| | | }, 30000); |
| | | }) |
| | | |
| | | 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 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 每点一次都会监听一遍 |
| | | } |
| | | }); |
| | | laydate.render({ |
| | | elem: '#createTime', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | |
| | | // 进度条加载 |
| | | function loading(){ |
| | | var options = $.extend({ |
| | | percentage : $('#agentTotal').text(), |
| | | ShowProgressCount: false, |
| | | duration: 10, |
| | | // 进度条加载 |
| | | function loading(){ |
| | | var options = $.extend({ |
| | | percentage : $('#agentTotal').text()<100?$('#agentTotal').text():($('#agentTotal').text()>1000?$('#agentTotal').text()/100:$('#agentTotal').text()/10), |
| | | ShowProgressCount: false, |
| | | duration: 10, |
| | | |
| | | // Styling Options |
| | | fillBackgroundColor: '#3498db', |
| | | backgroundColor: '#EEEEEE', |
| | | radius: '10px', |
| | | height: '20px', |
| | | width: '80%' |
| | | }); |
| | | $('#pro1').LineProgressbar(options); |
| | | var options = $.extend({ |
| | | percentage : $('#agentMonthTotal').text(), |
| | | ShowProgressCount: false, |
| | | duration: 10, |
| | | // Styling Options |
| | | fillBackgroundColor: '#3498db', |
| | | backgroundColor: '#EEEEEE', |
| | | radius: '10px', |
| | | height: '20px', |
| | | width: '80%' |
| | | }); |
| | | $('#pro1').LineProgressbar(options); |
| | | var options = $.extend({ |
| | | percentage : $('#agentMonthTotal').text()<100?$('#agentMonthTotal').text():($('#agentMonthTotal').text()>1000?$('#agentMonthTotal').text()/100:$('#agentMonthTotal').text()/10), |
| | | ShowProgressCount: false, |
| | | duration: 10, |
| | | |
| | | // Styling Options |
| | | fillBackgroundColor: '#3498db', |
| | | backgroundColor: '#EEEEEE', |
| | | radius: '10px', |
| | | height: '20px', |
| | | width: '80%' |
| | | }); |
| | | $('#pro2').LineProgressbar(options); |
| | | var options = $.extend({ |
| | | percentage : $('#driverTotal').text(), |
| | | ShowProgressCount: false, |
| | | duration: 10, |
| | | // Styling Options |
| | | fillBackgroundColor: '#3498db', |
| | | backgroundColor: '#EEEEEE', |
| | | radius: '10px', |
| | | height: '20px', |
| | | width: '80%' |
| | | }); |
| | | $('#pro2').LineProgressbar(options); |
| | | var options = $.extend({ |
| | | percentage : $('#driverTotal').text()<100?$('#driverTotal').text():($('#driverTotal').text()>1000?$('#driverTotal').text()/100:$('#driverTotal').text()/10), |
| | | ShowProgressCount: false, |
| | | duration: 10, |
| | | |
| | | // Styling Options |
| | | fillBackgroundColor: '#3498db', |
| | | backgroundColor: '#EEEEEE', |
| | | radius: '10px', |
| | | height: '20px', |
| | | width: '80%' |
| | | }); |
| | | $('#pro3').LineProgressbar(options); |
| | | var options = $.extend({ |
| | | percentage : $('#driverMonthTotal').text(), |
| | | ShowProgressCount: false, |
| | | duration: 10, |
| | | // Styling Options |
| | | fillBackgroundColor: '#3498db', |
| | | backgroundColor: '#EEEEEE', |
| | | radius: '10px', |
| | | height: '20px', |
| | | width: '80%' |
| | | }); |
| | | $('#pro3').LineProgressbar(options); |
| | | var options = $.extend({ |
| | | percentage : $('#driverMonthTotal').text()<100?$('#driverMonthTotal').text():($('#driverMonthTotal').text()>1000?$('#driverMonthTotal').text()/100:$('#driverMonthTotal').text()/10), |
| | | ShowProgressCount: false, |
| | | duration: 10, |
| | | |
| | | // Styling Options |
| | | fillBackgroundColor: '#3498db', |
| | | backgroundColor: '#EEEEEE', |
| | | radius: '10px', |
| | | height: '20px', |
| | | width: '80%' |
| | | }); |
| | | $('#pro4').LineProgressbar(options); |
| | | } |
| | | // Styling Options |
| | | fillBackgroundColor: '#3498db', |
| | | backgroundColor: '#EEEEEE', |
| | | radius: '10px', |
| | | height: '20px', |
| | | width: '80%' |
| | | }); |
| | | $('#pro4').LineProgressbar(options); |
| | | } |
| | | |
| | | // 单量 |
| | | function queryOrderCount(){ |
| | | $('#btn1').css("backgroundColor","dodgerblue") |
| | | $('#btn1').css("borderColor","dodgerblue") |
| | | $('#btn1').css("color","#FFFFFF") |
| | | $('#btn2').css("backgroundColor","#FFFFFF") |
| | | $('#btn2').css("borderColor","dodgerblue") |
| | | $('#btn2').css("color","black") |
| | | $('#btn3').css("backgroundColor","#FFFFFF") |
| | | $('#btn3').css("borderColor","dodgerblue") |
| | | $('#btn3').css("color","black") |
| | | $('#btn1').val(1) |
| | | $('#btn2').val('') |
| | | $('#btn3').val('') |
| | | getOrder($('#btn1').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | // 收入 |
| | | function queryIncome(){ |
| | | $('#btn1').css("backgroundColor","#FFFFFF") |
| | | $('#btn1').css("borderColor","dodgerblue") |
| | | $('#btn1').css("color","black") |
| | | $('#btn2').css("backgroundColor","dodgerblue") |
| | | $('#btn2').css("borderColor","dodgerblue") |
| | | $('#btn2').css("color","#FFFFFF") |
| | | $('#btn3').css("backgroundColor","#FFFFFF") |
| | | $('#btn3').css("borderColor","dodgerblue") |
| | | $('#btn3').css("color","black") |
| | | $('#btn1').val('') |
| | | $('#btn2').val(2) |
| | | $('#btn3').val('') |
| | | getOrder($('#btn2').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | // 佣金 |
| | | function queryCommission(){ |
| | | $('#btn1').css("backgroundColor","#FFFFFF") |
| | | $('#btn1').css("borderColor","dodgerblue") |
| | | $('#btn1').css("color","black") |
| | | $('#btn2').css("backgroundColor","#FFFFFF") |
| | | $('#btn2').css("borderColor","dodgerblue") |
| | | $('#btn2').css("color","black") |
| | | $('#btn3').css("backgroundColor","dodgerblue") |
| | | $('#btn3').css("borderColor","dodgerblue") |
| | | $('#btn3').css("color","#FFFFFF") |
| | | $('#btn1').val('') |
| | | $('#btn2').val('') |
| | | $('#btn3').val(3) |
| | | getOrder($('#btn3').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | // 单量 |
| | | function queryOrderCount(){ |
| | | $('#btn1').css("backgroundColor","dodgerblue") |
| | | $('#btn1').css("borderColor","dodgerblue") |
| | | $('#btn1').css("color","#FFFFFF") |
| | | $('#btn2').css("backgroundColor","#FFFFFF") |
| | | $('#btn2').css("borderColor","dodgerblue") |
| | | $('#btn2').css("color","black") |
| | | $('#btn3').css("backgroundColor","#FFFFFF") |
| | | $('#btn3').css("borderColor","dodgerblue") |
| | | $('#btn3').css("color","black") |
| | | $('#btn1').val(1) |
| | | $('#btn2').val('') |
| | | $('#btn3').val('') |
| | | getOrder($('#btn1').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | // 收入 |
| | | function queryIncome(){ |
| | | $('#btn1').css("backgroundColor","#FFFFFF") |
| | | $('#btn1').css("borderColor","dodgerblue") |
| | | $('#btn1').css("color","black") |
| | | $('#btn2').css("backgroundColor","dodgerblue") |
| | | $('#btn2').css("borderColor","dodgerblue") |
| | | $('#btn2').css("color","#FFFFFF") |
| | | $('#btn3').css("backgroundColor","#FFFFFF") |
| | | $('#btn3').css("borderColor","dodgerblue") |
| | | $('#btn3').css("color","black") |
| | | $('#btn1').val('') |
| | | $('#btn2').val(2) |
| | | $('#btn3').val('') |
| | | getOrder($('#btn2').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | // 佣金 |
| | | function queryCommission(){ |
| | | $('#btn1').css("backgroundColor","#FFFFFF") |
| | | $('#btn1').css("borderColor","dodgerblue") |
| | | $('#btn1').css("color","black") |
| | | $('#btn2').css("backgroundColor","#FFFFFF") |
| | | $('#btn2').css("borderColor","dodgerblue") |
| | | $('#btn2').css("color","black") |
| | | $('#btn3').css("backgroundColor","dodgerblue") |
| | | $('#btn3').css("borderColor","dodgerblue") |
| | | $('#btn3').css("color","#FFFFFF") |
| | | $('#btn1').val('') |
| | | $('#btn2').val('') |
| | | $('#btn3').val(3) |
| | | getOrder($('#btn3').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | |
| | | // 通过年查询订单数量(查询每月) |
| | | 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) { |
| | | }); |
| | | ajax.set("agentId",$("#agentName").val()); |
| | | if(e==''){ |
| | | ajax.set("yearDate",$("#year").val()); |
| | | }else{ |
| | | ajax.set("yearDate",e); |
| | | } |
| | | // 通过年查询订单数量(查询每月) |
| | | 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) { |
| | | }); |
| | | ajax.set("agentId",$("#agentName").val()); |
| | | if(e==''){ |
| | | ajax.set("yearDate",$("#year").val()); |
| | | }else{ |
| | | ajax.set("yearDate",e); |
| | | } |
| | | |
| | | ajax.start(); |
| | | } |
| | | ajax.start(); |
| | | } |
| | | |
| | | // 通过本月查询订单数量(查询本月每天) |
| | | function orderByMonth(){ |
| | | var dom = document.getElementById('chart2'); |
| | | var ajax = new $ax(Feng.ctxPath+"/tHomePage/statisticsMonthByAgentId",function(data){ |
| | | data = data.monthResp |
| | | var mon = new Date().getMonth()+1; |
| | | if(mon < 10){ |
| | | mon = '0'+mon; |
| | | } |
| | | var yResp = []; |
| | | var xResp = []; |
| | | for (var i =0;i<data.length;i++){ |
| | | yResp.push({ |
| | | value:data[i].orderCount, |
| | | }) |
| | | xResp.push({ |
| | | value:mon+'-'+data[i].month, |
| | | }) |
| | | } |
| | | 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}' |
| | | }, |
| | | // 通过本月查询订单数量(查询本月每天) |
| | | function orderByMonth(){ |
| | | var dom = document.getElementById('chart2'); |
| | | var ajax = new $ax(Feng.ctxPath+"/tHomePage/statisticsMonthByAgentId",function(data){ |
| | | data = data.monthResp |
| | | var mon = new Date().getMonth()+1; |
| | | if(mon < 10){ |
| | | mon = '0'+mon; |
| | | } |
| | | var yResp = []; |
| | | var xResp = []; |
| | | for (var i =0;i<data.length;i++){ |
| | | yResp.push({ |
| | | value:data[i].orderCount, |
| | | }) |
| | | xResp.push({ |
| | | value:mon+'-'+data[i].month, |
| | | }) |
| | | } |
| | | 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: xResp |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: yResp, |
| | | type: 'line', |
| | | color: '#00b7ee' |
| | | } |
| | | ] |
| | | }; |
| | | option && myChart.setOption(option); |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentName").val()); |
| | | ajax.start(); |
| | | } |
| | | xAxis: { |
| | | type: 'category', |
| | | data: xResp |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: yResp, |
| | | type: 'line', |
| | | color: '#00b7ee' |
| | | } |
| | | ] |
| | | }; |
| | | option && myChart.setOption(option); |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentName").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | function getOrder(type,e){ |
| | | $.ajax({ |
| | | url: Feng.ctxPath + '/tHomePage/statisticsOrderByAgentId', |
| | | type: 'POST', |
| | | data: { |
| | | agentId: $("#agentName").val(), |
| | | monthDate: e, |
| | | type: type |
| | | }, |
| | | success: function (res) { |
| | | var str = '<table border="1" style="border: #c2ccd1;border-radius: 1px;height: 90%;width: 100%;text-align:center;table-layout:fixed;tword-break:break-all;">\n' + |
| | | ' <tr style="text-align: center;width:100px;height:40px">\n' + |
| | | ' <th class="orderTh">排名</th>\n' + |
| | | ' <th class="orderTh">时间</th>\n' + |
| | | ' <th class="orderTh">姓名</th>\n'; |
| | | if(type == 1){ |
| | | str += ' <th class="orderTh">单量</th>\n' + |
| | | ' </tr>'; |
| | | } |
| | | if(type == 2){ |
| | | str += ' <th class="orderTh">收入</th>\n' + |
| | | ' </tr>'; |
| | | } |
| | | if(type == 3){ |
| | | str += ' <th class="orderTh">佣金</th>\n' + |
| | | ' </tr>'; |
| | | } |
| | | if(!$.isEmptyObject(res)){ |
| | | var order = res.performanceResp |
| | | if(order.length > 0){ |
| | | for(var i in order){ |
| | | var a=parseInt(i)+1 |
| | | str += |
| | | '<tr><td class="orderTd">' + a + '</td><td class="orderTd">' + order[i].monthTime + '</td><td class="orderTd">' + order[i].userName + '</td><td class="orderTd">' + order[i].amount + '</td></tr>'; |
| | | } |
| | | } |
| | | } |
| | | str += '</table>'; |
| | | $('#performanceResp').html(''); |
| | | $('#performanceResp').html(str); |
| | | } |
| | | }); |
| | | } |
| | | function getOrder(type,e){ |
| | | $.ajax({ |
| | | url: Feng.ctxPath + '/tHomePage/statisticsOrderByAgentId', |
| | | type: 'POST', |
| | | data: { |
| | | agentId: $("#agentName").val(), |
| | | monthDate: e, |
| | | type: type |
| | | }, |
| | | success: function (res) { |
| | | var str = '<table border="1" style="border: #c2ccd1;border-radius: 1px;height: 90%;width: 100%;text-align:center;table-layout:fixed;tword-break:break-all;">\n' + |
| | | ' <tr style="text-align: center;width:100px;height:40px">\n' + |
| | | ' <th class="orderTh">排名</th>\n' + |
| | | ' <th class="orderTh">时间</th>\n' + |
| | | ' <th class="orderTh">姓名</th>\n'; |
| | | if(type == 1){ |
| | | str += ' <th class="orderTh">单量</th>\n' + |
| | | ' </tr>'; |
| | | } |
| | | if(type == 2){ |
| | | str += ' <th class="orderTh">收入</th>\n' + |
| | | ' </tr>'; |
| | | } |
| | | if(type == 3){ |
| | | str += ' <th class="orderTh">佣金</th>\n' + |
| | | ' </tr>'; |
| | | } |
| | | if(!$.isEmptyObject(res)){ |
| | | var order = res.performanceResp |
| | | if(order.length > 0){ |
| | | for(var i in order){ |
| | | var a=parseInt(i)+1 |
| | | str += |
| | | '<tr><td class="orderTd">' + a + '</td><td class="orderTd">' + order[i].monthTime + '</td><td class="orderTd">' + order[i].userName + '</td><td class="orderTd">' + order[i].amount + '</td></tr>'; |
| | | } |
| | | } |
| | | } |
| | | str += '</table>'; |
| | | $('#performanceResp').html(''); |
| | | $('#performanceResp').html(str); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 动态查询代理商司机数量 |
| | | function getInfo(){ |
| | | var ajax = new $ax(Feng.ctxPath+"/tHomePage/statisticsDriverByAgentId",function(data){ |
| | | $("#agentTotal").text(data.agentTotal) |
| | | $("#agentMonthTotal").text(data.agentMonthTotal) |
| | | $("#driverTotal").text(data.driverTotal) |
| | | $("#driverMonthTotal").text(data.driverMonthTotal) |
| | | loading() |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentName").val()); |
| | | ajax.start(); |
| | | } |
| | | // 动态查询代理商司机数量 |
| | | function getInfo(){ |
| | | var ajax = new $ax(Feng.ctxPath+"/tHomePage/statisticsDriverByAgentId",function(data){ |
| | | $("#agentTotal").text(data.agentTotal) |
| | | $("#agentMonthTotal").text(data.agentMonthTotal) |
| | | $("#driverTotal").text(data.driverTotal) |
| | | $("#driverMonthTotal").text(data.driverMonthTotal) |
| | | loading() |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentName").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | // 代理商选择事件 |
| | | $('#agentName').change(function(){ |
| | | // 查询代理商 查询司机 |
| | | getInfo() |
| | | // 查询月度报表 |
| | | orderByMonth() |
| | | // 通过年查询订单报表 |
| | | orderByYear($('#insertTime').val()) |
| | | // 查询排行榜 |
| | | if($('#btn1').val() != null && $('#btn1').val() != ''){ |
| | | console.log(111) |
| | | getOrder($('#btn1').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | if($('#btn2').val() != null && $('#btn2').val() != ''){ |
| | | console.log(222) |
| | | getOrder($('#btn2').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | if($('#btn3').val() != null && $('#btn3').val() != ''){ |
| | | console.log(333) |
| | | getOrder($('#btn3').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | }) |
| | | |
| | | |
| | | /** |
| | | * 定时器 |
| | | */ |
| | | setInterval(function () { |
| | | getData(); |
| | | }, 30000); |
| | | // 代理商选择事件 |
| | | $('#agentName').change(function(){ |
| | | // 查询代理商 查询司机 |
| | | getInfo() |
| | | // 查询月度报表 |
| | | orderByMonth() |
| | | // 通过年查询订单报表 |
| | | orderByYear($('#insertTime').val()) |
| | | // 查询排行榜 |
| | | if($('#btn1').val() != null && $('#btn1').val() != ''){ |
| | | console.log(111) |
| | | getOrder($('#btn1').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | if($('#btn2').val() != null && $('#btn2').val() != ''){ |
| | | console.log(222) |
| | | getOrder($('#btn2').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | if($('#btn3').val() != null && $('#btn3').val() != ''){ |
| | | console.log(333) |
| | | getOrder($('#btn3').val(),$('#insertTimeMonth').val()) |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | function getData(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tHomePage/getMap", function (data) { |
| | | document.getElementById("onLineDriverCount").innerText=data.onLineDriverCount |
| | | document.getElementById("pendingOrderCount").innerText=data.pendingOrderCount |
| | | document.getElementById("serverCount").innerText=data.serverCount |
| | | document.getElementById("finishCount").innerText=data.finishCount |
| | | document.getElementById("cancelCount").innerText=data.cancelCount |
| | | $('#allList').val(data.allList); |
| | | console.log(data.allList) |
| | | map(data.allList,data.addressLon,data.addressLat) |
| | | getOrderData() |
| | | |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentId").val()); |
| | | ajax.set("type",$("#orderType").val()); |
| | | ajax.start(); |
| | | } |
| | | function reset(){ |
| | | $("#agentId").val('') |
| | | $("#orderType").val('') |
| | | var ajax = new $ax(Feng.ctxPath + "/tHomePage/getMap", function (data) { |
| | | document.getElementById("onLineDriverCount").innerText=data.onLineDriverCount |
| | | document.getElementById("pendingOrderCount").innerText=data.pendingOrderCount |
| | | document.getElementById("serverCount").innerText=data.serverCount |
| | | document.getElementById("finishCount").innerText=data.finishCount |
| | | document.getElementById("cancelCount").innerText=data.cancelCount |
| | | $('#allList').val(data.allList); |
| | | map(data.allList,data.addressLon,data.addressLat) |
| | | getOrderData() |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentId").val()); |
| | | ajax.set("type",$("#orderType").val()); |
| | | ajax.start(); |
| | | } |
| | | function getData(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tHomePage/getMap", function (data) { |
| | | document.getElementById("onLineDriverCount").innerText=data.onLineDriverCount |
| | | document.getElementById("pendingOrderCount").innerText=data.pendingOrderCount |
| | | document.getElementById("serverCount").innerText=data.serverCount |
| | | document.getElementById("finishCount").innerText=data.finishCount |
| | | document.getElementById("cancelCount").innerText=data.cancelCount |
| | | $('#onLineDriver').val(data.onLineDriver); |
| | | console.log(data.onLineDriver) |
| | | map(data.onLineDriver,data.addressLon,data.addressLat) |
| | | getOrderData() |
| | | |
| | | function getDataOrder(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tHomePage/getMap", function (data) { |
| | | document.getElementById("onLineDriverCount").innerText=data.onLineDriverCount |
| | | document.getElementById("pendingOrderCount").innerText=data.pendingOrderCount |
| | | document.getElementById("serverCount").innerText=data.serverCount |
| | | document.getElementById("finishCount").innerText=data.finishCount |
| | | document.getElementById("cancelCount").innerText=data.cancelCount |
| | | $('#allList').val(data.allList); |
| | | console.log(data.allList) |
| | | mapOrder(data.allList) |
| | | getOrderData() |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentId").val()); |
| | | ajax.set("type",$("#orderType").val()); |
| | | ajax.start(); |
| | | } |
| | | function reset(){ |
| | | $("#agentId").val('') |
| | | $("#orderType").val('') |
| | | var ajax = new $ax(Feng.ctxPath + "/tHomePage/getMap", function (data) { |
| | | document.getElementById("onLineDriverCount").innerText=data.onLineDriverCount |
| | | document.getElementById("pendingOrderCount").innerText=data.pendingOrderCount |
| | | document.getElementById("serverCount").innerText=data.serverCount |
| | | document.getElementById("finishCount").innerText=data.finishCount |
| | | document.getElementById("cancelCount").innerText=data.cancelCount |
| | | $('#onLineDriver').val(data.onLineDriver); |
| | | map(data.onLineDriver,data.addressLon,data.addressLat) |
| | | getOrderData() |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentId").val()); |
| | | ajax.set("type",$("#orderType").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentId").val()); |
| | | ajax.set("type",$("#orderType").val()); |
| | | ajax.start(); |
| | | } |
| | | function resetOrder(){ |
| | | $("#agentId").val('') |
| | | $("#orderType").val('') |
| | | var ajax = new $ax(Feng.ctxPath + "/tHomePage/getMap", function (data) { |
| | | document.getElementById("onLineDriverCount").innerText=data.onLineDriverCount |
| | | document.getElementById("pendingOrderCount").innerText=data.pendingOrderCount |
| | | document.getElementById("serverCount").innerText=data.serverCount |
| | | document.getElementById("finishCount").innerText=data.finishCount |
| | | document.getElementById("cancelCount").innerText=data.cancelCount |
| | | $('#allList').val(data.allList); |
| | | mapOrder(data.allList) |
| | | getOrderData() |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentId").val()); |
| | | ajax.set("type",$("#orderType").val()); |
| | | ajax.start(); |
| | | } |
| | | function getDataOrder(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tHomePage/getMap", function (data) { |
| | | document.getElementById("onLineDriverCount").innerText=data.onLineDriverCount |
| | | document.getElementById("pendingOrderCount").innerText=data.pendingOrderCount |
| | | document.getElementById("serverCount").innerText=data.serverCount |
| | | document.getElementById("finishCount").innerText=data.finishCount |
| | | document.getElementById("cancelCount").innerText=data.cancelCount |
| | | $('#allList').val(data.allList); |
| | | console.log(data.allList) |
| | | mapOrder(data.allList) |
| | | getOrderData() |
| | | |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentId").val()); |
| | | ajax.set("type",$("#orderType").val()); |
| | | ajax.start(); |
| | | } |
| | | function resetOrder(){ |
| | | $("#agentId").val('') |
| | | $("#orderType").val('') |
| | | var ajax = new $ax(Feng.ctxPath + "/tHomePage/getMap", function (data) { |
| | | document.getElementById("onLineDriverCount").innerText=data.onLineDriverCount |
| | | document.getElementById("pendingOrderCount").innerText=data.pendingOrderCount |
| | | document.getElementById("serverCount").innerText=data.serverCount |
| | | document.getElementById("finishCount").innerText=data.finishCount |
| | | document.getElementById("cancelCount").innerText=data.cancelCount |
| | | $('#allList').val(data.allList); |
| | | mapOrder(data.allList) |
| | | getOrderData() |
| | | }, function (data) { |
| | | }); |
| | | ajax.set("agentId",$("#agentId").val()); |
| | | ajax.set("type",$("#orderType").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | |
| | | function map(e,addressLon,addressLat){ |
| | | window._AMapSecurityConfig = { |
| | | securityJsCode:'b62d9146929db08c4c2f4537d045320d', |
| | | }; |
| | | laydate.render({ |
| | | elem: '#createTime', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | function map(e,addressLon,addressLat){ |
| | | window._AMapSecurityConfig = { |
| | | securityJsCode:'b62d9146929db08c4c2f4537d045320d', |
| | | }; |
| | | |
| | | AMapLoader.reset() // 需要把这个reset一下 |
| | | AMapLoader.load({ |
| | | "key": "1d43098bcd98ab124623e7e4bcc9595e", // 申请好的Web端开发者Key,首次调用 load 时必填 |
| | | "version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 |
| | | "plugins": ['AMap.Driving'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 |
| | | "AMapUI": { // 是否加载 AMapUI,缺省不加载 |
| | | "version": '1.1', // AMapUI 版本 |
| | | "plugins":['overlay/SimpleMarker'], // 需要加载的 AMapUI ui插件 |
| | | }, |
| | | "Loca":{ // 是否加载 Loca, 缺省不加载 |
| | | "version": '2.0' // Loca 版本 |
| | | }, |
| | | }).then((AMap)=>{ |
| | | //初始化地图对象,加载地图 |
| | | var map = new AMap.Map('container', { |
| | | viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D', |
| | | zoom:10, //初始化地图层级 |
| | | center: [addressLon,addressLat] //初始化地图中心点 |
| | | }); |
| | | // map.clearMap(); // 清除地图覆盖物 |
| | | // 经纬度坐标数组 |
| | | const onLineDriver = $('#onLineDriver').val(); |
| | | var list1 = JSON.stringify(onLineDriver) |
| | | const jsonArr = JSON.parse(list1) |
| | | const jsonArr1 = JSON.parse(jsonArr); |
| | | console.log(jsonArr1) |
| | | M = jsonArr1; |
| | | M.forEach(function(marker) { |
| | | new AMap.Marker({ |
| | | map: map, |
| | | icon: marker[2]==1?'https://csxdj.obs.cn-south-1.myhuaweicloud.com/c1d2f38187de40daa353fcc70993288e.png':'https://csxdj.obs.cn-south-1.myhuaweicloud.com/c1d2f38187de40daa353fcc70993288e.png', |
| | | position: [marker[0], marker[1]], |
| | | offset: new AMap.Pixel(-13, -30) |
| | | }); |
| | | }); |
| | | AMapLoader.reset() // 需要把这个reset一下 |
| | | AMapLoader.load({ |
| | | "key": "1d43098bcd98ab124623e7e4bcc9595e", // 申请好的Web端开发者Key,首次调用 load 时必填 |
| | | "version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 |
| | | "plugins": ['AMap.Driving'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 |
| | | "AMapUI": { // 是否加载 AMapUI,缺省不加载 |
| | | "version": '1.1', // AMapUI 版本 |
| | | "plugins":['overlay/SimpleMarker'], // 需要加载的 AMapUI ui插件 |
| | | }, |
| | | "Loca":{ // 是否加载 Loca, 缺省不加载 |
| | | "version": '2.0' // Loca 版本 |
| | | }, |
| | | }).then((AMap)=>{ |
| | | //初始化地图对象,加载地图 |
| | | var map = new AMap.Map('container', { |
| | | viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D', |
| | | zoom:10, //初始化地图层级 |
| | | center: [addressLon,addressLat] //初始化地图中心点 |
| | | }); |
| | | // map.clearMap(); // 清除地图覆盖物 |
| | | // 经纬度坐标数组 |
| | | |
| | | // var center = map.getCenter(); |
| | | // var centerText = '当前中心点坐标:' + center.getLng() + ',' + center.getLat(); |
| | | // 添加事件监听, 使地图自适应显示到合适的范围 |
| | | AMap.event.addDomListener(document.getElementById('container'), 'click', function() { |
| | | var newCenter = map.setFitView(); |
| | | }); |
| | | }).catch((e)=>{ |
| | | console.error(e); //加载错误提示 |
| | | }); |
| | | } |
| | | var onLineDriver; |
| | | if(e==""){ |
| | | onLineDriver = $('#onLineDriver').val(); |
| | | console.log("onLineDriver========================") |
| | | console.log(onLineDriver) |
| | | var list1 = JSON.stringify(onLineDriver) |
| | | console.log("list1========================") |
| | | console.log(list1) |
| | | const jsonArr = JSON.parse(list1) |
| | | console.log("jsonArr========================") |
| | | console.log(jsonArr) |
| | | const jsonArr1 = JSON.parse(jsonArr); |
| | | console.log("jsonArr1========================") |
| | | console.log(jsonArr1) |
| | | M = jsonArr1; |
| | | }else{ |
| | | M=e; |
| | | } |
| | | console.log("M =========================") |
| | | console.log(M) |
| | | M.forEach(function(marker) { |
| | | console.log("========================") |
| | | console.log(marker) |
| | | new AMap.Marker({ |
| | | map: map, |
| | | icon: marker[2]==1?'https://csxdj.obs.cn-south-1.myhuaweicloud.com/c1d2f38187de40daa353fcc70993288e.png':'https://csxdj.obs.cn-south-1.myhuaweicloud.com/c1d2f38187de40daa353fcc70993288e.png', |
| | | position: [marker[0], marker[1]], |
| | | offset: new AMap.Pixel(-13, -30) |
| | | }); |
| | | }); |
| | | |
| | | function mapOrder(e){ |
| | | window._AMapSecurityConfig = { |
| | | securityJsCode:'b62d9146929db08c4c2f4537d045320d', |
| | | }; |
| | | AMapLoader.reset() // 需要把这个reset一下 |
| | | AMapLoader.load({ |
| | | "key": "1d43098bcd98ab124623e7e4bcc9595e", // 申请好的Web端开发者Key,首次调用 load 时必填 |
| | | "version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 |
| | | "plugins": ['AMap.Driving'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 |
| | | "AMapUI": { // 是否加载 AMapUI,缺省不加载 |
| | | "version": '1.1', // AMapUI 版本 |
| | | "plugins":['overlay/SimpleMarker'], // 需要加载的 AMapUI ui插件 |
| | | }, |
| | | "Loca":{ // 是否加载 Loca, 缺省不加载 |
| | | "version": '2.0' // Loca 版本 |
| | | }, |
| | | }).then((AMap)=>{ |
| | | //初始化地图对象,加载地图 |
| | | var map = new AMap.Map('containerOrder', { |
| | | viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D', |
| | | zoom:10, //初始化地图层级 |
| | | center: [102.709,25.0635] //初始化地图中心点 |
| | | }); |
| | | // map.clearMap(); // 清除地图覆盖物 |
| | | // 经纬度坐标数组 |
| | | var allList; |
| | | if(e==""){ |
| | | allList = $('#allList').val(); |
| | | var list = JSON.stringify(allList) |
| | | const jsonArray = JSON.parse(list) |
| | | const jsonArray1 = JSON.parse(jsonArray); |
| | | console.log(jsonArray1) |
| | | M = jsonArray1; |
| | | }else{ |
| | | M=e; |
| | | } |
| | | console.log(M) |
| | | M.forEach(function(marker) { |
| | | new AMap.Marker({ |
| | | map: map, |
| | | icon: marker[2]==301?'https://csxdj.obs.cn-south-1.myhuaweicloud.com/8a6bb84da305438faba9fa1552c59f64.png':((marker[2]==109||marker[2]==107||marker[2]==108)?'https://csxdj.obs.cn-south-1.myhuaweicloud.com/6132e18884e24916a507b4b55d38d07b.png': |
| | | (marker[2]==101?'https://csxdj.obs.cn-south-1.myhuaweicloud.com/7461e4a7e4004c548e91aafa538246a1.png':'https://csxdj.obs.cn-south-1.myhuaweicloud.com/d8739241fa36482b80df7cacac2cc3d1.png') |
| | | ), |
| | | position: [marker[0], marker[1]], |
| | | offset: new AMap.Pixel(-13, -30) |
| | | }); |
| | | }); |
| | | // var center = map.getCenter(); |
| | | // var centerText = '当前中心点坐标:' + center.getLng() + ',' + center.getLat(); |
| | | // 添加事件监听, 使地图自适应显示到合适的范围 |
| | | AMap.event.addDomListener(document.getElementById('containerOrder'), 'click', function() { |
| | | var newCenter = map.setFitView(); |
| | | }); |
| | | }).catch((e)=>{ |
| | | console.error(e); //加载错误提示 |
| | | }); |
| | | } |
| | | // var center = map.getCenter(); |
| | | // var centerText = '当前中心点坐标:' + center.getLng() + ',' + center.getLat(); |
| | | // 添加事件监听, 使地图自适应显示到合适的范围 |
| | | AMap.event.addDomListener(document.getElementById('container'), 'click', function() { |
| | | var newCenter = map.setFitView(); |
| | | }); |
| | | }).catch((e)=>{ |
| | | console.error(e); //加载错误提示 |
| | | }); |
| | | } |
| | | |
| | | function getOrderData(){ |
| | | $.ajax({ |
| | | url: Feng.ctxPath + '/tHomePage/getServerOrder', |
| | | type: 'POST', |
| | | data: { |
| | | agentId: $("#agentId").val() |
| | | }, |
| | | success: function (res) { |
| | | var order = res.serverList |
| | | var str = '<table><tr><h3>服务中</h3></tr><hr/><br>'; |
| | | if(order.length > 0){ |
| | | for(var i in order){ |
| | | console.log(order[i].startTime) |
| | | str += |
| | | '<tr><img src=' + order[i].avatar + ' style="height: 40px;width: 40px"></img>' + order[i].driverName +'</tr><br>' + |
| | | '<table><tr><td class="name1">驾龄</td><td class="name1">' + order[i].drivingExperience + '年'+'</td><td class="name1">代驾次数</td><td class="name1">' + order[i].valetDrivingCount + '次'+'</td></tr><br></table>' + |
| | | '<table><br><tr><td class="name1">出行时间</td><td class="name1">' + order[i].startTime + '</td></tr>' + |
| | | '<tr><td class="name1">起点</td><td class="name1">' + order[i].startAddress + '</td></tr>' + |
| | | '<tr><td class="name1">终点</td><td class="name1">' + order[i].endAddress + '</td></tr></table><br>' + |
| | | '<table><tr><td class="name1">预估费用</td><td class="name1">' + order[i].estimatedPrice + '元'+'</td><td class="name1">行驶里程</td><td class="name1">' + order[i].mileageTraveled + '公里'+'</td></tr>' + |
| | | '<tr><td class="name1">等待时间</td><td class="name1">' + order[i].waitTime + '分钟'+'</td><td class="name1">行驶时间</td><td class="name1">' + order[i].goTime + '分钟'+'</td></tr></table><hr/>'; |
| | | } |
| | | } |
| | | str += '</table>'; |
| | | $('#serverOrder').html(str); |
| | | } |
| | | }); |
| | | } |
| | | function mapOrder(e){ |
| | | window._AMapSecurityConfig = { |
| | | securityJsCode:'b62d9146929db08c4c2f4537d045320d', |
| | | }; |
| | | AMapLoader.reset() // 需要把这个reset一下 |
| | | AMapLoader.load({ |
| | | "key": "1d43098bcd98ab124623e7e4bcc9595e", // 申请好的Web端开发者Key,首次调用 load 时必填 |
| | | "version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 |
| | | "plugins": ['AMap.Driving'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 |
| | | "AMapUI": { // 是否加载 AMapUI,缺省不加载 |
| | | "version": '1.1', // AMapUI 版本 |
| | | "plugins":['overlay/SimpleMarker'], // 需要加载的 AMapUI ui插件 |
| | | }, |
| | | "Loca":{ // 是否加载 Loca, 缺省不加载 |
| | | "version": '2.0' // Loca 版本 |
| | | }, |
| | | }).then((AMap)=>{ |
| | | //初始化地图对象,加载地图 |
| | | var map = new AMap.Map('containerOrder', { |
| | | viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D', |
| | | zoom:10, //初始化地图层级 |
| | | center: [113.264434,23.129162] //初始化地图中心点 |
| | | }); |
| | | // map.clearMap(); // 清除地图覆盖物 |
| | | // 经纬度坐标数组 |
| | | var allList; |
| | | if(e==""){ |
| | | allList = $('#allList').val(); |
| | | var list = JSON.stringify(allList) |
| | | const jsonArray = JSON.parse(list) |
| | | const jsonArray1 = JSON.parse(jsonArray); |
| | | console.log(jsonArray1) |
| | | M = jsonArray1; |
| | | }else{ |
| | | M=e; |
| | | } |
| | | console.log(M) |
| | | M.forEach(function(marker) { |
| | | new AMap.Marker({ |
| | | map: map, |
| | | icon: marker[2]==301?'https://csxdj.obs.cn-south-1.myhuaweicloud.com/8a6bb84da305438faba9fa1552c59f64.png':((marker[2]==109||marker[2]==107||marker[2]==108)?'https://csxdj.obs.cn-south-1.myhuaweicloud.com/6132e18884e24916a507b4b55d38d07b.png': |
| | | (marker[2]==101?'https://csxdj.obs.cn-south-1.myhuaweicloud.com/7461e4a7e4004c548e91aafa538246a1.png':'https://csxdj.obs.cn-south-1.myhuaweicloud.com/d8739241fa36482b80df7cacac2cc3d1.png') |
| | | ), |
| | | position: [marker[0], marker[1]], |
| | | offset: new AMap.Pixel(-13, -30) |
| | | }); |
| | | }); |
| | | // var center = map.getCenter(); |
| | | // var centerText = '当前中心点坐标:' + center.getLng() + ',' + center.getLat(); |
| | | // 添加事件监听, 使地图自适应显示到合适的范围 |
| | | AMap.event.addDomListener(document.getElementById('containerOrder'), 'click', function() { |
| | | var newCenter = map.setFitView(); |
| | | }); |
| | | }).catch((e)=>{ |
| | | console.error(e); //加载错误提示 |
| | | }); |
| | | } |
| | | |
| | | function getOrderData(){ |
| | | $.ajax({ |
| | | url: Feng.ctxPath + '/tHomePage/getServerOrder', |
| | | type: 'POST', |
| | | data: { |
| | | agentId: $("#agentId").val() |
| | | }, |
| | | success: function (res) { |
| | | var order = res.serverList |
| | | var str = '<table><tr><h3>服务中</h3></tr><hr/><br>'; |
| | | if(order.length > 0){ |
| | | for(var i in order){ |
| | | console.log(order[i].startTime) |
| | | str += |
| | | '<tr><img src=' + order[i].avatar + ' style="height: 40px;width: 40px"></img>' + order[i].driverName +'</tr><br>' + |
| | | '<table><tr><td class="name1">驾龄</td><td class="name1">' + order[i].drivingExperience + '年'+'</td><td class="name1">代驾次数</td><td class="name1">' + order[i].valetDrivingCount + '次'+'</td></tr><br></table>' + |
| | | '<table><br><tr><td class="name1">出行时间</td><td class="name1">' + order[i].startTime + '</td></tr>' + |
| | | '<tr><td class="name1">起点</td><td class="name1">' + order[i].startAddress + '</td></tr>' + |
| | | '<tr><td class="name1">终点</td><td class="name1">' + order[i].endAddress + '</td></tr></table><br>' + |
| | | '<table><tr><td class="name1">预估费用</td><td class="name1">' + order[i].estimatedPrice + '元'+'</td><td class="name1">行驶里程</td><td class="name1">' + order[i].mileageTraveled + '公里'+'</td></tr>' + |
| | | '<tr><td class="name1">等待时间</td><td class="name1">' + order[i].waitTime + '分钟'+'</td><td class="name1">行驶时间</td><td class="name1">' + order[i].goTime + '分钟'+'</td></tr></table><hr/>'; |
| | | } |
| | | } |
| | | str += '</table>'; |
| | | $('#serverOrder').html(str); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | | @} |