<ion-view view-title="报销" hide-back-button="true">
    <ion-nav-buttons side="left">
        <button class="button ion-chevron-left button-clear button-dark" ng-click="goBack()">&nbsp;返回</button>
    </ion-nav-buttons>
    <ion-nav-buttons side="right">
        <button class="button button-clear" ng-click="toman()" ng-if="roleid==1">管理&nbsp;&nbsp;</button>
        <button class="button button-clear" ng-click="popover.show($event)">
            <i class="icon ion-android-add"></i>
        </button>
    </ion-nav-buttons>
    <ion-content>
        <ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
        <a class="item item-icon-right" ng-href="#/billlist/0">我提交的报销单
            <i class="icon ion-chevron-right icon-accessory"></i>
            <!--<span class="badge badge-assertive">1</span>-->
        </a>
        <a class="item item-icon-right" ng-href="#/billapprove/1">需要我审批的报销单
            <i class="icon ion-chevron-right icon-accessory"></i>
            <!--<span class="badge badge-assertive">1</span>-->
        </a>
        <a class="item item-icon-right" ng-href="#/billpay/3">需要我支付的报销单
            <i class="icon ion-chevron-right icon-accessory"></i>
        </a>
        <div class="item item-divider">消费记录({{recordlist.results.length}})</div>
        <ion-list>
            <div class="item item-icon-left" ng-repeat="record in recordlist.results" ng-click="torecord(record)">
                <i class="icon icon-style" style="background-color:{{record.type_modal.icon_color}}" ng-class="record.type_modal.icon"></i>{{record.description}}
                <span class="item-note assertive">￥{{record.amount}}</span>
                <p>{{record.spend_date | date:'yyyy-MM-dd'}}</p>
            </div>
        </ion-list>
        <ion-infinite-scroll spinner="android" ng-if="moreCanBeLoaded()" on-infinite="loadMore()" distance="1%" immediate-check="false"></ion-infinite-scroll>
    </ion-content>
    <script id="templates/paymenu.html" type="text/ng-template">
        <ion-popover-view ng-class="{'true':'details-popup','false':'popver_view'}[is_have_step]">
            <ion-content>
                <ion-list>
                    <ion-item class="item item-button" ng-click="torecord()">添加消费记录</ion-item>
                    <ion-item class="item item-button" ng-click="addpaybill()" ng-if="is_have_step">创建报销单</ion-item>
                    <ion-item class="item item-button" ng-click="toauditstep()">{{is_have_step?"修改审批人":"添加审批步骤"}}</ion-item>
                </ion-list>
            </ion-content>
        </ion-popover-view>
    </script>
</ion-view>