|
|
@@ -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();//阻止默认的事件。
|