|
|
@@ -163,24 +163,6 @@ define([ 'app/app' ], function(app) {
|
|
|
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;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
|
|
|
//获取选中之后的信息
|
|
|
$scope.getChoosedInfo = function () {
|
|
|
@@ -538,37 +520,39 @@ define([ 'app/app' ], function(app) {
|
|
|
function publishGoods(product) {
|
|
|
if (!validateGoods($scope.goods)) return ;
|
|
|
|
|
|
- if ($scope.needShowTip) {
|
|
|
- $modal.open({
|
|
|
- animation : true,
|
|
|
- templateUrl : 'static/view/common/modal/delivery_rule_modal.html',
|
|
|
- controller : 'rule_tip_ctrl',
|
|
|
- resolve : {
|
|
|
- center : function() {
|
|
|
- return false;
|
|
|
- }
|
|
|
+ $q.all([initRuleCount().$promise]).then(function (data) {
|
|
|
+ if (data){
|
|
|
+ if ($scope.needShowTip){
|
|
|
+ $modal.open({
|
|
|
+ templateUrl: 'static/view/common/modal/delivery_rule_modal.html',
|
|
|
+ controller: 'rule_tip_ctrl',
|
|
|
+ resolve : {
|
|
|
+ type : function() {
|
|
|
+ return 'product';
|
|
|
+ },
|
|
|
+ tipModal : function() {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return ;
|
|
|
}
|
|
|
- });
|
|
|
- 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) {
|
|
|
- if (result.success) {
|
|
|
- toaster.pop('success', '商品上架成功');
|
|
|
- closeShelArea(product);
|
|
|
- } else {
|
|
|
- toaster.pop('error', result.message);
|
|
|
+ $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) {
|
|
|
+ if (result.success) {
|
|
|
+ toaster.pop('success', '商品上架成功');
|
|
|
+ closeShelArea(product);
|
|
|
+ } else {
|
|
|
+ toaster.pop('error', result.message);
|
|
|
+ }
|
|
|
+ }, function (error) {
|
|
|
+ toaster.pop('error', error.data);
|
|
|
+ });
|
|
|
}
|
|
|
- }, function (error) {
|
|
|
- toaster.pop('error', error.data);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- $scope.cancelDelete = function () {
|
|
|
- $scope.showNoRuleTip = false;
|
|
|
- };
|
|
|
-
|
|
|
/**
|
|
|
* 验证商品信息
|
|
|
*
|