Esempio n. 1
0
def user_list_view(request):
    """
    用户一览View
    """
    if check_role(request, ROLE_STAFF):
        raise PermissionDeniedError
    # 排除自己,为了避免删除自己的帐号
    queryset = User.objects.filter(is_superuser=False).exclude(
        is_active=False).exclude(id=request.user.id)
    params = get_list_params(request)

    order_dict = {
        u"un": "username",
        u"fn": "full_name",
        u"cd": "create_datetime",
        u"gr": "groups",
    }

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(
            Q(username__contains=params['query'])
            | Q(full_name__contains=params['query'])
            | Q(groups__name__contains=params['query']))

    # 如果是经理,权限等同管理员,显示全部
    if check_role(request, ROLE_MANAGER):
        queryset = queryset
    # 如果是人事,只显示员工
    elif check_role(request, ROLE_HR):
        queryset = queryset.filter(groups__name=ROLES[ROLE_STAFF])

    # 排序
    if not params['order_field'] or not order_dict.has_key(
            params['order_field']):
        params['order_field'] = 'un'
        params['order_direction'] = ''

    queryset = queryset.order_by(
        "%s%s" %
        (params['order_direction'], order_dict[params['order_field']]))
    total_count = queryset.count()

    return render(
        request, "account/list.html", {
            "users": queryset[params['from']:params['to']],
            "query_params": params,
            "need_pagination": params['limit'] < total_count,
            "total_count": total_count,
        })
Esempio n. 2
0
def lend_list_view(request):
    """
    收入明细一览表
    :param request:
    :return:
    """
    # 获取收入信息的queryset
    queryset = Lend.objects.filter().exclude(delete_flg=True)

    # 获取收入信息实例
    lends = queryset

    # 排序
    params = get_list_params(request)

    order_dict = {
        u"op": "handler",
        u"jr": "lend_person",
        u"jc": "borrow_person",
        u"jj": "lend_amount",
        u"ky": "balance",
        u"jq": "lend_datetime",
        u"hq": "pay_datetime",
        u"mk": "remarks",
    }

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(lend_amount__contains=params['query'])

    # 排序
    if not params['order_field'] or not order_dict.has_key(
            params['order_field']):
        params['order_field'] = 'jj'
        params['order_direction'] = ''

    queryset = queryset.order_by(
        "%s%s" %
        (params['order_direction'], order_dict[params['order_field']]))
    total_count = queryset.count()

    return render(
        request, "income/lend_list.html", {
            'lends': queryset[params['from']:params['to']],
            'query_params': params,
            'need_pagination': params['limit'] < total_count,
            'total_count': total_count,
            'lend': lends,
        })
Esempio n. 3
0
def month_list_view(request):
    """
    收入明细一览表
    :param request:
    :return:
    """
    # 获取收入信息的queryset
    queryset = Monthly.objects.filter().exclude(delete_flg=True)

    # 获取收入信息实例
    months = queryset

    # 排序
    params = get_list_params(request)

    order_dict = {
        u"op": "handler",
        u"jr": "work_income",
        u"jc": "investment_income",
        u"jj": "life_spend",
        u"ky": "other_spend",
        u"jq": "start_date",
        u"hq": "end_date",
        u"mk": "remarks",
    }

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(work_income__contains=params['query'])

    # 排序
    if not params['order_field'] or not order_dict. has_key(params['order_field']):
        params['order_field'] = 'jj'
        params['order_direction'] = ''

    queryset = queryset.order_by("%s%s" % (params['order_direction'], order_dict[params['order_field']]))
    total_count = queryset.count()

    return render(request, "plan/monthly_list.html", {
        'months': queryset[params['from']: params['to']],
        'query_params': params,
        'need_pagination': params['limit'] < total_count,
        'total_count': total_count,
        'month': months,

    })
