|
|
@@ -1999,6 +1999,12 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// 集体
|
|
|
case 'teams':
|
|
|
fn = 'getTeams';break;
|
|
|
+ // 非标准
|
|
|
+ case 'nonstandard':
|
|
|
+ fn = 'getNonstandard';break;
|
|
|
+ // 标准
|
|
|
+ case 'standard':
|
|
|
+ fn = 'getStandard';break;
|
|
|
}
|
|
|
return fn;
|
|
|
};
|
|
|
@@ -9855,57 +9861,55 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
|
|
|
$scope.updateByBatch = function(updatetype) {
|
|
|
- angular.forEach($scope.tableParams.data, function(product) { // 单选全部时,全选选中
|
|
|
- if (product.checked) {
|
|
|
- products.push(product);
|
|
|
- }
|
|
|
- });
|
|
|
- if(products.length == 0) {
|
|
|
- toaster.pop('warning', '提示', '请至少选择一个产品');
|
|
|
- } else {
|
|
|
- var modalInstance = $modal.open({
|
|
|
- templateUrl: 'static/tpl/index/baseInfo/modal/updateByBatch_modal.html',
|
|
|
- controller: 'UpdateByBatchCtrl',
|
|
|
- size: 'lg',
|
|
|
- resolve: {
|
|
|
- products: function() {
|
|
|
- return products;
|
|
|
- },
|
|
|
- updatetype: function() {
|
|
|
- return updatetype;
|
|
|
- }
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ templateUrl: 'static/tpl/index/baseInfo/modal/updateByBatch_modal.html',
|
|
|
+ controller: 'UpdateByBatchCtrl',
|
|
|
+ size: 'lg',
|
|
|
+ resolve: {
|
|
|
+ updatetype: function() {
|
|
|
+ return updatetype;
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ modalInstance.result.then(function(data) {
|
|
|
+ toaster.pop('success', '提示', data.data);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ }, function(){
|
|
|
|
|
|
- modalInstance.result.then(function(data) {
|
|
|
- toaster.pop('success', '提示', data.data);
|
|
|
- $scope.tableParams.reload();
|
|
|
- }, function(){
|
|
|
-
|
|
|
- });
|
|
|
- }
|
|
|
+ });
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
/**
|
|
|
* 批量修改
|
|
|
*/
|
|
|
- app.controller('UpdateByBatchCtrl', ['$scope', '$modalInstance', 'toaster', 'BaseService', 'updatetype', 'products', 'Products', function($scope, $modalInstance, toaster, BaseService, updatetype, products, Products) {
|
|
|
+ app.controller('UpdateByBatchCtrl', ['$scope', '$modalInstance', 'toaster', 'BaseService', 'updatetype', 'Products', function($scope, $modalInstance, toaster, BaseService, updatetype, Products) {
|
|
|
$scope.updatetype = updatetype;
|
|
|
- $scope.products = products;
|
|
|
$scope.changed = false;
|
|
|
- $scope.ensure = function(keyword) {
|
|
|
- $scope.keyword = keyword;
|
|
|
- $scope.changed = true;
|
|
|
- }
|
|
|
- $scope.returnUpdate = function() {
|
|
|
- $scope.changed = false;
|
|
|
- }
|
|
|
$scope.cancel = function() {
|
|
|
$modalInstance.dismiss();
|
|
|
}
|
|
|
+ if(updatetype === '品牌')
|
|
|
+ var loadData = function() {
|
|
|
+ Products.getBrands({}, function(data) {
|
|
|
+ $scope.products = data;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(updatetype === '名称(类目)')
|
|
|
+ var loadData = function() {
|
|
|
+ Products.getTitles({}, function(data) {
|
|
|
+ $scope.products = data;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ loadData();
|
|
|
+
|
|
|
$scope.okay = function() {
|
|
|
- Products.updateByBatch({updatetype: updatetype, keyword: $scope.keyword}, $scope.products, function(data) {
|
|
|
+ Products.alterByBatch({oldvalue: $scope.oldvalue, newvalue: $scope.newvalue, updatetype: updatetype}, {}, function(data) {
|
|
|
$modalInstance.close(data);
|
|
|
}, function(response) {
|
|
|
toaster.pop('error', '提示', response.data);
|
|
|
@@ -15527,35 +15531,23 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
|
|
|
$scope.updateByBatch = function(updatetype) {
|
|
|
- angular.forEach($scope.tableParams.data, function(product) { // 单选全部时,全选选中
|
|
|
- if (product.checked) {
|
|
|
- products.push(product);
|
|
|
- }
|
|
|
- });
|
|
|
- if(products.length == 0) {
|
|
|
- toaster.pop('warning', '提示', '请至少选择一个物料');
|
|
|
- } else {
|
|
|
- var modalInstance = $modal.open({
|
|
|
- templateUrl: 'static/tpl/index/baseInfo/modal/updateByBatch_modal.html',
|
|
|
- controller: 'UpdateByBatchCtrl',
|
|
|
- size: 'lg',
|
|
|
- resolve: {
|
|
|
- products: function() {
|
|
|
- return products;
|
|
|
- },
|
|
|
- updatetype: function() {
|
|
|
- return updatetype;
|
|
|
- }
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ templateUrl: 'static/tpl/index/baseInfo/modal/updateByBatch_modal.html',
|
|
|
+ controller: 'UpdateByBatchCtrl',
|
|
|
+ size: 'lg',
|
|
|
+ resolve: {
|
|
|
+ updatetype: function() {
|
|
|
+ return updatetype;
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ modalInstance.result.then(function(data) {
|
|
|
+ toaster.pop('success', '提示', data.data);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ }, function(){
|
|
|
|
|
|
- modalInstance.result.then(function(data) {
|
|
|
- toaster.pop('success', '提示', data.data);
|
|
|
- $scope.tableParams.reload();
|
|
|
- }, function(){
|
|
|
-
|
|
|
- });
|
|
|
- }
|
|
|
+ });
|
|
|
}
|
|
|
}]);
|
|
|
|