|
|
@@ -1,6 +1,6 @@
|
|
|
define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
'use strict';
|
|
|
- app.register.controller('vendor_materialCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', '$location', '$stateParams', 'Search', '$modal', 'ComponentActiveAPI', 'BrandSubmit', 'BrandActiveAPI', 'DistributionRule', 'prodRepositoryService', 'AuthenticationService', 'StoreInfo', 'ProductServiceQuery', 'StoreCms', 'ByteCountService', function ($scope, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService, $location, $stateParams, Search, $modal, ComponentActiveAPI, BrandSubmit, BrandActiveAPI, DistributionRule, prodRepositoryService, AuthenticationService, StoreInfo, ProductServiceQuery, StoreCms, ByteCountService) {
|
|
|
+ app.register.controller('vendor_materialCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', '$location', '$stateParams', 'Search', '$modal', 'ComponentActiveAPI', 'BrandSubmit', 'BrandActiveAPI', 'DistributionRule', 'prodRepositoryService', 'AuthenticationService', 'StoreInfo', 'ProductServiceQuery', 'StoreCms', 'ByteCountService', 'Goods', function ($scope, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService, $location, $stateParams, Search, $modal, ComponentActiveAPI, BrandSubmit, BrandActiveAPI, DistributionRule, prodRepositoryService, AuthenticationService, StoreInfo, ProductServiceQuery, StoreCms, ByteCountService, Goods) {
|
|
|
$rootScope.active = 'vendor_material';
|
|
|
document.title = '卖家产品库-优软商城';
|
|
|
$scope.tab = 'material';
|
|
|
@@ -54,19 +54,6 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
// $scope.param.sorting = {code : 'ASC'};
|
|
|
$scope.isBatch = false;
|
|
|
}
|
|
|
- /**
|
|
|
- * 最大
|
|
|
- * @type {number}
|
|
|
- */
|
|
|
- $scope.maxReserve = 999999999;
|
|
|
- /**
|
|
|
- * 最小包装量的最大值
|
|
|
- */
|
|
|
- $scope.maxPackQty = 999999;
|
|
|
- $scope.minReserve = 1;
|
|
|
-
|
|
|
- //只包含中文和英文的字符
|
|
|
- var pattern = /^[\u4e00-\u9fa5a-zA-Z]+$/;
|
|
|
|
|
|
$scope.sortByERP = 'none';
|
|
|
$scope.sortByERPReserve = function () {
|
|
|
@@ -89,19 +76,6 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
// $scope.param.sorting = {code : 'ASC'};
|
|
|
$scope.isBatch = false;
|
|
|
}
|
|
|
- /**
|
|
|
- * 最大
|
|
|
- * @type {number}
|
|
|
- */
|
|
|
- $scope.maxReserve = 999999999;
|
|
|
- /**
|
|
|
- * 最小包装量的最大值
|
|
|
- */
|
|
|
- $scope.maxPackQty = 999999;
|
|
|
- $scope.minReserve = 1;
|
|
|
-
|
|
|
- //只包含中文和英文的字符
|
|
|
- var pattern = /^[\u4e00-\u9fa5a-zA-Z]+$/;
|
|
|
|
|
|
$scope.goods = { breakUp: 1, isSelfSupport: 1, prices: [{}] };
|
|
|
$scope.isSelfSupport = true;
|
|
|
@@ -157,7 +131,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
}).error(function(response) {
|
|
|
toaster.pop('info', '获取定单的信息' + response);
|
|
|
});
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
//判断是否是商城管理公司,是否可以选择自营。
|
|
|
$q.all([getAuthentication()]).then(function() {
|
|
|
@@ -310,35 +284,35 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
|
|
|
// 确认删除
|
|
|
$scope.confirmDelete = function (ids) {
|
|
|
- if($scope.isChoosedAll) {
|
|
|
- if($scope.standard_tab == 'standard') {
|
|
|
+ if ($scope.isChoosedAll) {
|
|
|
+ if ($scope.standard_tab == 'standard') {
|
|
|
Material.deleteStandardAll(null, null, function (data) {
|
|
|
$scope.deleteDiv = false;
|
|
|
loadDataReload();
|
|
|
- if(data.code != 1) {
|
|
|
+ if (data.code != 1) {
|
|
|
toaster.pop('error', data.message);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
toaster.pop('success', data.message);
|
|
|
}
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '批量删除信息失败');
|
|
|
});
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
Material.deleteUnstandardAll(null, null, function (data) {
|
|
|
$scope.deleteDiv = false;
|
|
|
loadDataReload();
|
|
|
- if(data.code != 1) {
|
|
|
+ if (data.code != 1) {
|
|
|
toaster.pop('error', data.message);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
toaster.pop('success', data.message);
|
|
|
}
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '批量删除信息失败');
|
|
|
});
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
var ids = $scope.choosedIds.join(',');
|
|
|
- Material.deleteBatch({ids : ids}, function (data) {
|
|
|
+ Material.deleteBatch({ids: ids}, function (data) {
|
|
|
toaster.pop('success', '删除成功');
|
|
|
$scope.choosedIds = [];
|
|
|
$scope.deleteDiv = false;
|
|
|
@@ -349,6 +323,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
$scope.deleteDiv = false;
|
|
|
});
|
|
|
}
|
|
|
+ };
|
|
|
|
|
|
/**
|
|
|
* 对自定义的标签说明做隐藏或显示
|
|
|
@@ -1481,7 +1456,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
// 保存物料详细信息
|
|
|
$scope.saveDetail = function(material) {
|
|
|
@@ -1493,7 +1468,6 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
|
|
|
toaster.pop('error', response.data);
|
|
|
})
|
|
|
};
|
|
|
- };
|
|
|
|
|
|
$scope.fitBrandToProduct = function (product) {
|
|
|
if (product.selectBrandId){
|