Browse Source

买卖家订单-筛选的时候订单数量不要随之改变3

wangdy 8 years ago
parent
commit
5acafd8d41

+ 3 - 4
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_order_ctrl.js

@@ -155,10 +155,10 @@ define(['app/app'], function (app) {
 				$scope.reload();
 			}
 		};
-        $scope.isSearch = false;
+
 		var loadData = function() {
 			Order.getIndividualOrder($scope.param, function(data) {
-				if ($scope.isSearch == false){
+                if (!$scope.startDate && !$scope.endDate && !$scope.keyword){
                     $scope.AllOrderInfo = data;
                     if($scope.childStatus ==''){
                         $scope.AllOrderInfo[$scope.status] = data.totalElements;
@@ -417,8 +417,7 @@ define(['app/app'], function (app) {
 			$scope.param.page = 1;
 			$scope.param.status = getState();
 			$scope.param.keyword = $scope.keyword;
-			$scope.isSearch = true;
-
+            $scope.setChildStatus('','订单状态')
 			loadData();
 			//getCounts();
 		};

+ 23 - 20
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js

@@ -401,10 +401,12 @@ define(['app/app'], function (app) {
 
         // 获取各种状态订单的数量信息
         var getCounts = function () {
-            Purchase.getAllStatusCounts({storeType: $scope.storeType}, function (data) {
-                $scope.counts = angular.copy(data);
-                $scope.counts[$scope.status] = $scope.pageParams.totalElements;
-            });
+            if (!$scope.startDate && !$scope.endDate && !$scope.keyword){
+                Purchase.getAllStatusCounts({storeType: $scope.storeType}, function (data) {
+                    $scope.counts = angular.copy(data);
+                    $scope.counts[$scope.status] = $scope.pageParams.totalElements;
+                });
+            }
         };
         getCounts();
 
@@ -494,7 +496,6 @@ define(['app/app'], function (app) {
             $scope.orderTableParams.reload();
         };
 
-        $scope.isSearch = false;
 
         $scope.orderTableParams = new ngTableParams($scope.tableParams, {
             total: 0,
@@ -525,23 +526,25 @@ define(['app/app'], function (app) {
 
                 Purchase.getByStatusAndInternal(param, function (page) {
                     if (page) {
-                        if ($scope.childStatus =='' && $scope.isSearch == false){
-                            if (page.content) {
-                                angular.forEach(page, function (value, key) {
-                                    if (key == 'all' || key == 'tobeconfirmed' || key == 'comfirmed' || key == 'inbound'
-                                        || key == 'tobepaid' || key == 'completed' || key == 'unavailable' || key == 'toBeReviewed') {
-                                        if(!$scope.counts) {
-                                            $scope.counts = {};
+                        if (!$scope.startDate && !$scope.endDate && !$scope.keyword) {
+                            if ($scope.childStatus == '') {
+                                if (page.content) {
+                                    angular.forEach(page, function (value, key) {
+                                        if (key == 'all' || key == 'tobeconfirmed' || key == 'comfirmed' || key == 'inbound'
+                                            || key == 'tobepaid' || key == 'completed' || key == 'unavailable' || key == 'toBeReviewed') {
+                                            if (!$scope.counts) {
+                                                $scope.counts = {};
+                                            }
+                                            $scope.counts[key] = value;
                                         }
-                                        $scope.counts[key] = value;
-                                    }
-                                    $scope.counts[$scope.status] = page.totalElements;
-                                });
-                            } else {
-                                $scope.counts = {};
+                                        $scope.counts[$scope.status] = page.totalElements;
+                                    });
+                                } else {
+                                    $scope.counts = {};
+                                }
                             }
                         }
-                        $scope.isSearch = false;
+
                         $scope.purchases = page.content;
                         $scope.requestOver = 0;
                         angular.forEach($scope.purchases, function (order) {
@@ -804,7 +807,7 @@ define(['app/app'], function (app) {
                 $scope.endDate = null;
                 return;
             }
-            $scope.isSearch = true;
+            $scope.setChildStatus('','订单状态');
             $scope.orderTableParams.page(1);
             $scope.orderTableParams.reload();
         };