<!--
	The ID "widget-grid" will start to initialize all widgets below 
	You do not need to use widgets if you dont want to. Simply remove 
	the <section></section> and you can use wells or panels instead 
	-->

<!-- widget grid -->
<section id="widget-grid" class="">

	<!-- row -->
	<div class="row">

		<!-- NEW WIDGET START -->
		<!-- WIDGET END -->
        <article class="col-xs-12 col-sm-12 col-md-3 col-lg-3">

            <!-- Widget ID (each widget will need unique ID)-->
            <div class="jarviswidget" id="wid-id-4">
                <header>
                    <span class="widget-icon"> <i class="fa fa-table"></i> </span>
                    <h2>发运快递商</h2>
                </header>
                <!-- widget div-->
                <div>
                    <!-- widget edit box -->
                    <div class="jarviswidget-editbox">
                        <!-- This area used as dropdown edit box -->
                    </div>
                    <!-- end widget edit box -->
                    <!-- widget content -->
                    <div class="widget-body no-padding">
                        <div class="table-responsive">
                            <table class="table table-condensed table-hover smart-form has-tickbox">
                                <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>快速商</th>
                                    <th width="80">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="express in expressList"
                                    ng-class="{'chose-tr':express.id == currentCustomer.id}"
                                    ng-if="expressList.length > 0" ng-mouseenter="show=true" ng-mouseleave="show=false">
                                    <td ng-bind="($index+1) +((pageSetting.pageNum -1) * pageSetting.pageSize)"></td>
                                    <td ng-bind="express.expressName"></td>
                                    <td>
                                        <div>
                                            <a href="javascript:void(0);" data-ng-click="choseExpressUser($index)">
                                                <span class="fa fa-inbox">选择</span>
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                <tr ng-if="expressList == null || expressList.length == 0">
                                    <td colspan="5">
                                        <div>暂无数据</div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="dt-toolbar-footer">
                            <div class="col-xs-12 col-sm-12">
                                <ug-pagination page-info="pageSetting" ></ug-pagination>
                            </div>
                        </div>
                    </div>
                    <!-- end widget content -->
                </div>
                <!-- end widget div -->
            </div>
            <!-- end widget -->

        </article>
        <article class="col-xs-12 col-sm-12 col-md-9 col-lg-9">

            <!-- Widget ID (each widget will need unique ID)-->
            <div class="jarviswidget" id="wid-id-4">
                <header>
                    <span class="widget-icon"> <i class="fa fa-table"></i> </span>
                    <h2>待分配列表</h2>
                </header>
                <!-- widget div-->
                <div>
                    <!-- widget edit box -->
                    <div class="jarviswidget-editbox">
                        <!-- This area used as dropdown edit box -->
                    </div>
                    <!-- end widget edit box -->
                    <!-- widget content -->
                    <div class="widget-body no-padding">
                        <div class="alert alert-info no-margin fade in">
                            <label>快递商：{{currentCustomer.expressName}}</label>
                        </div>
                        <div class="dt-toolbar">
                            <div class="col-md-2">
                                <div class="dataTables_filter">
                                    <label>
                                        <input type="search" placeholder="订单号" data-ng-keyup="getOrderList()" ng-model="queryParam.keyword" class="form-control" aria-controls="dt_basic"></label>
                                </div>
                            </div>
                            <div class="col-md-2">
                                <div class="input-group">
                                    <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" datepicker-localdate
                                           placeholder="配送起始时间"
                                           ng-model="queryParam.appointmentTimeStart"
                                           close-text="关闭"
                                           current-text="今日"
                                           clear-text="清除"
                                           is-open="datepickerSetting.appointmentTimeStart.opened"
                                           ng-required="true" />
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-default" ng-click="openDate($event, 0)"><i class="glyphicon glyphicon-calendar"></i></button>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-2">
                                <div class="input-group">
                                    <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" datepicker-localdate
                                           placeholder="配送截止时间"
                                           ng-model="queryParam.appointmentTimeEnd"
                                           close-text="关闭"
                                           current-text="今日"
                                           clear-text="清除"
                                           is-open="datepickerSetting.appointmentTimeEnd.opened"
                                           ng-required="true" />
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-default" ng-click="openDate($event, 1)"><i class="glyphicon glyphicon-calendar"></i></button>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-2">
                                <button class="btn btn-primary" type="button" data-ng-click="getOrderList()">
                                    <i class="fa fa-refresh"></i>
                                    刷新
                                </button>
                                <button class="btn btn-primary"   btn-loading="saveBtnLoading" type="button" data-ng-click="batchBindExpress()">
                                    <i class="fa fa-inbox"></i>
                                    批量发运
                                </button>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table class="table table-condensed table-hover smart-form has-tickbox">
                                <thead>
                                <tr>
                                    <th style="width : 20px;">
                                        <label class="checkbox">
                                            <input type="checkbox" ng-model="chooseAllCheck.isCheckOrder" ng-true-value="0" ng-false-value="1" ng-change="checkedAllOrder()" />
                                            <i></i>
                                        </label>
                                    </th>
                                    <th>序号</th>
                                    <th width="120">订单编号</th>
                                    <th>订单状态</th>
                                    <th>快递商</th>
                                    <th>分配状态</th>
                                    <th>客户姓名</th>
                                    <th>手机号</th>
                                    <th>地址</th>
                                    <th>配送时间</th>
                                    <th width="80">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="order in orderList"  ng-if="orderList.length > 0" ng-mouseenter="show=true" ng-mouseleave="show=false">
                                    <td style="width : 20px;">
                                        <label class="checkbox" ng-if="order.expressName == null">
                                            <input type="checkbox"
                                                   checklist-model="chooseOrder"
                                                   checklist-before-change="changeOrderList()"
                                                   checklist-value="order"
                                                    >
                                            <i></i>
                                        </label>
                                    </td>
                                    <td ng-bind="($index+1) +((pageInfoSetting.pageNum -1) * pageInfoSetting.pageSize)"></td>
                                    <td ng-bind="order.orderNo"></td>
                                    <td ng-bind="order.orderStatusDesc"></td>
                                    <td ng-bind="order.expressName"></td>
                                    <td>
                                        <div ng-if="order.expressName != null">已分配</div>
                                        <div ng-if="order.expressName == null">待分配</div>
                                    </td>
                                    <td ng-bind="order.consigneeName"></td>
                                    <td ng-bind="order.consigneePhone"></td>
                                    <td ng-bind="order.consigneeAddress"></td>
                                    <td ng-bind="order.appointmentTime | date: 'yyyy-MM-dd'"></td>
                                    <td>
                                        <div ng-show="order.expressName == null" >
                                            <a href="javascript:void(0);" data-ng-click="bindExpress($index)" title="分配">
                                                <span class="fa fa-inbox"></span>
                                            </a>
                                        </div>
                                        <div ng-show="order.expressName != null" >
                                            <a href="javascript:void(0);" data-ng-click="unbindExpress($index)" title="取消">
                                                <span class="fa fa-empire"></span>
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                <tr ng-if="orderList == null || orderList.length == 0">
                                    <td colspan="5">
                                        <div>暂无数据</div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="dt-toolbar-footer">
                            <div class="col-xs-12 col-sm-12">
                                <ug-pagination page-info="pageInfoSetting" ></ug-pagination>
                            </div>
                        </div>
                    </div>
                    <!-- end widget content -->
                </div>
                <!-- end widget div -->
            </div>
            <!-- end widget -->

        </article>
	</div>

	<!-- end row -->

</section>
<!-- end widget grid -->