<style>
.order-table .header>th {
	height: 38px;
	text-align: center;
	background: #f5f5f5;
	border-top: 1px solid #e8e8e8;
	border-bottom: 1px solid #e8e8e8;
}

.order-table .sep-row {
	height: 10px;
}

.order-table .selector {
	vertical-align: middle;
	margin: 0 0 2px 0;
}

.toolbar label {
	margin-right: 10px;
	margin-bottom: 0;
}

.toolbar .select_all {
	margin: 0 6px 0 10px;
	line-height: 20px;
}

.toolbar .btn {
	-moz-border-radius: 2px;
	margin-right: 5px;
	border: 1px solid #dcdcdc;
	border-radius: 2px;
	-webkit-border-radius: 2px;
}

.order-table .order-hd {
	background: #f5f5f5;
	height: 40px;
	line-height: 40px;
}

.order-table .order-hd td.first {
	padding-left: 20px;
}

.order-table .order-hd .order-main span {
	margin-right: 8px;
}

.order-table .order-hd .order-code {
	font-style: normal;
	font-family: verdana;
}

.order-table .order-hd .order-sum {
	padding: 0 5px;
}

.order-table>tbody {
	border: 1px solid transparent;
}

.order-table>tbody:hover {
	border-color: #56a022;
	border-width: 2px;
}

.order-table .operates {
	display: none;
}

.order-table>tbody:hover .operates {
	display: block;
}

.order-table .order-bd {
	border-bottom: 1px solid #e6e6e6;
}

.order-table .order-bd>td {
	padding: 10px 5px;
	vertical-align: top;
	position: relative;
}

.order-table .order-bd .product {
	padding-left: 20px;
}

.input-xs,.input-group-xs>.form-control,.input-group-xs>.input-group-addon,.input-group-xs>.input-group-btn>.btn
	{
	height: 26px;
	padding: 0 5px;
	font-size: 12px;
	line-height: 1.5;
	border-radius: 3px;
}

.input-group-xs .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

 .modal-dialog {
	margin-top: 110px;
}

.sampleSend .col {
	padding-left: 5px;
	padding-right: 5px;
	line-height: 30px;
}

.sampleSend label {
	font-weight: bold;
	text-align: right;
	font-family: "Microsoft YaHei","微软雅黑";
	line-height: 30px;
}

</style>
<div class="block">
<div class="loading in" ng-class="{'in': loading}">
	<i></i>
</div>
<div class="condition block">
		<div class="row">
			<div class="col-xs-4">
				<div class="btn-group btn-group-sm btn-group-justified">
					<div class="btn-group btn-group-sm">
						<button type="button" class="btn btn-default btn-line"
							ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部</button>
					</div>
				</div>
			</div>
			<div class="col-xs-6">
				<div class="search">
					<div class="form-group form-group-sm has-feedback">
						<input type="search" class="form-control input-sm" placeholder="输入商品、客户名称或单据流水号搜索" /><span
							class="form-control-feedback text-simple"><i
							class="fa fa-search"></i></span>
					</div>
				</div>
			</div>
			<div class="col-xs-2 toggle">
				<a ng-click="condition.$open=!condition.$open" class="text-simple">
					<span ng-bind="condition.$open ? '简化筛选条件' : '更多筛选条件'"></span>
					<i class="fa fa-fw" ng-class="{'fa-angle-up': condition.$open, 'fa-angle-down': !condition.$open}"></i>
				</a>
			</div>
		</div>
		<div class="more" ng-class="{'open': condition.$open}">
			<form class="form-inline">
			  <div class="form-group ">
			    <label>日期：</label>
			    <div class="btn-group btn-menu" dropdown is-open="condition.$dateZoneOpen">
				  <button type="button" style="width: 85px;" class="btn btn-default btn-xs dropdown-toggle">
				    	{{dateZoneText}}<i class="fa fa-fw fa-angle-down icon-right"></i></span>
				  </button>
				  <ul class="dropdown-menu">
					<li><a ng-click="changeDateZone(1)">一个月内</a></li>
				    <li><a ng-click="changeDateZone(6)">半年内</a></li>
				    <li><a ng-click="changeDateZone()">半年前</a></li>
				  </ul>
				</div>
			    <div class="form-group input-group input-group-xs input-trigger">
						<input type="text" ng-model="condition.dateFrom"
							class="form-control" placeholder="从"
							datepicker-popup="yyyy-MM-dd" is-open="condition.$fromOpened"
							ng-required="true"
							current-text="今天" clear-text="清除" close-text="关闭"
							datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
							ng-focus="openDatePicker($event, condition, '$fromOpened')">
						<span class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="openDatePicker($event, condition, '$fromOpened')">
								<i class="fa fa-calendar"></i>
							</button>
						</span>
					</div>
					<div class="form-group input-group input-group-xs input-trigger">
						<input type="text" ng-model="condition.dateTo"
							class="form-control" placeholder="到"
							datepicker-popup="yyyy-MM-dd" is-open="condition.$toOpened"
							ng-required="true"
							current-text="今天" clear-text="清除" close-text="关闭"
							datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
							ng-focus="openDatePicker($event, condition, '$toOpened')">
						<span class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="openDatePicker($event, condition, '$toOpened')">
								<i class="fa fa-calendar"></i>
							</button>
						</span>
					</div>
			  </div>
			</form>
		</div>
	</div>
