Bläddra i källkod

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@192 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d

administrator 11 år sedan
förälder
incheckning
925f079707

+ 22 - 4
src/main/java/com/uas/platform/b2b/controller/SaleOrderController.java

@@ -2,6 +2,8 @@ package com.uas.platform.b2b.controller;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -10,9 +12,12 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import com.uas.platform.b2b.model.PurchaseOrder;
 import com.uas.platform.b2b.model.PurchaseOrderAll;
+import com.uas.platform.b2b.model.PurchaseReply;
 import com.uas.platform.b2b.service.PurchaseOrderService;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.PageParams;
+import com.uas.platform.core.util.serializer.FlexJsonUtils;
 
 @Controller
 @RequestMapping("/sale")
@@ -35,19 +40,32 @@ public class SaleOrderController {
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
 		return purchaseOrderService.findAllByPageInfo(info);
 	}
-	
+
 	/**
 	 * 作为卖家,收到的采购订单(含明细)
 	 * 
 	 * @param json
 	 * @return
 	 */
-	@RequestMapping(value = "/orders/items", method = RequestMethod.POST)
+	@RequestMapping(value = "/orders/items", method = RequestMethod.GET)
 	@ResponseBody
-	public Page<PurchaseOrderAll> getReceivedPurchaseOrderItems(@RequestBody String json) {
-		PageInfo info = new PageInfo(json);
+	public Page<PurchaseOrderAll> getReceivedPurchaseOrderItems(PageParams params) {
+		PageInfo info = new PageInfo(params);
 		// 我作为卖家,把我的企业ID作为供应商ID传入
 		info.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
 		return purchaseOrderService.findAllDetailByPageInfo(info);
 	}
+
+	/**
+	 * 作为卖家,收到的采购订单(含明细)
+	 * 
+	 * @param json
+	 * @return
+	 */
+	@RequestMapping(value = "/orders/items/reply", method = RequestMethod.POST)
+	public ResponseEntity<String> replyOrderItem(@RequestBody String json) {
+		PurchaseReply reply = FlexJsonUtils.fromJson(json, PurchaseReply.class);
+		purchaseOrderService.reply(reply);
+		return new ResponseEntity<String>(HttpStatus.OK);
+	}
 }

+ 12 - 0
src/main/java/com/uas/platform/b2b/dao/PurchaseOrderItemDao.java

@@ -0,0 +1,12 @@
+package com.uas.platform.b2b.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.platform.b2b.model.PurchaseOrderItem;
+
+@Repository
+public interface PurchaseOrderItemDao extends JpaSpecificationExecutor<PurchaseOrderItem>, JpaRepository<PurchaseOrderItem, Long> {
+	
+}

+ 12 - 0
src/main/java/com/uas/platform/b2b/dao/PurchaseReplyDao.java

@@ -0,0 +1,12 @@
+package com.uas.platform.b2b.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.platform.b2b.model.PurchaseReply;
+
+@Repository
+public interface PurchaseReplyDao extends JpaSpecificationExecutor<PurchaseReply>, JpaRepository<PurchaseReply, Long> {
+
+}

+ 26 - 19
src/main/java/com/uas/platform/b2b/model/PurchaseOrderAllItem.java