def user_list_view(request):
    """
    用户一览View
    """
    if check_role(request, ROLE_STAFF):
        raise PermissionDeniedError
    # 排除自己,为了避免删除自己的帐号
    queryset = User.objects.filter(is_superuser=False).exclude(is_active=False).exclude(id=request.user.id)
    params = get_list_params(request)

    order_dict = {
        u"un": "username",
        u"fn": "full_name",
        u"cd": "create_datetime",
        u"gr": "groups",
    }

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(
            Q(username__contains=params['query']) |
            Q(full_name__contains=params['query']) |
            Q(groups__name__contains=params['query'])
        )

    # 如果是经理,权限等同管理员,显示全部
    if check_role(request, ROLE_MANAGER):
        queryset = queryset
    # 如果是人事,只显示员工
    elif check_role(request, ROLE_HR):
        queryset = queryset.filter(groups__name=ROLES[ROLE_STAFF])

    # 排序
    if not params['order_field'] or not order_dict.has_key(params['order_field']):
        params['order_field'] = 'un'
        params['order_direction'] = ''

    queryset = queryset.order_by("%s%s" % (params['order_direction'], order_dict[params['order_field']]))
    total_count = queryset.count()

    return render(request, "account/list.html", {
        "users": queryset[params['from']:params['to']],
        "query_params": params,
        "need_pagination": params['limit'] < total_count,
        "total_count": total_count,
    })
Esempio n. 5
0
def user_list_view(request):
    """
    用户一览View
    """
    queryset = User.objects.filter(is_superuser=False).exclude(is_active=False)
    params = get_list_params(request)

    order_dict = {
        u"un": "username",
        u"fn": "full_name",
        u"cd": "create_datetime",
        u"gr": "groups",
        u"mb": "mobile",
        u"em": "email",
    }

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(Q(username__contains=params['query']))

    # 如果是超级管理员,那么显示所有的用户信息
    if check_role(request, ROLE_SYSADMIN):
        queryset = queryset

    # 如果是家庭管理员,那么只显示家庭普通成员的信息
    elif check_role(request, ROLE_FAMILY_SUPER_USER):
        queryset = queryset.filter(groups__name=ROLES[ROLE_FAMILY_COMMON_USER])

    # 排序
    if not params['order_field'] or not order_dict.has_key(
            params['order_field']):
        params['order_field'] = 'un'
        params['order_direction'] = ''

    queryset = queryset.order_by(
        "%s%s" %
        (params['order_direction'], order_dict[params['order_field']]))
    total_count = queryset.count()

    return render(
        request, "user_account/list.html", {
            "users": queryset[params['from']:params['to']],
            "query_params": params,
            "need_pagination": params['limit'] < total_count,
            "total_count": total_count,
        })
Esempio n. 6
0
def income_list_view(request):
    """
    收入明细一览表
    :param request:
    :return:
    """
    # 获取收入信息的queryset
    queryset = Income.objects.filter().exclude(delete_flg=True)

    # 获取收入信息实例
    incomes = queryset

    # 排序
    params = get_list_params(request)

    order_dict = {
        u"ty": "income_type",
        u"am": "income_amount",
        u"tm": "create_datetime",
        u"hl": "handler",
        u"mk": "remarks",
    }

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(income_type__contains=params['query'])

    # 排序
    if not params['order_field'] or not order_dict.has_key(
            params['order_field']):
        params['order_field'] = 'am'
        params['order_direction'] = ''

    queryset = queryset.order_by(
        "%s%s" %
        (params['order_direction'], order_dict[params['order_field']]))
    total_count = queryset.count()

    return render(
        request, "income/income_detail.html", {
            'incomes': queryset[params['from']:params['to']],
            'query_params': params,
            'need_pagination': params['limit'] < total_count,
            'total_count': total_count,
            'income': incomes,
        })
Esempio n. 7
0
def check_in_all_list_view(request):
    """
    所有人考勤记录view
    """
    if check_role(request, ROLE_STAFF):
        raise PermissionDeniedError

    params = get_list_params(request)

    # queryset = CheckIn.objects.filter().order_by('-date', 'groups', 'full_name')
    queryset = CheckIn.objects.order_by('-date')

    order_dict = {
        u"da": "date",
    }

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(
            Q(personal_check_in__belong_to__full_name__contains=params['query']) |
            Q(personal_check_in__belong_to__groups__name__contains=params['query'])
        )

    # 如果是经理,权限等同管理员,显示全部
    if check_role(request, ROLE_MANAGER):
        queryset = queryset
    # 如果是人事,只显示员工
    elif check_role(request, ROLE_HR):
        queryset = queryset.filter(personal_check_in__belong_to__groups__name=ROLES[ROLE_STAFF])

    # 排序
    if not params['order_field'] or not order_dict.has_key(params['order_field']):
        params['order_field'] = 'da'
        params['order_direction'] = '-'

    queryset = queryset.order_by("%s%s" % (params['order_direction'], order_dict[params['order_field']]))
    total_count = queryset.count()

    return render(request, "comprehensive/check_in_all_view.html", {
        "check_in": queryset[params['from']:params['to']],
        "query_params": params,
        "need_pagination": params['limit'] < total_count,
        "total_count": total_count,
    })
