<!--
	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 -->
		<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">
				<!-- widget options:
                usage: <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">

                data-widget-colorbutton="false"
                data-widget-editbutton="false"
                data-widget-togglebutton="false"
                data-widget-deletebutton="false"
                data-widget-fullscreenbutton="false"
                data-widget-custombutton="false"
                data-widget-collapsed="true"
                data-widget-sortable="false"

                -->
				<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="col-sm-4">
								<div class="dataTables_filter">
									<label>
										<span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
										<input type="search" placeholder="采购编号" data-ng-keyup="getPackageTaskList()" ng-model="queryParam.keyword" class="form-control" aria-controls="dt_basic"></label>
								</div>
							</div>
							<div class="col-sm-2">
								<button class="btn btn-primary" type="button" data-ng-click="getPackageTaskList()">
									<i class="fa fa-refresh"></i>
									刷新
								</button>
								<!--<button class="btn btn-primary" type="button" ui-sref="packageTask_create">-->
									<!--<i class="fa fa-plus"></i>-->
									<!--生成采购计划-->
								<!--</button>-->
							</div>
						</div>
						<div class="table-responsive">
							<table class="table table-striped table-condensed table-hover smart-form has-tickbox">
								<thead>
								<tr>
									<th></th>
									<th width="80">采购单号</th>
									<th>产品名称</th>
									<th>包装份数</th>
									<th>已包装份数</th>
                                    <th>未包装份数</th>
                                    <th>任务创建时间</th>
                                    <th>任务开始时间</th>
                                    <th>任务完成时间</th>
                                    <th>任务执行人</th>
                                    <th>任务状态</th>
                                    <th>操作</th>
								</tr>
								</thead>
								<tbody>
								<tr ng-repeat="packageTask in packageTaskList"  ng-if="packageTaskList.length > 0" ng-mouseenter="show=true" ng-mouseleave="show=false">
									<td></td>
									<td ng-bind="packageTask.purchaseCode"></td>
									<td ng-bind="packageTask.itemName"></td>
									<td ng-bind="packageTask.countValue"></td>
									<td ng-bind="packageTask.finishValue"></td>
									<td ng-bind="packageTask.noFinishValue"></td>
                                    <td>{{packageTask.jobCreateTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
                                    <td>{{packageTask.jobBeginTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
                                    <td>{{packageTask.finishTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
                                    <td ng-bind="packageTask.jobUserName"></td>
                                    <td><span ng-if="packageTask.jobStatus== 0">未开始</span><span ng-if="packageTask.jobStatus == 1">包装中</span><span ng-if="packageTask.jobStatus ==2">包装完成</span></td>
                                    <td>
                                        <div ng-show="show">
                                            <a ng-show="packageTask.jobStatus != 2" href="javascript:void(0);" ui-sref="packageWorking({id:packageTask.id})" title="开始包装：{{packageTask.itemName}}">
                                                <span class="fa fa-pencil"></span>
                                            </a>
                                        </div>
                                    </td>
								</tr>

								<tr ng-if="packageTaskList == null || packageTaskList.length == 0">
									<td colspan="11">
										<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>
		<!-- WIDGET END -->

	</div>

	<!-- end row -->

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