Browse Source

处理tab切换时异常,

wangcz 7 years ago
parent
commit
a4f7d67249

+ 7 - 4
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -178,6 +178,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
                   $scope.toogleBomTab($scope.bomTab);
                   $scope.toogleBomTab($scope.bomTab);
               }
               }
             $scope.toogleTab = function (tab) {
             $scope.toogleTab = function (tab) {
+                $scope.currentSeek = {};
               $scope.vendorType = 'self'
               $scope.vendorType = 'self'
                 $scope.tab = tab;
                 $scope.tab = tab;
               $scope.seekPurchaseTableParams = new ngTableParams({
               $scope.seekPurchaseTableParams = new ngTableParams({
@@ -699,10 +700,12 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
               if (isDisabled) {
               if (isDisabled) {
                   return;
                   return;
               }
               }
-              $scope.isInit = true;
-              $scope.goodsCount = 0;
-              $scope.offerCount = 0;
-              $scope.replaceOfferCount = 0;
+              if (seek.id != $scope.currentSeek.id) {
+                  $scope.isInit = true;
+                  $scope.goodsCount = 0;
+                  $scope.offerCount = 0;
+                  $scope.replaceOfferCount = 0;
+              }
             $scope.currentSeek = seek;
             $scope.currentSeek = seek;
               if (!seek.$status || seek.$status != 1) {
               if (!seek.$status || seek.$status != 1) {
                   seekPurchase.getMallGoodsList({code:seek.cmpCode, brand: seek.inbrand}, function (data) {
                   seekPurchase.getMallGoodsList({code:seek.cmpCode, brand: seek.inbrand}, function (data) {