Jelajahi Sumber

采购验退单详情

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@9397 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 8 tahun lalu
induk
melakukan
d016e30052

+ 14 - 0
src/main/java/com/uas/platform/b2b/model/PurchaseReturn.java

@@ -11,7 +11,9 @@ import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
+import javax.persistence.JoinColumn;
 import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
 import javax.persistence.OrderBy;
 import javax.persistence.SequenceGenerator;
 import javax.persistence.Table;
@@ -55,6 +57,10 @@ public class PurchaseReturn implements Serializable {
 	@Column(name = "pr_enuu")
 	private Long enUU;
 
+	@OneToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE })
+	@JoinColumn(name = "pr_enuu", insertable = false, updatable = false)
+	private Enterprise custEnterprise;
+
 	/**
 	 * 送货单号
 	 */
@@ -273,4 +279,12 @@ public class PurchaseReturn implements Serializable {
 		this.erpId = erpId;
 	}
 
+	public Enterprise getCustEnterprise() {
+		return custEnterprise;
+	}
+
+	public void setCustEnterprise(Enterprise custEnterprise) {
+		this.custEnterprise = custEnterprise;
+	}
+
 }

+ 14 - 0
src/main/webapp/resources/js/index/app.js

@@ -6517,6 +6517,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		if($stateParams.id) {
 			PurcAccept.getDetail({id: $stateParams.id}, {}, function(data) {
 				$scope.accept= data;
+				if($scope.accept.acceptItems != null) {
+					var sum = 0;
+					angular.forEach($scope.accept.acceptItems, function(item) {
+						sum += item.orderPrice * item.qty;
+					});
+					$scope.totalPrice = sum;
+				}
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
 			});
@@ -6612,6 +6619,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		if($stateParams.id != null) {
 			PurcReturn.getDetail({id: $stateParams.id}, {}, function(data) {
 				$scope.returns = data;
+				if($scope.returns.returnItems != null) {
+					var sum = 0;
+					angular.forEach($scope.returns.returnItems, function(item) {
+						sum += item.orderPrice * item.qty;
+					});
+					$scope.totalPrice = sum;
+				}
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
 			});

+ 5 - 5
src/main/webapp/resources/tpl/index/sale/accept_detail.html

@@ -65,7 +65,7 @@
 			</div>
 			<div class="col-xs-6">
 				<div class="title">金额:</div>
-				<div class="unchanged-info">{{accept.price}}</div>
+				<div class="unchanged-info">{{totalPrice| number: 6}}</div>
 			</div>
 		</div>
 		<div class="row row-sm item">
@@ -102,7 +102,7 @@
 							</div>
 						</td>
 						<td width="180">
-							<div ng-bind="::acceptitem.orderItem.order.code"></div>
+							<a ng-bind="::acceptitem.orderItem.order.code" ui-sref="sale.order_detail({id:acceptitem.orderItem.order.id})"></a>
 						</td>
 						<td class="text-center" width="180">
 							<div><span ng-bind="::acceptitem.orderItem.product.title"></span><span ng-bind="::acceptitem.orderItem.product.cmpcode"></span></div>
@@ -114,12 +114,12 @@
 							<div ng-bind="::acceptitem.orderItem.product.unit"></div>
 						</td>
 						<td class="text-center" width="60">
-							<div ng-bind="::acceptitem.orderItem.price"></div>
+							<div ng-bind="::acceptitem.orderPrice"></div>
 						<td class="text-center" width="80">
-							<div ng-bind="::acceptitem.orderItem.acceptQty"></div>
+							<div ng-bind="::acceptitem.qty"></div>
 						</td>
 						<td class="text-center" width="80">
-							<div>{{acceptitem.orderItem.acceptQty*acceptitem.orderItem.price | number: 6}}</div>
+							<div>{{acceptitem.qty * acceptitem.orderPrice | number: 6}}</div>
 						</td>
 						<td class="text-center" width="120">
 							<div ng-bind="::acceptitem.batchCode"></div>

+ 5 - 5
src/main/webapp/resources/tpl/index/sale/return_detail.html

@@ -35,7 +35,7 @@
             </div>
             <div class="col-xs-6">
                 <span class="title">客户名称:</span>
-                <div class="content" ng-bind="::returns.receivename"></div>
+                <div class="content" ng-bind="::returns.custEnterprise.enName"></div>
             </div>
         </div>
         <div class="row row-sm item">
@@ -65,7 +65,7 @@
             </div>
             <div class="col-xs-6">
                 <div class="title">金额:</div>
-                <div class="unchanged-info"></div>
+                <div class="unchanged-info" ng-bind="::totalPrice| number: 6"></div>
             </div>
         </div>
         <div class="row row-sm item">
@@ -101,9 +101,9 @@
                     <td width="180" class="text-center"><span ng-bind="::returnitem.product.title"></span></td>
                     <td width="100" class="text-center"><span ng-bind="::returnitem.product.brand"></span></td>
                     <td width="50" class="text-center"><span ng-bind="::returnitem.product.unit"></span></td>
-                    <td width="60" class="text-center"><span ng-bind="::returnitem.orderItem.price"></span></td>
-                    <td width="80" class="text-center"><span ng-bind="::returnitem.acceptQty"></span></td>
-                    <td width="80" class="text-center">{{returnitem.acceptQty*returnitem.orderItem.price| number: 6}}</td>
+                    <td width="60" class="text-center"><span ng-bind="::returnitem.orderPrice"></span></td>
+                    <td width="80" class="text-center"><span ng-bind="::returnitem.qty"></span></td>
+                    <td width="80" class="text-center">{{returnitem.qty * returnitem.orderPrice| number: 6}}</td>
                     <td width="120" class="text-center"><span ng-bind="::returnitem.batchCode"></span></td>
                 </tr>
                 </tbody>