@@ -52,6 +52,12 @@ public class PurchaseOrderAllItem {
 	@Column(name = "pd_qty")
 	private Double qty;
 
+	/**
+	 * 已回复的数量
+	 */
+	@Column(name = "pd_replyqty")
+	private Double replyQty;
+
 	/**
 	 * 备注
 	 */
@@ -69,6 +75,9 @@ public class PurchaseOrderAllItem {
 	 */
 	@Column(name = "pd_taxrate")
 	private Float taxrate;
+	
+	@Column(name="pd_status")
+	private Short status;
 
 	/**
 	 * 含税金额
@@ -93,9 +102,7 @@ public class PurchaseOrderAllItem {
 	 */
 	@Column(name = "pd_delivery")
 	private Date delivery;
-
-	private Short isok;
-
+	
 	public Long getId() {
 		return id;
 	}
@@ -112,14 +119,6 @@ public class PurchaseOrderAllItem {
 		this.number = number;
 	}
 
-//	public PurchaseOrderAll getOrder() {
-//		return order;
-//	}
-//
-//	public void setOrder(PurchaseOrderAll order) {
-//		this.order = order;
-//	}
-
 	public Long getProductId() {
 		return productId;
 	}
@@ -144,6 +143,14 @@ public class PurchaseOrderAllItem {
 		this.qty = qty;
 	}
 
+	public Double getReplyQty() {
+		return replyQty;
+	}
+
+	public void setReplyQty(Double replyQty) {
+		this.replyQty = replyQty;
+	}
+
 	public String getRemark() {
 		return remark;
 	}
@@ -192,14 +199,6 @@ public class PurchaseOrderAllItem {
 		this.noTaxAmount = noTaxAmount;
 	}
 
-	public Short getIsok() {
-		return isok;
-	}
-
-	public void setIsok(Short isok) {
-		this.isok = isok;
-	}
-
 	public Date getDelivery() {
 		return delivery;
 	}
@@ -207,4 +206,12 @@ public class PurchaseOrderAllItem {
 	public void setDelivery(Date delivery) {
 		this.delivery = delivery;
 	}
+
+	public Short getStatus() {
+		return status;
+	}
+
+	public void setStatus(Short status) {
+		this.status = status;
+	}
 }

+ 22 - 7
src/main/java/com/uas/platform/b2b/model/PurchaseOrderItem.java

@@ -55,7 +55,13 @@ public class PurchaseOrderItem {
 	 */
 	@Column(name = "pd_qty")
 	private Double qty;
-
+	
+	/**
+	 * 回复数量
+	 */
+	@Column(name = "pd_replyqty")
+	private Double replyQty;
+	
 	/**
 	 * 备注
 	 */
@@ -97,8 +103,9 @@ public class PurchaseOrderItem {
 	 */
 	@Column(name = "pd_delivery")
 	private Date delivery;
-
-	private Short isok;
+	
+	@Column(name="pd_status")
+	private Short status;
 
 	public Long getId() {
 		return id;
@@ -196,12 +203,12 @@ public class PurchaseOrderItem {
 		this.noTaxAmount = noTaxAmount;
 	}
 
-	public Short getIsok() {
-		return isok;
+	public Double getReplyQty() {
+		return replyQty;
 	}
 
-	public void setIsok(Short isok) {
-		this.isok = isok;
+	public void setReplyQty(Double replyQty) {
+		this.replyQty = replyQty;
 	}
 
 	public Date getDelivery() {
@@ -211,4 +218,12 @@ public class PurchaseOrderItem {
 	public void setDelivery(Date delivery) {
 		this.delivery = delivery;
 	}
+
+	public Short getStatus() {
+		return status;
+	}
+
+	public void setStatus(Short status) {
+		this.status = status;
+	}
 }

+ 2 - 2
src/main/java/com/uas/platform/b2b/model/PurchaseReply.java

@@ -23,7 +23,7 @@ import javax.persistence.Table;
  */
 @Table(name = "purc$reply")
 @Entity
-public class PurchaseReply implements Serializable{
+public class PurchaseReply implements Serializable {
 
 	/**
 	 * 
@@ -46,7 +46,7 @@ public class PurchaseReply implements Serializable{
 	 * 采购订单明细
 	 */
 	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
-	@JoinColumn(name = "pr_pdid")
+	@JoinColumn(name = "pr_pdid", updatable = true, insertable = false)
 	private PurchaseOrderItem orderItem;
 
 	/**

+ 3 - 0
src/main/java/com/uas/platform/b2b/service/PurchaseOrderService.java

@@ -4,6 +4,7 @@ import org.springframework.data.domain.Page;
 
 import com.uas.platform.b2b.model.PurchaseOrder;
 import com.uas.platform.b2b.model.PurchaseOrderAll;
+import com.uas.platform.b2b.model.PurchaseReply;
 import com.uas.platform.core.model.PageInfo;
 
 public interface PurchaseOrderService {
@@ -11,5 +12,7 @@ public interface PurchaseOrderService {
 	public Page<PurchaseOrder> findAllByPageInfo(PageInfo pageInfo);
 	
 	public Page<PurchaseOrderAll> findAllDetailByPageInfo(PageInfo pageInfo);
+	
+	public void reply(PurchaseReply reply);
 
 }

+ 22 - 2
src/main/java/com/uas/platform/b2b/service/impl/PurchaseOrderServiceImpl.java

@@ -12,20 +12,30 @@ import org.springframework.stereotype.Service;
 
 import com.uas.platform.b2b.dao.PurchaseOrderAllDao;
 import com.uas.platform.b2b.dao.PurchaseOrderDao;
+import com.uas.platform.b2b.dao.PurchaseOrderItemDao;
+import com.uas.platform.b2b.dao.PurchaseReplyDao;
 import com.uas.platform.b2b.model.PurchaseOrder;
 import com.uas.platform.b2b.model.PurchaseOrderAll;
+import com.uas.platform.b2b.model.PurchaseOrderItem;
+import com.uas.platform.b2b.model.PurchaseReply;
 import com.uas.platform.b2b.service.PurchaseOrderService;
 import com.uas.platform.core.model.PageInfo;
 
 @Service
-public class PurchaseOrderServiceImpl implements PurchaseOrderService{
+public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 
 	@Autowired
 	private PurchaseOrderDao purchaseOrderDao;
-	
+
 	@Autowired
 	private PurchaseOrderAllDao purchaseOrderAllDao;
+
+	@Autowired
+	private PurchaseReplyDao purchaseReplyDao;
 	
+	@Autowired
+	private PurchaseOrderItemDao purchaseOrderItemDao;
+
 	public Page<PurchaseOrder> findAllByPageInfo(final PageInfo pageInfo) {
 		return purchaseOrderDao.findAll(new Specification<PurchaseOrder>() {
 
@@ -47,4 +57,14 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService{
 		}, pageInfo);
 	}
 
+	@Override
+	public void reply(PurchaseReply reply) {
+		purchaseReplyDao.save(reply);
+		PurchaseOrderItem item = purchaseOrderItemDao.findOne(reply.getOrderItem().getId());
+		Double replyQty = item.getReplyQty();
+		replyQty = replyQty == null ? 0 : replyQty;
+		item.setReplyQty(replyQty + reply.getQty());
+		purchaseOrderItemDao.save(item);
+	}
+
 }

+ 0 - 1
src/main/webapp/WEB-INF/views/normal/index.html

@@ -12,7 +12,6 @@
 <link rel="stylesheet" href="static/lib/bootstrap/css/bootstrap.min.css" />
 <link rel="stylesheet"
 	href="static/lib/fontawesome/css/font-awesome.min.css" />
-<link rel="stylesheet" href="static/lib/angular/ng-table.css" />
 <link rel="stylesheet" href="static/css/index.css" />
 </head>
 <body>

+ 19 - 38
src/main/webapp/resources/css/index.css

@@ -21,6 +21,7 @@ a {
 .block {
 	background-color: #fff;
 	width: 100%;
+	position: relative;
 }
 
 .f12 {
@@ -892,7 +893,6 @@ px
 	height: 40px;
 	line-height: 40px;
 	padding: 0 20px;
-	margin-bottom: 22px;
 	border-bottom: 1px solid #e8e8e8;
 	font-size: 14px;
 }
@@ -948,47 +948,28 @@ px
 	margin-left: 15px;
 	content: "|"
 }
-/*table*/
-.table thead th {
-	background-color: #f5f5f5;
-	background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
-	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff),
-		to(#e6e6e6));
-	background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
-	background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
-	background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
-	background-repeat: repeat-x;
-	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',
-		endColorstr='#ffe6e6e6', GradientType=0);
-}
-
-.ng-table-filters>th {
-	padding: 0;
-}
-
-.ng-table th.filter .input-filter {
-	border: none;
-	-webkit-border-radius: 0;
-	-moz-border-radius: 0;
-	border-radius: 0;
-}
-
-.table-striped tbody>tr:hover,.table-striped tbody>tr:nth-child(odd):hover>td
-	{
-	background-color: rgba(141, 192, 219, 0.25);
+/*loading*/
+.loading {
+	display: none;
+	position: absolute;
+	width: 100%;
+	height: 300px;
+	top: 0;
+	left: 0;
 }
 
-.ng-table th.sortable.sort-desc,.ng-table th.sortable.sort-asc {
-	background-image: -moz-linear-gradient(top, #ffffff, rgba(141, 192, 219, 0.25));
-	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff),
-		to(rgba(141, 192, 219, 0.25)));
-	background-image: -webkit-linear-gradient(top, #ffffff, rgba(141, 192, 219, 0.25));
-	background-image: -o-linear-gradient(top, #ffffff, rgba(141, 192, 219, 0.25));
-	background-image: linear-gradient(to bottom, #ffffff, rgba(141, 192, 219, 0.25));
+.loading.in {
+	display: block;
 }
 
-.table .text-right>span {
-	float: right;
+.loading.in>i {
+	position: absolute;
+	top: 50%;
+	left: 50%;
+	margin: -33px 0 0 -33px;
+	background: url("../img/all/loading.gif") no-repeat center center;
+	width: 66px;
+	height: 66px;
 }
 /*sale */
 .sale .state {

+ 28 - 40
src/main/webapp/resources/js/index/app.js

@@ -1,6 +1,6 @@
-define([ 'toaster', 'charts', 'ngTable', 'services', 'ui.router', 'ui.bootstrap' ], function() {
+define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/PurcOrder', 'ui.router', 'ui.bootstrap' ], function() {
 	'use strict';
-	var app = angular.module('myApp', [ 'toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'ui.bootstrap' ]);
+	var app = angular.module('myApp', [ 'toaster', 'angularCharts', 'ngTable', 'ui.router', 'common.services', 'PurcOrderServices', 'ui.bootstrap' ]);
 	app.init = function() {
 		angular.bootstrap(document, [ 'myApp' ]);
 	};
@@ -262,7 +262,7 @@ define([ 'toaster', 'charts', 'ngTable', 'services', 'ui.router', 'ui.bootstrap'
 			}
 		};
 	});
-	app.controller('SaleOrderCtrl', function($scope, $filter, $http, ngTableParams){
+	app.controller('SaleOrderCtrl', function($scope, $filter, PurcOrderItem, ngTableParams){
 		var isNumber = function(n) {
             return !isNaN(parseFloat(n)) && isFinite(n);
         };
@@ -288,59 +288,47 @@ define([ 'toaster', 'charts', 'ngTable', 'services', 'ui.router', 'ui.bootstrap'
 		};
 		$scope.tableParams = new ngTableParams({
 			page : 1, // show first page
-			count : 10, // count per page
+			count : 5, // count per page
 			sorting: {
-                code: 'asc' 
+                date: 'desc' 
+            },
+            filter: {
+            	'status' : 200
             }
 		}, {
 			total : 0, 
+			counts: [5, 10, 25, 50],
 			getData : function($defer, params) {
-				$http.post('sale/orders/items', parseParams(params.url())).success(function(page){
+				PurcOrderItem.get(parseParams(params.url()), function(page){
 					if(page) {
 						params.total(page.totalElements);
 						$defer.resolve(page.content);
 					}
-				}).error(function(){
-					
 				});
 			}
 		});
-		$scope.checkboxes = {
-			'checked' : false,
-			items : {},
-			length : 0
+		
+		$scope.getOrderTotal = function(items) {
+			var sum = 0;
+			angular.forEach(items, function(item){
+				sum += item.qty * item.price;
+			});
+			return sum;
 		};
 		
-		// watch for check all checkbox
-		$scope.$watch('checkboxes.checked', function(value) {
-			var i = 0;
-			angular.forEach($scope.tableParams.data, function(item) {
-				if (angular.isDefined(item.id)) {
-					$scope.checkboxes.items[item.id] = value;
-					i++;
+		$scope.reply = function(item) {
+			if(item.reply) {
+				var reply = angular.copy(item.reply), 
+					dateFilter = $filter('date');
+				if(reply.delivery) {
+					reply.delivery = reply.delivery.getTime();
 				}
-			});
-			$scope.checkboxes.length = i;
-		});
-
-		// watch for data checkboxes
-		$scope.$watch('checkboxes.items', function(values) {
-			if (!$scope.tableParams.data) {
-				return;
-			}
-			var checked = 0, unchecked = 0, total = $scope.tableParams.total();
-			angular.forEach($scope.tableParams.data, function(item) {
-				checked += ($scope.checkboxes.items[item.id]) || 0;
-				unchecked += (!$scope.checkboxes.items[item.id]) || 0;
-			});
-			if (total > 0 && (unchecked == 0 || checked == 0)) {
-				$scope.checkboxes.checked = (checked == total);
+				reply.orderItem = {id: item.id};
+				PurcOrderItem.reply(reply, function(){
+					$scope.tableParams.reload();
+				});
 			}
-			$scope.checkboxes.length = checked;
-			// grayed checkbox
-			angular.element(document.getElementById("select_all")).prop("indeterminate",
-					(checked != 0 && unchecked != 0));
-		}, true);
+		};
 	});
 	return app;
 });

+ 5 - 3
src/main/webapp/resources/js/index/main.js

@@ -7,19 +7,21 @@ require.config({
 		'toaster' : 'lib/angular/angular-toaster.min',
 		'd3' : 'lib/angular/d3.min',
 		'charts' : 'lib/angular/angular-charts.min',
-		'services' : 'js/common/services',
+		'common' : 'js/common',
+		'service' : 'js/index/services',
 		'ui.router' : 'lib/angular/angular-ui-router.min',
 		'ui.bootstrap' : 'lib/angular/ui-bootstrap-tpls',
-		'ngTable' : 'lib/angular/ng-table'
+		'ngTable' : 'lib/angular/ng-table',
+		'ngResource' : 'lib/angular/angular-resource.min'
 	},
 	shim : {
 		'angular' : {
 			'exports' : 'angular'
 		},
 		'ngAnimate' : ['angular'],
+		'ngResource' : ['angular'],
 		'toaster' : ['angular', 'ngAnimate'],
 		'charts' : ['angular', 'd3'],
-		'services' : ['angular'],
 		'ui.router' : ['angular'],
 		'ui.bootstrap' : [ 'angular' ],
 		'ngTable' : {

+ 12 - 0
src/main/webapp/resources/js/index/services/PurcOrder.js

@@ -0,0 +1,12 @@
+define([ 'ngResource' ], function() {
+	angular.module('PurcOrderServices', [ 'ngResource' ]).factory('PurcOrder', function($resource) {
+		return $resource('sale/orders/:id', {});
+	}).factory('PurcOrderItem', function($resource) {
+		return $resource('sale/orders/items', {}, {
+			reply: {
+				url: 'sale/orders/items/reply',
+				method: 'POST'
+			}
+		});
+	});
+});

+ 113 - 117
src/main/webapp/resources/tpl/index/sale/order.html

@@ -1,35 +1,4 @@
-<div ng-controller="SaleOrderCtrl">
-	<div class="condition block">
-		<div class="state-wrap">
-			<ul class="list-unstyled list-inline">
-				<li class="first"><a href="#"><span>所有订单</span></a></li>
-				<li class="active"><a href="#"><span>待回复</span><em
-						class="tm-h">6</em></a></li>
-				<li><a href="#"><span>待发货</span><em class="tm-h">0</em></a></li>
-				<li><a href="#"><span>退货中</span><em class="tm-h">0</em></a></li>
-			</ul>
-		</div>
-	</div>
-	<table ng-table="tableParams"
-		class="table table-bordered table-striped">
-		<tr ng-repeat="order in $data">
-			<td width="20" style="text-align: center"
-				header="'ng-table/headers/checkbox.html'"><input
-				type="checkbox" ng-model="checkboxes.items[order.id]" /></td>
-			<td data-title="'编号'" sortable="'code'">{{order.code}}</td>
-			<td data-title="'日期'" width="120">{{order.date | date:
-				"yyyy-MM-dd"}}</td>
-			<td data-title="'类型'" width="80">{{order.type}}</td>
-			<td data-title="'客户名称'" width="230">{{order.customer.name}}</td>
-			<td data-title="'交货日期'" width="120" sortable="'delivery'">{{order.delivery
-				| date: "yyyy-MM-dd"}}</td>
-			<td data-title="'状态'" width="50">{{order.status}}</td>
-		</tr>
-	</table>
-	<script type="text/ng-template" id="ng-table/headers/checkbox.html">
-		<input type="checkbox" ng-model="checkboxes.checked" id="select_all" name="filter-checkbox" value="" />
-	</script>
-	<style>
+<style>
 .order-table .header>th {
 	height: 38px;
 	text-align: center;
@@ -49,6 +18,7 @@
 
 .toolbar label {
 	margin-right: 10px;
+	margin-bottom: 0;
 }
 
 .toolbar .select_all {
@@ -66,7 +36,6 @@
 
 .order-table .order-hd {
 	background: #f5f5f5;
-	border-bottom: 1px solid #f5f5f5;
 	height: 40px;
 	line-height: 40px;
 }
@@ -84,21 +53,64 @@
 	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: #ccc;
+}
+
+.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{
+.order-table .order-bd td {
 	padding: 10px 5px;
-	overflow: hidden;
 	vertical-align: top;
 }
 
 .order-table .order-bd .product {
 	padding-left: 20px;
 }
+
+.dropdown.item-reply:hover>.dropdown-toggle {
+	border: none;
+}
+
+.dropdown.item-reply:hover>.dropdown-menu {
+	top: 0;
+	right: 100%;
+}
 </style>
-	<table class="order-table block">
+<div ng-controller="SaleOrderCtrl" class="block">
+	<div class="loading in">
+		<i></i>
+	</div>
+	<div class="condition block">
+		<div class="state-wrap">
+			<ul class="list-unstyled list-inline">
+				<li class="first"><a href="#"><span>所有订单</span></a></li>
+				<li class="active"><a href="#"><span>待回复</span><em
+						class="tm-h">6</em></a></li>
+				<li><a href="#"><span>待发货</span><em class="tm-h">0</em></a></li>
+				<li><a href="#"><span>退货中</span><em class="tm-h">0</em></a></li>
+			</ul>
+		</div>
+	</div>
+	<table class="order-table block" ng-table="tableParams">
 		<thead>
 			<tr class="header">
 				<th>商品</th>
@@ -106,117 +118,101 @@
 				<th>数量</th>
 				<th>交货日期</th>
 				<th>回复状态</th>
+				<th>操作</th>
 			</tr>
 			<tr class="sep-row">
-				<td colspan="5"></td>
+				<td colspan="6"></td>
 			</tr>
 			<tr class="toolbar toolbar-top">
-				<td colspan="5">
-					<div class="operates">
+				<td colspan="6">
+					<div>
 						<label><input type="checkbox" class="selector select_all">全选</label>
 						<a href="javascript:void(0)" class="btn btn-default btn-xs">批量回复</a>
 					</div> <!-- 分页 -->
 				</td>
 			</tr>
-		</thead>
-		<tbody>
 			<tr class="sep-row">
-				<td colspan="5"></td>
+				<td colspan="6"></td>
 			</tr>
+		</thead>
+		<tbody ng-repeat="order in $data">
 			<tr class="order-hd">
 				<td class="first">
 					<div class="order-main">
 						<span> <input type="checkbox" class="selector">
-						</span> <span class="text-num text-bold" title="2015-01-11 20:26">2015-01-11</span>
-						<span>订单号:<em class="text-num">933264676769308</em></span>
+						</span> <span class="text-num text-bold" title="{{order.date}}"
+							ng-bind="order.date"></span> <span>订单号:<a class="text-num"
+							ng-bind="order.code" href="#"></a></span>
 					</div>
 				</td>
-				<td class="column" colspan="3"><a href="#">中国移动官方旗舰店</a></td>
-				<td colspan="1"></td>
-			</tr>
-			<tr class="order-bd">
-				<td class="product">
-					<div class="text-num text-bold">
-						<a href="#"> 1.0125301S.T015</a>
-					</div>
-					<div>
-						<a href="#"> 广东移动 </a>
-					</div>
-					<div class="text-muted" title="">手机 话费充值 50元
-						快充直充 24小时自动充即时到账</div>
-				</td>
-				<td class="text-center text-num" title="49.50">49.50</td>
-				<td class="text-center text-num" title="1">1</td>
-				<td class="text-center text-num br-l">2015-03-01</td>
-				<td class="text-center br-l"><div>数量完成48%</div>
-					<div>交期未达标</div></td>
-			</tr>
-			<tr class="order-bd">
-				<td class="product">
-					<div class="text-num text-bold">
-						<a href="#"> 1.0125301S.T015</a>
-					</div>
-					<div>
-						<a href="#"> 广东移动 </a>
-					</div>
-					<div class="text-muted" title="">手机 话费充值 50元
-						快充直充 24小时自动充即时到账</div>
+				<td colspan="3"><a href="#" ng-bind="order.enterprise.enName"></a></td>
+				<td colspan="1" class="order-sum">{{order.currency}}: <span
+					ng-bind="getOrderTotal(order.orderItems) | number : 2"
+					class="text-num text-bold"></span>
 				</td>
-				<td class="text-center text-num" title="49.50">49.50</td>
-				<td class="text-center text-num" title="1">1</td>
-				<td class="text-center text-num br-l">2015-03-01</td>
-				<td class="text-center br-l"><div>数量完成48%</div>
-					<div>交期未达标</div></td>
-			</tr>
-		</tbody>
-		<tbody>
-			<tr class="sep-row">
-				<td colspan="5"></td>
-			</tr>
-			<tr class="order-hd">
-				<td class="first">
-					<div class="order-main">
-						<span> <input type="checkbox" class="selector">
-						</span> <span class="text-num text-bold" title="2015-01-11 20:26">2015-01-11</span>
-						<span>订单号:<em class="text-num">933264676769308</em></span>
+				<td colspan="1" class="text-center">
+					<div class="operates">
+						<a href="#" class="text-muted" title="打印"><i
+							class="fa fa-print fa-lg"></i></a>
 					</div>
 				</td>
-				<td class="column" colspan="3"><a href="#">中国移动官方旗舰店</a></td>
-				<td colspan="1"></td>
 			</tr>
-			<tr class="order-bd">
+			<tr class="order-bd" ng-repeat="item in order.orderItems">
 				<td class="product">
 					<div class="text-num text-bold">
-						<a href="#"> 1.0125301S.T015</a>
+						<a href="#" ng-bind="item.product.code"></a>
 					</div>
 					<div>
-						<a href="#"> 广东移动 </a>
+						<a href="#" ng-bind="item.product.title"></a>
 					</div>
-					<div class="text-muted" title="">手机 话费充值 50元
-						快充直充 24小时自动充即时到账</div>
+					<div class="text-muted" title="{{item.product.spec}}"
+						ng-bind="item.product.spec"></div>
 				</td>
-				<td class="text-center text-num" title="49.50">49.50</td>
-				<td class="text-center text-num" title="1">1</td>
-				<td class="text-center text-num br-l">2015-03-01</td>
-				<td class="text-center br-l"><div>数量完成48%</div>
-					<div>交期未达标</div></td>
-			</tr>
-			<tr class="order-bd">
-				<td class="product">
-					<div class="text-num text-bold">
-						<a href="#"> 1.0125301S.T015</a>
-					</div>
-					<div>
-						<a href="#"> 广东移动 </a>
-					</div>
-					<div class="text-muted" title="">手机 话费充值 50元
-						快充直充 24小时自动充即时到账</div>
+				<td class="text-center text-num" title="{{item.price}}"
+					ng-bind="item.price"></td>
+				<td class="text-center">
+					<div class="text-num" title="{{item.qty}}" ng-bind="item.qty"></div>
+					<div class="text-muted" ng-bind="item.product.unit"></div>
 				</td>
-				<td class="text-center text-num" title="49.50">49.50</td>
-				<td class="text-center text-num" title="1">1</td>
-				<td class="text-center text-num br-l">2015-03-01</td>
+				<td class="text-center text-num br-l" ng-bind="item.delivery"></td>
 				<td class="text-center br-l"><div>数量完成48%</div>
 					<div>交期未达标</div></td>
+				<td class="text-center br-l dropdown item-reply"><a href="#"
+					class="dropdown-toggle">回复</a>
+					<div class="dropdown-menu dropdown-menu-right"
+						style="padding: 15px 15px 5px 15px; width: 250px;">
+						<form class="form-horizontal" ng-submit="reply(item)"
+							name="myform" novalidate>
+							<div class="form-group">
+								<label class="col-sm-3 control-label">数量</label>
+								<div class="col-sm-9">
+									<input type="text" class="form-control input-sm"
+										ng-model="item.reply.qty" name="qty"
+										placeholder="{{item.qty-item.replyQty}}" required>
+								</div>
+							</div>
+							<div class="form-group">
+								<label class="col-sm-3 control-label">交期</label>
+								<div class="col-sm-9">
+									<input type="date" class="form-control input-sm"
+										ng-model="item.reply.delivery" name="delivery"
+										placeholder="item.delivery" required>
+								</div>
+							</div>
+							<div class="form-group">
+								<label class="col-sm-3 control-label">回复备注</label>
+								<div class="col-sm-9">
+									<textarea type="date" class="form-control input-sm"
+										ng-model="item.reply.remark" name="remark" required></textarea>
+								</div>
+							</div>
+							<div class="form-group">
+								<div class="col-sm-offset-3 col-sm-9">
+									<button class="btn btn-info btn-sm btn-block" type="submit">确认</button>
+								</div>
+							</div>
+						</form>
+					</div></td>
 			</tr>
 		</tbody>
 	</table>