<table class="order-table block" ng-table="tableParams">
	<thead>
		<tr class="header">
			<th>商品</th>
			<th>需求数量</th>
			<th>单价</th>
			<th width="120">交货日期</th>
			<th width="140">客户单据</th>
			<th width="70">操作</th>
		</tr>
		<tr class="sep-row">
			<td colspan="6"></td>
		</tr>
		<tr class="toolbar toolbar-top">
			<td colspan="6">
				<div>
					<label><input type="checkbox" class="selector select_all"
						ng-model="selectAll">全选</label> <a href="javascript:void(0)"
						class="btn btn-default btn-xs">批量回复</a>
				</div> <!-- 分页 -->
			</td>
		</tr>
		<tr class="sep-row">
			<td colspan="6"></td>
		</tr>
	</thead>
	<tbody ng-repeat="sample in $data">
		<tr class="order-hd">
			<td class="first">
				<div class="order-main">
					<span> <input type="checkbox" class="selector"
						ng-model="sample.$selected">
					</span> <span class="text-num text-bold" title="{{sample.proofing.date | date: 'yyyy年MM月dd日 hh:mm'}}"
						ng-bind="sample.proofing.date | date:'yyyy-MM-dd'"></span>
				</div>
			</td>
			<td colspan="3"><a title="客户名称" href="#"
				ng-bind="sample.proofing.enterprise.enName"></a></td>
			<td colspan="1" class="order-sum" title="是否收费">
				<div ng-show="sample.proofing.isCharge == '是'" class="label label-success">收&nbsp;&nbsp;&nbsp;费</div>
				
			</td>
			<td colspan="1" class="text-center">
				<div class="operates">
					<a href="#" class="text-muted" title="打印">
						<i class="fa fa-print fa-lg fa-fw"></i>
					</a>
				</div>
			</td>
		</tr>
		<tr class="order-bd">
			<td class="product">
				<div class="text-num text-bold">
					<a href="#" ng-bind="sample.proofing.product.code"></a>
				</div>
				<div>
					<a href="#" ng-bind="sample.proofing.product.title"></a>
				</div>
				<div class="text-muted" title="{{sample.proofing.product.spec}}"
					ng-bind="sample.proofing.product.spec"></div>
			</td>
			<td class="text-center">
				<div class="text-num text-bold"
					title="{{sample.qty}}" ng-bind="sample.qty"></div>
				<div class="text-muted" ng-bind="sample.proofing.product.unit"></div>
			</td>
			<td class="text-center">
				<div ng-show="sample.proofing.isCharge != '是'" class="label label-default">不收费</div>
				<div ng-show="sample.proofing.isCharge == '是'" class="text-num">
					<span ng-bind="sample.price | currency: currency(sample.currency)"></span>
				</div>
				<div ng-show="sample.proofing.isCharge == '是'">
					<br>
					总额：<span class="text-num" ng-bind="sample.amount | currency: currency(sample.currency)"></span>
				</div>
			</td>
			<td class="text-center br-l" title="交货日期">
				<div class="text-num"
					ng-bind="sample.proofing.delivery | date: 'yyyy-MM-dd'"></div>
			</td>
			<td class="br-l">
				<div>编号：<a href="#" ng-bind="sample.proofing.code"></a></div>
				<div>第 <span ng-bind="sample.number"></span> 行</div>
			</td>
			<td class="br-l text-center">
				<div class="operates" ng-show="sample.status == 401">
					<a ng-click="openSend($index, sample)" class="text-muted" title="送样">
						<i class="fa fa-paper-plane fa-lg fa-fw"></i><br>
						送样
					</a>
				</div>
				<div ng-if="sample.status == 400" class="block">
					<span class="text-trans success">已送样</span>
				</div>
			</td>
		</tr>
	</tbody>
