<style>
	label {
		margin-bottom: 0px;
	}
	.va-top {
		vertical-align: top;
	}
	.text-help {
		color: #CCCCCC;
	}
	.border-success {
		border-color: #449d44;
	}
	.module {
		border-bottom: solid 1px #339999;
	}
	.tr-border {
		border-bottom: solid 1px #DDDDDD;
	}
	.tr-border td {
		padding-bottom: 16px;
	}
	td {
		padding: 0px 5px;
	}
	.text-red {
		color: #F00000;
	}
	.text-green {
		color: #009966;
	}
	.btn-sm {
		height: 30px;
	}
	.tittle {
		
	}
	.log {
		border: solid 1px #BBBBBB;
		border-radius: 4px;
		position: relative;
		padding: 5px 10px;
		font-size: 13px;
	}
	.log .up {
		position: absolute;
		top: -8px;
		right: 20px;
		background: #FFFFFF;
		overflow: hidden;
		width: 13px;
		height: 13px;
		border-left: 1px solid #BBBBBB;
		border-top: 1px solid #BBBBBB;
		-webkit-transform: rotate(45deg);
		-moz-transform: rotate(45deg);
		-o-transform: rotate(45deg);
		transform: rotate(45deg);
		z-index: 9;
	}
	.status {
		position: absolute;
		height: 50px;
		width: 50px;
		border-radius: 30px;
		border: dashed 1px #009966;
		padding-top: 12px;
		text-align: center;
		right: 10px;
		top:10px;
		background-color: #FFFFFF;
		color: #009966;
		-webkit-transform: rotate(15deg);
		-moz-transform: rotate(15deg);
		-o-transform: rotate(15deg);
		transform: rotate(15deg);
		font-size: 14px;
		z-index: 9;
	}
</style>
<div ng-controller="SaleNoticeCtrl">
	<div class="top padding5 bold">
		<a href="#" class="f16 topText">&nbsp;<i class="fa fa-angle-left"></i>&nbsp;单据详情</a>
		<div class="right"><i class="fa fa-reorder"></i>&nbsp;&nbsp;</div>
	</div>
	<div class="padding5">
		<div class="loading" ng-class="{'in': loading}">
			<i></i>
		</div>
		<table style="margin-bottom: 20px;">
			<tr>
				<td class="va-top text-right" style="width: 20%;">
					<label class="text-black"><i style="color: #339999;" class="fa fa-newspaper-o"></i></label>
				</td>
				<td style="position: relative;">
					<div ng-show="notice.status == 201" class="status">已完成</div>
					<div ng-show="notice.status != 201" class="status">待处理</div>
					<span href="#" ng-bind="notice.orderItem.product.title"></span>
				</td>
			</tr>
			<tr class="text-muted">
				<td class="va-top text-right">编号</td>
				<td>
					<span class="text-num" ng-bind="notice.orderItem.product.code"></span>
				</td>
			</tr>
			<tr class="text-muted tr-border">
				<td class="va-top text-right">规格</td>
				<td>
					<span class="text-num" ng-bind="notice.orderItem.product.spec"></span>
				</td>
			</tr>
			<tr>
				<td class="va-top text-right text-muted">采购员</td>
				<td>
					<span class="" ng-bind="notice.orderItem.order.user.userName"></span>
					&nbsp;<span class="text-num" ng-bind="notice.orderItem.order.user.userTel"></span><br>
					<span class="text-muted" ng-bind="notice.orderItem.order.enterprise.enName"></span>
				</td>
			</tr>
			<tr class="tr-border">
				<td class="va-top text-right"><i style="color: #339999;" class="fa fa-map-marker"></i>&nbsp;&nbsp;</td>
				<td>
					<span class="" ng-bind="notice.orderItem.order.shipAddress"></span>
				</td>
			</tr>
			<tr>
				<td class="va-top text-right">需求数</td>
				<td>
					<span class="text-num bold">{{notice.qty}}</span> {{notice.orderItem.product.unit}}
					<span class="right text-muted">[订单数：{{notice.orderItem.qty}}]</span>
				</td>
			</tr>
			<tr>
				<td class="va-top text-right" style="padding-bottom: 8px;">未发货</td>
				<td style="padding-bottom: 8px;">
					<span class="text-num text-red bold">{{notice.qty - (notice.endQty || 0)}}</span> {{notice.orderItem.product.unit}}
					<span ng-click="logShow = !logShow; getSends();" class="right text-green bold"> <i class="fa fa-caret-square-o-down"></i> [已发货：{{notice.endQty || 0}}]</span>
				</td>
			</tr>
			<tr class="text-muted" ng-show="logShow">
				<td colspan="2">
					<div class="log">
						<div class="up"></div>
						<div ng-repeat="send in notice.sendLogs">
							发货单号：{{send.send.code}}，发货：{{send.qty}} {{notice.orderItem.product.unit}}
						</div>
					</div>
				</td>
			</tr>
			<tr class="tr-border">
				<td colspan="2" style="padding-top: 10px;" ng-init="notice.send.qty=notice.qty-(notice.endQty || 0)">
					<form name="sendForm">
						<input class="form-control input-sm" type="text" placeholder="送货单号" 
							style="width: 45%;display: inline-block;" required ng-model="notice.send.code">
						<input class="form-control input-sm" type="number" placeholder="本次数量" 
							style="width: 30%;display: inline-block;" required ng-model="notice.send.qty">
						<button ng-disabled="notice.status != 200 || sendForm.$invalid" ng-click="onReplyClick(notice)" 
							class="btn btn-success btn-sm right" style="width: 20%;">发货
						</button>
					</form>
				</td>
			</tr>
			<tr class="text-muted">
				<td class="va-top text-right">单价</td>
				<td>
					<span class="text-num text-muted">{{notice.orderItem.price | currency: symbol(notice.orderItem.order.currency)}}</span>
					<span class="right">交货日期：{{notice.orderItem.delivery | date: 'yyyy-MM-dd'}}</span>
				</td>
			</tr>
			<tr class="text-muted">
				<td class="va-top text-right">金额</td>
				<td>
					<span class="text-num text-muted">{{notice.orderItem.price * notice.orderItem.qty | currency: symbol(notice.orderItem.order.currency)}}</span>
				</td>
			</tr>
			<tr class="text-muted">
				<td class="va-top text-right">单据</td>
				<td>
					<a href="#" class="text-num">{{notice.orderItem.order.code}}</a>
					<span class="right">第 {{notice.orderItem.number}} 行&nbsp;&nbsp;</span>
				</td>
			</tr>
			<tr class="text-muted">
				<td class="va-top text-right">时间</td>
				<td>
					<span>{{notice.orderItem.order.date | date: 'yyyy-MM-dd'}}</span>
				</td>
			</tr>
			<tr class="text-muted">
				<td class="va-top text-right">客户</td>
				<td>
					<a href="#">{{notice.orderItem.order.enterprise.enName}}</a><br>
				</td>
			</tr>
		</table>
	</div>
	<div class="padding5" style="">
		
	</div>
</div>