<!--
	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">
        <article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <!-- 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">
            <fieldset class="demo-switcher-1">
                <legend>工作区</legend>
                <div class="form-group">
                    <div class="col-md-12">
                        <div class="input-group input-group-md">
                            <input type="text"  ng-model="boxNo" ng-keyup="saoOrderNoEvent($event);"  placeholder="扫描面单上的条形码"  name="boxNo" class="form-control" id="boxNo">
                        </div>
                    </div>
                </div>
            </fieldset>
                        </div>
                    </div>
                </div>
        </article>

        <article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <!-- 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="dt-toolbar">
                            <div class="row">
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <input type="text" id="startTimeId" class="form-control" datepicker-popup="yyyy-MM-dd" datepicker-localdate
                                               placeholder="配送起始日期"
                                               ng-model="queryTakeDeliveryParam.takeDeliveryStartTime"
                                               close-text="关闭"
                                               current-text="今日"
                                               clear-text="清除"
                                               is-open="datepickerSetting.takeDeliveryStartTime.opened"
                                               ng-required="true" />
                                        <div class="input-group-btn">
                                            <button type="button" class="btn btn-default" ng-click="openDatepicker($event, 3)"><i class="glyphicon glyphicon-calendar"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <input type="text" id="endTimeId" class="form-control" datepicker-popup="yyyy-MM-dd" datepicker-localdate
                                               placeholder="配送截止日期"
                                               ng-model="queryTakeDeliveryParam.takeDeliveryEndTime"
                                               close-text="关闭"
                                               current-text="今日"
                                               clear-text="清除"
                                               is-open="datepickerSetting.takeDeliveryEndTime.opened"
                                               ng-required="true" />
                                        <div class="input-group-btn">
                                            <button type="button" class="btn btn-default" ng-click="openDatepicker($event, 4)"><i class="glyphicon glyphicon-calendar"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row margin-top-10">
                                <div class="col-sm-12">
                                    <div class="input-group">
                                        <div class="input-group-btn">
                                            <button class="btn btn-primary margin-right-5" type="button" data-ng-click="getOrderTakeDeliveryList()">
                                                <i class="fa fa-refresh"></i>
                                                刷新
                                            </button>
                                            <button class="btn btn-primary" type="button" ng-click="exportExcel(2)">
                                                <i class="fa fa-download"></i>
                                                导出已分配未提货订单
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="table-responsive margin-top-10">
                            <table class="table table-condensed table-hover smart-form has-tickbox">
                                <thead>
                                <tr>

                                    <th>序号</th>
                                    <th width="120">订单编号</th>
                                    <th>订单状态</th>
                                    <th>快递商</th>
                                    <th>分配状态</th>
                                    <th>客户姓名</th>
                                    <th>手机号</th>
                                    <th>地址</th>
                                    <th>配送时间</th>
                                    <th>总箱数/已扫描箱数</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="order in orderTakeDeliveryList"  ng-if="orderTakeDeliveryList.length > 0" ng-mouseenter="show=true" ng-mouseleave="show=false">
                                    <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>已分配</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>{{order.totalBoxNum}}/{{order.expressScanBoxNum}}</td>
                                </tr>
                                <tr ng-if="orderTakeDeliveryList == null || orderTakeDeliveryList.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="pageInfoTakeDeliverySetting" ></ug-pagination>
                            </div>
                        </div>
                    </div>
                    <!-- end widget content -->
                </div>
                <!-- end widget div -->
            </div>
            <!-- end widget -->

        </article>

		<!-- NEW WIDGET START -->
		<!-- WIDGET END -->
        <article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <!-- 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="dt-toolbar">
                            <div class="row">
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <input type="text" id="startTimeId" class="form-control" datepicker-popup="yyyy-MM-dd" datepicker-localdate
                                               placeholder="配送起始日期"
                                               ng-model="queryParam.startTime"
                                               close-text="关闭"
                                               current-text="今日"
                                               clear-text="清除"
                                               is-open="datepickerSetting.startTime.opened"
                                               ng-required="true" />
                                        <div class="input-group-btn">
                                            <button type="button" class="btn btn-default" ng-click="openDatepicker($event, 1)"><i class="glyphicon glyphicon-calendar"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <input type="text" id="endTimeId" class="form-control" datepicker-popup="yyyy-MM-dd" datepicker-localdate
                                               placeholder="配送截止日期"
                                               ng-model="queryParam.endTime"
                                               close-text="关闭"
                                               current-text="今日"
                                               clear-text="清除"
                                               is-open="datepickerSetting.endTime.opened"
                                               ng-required="true" />
                                        <div class="input-group-btn">
                                            <button type="button" class="btn btn-default" ng-click="openDatepicker($event, 2)"><i class="glyphicon glyphicon-calendar"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row margin-top-10">
                                <div class="col-sm-12">
                                    <div class="input-group">
                                        <div class="input-group-btn">
                                            <button class="btn btn-primary margin-right-5" type="button" data-ng-click="getOrderList()">
                                                <i class="fa fa-refresh"></i>
                                                刷新
                                            </button>
                                            <button class="btn btn-primary margin-right-5" type="button" ng-click="exportExcel(1)">
                                                <i class="fa  fa-download"></i>
                                                导出已提货订单
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="table-responsive margin-top-10">
                            <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>
                                            <a href="javascript:void(0);" data-ng-click="unTakeDelivery(order.orderNo)" 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 -->