Esempio n. 8
0
def expend_list_view(request):

    # 获取收入信息的queryset
    queryset = Expend.objects.filter().exclude(delete_flg=True)

    # 获取收入信息实例
    expends = queryset

    # 排序
    params = get_list_params(request)

    order_dict = {
        u"type": "expend_type",
        u"acc": "expend_account",
        u"amo": "expend_amount",
        u"bal": "balance",
        u"dat": "create_datetime",
        u"hl": "handler",
        u"mk": "remarks",
    }

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(expend_amount__contains=params['query'])

    # 排序
    if not params['order_field'] or not order_dict.has_key(
            params['order_field']):
        params['order_field'] = 'amo'
        params['order_direction'] = ''

    queryset = queryset.order_by(
        "%s%s" %
        (params['order_direction'], order_dict[params['order_field']]))
    total_count = queryset.count()

    return render(
        request, "income/expend_list.html", {
            'expends': queryset[params['from']:params['to']],
            'query_params': params,
            'need_pagination': params['limit'] < total_count,
            'total_count': total_count,
            'expend': expends,
        })
Esempio n. 9
0
def information_contacts_view(request):
    """
    通讯录
    """
    queryset = User.objects.select_related('personal').filter(is_superuser=False).\
        exclude(is_active=False).exclude(personal__status=2).order_by('groups', 'full_name')
    params = get_list_params(request)

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(
            Q(full_name__contains=params['query'])
            | Q(groups__name__contains=params['query']))

    total_count = queryset.count()

    return render(request, "information/contacts.html", {
        "users": queryset,
        "query_params": params,
        "total_count": total_count,
    })
Esempio n. 10
0
def check_in_personal_list_view(request, user_id):
    """
    个人考勤list view
    """
    if not check_permission_allowed(request, user_id):
        raise PermissionDeniedError

    params = get_list_params(request)

    user = get_object_or_404(User, id=user_id)

    queryset = CheckIn.objects.filter(personal_id=user.personal_id).order_by('-date')
    total_count = queryset.count()

    return render(request, "comprehensive/check_in_personal_list.html", {
        "check_in": queryset[params['from']:params['to']],
        "query_params": params,
        "need_pagination": params['limit'] < total_count,
        "total_count": total_count,
        "user": user,
    })
Esempio n. 11
0
def department_list_view(request):
    """
    部门一览View
    """
    if check_role(request, ROLE_STAFF):
        raise PermissionDeniedError

    queryset = Department.objects.filter(delete_flg=False).order_by('name')
    params = get_list_params(request)

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(name__contains=params['query'])

    total_count = queryset.count()

    return render(request, "comprehensive/department_list.html", {
        "departments": queryset,
        "query_params": params,
        "total_count": total_count,
    })
Esempio n. 12
0
def information_contacts_view(request):
    """
    通讯录
    """
    queryset = User.objects.select_related('personal').filter(is_superuser=False).\
        exclude(is_active=False).exclude(personal__status=2).order_by('groups', 'full_name')
    params = get_list_params(request)

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(
            Q(full_name__contains=params['query']) |
            Q(groups__name__contains=params['query'])
        )

    total_count = queryset.count()

    return render(request, "information/contacts.html", {
        "users": queryset,
        "query_params": params,
        "total_count": total_count,
    })
Esempio n. 13
0
def notice_list_view(request):
    """
    公告一览view
    """
    if check_role(request, ROLE_STAFF):
        raise PermissionDeniedError

    queryset = Notice.objects.filter().exclude(delete_flg=True)
    params = get_list_params(request)

    order_dict = {
        u"sd": "start_date",
        u"ed": "end_date",
    }

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(
            Q(content__contains=params['query'])
            | Q(title__contains=params['query']))

    # 排序
    if not params['order_field'] or not order_dict.has_key(
            params['order_field']):
        params['order_field'] = 'sd'
        params['order_direction'] = ''

    queryset = queryset.order_by(
        "%s%s" %
        (params['order_direction'], order_dict[params['order_field']]))
    total_count = queryset.count()

    return render(
        request, "notice/list.html", {
            "notices": queryset[params['from']:params['to']],
            "query_params": params,
            "need_pagination": params['limit'] < total_count,
            "total_count": total_count,
        })
