Browse Source

后台接收的数据传到前端,增加非空的判断。

yujia 8 years ago
parent
commit
1b598f8305

+ 12 - 7
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js

@@ -210,7 +210,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
          * 获取批量上架的配置信息
          */
         UASBatchPutOnPropertyServices.get(null, function (data) {
-            if (data) {
+            if (data && typeof data.fluctuateRate != 'undefined') {
                 $scope.uasBatchPutOnProperty = data;
                 $scope.uasBatchPutOnProperty.editFluctuateRate = NumberService.mul($scope.uasBatchPutOnProperty.fluctuateRate, 100) || 100;
                 $scope.uasBatchPutOnProperty.editMaxDelivery = $scope.uasBatchPutOnProperty.maxDelivery || 1;
@@ -1405,12 +1405,17 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
                         }
                         for(var i = 0; i < $scope.currenctMaterial.length; i++) {
                             if($scope.currenctMaterial[i].id == response.id) {
-                                $scope.currenctMaterial.splice(i, 1, response);
-                                if(response.batchCount > 0) {
-                                    $scope.expandGoods($scope.currenctMaterial[i]);
-                                }else {
-                                    $scope.currenctMaterial[i].exPandOper = false;
-                                }
+								if (!$scope.currenctMaterial[i].batchCount) {
+									$scope.currenctMaterial[i].batchCount = 1;
+								} else {
+									$scope.currenctMaterial[i].batchCount++;
+								}
+                                // if(response.batchCount > 0) {
+                                //     $scope.expandGoods($scope.currenctMaterial[i]);
+                                // }else {
+                                //     $scope.currenctMaterial[i].exPandOper = false;
+                                // }
+								$scope.expandGoods($scope.currenctMaterial[i]);
                             }
                         }
                     }, function (response) {