|
|
@@ -1,6 +1,6 @@
|
|
|
define([ 'app/app' ], function(app) {
|
|
|
'use strict';
|
|
|
- app.register.controller('vendor_materialCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', function ($scope, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService) {
|
|
|
+ app.register.controller('vendor_materialCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', 'DistributionRule', function ($scope, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService, DistributionRule) {
|
|
|
$rootScope.active = 'vendor_material';
|
|
|
document.title = '卖家产品库-优软商城';
|
|
|
$scope.tab = 'material';
|
|
|
@@ -154,6 +154,17 @@ define([ 'app/app' ], function(app) {
|
|
|
checkChoosedAll();
|
|
|
};
|
|
|
|
|
|
+ var initRuleCount = function () {
|
|
|
+ DistributionRule.findCountOfActiveRule({},{},function (data) {
|
|
|
+ if (data.success){
|
|
|
+ $scope.needShowTip = data.data;
|
|
|
+ }
|
|
|
+ }, function (error) {
|
|
|
+ toaster.pop("error", error.data);
|
|
|
+ })
|
|
|
+ };
|
|
|
+ initRuleCount();
|
|
|
+
|
|
|
//获取选中之后的信息
|
|
|
$scope.getChoosedInfo = function () {
|
|
|
angular.forEach($scope.currenctMaterial, function (material) {
|
|
|
@@ -510,8 +521,11 @@ define([ 'app/app' ], function(app) {
|
|
|
function publishGoods(product) {
|
|
|
if (!validateGoods($scope.goods)) return ;
|
|
|
|
|
|
- console.log('product', product);
|
|
|
- console.log($scope.goods);
|
|
|
+ if ($scope.needShowTip) {
|
|
|
+ $scope.showNoRuleTip = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
$scope.goods.breakUp = 1 === $scope.goods.breakUp;
|
|
|
$scope.isSelfSupport = 1 === $scope.goods.isSelfSupport;
|
|
|
Material.newStockByStandardProduct({ id: product.id, isSelfSupport: $scope.isSelfSupport}, $scope.goods, function (result) {
|
|
|
@@ -526,6 +540,10 @@ define([ 'app/app' ], function(app) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ $scope.cancelDelete = function () {
|
|
|
+ $scope.showNoRuleTip = false;
|
|
|
+ };
|
|
|
+
|
|
|
/**
|
|
|
* 验证商品信息
|
|
|
*
|