liujie
2023-10-10 8d136a0f92dcd31d77e18c30f9b1865db83b0f85
cloud-server-management/src/main/webapp/WEB-INF/view/system/dataStatistics/storeIncome.html
@@ -279,6 +279,8 @@
        if(cutType==2){
            yytj()
            ptUser()
            ptActivity()
        }
        if(cutType==3){
            jxtj()
@@ -761,12 +763,329 @@
    }
    function ptUser() {
        var myChart2 = echarts.init(document.getElementById('user'));
        var myChart3 = echarts.init(document.getElementById('vip'));
        myChart2.on('legendselectchanged', obj => {
            var options = myChart2.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
            }
            myChart2.setOption(options, true)
        });
        let id  = $("#cCode").val()
        console.log(id)
        if(id==''){
            Feng.info("请先选择门店");
            return;
        }
        myChart3.on('legendselectchanged', obj => {
            var options = myChart3.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
            }
            myChart3.setOption(options, true)
        });
        var ajax2 = new $ax(Feng.ctxPath + "/data/userAndVipStore", function(data){
            $("#userAll").text(data.allUser)
            $("#userVipAll").text(data.allVip)
            console.log(data)
            option2  = {
                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.count,data.count1,data.count2,data.count3]
                    },
                    {
                        name: '日度用户数',
                        type: 'line',
                        stack: 'Total',
                        data: data.dayData
                    }
                ]
            };
            option3  = {
                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.yearsVip
                    },
                    {
                        name: '月度会员数',
                        type: 'line',
                        stack: 'Total',
                        data:  data.monthsVip
                    },
                    {
                        name: '周度会员数',
                        type: 'line',
                        stack: 'Total',
                        data:[data.countVip,data.countVip1,data.countVip2,data.countVip3]
                    },
                    {
                        name: '日度会员数',
                        type: 'line',
                        stack: 'Total',
                        data: data.daysVip
                    }
                ]
            };
        });
        ajax2.set("id",id)
        ajax2.start()
        myChart2.setOption(option2);
        myChart3.setOption(option3);
    }
    function ptActivity() {
        var myChart4 = echarts.init(document.getElementById('activity'));
        var myChart5 = echarts.init(document.getElementById('prepare'));
        myChart4.on('legendselectchanged', obj => {
            var options = myChart4.getOption()
            //这里是选择切换什么样的x轴,那么他会进行对Y值的切换
            if (obj.name == '年度次数') {
                options.xAxis[0].data = yearX
            } else if (obj.name == '月度次数') {
                options.xAxis[0].data = monthX
            }
            myChart4.setOption(options, true)
        });
        myChart5.on('legendselectchanged', obj => {
            var options = myChart5.getOption()
            //这里是选择切换什么样的x轴,那么他会进行对Y值的切换
            if (obj.name == '年度次数') {
                options.xAxis[0].data = yearX
            } else if (obj.name == '月度次数') {
                options.xAxis[0].data = monthX
            }
            myChart5.setOption(options, true)
        });
        let id  = $("#cCode").val()
        console.log(id)
        if(id==''){
            Feng.info("请先选择门店");
            return;
        }
        var ajax2 = new $ax(Feng.ctxPath + "/data/actStore", function(data){
            $("#allHour").text(data.allHour)
            option4 = {
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['年度次数', '月度次数'],
                    icon: 'stack',
                    selectedMode: 'single', // 单选
                    selected: {
                        年度次数: true,
                        月度次数: 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
                    }
                ]
            };
            option5 = {
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['年度次数', '月度次数'],
                    icon: 'stack',
                    selectedMode: 'single', // 单选
                    selected: {
                        年度次数: true,
                        月度次数: 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.yearsUser
                    },
                    {
                        name: '月度次数',
                        type: 'line',
                        stack: 'Total',
                        data: data.monthsUser
                    }
                ]
            };
        });
        ajax2.set("id",id)
        ajax2.start()
        myChart4.setOption(option4);
        myChart5.setOption(option5);
    }
    laydate.render({
        elem: '#beginTime'
        , trigger: 'click'
        , range: true
    });
    $(function(){
        var ajax2 = new $ax(Feng.ctxPath + "/data/getYears", function(data){
            yearX=data
        });
        ajax2.start()
        getContent(1);
        getContent1(1);
        getContent2(1);
@@ -1165,6 +1484,8 @@
        if(type==2){
            yytj()
            ptUser()
            ptActivity()
        }
        if(type==3){