Esempio n. 14
0
def notice_list_view(request):
    """
    公告一览view
    """
    if check_role(request, ROLE_STAFF):
        raise PermissionDeniedError

    queryset = Notice.objects.filter().exclude(delete_flg=True)
    params = get_list_params(request)

    order_dict = {
        u"sd": "start_date",
        u"ed": "end_date",
    }

    # 搜索条件
    if params['query']:
        queryset = queryset.filter(
            Q(content__contains=params['query']) |
            Q(title__contains=params['query'])
        )

    # 排序
    if not params['order_field'] or not order_dict.has_key(params['order_field']):
        params['order_field'] = 'sd'
        params['order_direction'] = ''

    queryset = queryset.order_by("%s%s" % (params['order_direction'], order_dict[params['order_field']]))
    total_count = queryset.count()

    return render(request, "notice/list.html", {
        "notices": queryset[params['from']:params['to']],
        "query_params": params,
        "need_pagination": params['limit'] < total_count,
        "total_count": total_count,
    })
Esempio n. 15
0
def department_set_view(request):
    """
    部门配置view
    """
    if check_role(request, ROLE_STAFF):
        raise PermissionDeniedError

    user = User.objects.select_related('personal').filter(is_superuser=False).\
        exclude(is_active=False).order_by('groups', 'full_name')
    params = get_list_params(request)

    # 搜索条件
    if params['query']:
        user = user.filter(
            Q(full_name__contains=params['query']) |
            Q(groups__name__contains=params['query']) |
            Q(personal__department__name__contains=params['query'])
        )

    # 如果是经理,权限等同管理员,显示全部
    if check_role(request, ROLE_MANAGER):
        user = user
    # 如果是人事,只显示员工
    elif check_role(request, ROLE_HR):
        user = user.filter(groups__name=ROLES[ROLE_STAFF])

    total_count = user.count()

    department = Department.objects.filter(delete_flg=False).order_by('name')

    return render(request, "comprehensive/department_set.html", {
        "form_list": user,
        "departments": department,
        "query_params": params,
        "total_count": total_count,
    })
Esempio n. 16
0
def index_view(request):
    """
    首页View
    """
    # 用户一览queryset
    queryset = User.objects.filter(is_superuser=False).exclude(is_active=False)
    params = get_list_params(request)
    user_count = queryset.count()

    # 收入信息一览
    income_queryset = Income.objects.filter().exclude(delete_flg=True)
    income_params = get_list_params(request)
    income_count = income_queryset.count()

    # 获取收入信息的queryset
    expend_queryset = Expend.objects.filter().exclude(delete_flg=True)
    expend_params = get_list_params(request)
    expend_count = expend_queryset.count()

    # 借出queryset
    lend_queryset = Lend.objects.filter().exclude(delete_flg=True)

    # 排序
    lend_params = get_list_params(request)
    lend_count = lend_queryset.count()

    borrow_queryset = Borrow.objects.filter().exclude(delete_flg=True)
    # 排序
    borrow_params = get_list_params(request)
    borrow_count = borrow_queryset.count()

    month_queryset = Monthly.objects.filter().exclude(delete_flg=True)
    month_params = get_list_params(request)
    month_count = month_queryset.count()

    # 获取收入信息的queryset
    year_queryset = Yearly.objects.filter().exclude(delete_flg=True)
    year_params = get_list_params(request)
    year_count = year_queryset.count()

    return render(
        request,
        "index_index/demo_html.html",
        {
            # 首页一览用户信息return开始
            # return render(request, "index/index.html", {
            "users": queryset[params['from']:params['to']],
            "user_count": user_count,
            # 首页一览用户信息return结束
            # 收入信息
            'incomes':
            income_queryset[income_params['from']:income_params['to']],
            "income_count": income_count,
            # 支出信息
            'expends':
            expend_queryset[expend_params['from']:expend_params['to']],
            "expend_count": expend_count,
            # 借出
            'lends': lend_queryset[lend_params['from']:lend_params['to']],
            "lend_count": lend_count,
            # 借入
            'borrows':
            borrow_queryset[borrow_params['from']:borrow_params['to']],
            "borrow_count": borrow_count,
            # 月收入计划
            'months': month_queryset[month_params['from']:month_params['to']],
            "month_count": month_count,
            # 年收入计划
            'years': year_queryset[year_params['from']:year_params['to']],
            "year_count": year_count,
        })
