Browse Source

认定单增加根据日期筛选以及根据筛选结果导出

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@1251 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
shenj 10 years ago
parent
commit
a9c3866c5b
1 changed files with 18 additions and 6 deletions
  1. 18 6
      src/main/webapp/resources/js/index/app.js

+ 18 - 6
src/main/webapp/resources/js/index/app.js

@@ -664,7 +664,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 			condition.dateFrom = date;
 			condition.dateTo = new Date();
 		} else {
-			date.setMonth(date.getMonth() - 6)
+			date.setMonth(date.getMonth() - 6);
 			condition.dateFrom = null;
 			condition.dateTo = date;
 		}
@@ -2093,15 +2093,12 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		$scope.dateZoneText = '一个月内';
 		$scope.condition = {dateZone: 1};
 		$scope.currency = Symbol.currency;//将币别转化为对应的符号
-		$scope.changeAgreed = function(agreed) {
-			$scope.condition.agreed = agreed;
-			$scope.agreedText = typeof agreed == 'undefined' ? '全部' : (agreed == 1 ? '已同意' : '不同意');
-			$scope.condition.$agreedOpen = false;
-		};
 		$scope.changeDateZone = function(zone) {
 			$scope.condition.dateZone = zone;
 			$scope.dateZoneText = typeof zone == 'undefined' ? '半年前' : (zone == 1 ? '一个月内' : '半年内');
 			$scope.condition.$dateZoneOpen = false;
+			getDateCondition(zone, $scope.condition);
+			$scope.tableParams.reload();
 		};
 		$scope.setActive = function(state) {
 			if($scope.active != state) {
@@ -2129,12 +2126,16 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 				$scope.loading = true;
 				var pageParams = params.url();
 				pageParams.keyword = $scope.keyword;
+				pageParams.fromDate = $scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null;
+				pageParams.endDate = $scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null;
 				getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
 					$scope.loading = false;
 					if(page) {
 						params.total(page.totalElements);
 						$defer.resolve(page.content);
 						$scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
+						$scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
+						$scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
 					}
 				}, function(response){
 					$scope.loading = false;
@@ -2149,12 +2150,23 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		    item[openParam] = !item[openParam];
 		};
 		
+		$scope.parseDate = function(dateStr) {
+			if(dateStr)
+				return Date.parse(dateStr, 'yyyy-MM-dd');
+			return new Date();
+		};
+		
 		// 搜索框回车
 		$scope.onSearch = function() {
 			$scope.tableParams.page(1);
 			$scope.tableParams.reload();
 		};
 		
+		// 选择查找日期
+		$scope.onDateCondition = function(){
+			$scope.tableParams.page(1);
+			$scope.tableParams.reload();
+		};
 	}]);
 	
 	/**