Преглед изворни кода

更新财务对账功能,点击“筛选单据”时,如果没有选择客户,则提示“请先选择客户!!”并且焦点自动在客户输入框中

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@7220 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq пре 9 година
родитељ
комит
a67a28a5e6
1 измењених фајлова са 13 додато и 11 уклоњено
  1. 13 11
      src/main/webapp/resources/js/index/app.js

+ 13 - 11
src/main/webapp/resources/js/index/app.js

@@ -4757,10 +4757,6 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 				$scope.checkboxes.checked = false;
 				item.$selected = false;
 			});
-//			if($scope.suuorname == '') {
-//				toaster.pop('info','提示', '请先输入客户');
-//				document.getElementById('suuorname').focus();//光标默认在客户
-//			}
 			$scope.totalMoney = 0;
 			$scope.condition.uuorname = $scope.suuorname;
 			$scope.condition.factory = $scope.factory
@@ -4783,6 +4779,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 //			$scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
 //			$scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
 			if($scope.condition.dateFrom != null || $scope.condition.dateTo != null || $scope.keywordXls != null) {
+				
 				$scope.fromDate =$scope.condition.dateFrom ?  $scope.condition.dateFrom.getTime() : null;
 				$scope.endDate = $scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null;
 				$scope.keywordXls = angular.copy(($scope.condition.uuorname == null ? "" : $scope.condition.uuorname)
@@ -4790,17 +4787,22 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 						+ "|"+ ($scope.condition.factory == null ? "" : $scope.condition.factory)
 						+ "|"+ ($scope.condition.prodTitle == null ? "" : $scope.condition.prodTitle)
 						+ "|"+ ($scope.condition.prodSpec == null ? "" : $scope.condition.prodSpec));//保存当前取值的关键词
-				FaApCheck.getAllByKeywords({fromDate: $scope.fromDate, endDate: $scope.endDate, keyword:$scope.keywordXls}, function(data) {
-					$scope.data = data;
-					angular.forEach($scope.data, function(item) {
+				if($scope.suuorname == '') {
+					toaster.pop('info','提示', '请先选择客户');
+					document.getElementById('suuorname').focus();//光标默认在客户
+				} else {
+					FaApCheck.getAllByKeywords({fromDate: $scope.fromDate, endDate: $scope.endDate, keyword:$scope.keywordXls}, function(data) {
+						$scope.data = data;
+						angular.forEach($scope.data, function(item) {
 							item:{
 								$selected:true;
 							}
 						});
-					$scope.loading = false;
-				}, function(response) {
-					toaster.pop('error', '提示', response.data);
-				});
+						$scope.loading = false;
+					}, function(response) {
+						toaster.pop('error', '提示', response.data);
+					});
+				}
 			}
 			
 		}