yangc преди 7 години
родител
ревизия
df95e165c4

+ 5 - 0
src/main/webapp/resources/js/common/query/releaseProInfo.js

@@ -17,6 +17,11 @@ define([ 'ngResource' ], function() {
 				url: 'release/product/batchRelease',
 				method: 'POST',
 			},
+			// 批量发布PCB产品
+			batchReleasePcb: {
+				url: 'release/product/batchRelease/pcb',
+				method: 'POST',
+			},
             // 批量上架个人产品
             batchReleasePerson: {
                 url: 'release/product/batchRelease/person',

+ 37 - 26
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_upload_ctrl.js

@@ -323,36 +323,47 @@ define([ 'app/app' ], function(app) {
             }
         };
 
+        var afterPublish = function () {
+            $modal.open({
+                animation : true,
+                templateUrl : 'static/view/common/modal/product_upload_modal.html',
+                controller : 'rule_tip_ctrl',
+                resolve : {
+                    type : function() {
+                        return 'upload';
+                    },
+                    tipModal : function() {
+                        return true;
+                    },
+                    success : function () {
+                        return $scope.needShowTip;
+                    },
+                    uuid: function () {
+                        return $scope.storeUuid;
+                    }
+                }
+            });
+            $scope.relTableParams.page(1);
+            $scope.relTableParams.reload();
+            $scope.result.success = 0;//设置成0,让前端用户不能点击
+            $scope.hadImport = true; //上架后隐藏提示语
+        }
         //批量发布
         $scope.publish = function(event) {
             if ($scope.pageParams.totalElements > 0) {
-                ReleaseProductByBatch.batchRelease({batch : $scope.result.batch}, null, function(data) {
-                    $modal.open({
-                        animation : true,
-                        templateUrl : 'static/view/common/modal/product_upload_modal.html',
-                        controller : 'rule_tip_ctrl',
-                        resolve : {
-                            type : function() {
-                                return 'upload';
-                            },
-                            tipModal : function() {
-                                return true;
-                            },
-                            success : function () {
-                                return $scope.needShowTip;
-                            },
-                            uuid: function () {
-                                return $scope.storeUuid;
-                            }
-                        }
+                if ($rootScope.isPcbStore) {
+                    ReleaseProductByBatch.batchReleasePcb({batch : $scope.result.batch}, null, function(data) {
+                        afterPublish();
+                    }, function(res) {
+                        toaster.pop("error", "发布失败", res.data);
                     });
-                    $scope.relTableParams.page(1);
-                    $scope.relTableParams.reload();
-                    $scope.result.success = 0;//设置成0,让前端用户不能点击
-                    $scope.hadImport = true; //上架后隐藏提示语
-                }, function(res) {
-                    toaster.pop("error", "发布失败", res.data);
-                });
+                } else {
+                    ReleaseProductByBatch.batchRelease({batch : $scope.result.batch}, null, function(data) {
+                        afterPublish();
+                    }, function(res) {
+                        toaster.pop("error", "发布失败", res.data);
+                    });
+                }
             } else {
                 event.stopPropagation();//阻止冒泡事件
                 event.preventDefault();//阻止默认的事件。