</table>
</div>
	<script type="text/ng-template" id="sendModal.html">
        <div class="modal-header">
            <h3 class="modal-title">送样</h3>
        </div>
		<form class="sampleSend" name="sampleSendForm" ng-submit="ok(sampleSendForm)">
        	<div class="modal-body">
				<div class="row">
					<label class="col-md-2 col-sm-2 col">物料：</label>
					<div class="col-md-4 col-sm-4 col">{{sampleItem.proofing.product.title}} </div>
					<label class="col-md-2 col-sm-2 col">客户：</label>
					<div class="col-md-4 col-sm-4 col">{{sampleItem.proofing.enterprise.enName}} </div>
				</div>
				<div class="row">
					<label class="col-md-2 col-sm-2 col">规格：</label>
					<div class="col-md-4 col-sm-4 col">{{sampleItem.proofing.product.spec}}</div>
					<label class="col-md-2 col-sm-2 col">数量：</label>
					<div class="col-md-4 col-sm-4 col">{{sampleItem.qty}} {{sampleItem.proofing.product.unit}}</div>
				</div>
				<div class="row" style="">
					<label class="col-md-2 col-sm-2 col">送样单号：</label>
					<div class="col-md-4 col-sm-4 col"><input ng-model="sampleItem.sampleSend.code" class="form-control input-sm" type="text" required></div>
					<label class="col-md-2 col-sm-2 col">单重：</label>
					<div class="col-md-4 col-sm-4 col input-group">
						<input ng-model="sampleItem.sampleSend.weight" class="form-control input-sm" type="number">
						<span class="input-group-addon">g</span>
					</div>
				</div>
				<div class="row" style="">
					<label class="col-md-2 col-sm-2 col">材料：</label>
					<div class="col-md-4 col-sm-4 col"><input ng-model="sampleItem.sampleSend.material" class="form-control input-sm" type="text"></div>
					<label class="col-md-2 col-sm-2 col">口水料比例：</label>
					<div class="col-md-4 col-sm-4 col input-group">
						<input ng-model="sampleItem.sampleSend.ratio" class="form-control input-sm" type="number">
						<span class="input-group-addon">%</span>
					</div>
				</div>
				<div class="row" style="">
					<label class="col-md-2 col-sm-2 col">材质：</label>
					<div class="col-md-4 col-sm-4 col"><input ng-model="sampleItem.sampleSend.materialQuality" class="form-control input-sm" type="text"></div>
					<label class="col-md-2 col-sm-2 col">最小订购量：</label>
					<div class="col-md-4 col-sm-4 col input-group">
						<input ng-model="sampleItem.sampleSend.minBuyQty" class="form-control input-sm" type="number">
						<span class="input-group-addon">{{sampleItem.proofing.product.unit}}</span>
					</div>
				</div>
				<div class="row" style="">
					<label class="col-md-2 col-sm-2 col">产地：</label>
					<div class="col-md-4 col-sm-4 col"><input ng-model="sampleItem.sampleSend.adress" class="form-control input-sm" type="text"></div>
					<label class="col-md-2 col-sm-2 col">最小包装数：</label>
					<div class="col-md-4 col-sm-4 col input-group">
						<input ng-model="sampleItem.sampleSend.minQty" class="form-control input-sm" type="number">
						<span class="input-group-addon">{{sampleItem.proofing.product.unit}}</span>
					</div>
				</div>
				<div class="row" style="">
					<label class="col-md-2 col-sm-2 col">产地识别：</label>
					<div class="col-md-4 col-sm-4 col"><input ng-model="sampleItem.sampleSend.addressMark" class="form-control input-sm" type="text"></div>
					<label class="col-md-2 col-sm-2 col">交货周期：</label>
					<div class="col-md-4 col-sm-4 col input-group">
						<input ng-model="sampleItem.sampleSend.delivery" class="form-control input-sm" type="number">
						<span class="input-group-addon">天</span>
					</div>
				</div>
				<div class="row" style="">
					<label class="col-md-2 col-sm-2 col">品牌：</label>
					<div class="col-md-4 col-sm-4 col"><input ng-model="sampleItem.sampleSend.brand" class="form-control input-sm" type="text"></div>
					<label class="col-md-2 col-sm-2 col">采购单价：</label>
					<div class="col-md-4 col-sm-4 col"><input ng-model="sampleItem.sampleSend.puprice" class="form-control input-sm" type="number"></div>
				</div>
				<div class="row" style="">
					<label class="col-md-2 col-sm-2 col">附件：</label>
					<div class="col-md-4 col-sm-4 col">
						<input type="file" ng-model="attachFile" ng-file-select accept="*/*" ng-multiple="false" class="form-control input-sm" name="attachFile" id="attachFile">
					</div>
				</div>
        	</div>
        	<div class="modal-footer">
            	<button class="btn btn-primary" type="submit">确认送样</button>
            	<button class="btn btn-warning" ng-click="cancel()" type="button">取消</button>
        	</div>
		</form>
    </script>