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

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

wangdy пре 8 година
родитељ
комит
bd0adf72aa

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

@@ -158,10 +158,13 @@ define(['app/app'], function (app) {
 
 		var loadData = function() {
 			Order.getIndividualOrder($scope.param, function(data) {
-				$scope.AllOrderInfo = data;
-                if($scope.childStatus ==''){
-                    $scope.AllOrderInfo[$scope.status] = data.totalElements;
-                }
+				if ($scope.isSearch){
+                    $scope.AllOrderInfo = data;
+                    if($scope.childStatus ==''){
+                        $scope.AllOrderInfo[$scope.status] = data.totalElements;
+                    }
+				}
+                $scope.isSearch = false;
 				$scope.currenctOrders = data.content;
 				angular.forEach($scope.currenctOrders, function(data){
                     data.ensurePrice = Number(NumberService.toCeil(data.ensurePrice, 2));
@@ -414,6 +417,7 @@ define(['app/app'], function (app) {
 			$scope.param.page = 1;
 			$scope.param.status = getState();
 			$scope.param.keyword = $scope.keyword;
+			$scope.isSearch = true;
 
 			loadData();
 			getCounts();

+ 3 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js

@@ -523,7 +523,7 @@ define(['app/app'], function (app) {
 
                 Purchase.getByStatusAndInternal(param, function (page) {
                     if (page) {
-                        if ($scope.childStatus ==''){
+                        if ($scope.childStatus =='' && $scope.isSearch){
                             if (page.content) {
                                 angular.forEach(page, function (value, key) {
                                     if (key == 'all' || key == 'tobeconfirmed' || key == 'comfirmed' || key == 'inbound'
@@ -539,6 +539,7 @@ define(['app/app'], function (app) {
                                 $scope.counts = {};
                             }
                         }
+                        $scope.isSearch = false;
                         $scope.purchases = page.content;
                         $scope.requestOver = 0;
                         angular.forEach($scope.purchases, function (order) {
@@ -801,6 +802,7 @@ define(['app/app'], function (app) {
                 $scope.endDate = null;
                 return;
             }
+            $scope.isSearch = true;
             $scope.orderTableParams.page(1);
             $scope.orderTableParams.reload();
         };