Esempio n. 17
0
def get_income_collect(request):
    """
    对家庭收入信息进行选择时间段汇总
    :param request:
    :return:
    """
    # 收入信息接受对象
    income_list = []
    total_income = 0

    time_is_ok, error_message = False, None  # 初始化参数。
    # 从地址栏取得时间段,没有的不查询。
    if 'sss' in request.GET and 'eee' in request.GET:
        try:
            start_time = datetime.strptime(request.GET['sss'], "%Y-%m-%d")
            end_time = datetime.strptime(request.GET['eee'], "%Y-%m-%d")+timedelta(days=1)
            assert(start_time < end_time)
            time_is_ok = True
        except ValueError:
            error_message = u"时间参数错误,请联系管理员"
        except AssertionError:
            error_message = u"结束时间不得大于开始时间,请修改后重新结算"
    if time_is_ok:
        order_dict = {
            u"ty": "income_type",
            u"am": "income_amount",
            u"tm": "create_datetime",
            u"hl": "handler",
            u"mk": "remarks",
        }
        queryset = Income.objects.filter(
            delete_flg=False,
            create_datetime__gte=start_time,
            create_datetime__lt=end_time
        )
        for income in queryset:
            income_list.append(int(income.income_amount))
        # 获取总收入
        for amount in income_list:
            total_income += amount
        # 取得画面列表参数
        params = get_list_params(request)
        # 添加起始时段画面参数。
        params['sss'] = request.GET['sss']
        params['eee'] = request.GET['eee']

        # 排序
        if not params['order_field'] or not params['order_field'] in order_dict:
            # 默认没有设定排序状态时,按照状态排序的默认方式进行排序
            queryset = queryset.order_by("create_datetime")
            params['order_field'] = "tm"
        else:
            queryset = queryset.order_by("%s%s" % (params['order_direction'], order_dict[params['order_field']]))

        total_count = queryset.count()

        return render(request, "get_total/get_total_income.html", {
            "time_is_ok": time_is_ok,
            # "sum_dict": sum_dict,
            "time_content": u"从 %s 到 %s 的汇总:" % (start_time, end_time-timedelta(seconds=1)),
            "incomes": queryset[params['from']:params['to']],
            "query_params": params,
            "need_pagination": params['limit'] < total_count,
            "total_count": total_count,
            "sss_time_str": params['sss'],
            "eee_time_str": params['eee'],
            "total_income": total_income,
        })
    else:
        # 设置默认的检索时段。(上月初到月末)
        last_time = date.today().replace(day=1)-timedelta(days=1)
        sss_time_str = (last_time.replace(day=1)).strftime('%Y-%m-%d')
        eee_time_str = last_time.strftime('%Y-%m-%d')
        return render(request, "get_total/get_total_income.html", {
            "time_is_ok": time_is_ok,  # 无参数时提示的标志。
            "error_message": error_message,
            "total_count": 0,
            "sss_time_str": sss_time_str,
            "eee_time_str": eee_time_str,
        })
