Browse Source

新增采购单更换供应商时给出提示

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@7684 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
6b2a28f8cb

+ 22 - 16
src/main/webapp/resources/js/index/app.js

@@ -8052,6 +8052,20 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 				},
 		};
 		
+		//商品信息
+		$scope.order.orderItems = [];
+		var item = {
+				code: null,
+				title: null,
+				spec: null,
+				unit: null,
+				qty: null, 
+				price: null,
+				remark: null, 
+				delivery: null,
+				id: null,
+				};
+		
 		// 获取供应商列表
 		cartOperation.vendorInfo({}, function(data) {
 		});
@@ -8078,7 +8092,9 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 				controller: 'DbfindVendorInfoCtrl',
 				size: 'lg',
 				resolve: {
-					
+					orderItems: function() {
+						return $scope.order.orderItems;
+						}
 				}
 			});
 			
@@ -8110,20 +8126,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		};
 		
 	
-		
-		//商品信息
-		$scope.order.orderItems = [];
-		var item = {
-				code: null,
-				title: null,
-				spec: null,
-				unit: null,
-				qty: null, 
-				price: null,
-				remark: null, 
-				delivery: null,
-				id: null,
-				};
 //		$scope.order.orderItems.push(item);
 		if($rootScope.prodId) {
 			VendorInfo.getProdInfo({id: $rootScope.prodId}, {}, function(data) {
@@ -8334,7 +8336,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	}]);
 	
 	// 查找供应商
-	app.controller('DbfindVendorInfoCtrl', ['$scope', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', 'Vendor', '$rootScope', function($scope, BaseService, ngTableParams, toaster, $modalInstance, Vendor, $rootScope){
+	app.controller('DbfindVendorInfoCtrl', ['$scope', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', 'Vendor', '$rootScope', 'orderItems', function($scope, BaseService, ngTableParams, toaster, $modalInstance, Vendor, $rootScope, orderItems){
+		$scope.prod = false;
+		if(orderItems.length != 0) {
+			$scope.prod  = true;
+		}
 		BaseService.scrollBackToTop();
 		if($rootScope.venduu != null) {
 			$scope.venduu = $rootScope.venduu;

+ 6 - 6
src/main/webapp/resources/tpl/index/purc/modal/purc_order_vendor.html

@@ -38,18 +38,18 @@
 				<td class="text-center" ng-bind="::vendor.vendorEnterprise.uu"></td>
 				<td class="text-center" ng-bind="::vendor.vendorEnterprise.enName"></td>
 				<td class="text-center" ng-bind="::vendor.vendorEnterprise.enAddress"></td>
-				<td class="text-center" ng-if="venduu != null && vendor.vendorEnterprise.uu!=venduu"><a title="选择" href="javascript:void(0)" ng-click="check(vendor)" style="text-decoration: none;">选择</a></td>
+				<td class="text-center" ng-if="prod && vendor.vendorEnterprise.uu!=venduu"><a title="选择" href="javascript:void(0)" ng-click="check(vendor)" style="text-decoration: none;">选择</a></td>
 				<td class="text-center" ng-if="vendor.vendorEnterprise.uu==venduu"><a style="text-decoration: none;">已选择</a></td>
-				<td class="text-center" ng-if="venduu == null"><a title="选择" href="javascript:void(0)" ng-click="checkVendor(vendor)" style="text-decoration: none;">选择</a></td>
+				<td class="text-center" ng-if="!prod && vendor.vendorEnterprise.uu!=venduu"><a title="选择" href="javascript:void(0)" ng-click="checkVendor(vendor)" style="text-decoration: none;">选择</a></td>
 			</tr>
 		</tbody>
 	</table>
 </div>
 <div class="modal-footer">
-	<div class="pull-left" ng-if="ensure && venduu!=null">
-		<span style="color: red; font-size: 14px;">已选择供应商,确定更换?</span>
+	<div class="pull-left" ng-if="ensure && prod">
+		<span style="color: red; font-size: 14px;">重新选择供应商将会清掉已经选择的产品信息,请确认是否执行?</span>
 		<br>
 	</div>
-	<button class="btn btn-success" ng-if="ensure && venduu!=null" ng-click="checkVendor(vendorInfo)">确定</button>
-	<button class="btn btn-danger" ng-click="cancel()" type="button">取消</button>
+	<button class="btn btn-success btn-sm" ng-if="ensure && prod" ng-click="checkVendor(vendorInfo)">确定</button>
+	<button class="btn btn-danger btn-sm" ng-click="cancel()" type="button">取消</button>
 </div>