|
|
@@ -20872,12 +20872,15 @@
|
|
|
// 批量转入我的产品库
|
|
|
$scope.addtoUserByCheck = function() {
|
|
|
var ids = angular.toJson($rootScope.ids);
|
|
|
- if(ids.length <= 2) {
|
|
|
- toaster.pop('error', '提示', '请先选择物料');
|
|
|
+ if($rootScope.ids.length == 0) {
|
|
|
+ toaster.pop('error', '提示', '请先选择产品');
|
|
|
} else {
|
|
|
ids = ids.replace(/\[|]/g,'');
|
|
|
prodUser.coverToUserByIds({ids: ids}, {}, function(data) {
|
|
|
- toaster.pop('success', '提示', '成功转入' + data.count + '个物料');
|
|
|
+ toaster.pop('success', '提示', '选择' + $rootScope.ids.length + '个产品,成功转入' + data.count + '个产品');
|
|
|
+ $rootScope.ids = [];
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
}, function(res) {
|
|
|
toaster.pop('error', '提示', '转入失败');
|
|
|
});
|
|
|
@@ -22490,13 +22493,18 @@
|
|
|
// 批量删除
|
|
|
$scope.deleteByBatch = function() {
|
|
|
var ids = angular.toJson($rootScope.ids);
|
|
|
- prodUser.deleteByBatch({ids: ids}, {}, function(data) {
|
|
|
- toaster.pop('success', '提示', '成功删除' + $rootScope.ids.length + '个物料');
|
|
|
- $scope.tableParams.page(1);
|
|
|
- $scope.tableParams.reload();
|
|
|
- }, function(res) {
|
|
|
- toaster.pop('error', '提示', '删除失败');
|
|
|
- });
|
|
|
+ if($rootScope.ids.length > 0) {
|
|
|
+ prodUser.deleteByBatch({ids: ids}, {}, function(data) {
|
|
|
+ toaster.pop('success', '提示', '成功移除' + $rootScope.ids.length + '个产品');
|
|
|
+ $rootScope.ids = [];
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ }, function(res) {
|
|
|
+ toaster.pop('error', '提示', '移除失败');
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ toaster.pop('error', '提示', '请先选择产品');
|
|
|
+ }
|
|
|
}
|
|
|
}]);
|
|
|
|