|
|
@@ -1,6 +1,6 @@
|
|
|
define([ 'app/app' ], function(app) {
|
|
|
'use strict';
|
|
|
- app.register.controller('vendor_materialCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', 'DistributionRule', function ($scope, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService, DistributionRule) {
|
|
|
+ app.register.controller('vendor_materialCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', 'DistributionRule', '$modal', function ($scope, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService, DistributionRule, $modal) {
|
|
|
$rootScope.active = 'vendor_material';
|
|
|
document.title = '卖家产品库-优软商城';
|
|
|
$scope.tab = 'material';
|
|
|
@@ -155,7 +155,7 @@ define([ 'app/app' ], function(app) {
|
|
|
};
|
|
|
|
|
|
var initRuleCount = function () {
|
|
|
- DistributionRule.findCountOfActiveRule({},{},function (data) {
|
|
|
+ return DistributionRule.findCountOfActiveRule({},{},function (data) {
|
|
|
if (data.success){
|
|
|
$scope.needShowTip = data.data;
|
|
|
}
|
|
|
@@ -165,6 +165,23 @@ define([ 'app/app' ], function(app) {
|
|
|
};
|
|
|
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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
//获取选中之后的信息
|
|
|
$scope.getChoosedInfo = function () {
|
|
|
angular.forEach($scope.currenctMaterial, function (material) {
|
|
|
@@ -522,10 +539,18 @@ define([ 'app/app' ], function(app) {
|
|
|
if (!validateGoods($scope.goods)) return ;
|
|
|
|
|
|
if ($scope.needShowTip) {
|
|
|
- $scope.showNoRuleTip = true;
|
|
|
+ $modal.open({
|
|
|
+ animation : true,
|
|
|
+ templateUrl : 'static/view/common/modal/delivery_rule_modal.html',
|
|
|
+ controller : 'rule_tip_ctrl',
|
|
|
+ resolve : {
|
|
|
+ center : function() {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
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) {
|