Esempio n. 18
0
def get_income_collect(request):
    """
    对家庭收入信息进行选择时间段汇总
    :param request:
    :return:
    """
    # 收入信息接受对象
    income_list = []
    total_income = 0

    time_is_ok, error_message = False, None  # 初始化参数。
    # 从地址栏取得时间段,没有的不查询。
    if 'sss' in request.GET and 'eee' in request.GET:
        try:
            start_time = datetime.strptime(request.GET['sss'], "%Y-%m-%d")
            end_time = datetime.strptime(request.GET['eee'],
                                         "%Y-%m-%d") + timedelta(days=1)
            assert (start_time < end_time)
            time_is_ok = True
        except ValueError:
            error_message = u"时间参数错误,请联系管理员"
        except AssertionError:
            error_message = u"结束时间不得大于开始时间,请修改后重新结算"
    if time_is_ok:
        order_dict = {
            u"ty": "income_type",
            u"am": "income_amount",
            u"tm": "create_datetime",
            u"hl": "handler",
            u"mk": "remarks",
        }
        queryset = Income.objects.filter(delete_flg=False,
                                         create_datetime__gte=start_time,
                                         create_datetime__lt=end_time)
        for income in queryset:
            income_list.append(int(income.income_amount))
        # 获取总收入
        for amount in income_list:
            total_income += amount
        # 取得画面列表参数
        params = get_list_params(request)
        # 添加起始时段画面参数。
        params['sss'] = request.GET['sss']
        params['eee'] = request.GET['eee']

        # 排序
        if not params['order_field'] or not params['order_field'] in order_dict:
            # 默认没有设定排序状态时,按照状态排序的默认方式进行排序
            queryset = queryset.order_by("create_datetime")
            params['order_field'] = "tm"
        else:
            queryset = queryset.order_by(
                "%s%s" %
                (params['order_direction'], order_dict[params['order_field']]))

        total_count = queryset.count()

        return render(
            request,
            "get_total/get_total_income.html",
            {
                "time_is_ok":
                time_is_ok,
                # "sum_dict": sum_dict,
                "time_content":
                u"从 %s 到 %s 的汇总:" %
                (start_time, end_time - timedelta(seconds=1)),
                "incomes":
                queryset[params['from']:params['to']],
                "query_params":
                params,
                "need_pagination":
                params['limit'] < total_count,
                "total_count":
                total_count,
                "sss_time_str":
                params['sss'],
                "eee_time_str":
                params['eee'],
                "total_income":
                total_income,
            })
    else:
        # 设置默认的检索时段。(上月初到月末)
        last_time = date.today().replace(day=1) - timedelta(days=1)
        sss_time_str = (last_time.replace(day=1)).strftime('%Y-%m-%d')
        eee_time_str = last_time.strftime('%Y-%m-%d')
        return render(
            request,
            "get_total/get_total_income.html",
            {
                "time_is_ok": time_is_ok,  # 无参数时提示的标志。
                "error_message": error_message,
                "total_count": 0,
                "sss_time_str": sss_time_str,
                "eee_time_str": eee_time_str,
            })
Esempio n. 19
0
def index_view(request):
    """
    首页View
    """
    # 用户一览queryset
    queryset = User.objects.filter(is_superuser=False).exclude(is_active=False)
    params = get_list_params(request)
    user_count = queryset.count()


    # 收入信息一览
    income_queryset = Income.objects.filter().exclude(delete_flg=True)
    income_params = get_list_params(request)
    income_count = income_queryset.count()

    # 获取收入信息的queryset
    expend_queryset = Expend.objects.filter().exclude(delete_flg=True)
    expend_params = get_list_params(request)
    expend_count = expend_queryset.count()


    # 借出queryset
    lend_queryset = Lend.objects.filter().exclude(delete_flg=True)

    # 排序
    lend_params = get_list_params(request)
    lend_count = lend_queryset.count()

    borrow_queryset = Borrow.objects.filter().exclude(delete_flg=True)
    # 排序
    borrow_params = get_list_params(request)
    borrow_count = borrow_queryset.count()

    month_queryset = Monthly.objects.filter().exclude(delete_flg=True)
    month_params = get_list_params(request)
    month_count = month_queryset.count()

    # 获取收入信息的queryset
    year_queryset = Yearly.objects.filter().exclude(delete_flg=True)
    year_params = get_list_params(request)
    year_count = year_queryset.count()

    return render(request, "index_index/demo_html.html", {
        # 首页一览用户信息return开始
    # return render(request, "index/index.html", {
        "users": queryset[params['from']:params['to']],
        "user_count": user_count,
        # 首页一览用户信息return结束
        # 收入信息
        'incomes': income_queryset[income_params['from']: income_params['to']],
        "income_count": income_count,
        # 支出信息
        'expends': expend_queryset[expend_params['from']: expend_params['to']],
        "expend_count": expend_count,
        # 借出
        'lends': lend_queryset[lend_params['from']: lend_params['to']],
        "lend_count": lend_count,
        # 借入
        'borrows': borrow_queryset[borrow_params['from']: borrow_params['to']],
        "borrow_count": borrow_count,
        # 月收入计划
        'months': month_queryset[month_params['from']: month_params['to']],
        "month_count": month_count,
        # 年收入计划
        'years': year_queryset[year_params['from']: year_params['to']],
        "year_count": year_count,
    })