|
@@ -90,6 +90,17 @@ define([ 'app/app' ], function(app) {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ var initRuleCount = function () {
|
|
|
|
|
+ return DistributionRule.findCountOfActiveRule({},{},function (data) {
|
|
|
|
|
+ if (data.success){
|
|
|
|
|
+ $scope.needShowTip = data.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ }, function (error) {
|
|
|
|
|
+ toaster.pop("error", error.data);
|
|
|
|
|
+ })
|
|
|
|
|
+ };
|
|
|
|
|
+ initRuleCount();
|
|
|
|
|
+
|
|
|
// 查看范例
|
|
// 查看范例
|
|
|
$scope.showImg = function() {
|
|
$scope.showImg = function() {
|
|
|
var src = '';
|
|
var src = '';
|
|
@@ -159,34 +170,6 @@ define([ 'app/app' ], function(app) {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- var initRuleCount = function () {
|
|
|
|
|
- return DistributionRule.findCountOfActiveRule({},{},function (data) {
|
|
|
|
|
- if (data.success){
|
|
|
|
|
- $scope.needShowTip = data.data;
|
|
|
|
|
- }
|
|
|
|
|
- }, function (error) {
|
|
|
|
|
- toaster.pop("error", error.data);
|
|
|
|
|
- })
|
|
|
|
|
- };
|
|
|
|
|
- initRuleCount();
|
|
|
|
|
-
|
|
|
|
|
- $q.all([initRuleCount().$promise]).then(function (data) {
|
|
|
|
|
- if (data){
|
|
|
|
|
- if ($scope.needShowTip){
|
|
|
|
|
- $modal.open({
|
|
|
|
|
- animation: true,
|
|
|
|
|
- templateUrl: 'static/view/common/modal/delivery_rule_modal.html',
|
|
|
|
|
- controller: 'rule_tip_ctrl',
|
|
|
|
|
- resolve : {
|
|
|
|
|
- center : function() {
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
// 上传Excel批量发布(大量)
|
|
// 上传Excel批量发布(大量)
|
|
|
$scope.upload = function() {
|
|
$scope.upload = function() {
|
|
|
if(($scope.batch.myFiles == null) || ($scope.batch.myFiles.length == 0)) {
|
|
if(($scope.batch.myFiles == null) || ($scope.batch.myFiles.length == 0)) {
|
|
@@ -263,6 +246,25 @@ define([ 'app/app' ], function(app) {
|
|
|
$scope.publish = function(event) {
|
|
$scope.publish = function(event) {
|
|
|
if ($scope.pageParams.totalElements > 0) {
|
|
if ($scope.pageParams.totalElements > 0) {
|
|
|
ReleaseProductByBatch.batchRelease({batch : $scope.result.batch}, null, function(data) {
|
|
ReleaseProductByBatch.batchRelease({batch : $scope.result.batch}, null, function(data) {
|
|
|
|
|
+ if ($scope.needShowTip){
|
|
|
|
|
+ $scope.relTableParams.page(1);
|
|
|
|
|
+ $scope.relTableParams.reload();
|
|
|
|
|
+ $scope.result.success = 0;//设置成0,让前端用户不能点击
|
|
|
|
|
+ $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;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return ;
|
|
|
|
|
+ }
|
|
|
toaster.pop("success", "提示", "发布成功 :" + data.data + "条");
|
|
toaster.pop("success", "提示", "发布成功 :" + data.data + "条");
|
|
|
$scope.relTableParams.page(1);
|
|
$scope.relTableParams.page(1);
|
|
|
$scope.relTableParams.reload();
|
|
$scope.relTableParams.reload();
|
|
@@ -330,4 +332,5 @@ define([ 'app/app' ], function(app) {
|
|
|
$modalInstance.dismiss();
|
|
$modalInstance.dismiss();
|
|
|
};
|
|
};
|
|
|
}]);
|
|
}]);
|
|
|
|
|
+
|
|
|
});
|
|
});
|