Exemplo n.º 1
0
def approval_index():
    """审批单列表
    
    不再编写模板,请参考 Person 相关的模板
    有必要掌握 Bootstrap3
    """
    
    rank = request.args.get('rank', 'id')
    search = request.args.get('search', '')
    order = request.args.get('order', 'asc')
    
    page, per_page, offset = get_page_items()
    approvals = Approval.find(search=search, order=order, rank=rank)
    pagination = get_pagination(page=page, total=approvals.count())

    return render_template('/approval/index.html',
                           approvals=approvals.offset(offset).limit(per_page),
                           pagination=pagination,
                           search=search, order=order)
Exemplo n.º 2
0
    """审批单列表
    
    不再编写模板,请参考 Person 相关的模板
    有必要掌握 Bootstrap3
    """
    
    rank = request.args.get('rank', 'id')
    search = request.args.get('search', '')
    order = request.args.get('order', 'asc')
<<<<<<< HEAD
    
=======

>>>>>>> 797deb1d9a238a9098207cfc01bab6963414987f
    page, per_page, offset = get_page_items()
    approvals = Approval.find(search=search, order=order, rank=rank)
    pagination = get_pagination(page=page, total=approvals.count())

    return render_template('/approval/index.html',
                           approvals=approvals.offset(offset).limit(per_page),
                           pagination=pagination,
                           search=search, order=order)

@approval.route('/<int:id>')
def approval_info(id):
    """显示单个审批单信息
    """
    approval = Approval.query.get(id)
    aget = Person.query.get(approval.agent_id)
    payee = Person.query.get(approval.payee_id)
    info_list = [aget.name, payee.name]