| | |
| | | <div class="col-sm-10" style="width: 1500px" > |
| | | </br> |
| | | </br> |
| | | <span>本年退费额度:</span> |
| | | <span>本月退费额度:</span> |
| | | <span>本周退费额度:</span> |
| | | <span>本日退费额度:</span> |
| | | <span id="yearRefund">本年退费额度:<span id="back1"></span></span> |
| | | <span id="monthRefund">本月退费额度:<span id="back2"></span></span> |
| | | <span id="weekRefund">本周退费额度:<span id="back3"></span></span> |
| | | <span id="todayRefund">本日退费额度:<span id="back4"></span></span> |
| | | </br> |
| | | </br> |
| | | <div id="refund" style="width: 1280px;height:500px;"></div> |
| | |
| | | |
| | | if(cutType==1){ |
| | | srtj() |
| | | tuifei() |
| | | } |
| | | |
| | | if(cutType==2){ |
| | |
| | | ajax.start(); |
| | | |
| | | } |
| | | function tuifei() { |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | let id = $("#cCode").val() |
| | | console.log(id) |
| | | if(id==''){ |
| | | Feng.info("请先选择门店"); |
| | | return; |
| | | } |
| | | var ajax3 = new $ax(Feng.ctxPath + "/data/backStore", function(data){ |
| | | $("#back1").text(data.thisYear); |
| | | $("#back2").text(data.thisMonth); |
| | | $("#back3").text(data.thisWeek); |
| | | $("#back4").text(data.thisDay); |
| | | option1 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度退费', '月度退费','周度退费','日度退费'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度会员数: true, |
| | | 月度会员数: false, |
| | | 周度会员数: false, |
| | | 日度会员数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.yearData |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.monthData |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.weekData |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.dayData |
| | | } |
| | | ] |
| | | |
| | | }; |
| | | }); |
| | | ajax3.set("id",id) |
| | | ajax3.start(); |
| | | |
| | | myChart1.on('legendselectchanged', obj => { |
| | | var options = myChart1.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | | if (obj.name == '年度退费') { |
| | | options.xAxis[0].data = yearX |
| | | } else if (obj.name == '月度退费') { |
| | | options.xAxis[0].data = monthX |
| | | } else if (obj.name == '周度退费') { |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | } else if (obj.name == '日度退费') { |
| | | options.xAxis[0].data = dataX |
| | | } |
| | | myChart1.setOption(options, true) |
| | | }) |
| | | myChart1.setOption(option1); |
| | | } |
| | | |
| | | |
| | | laydate.render({ |
| | |
| | | getContent2(1); |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('income')); |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | var myChart2 = echarts.init(document.getElementById('user')); |
| | | var myChart3 = echarts.init(document.getElementById('vip')); |
| | | var myChart4 = echarts.init(document.getElementById('activity')); |
| | | var myChart5 = echarts.init(document.getElementById('prepare')); |
| | | var myChart6 = echarts.init(document.getElementById('teach')); |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | tuifei() |
| | | option = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | |
| | | }, |
| | | { |
| | | name: '日度营收', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | | } |
| | | ] |
| | | }; |
| | | option1 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度退费', '月度退费', '周度退费', '日度退费'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 132, 101, 134, 90, 230, 160, 190, 410, 330, 210, 330] |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [220, 182, 191, 234, 290, 330, 310, 190, 210, 330, 410, 160] |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [150, 232, 201, 154, 190, 330, 410, 160, 210, 195, 210, 188] |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | |
| | | }; |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | myChart.setOption(option); |
| | | myChart1.setOption(option1); |
| | | myChart2.setOption(option2); |
| | | myChart3.setOption(option3); |
| | | myChart4.setOption(option4); |
| | |
| | | |
| | | if(type==1){ |
| | | srtj() |
| | | tuifei() |
| | | } |
| | | |
| | | if(type==2){ |
| | |
| | | $("#nextB").hide(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | </script> |
| | | <script> |
| | | var ans = []; |
| | | var weekX = ["1周","2周","3周","4周"]; |
| | | var monthX = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]; |
| | | var yearX = []; |
| | | var timeX = []; |
| | | var dataX = []; |
| | | // 创建一个日期对象 |
| | | var currentDate = new Date(); |
| | | // 获取当前日期的号数 |
| | | let currentDay = currentDate.getDate(); |
| | | // 循环添加号数到数组 |
| | | for (let i = 0; i < 7; i++) { |
| | | dataX.push(currentDay - 6+i); |
| | | } |
| | | // 获取当前月份 |
| | | var currentMonth = currentDate.getMonth(); |
| | | // 获取当前年份 |
| | | var currentYear = currentDate.getFullYear(); |
| | | // 计算指定年份和月份的天数 |
| | | function getDaysInMonth(year, month) { |
| | | // month 参数范围是 0-11,所以需要加 1 |
| | | return new Date(year, month + 1, 0).getDate(); |
| | | } |
| | | // 获取当前月份的天数 |
| | | var daysInMonth = getDaysInMonth(currentYear, currentMonth); |
| | | // 将天数按字符串格式添加到 timeX 数组中 |
| | | for (var i = 1; i <= daysInMonth; i++) { |
| | | timeX.push(String(i)); |
| | | } |
| | | $(function(){ |
| | | var chartDom = document.getElementById('cookieTicket'); |
| | | var myChart = echarts.init(chartDom); |