|
|
@@ -30,12 +30,16 @@ define([ 'app/app' ], function(app) {
|
|
|
loadData();
|
|
|
|
|
|
$scope.weight = function(brand){
|
|
|
- ComponentActive.setSimpleInfoWeight({weight: brand.inputWeight}, brand, function(data){
|
|
|
- toaster.pop('success', '处理成功', '【' + data[0].code + '】' + '禁用成功');
|
|
|
- loadData();
|
|
|
- }, function(res){
|
|
|
- toaster.pop('error', '错误', res.data);
|
|
|
- })
|
|
|
+ if (angular.isDefined(brand.inputWeight)) {
|
|
|
+ ComponentActive.setSimpleInfoWeight({weight: brand.inputWeight}, brand, function(data){
|
|
|
+ toaster.pop('success', '处理成功', '【' + data[0].code + '】' + '禁用成功');
|
|
|
+ loadData();
|
|
|
+ }, function(res){
|
|
|
+ toaster.pop('error', '错误', res.data);
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ toaster.pop('warning', '请先在右侧输入权重值');
|
|
|
+ }
|
|
|
};
|
|
|
$scope.disweight = function(brand){
|
|
|
ComponentActive.setSimpleInfoWeight({weight: 0}, brand, function(data){
|
|
|
@@ -50,12 +54,16 @@ define([ 'app/app' ], function(app) {
|
|
|
})
|
|
|
};
|
|
|
$scope.updateweight = function(brand){
|
|
|
- ComponentActive.setSimpleInfoWeight({weight: brand.inputWeight}, brand, function(data){
|
|
|
- toaster.pop('success', '处理成功', '【' + data.code + '】' + '已修改推广');
|
|
|
- $scope.load('weight');
|
|
|
- }, function(res){
|
|
|
- toaster.pop('error', '错误', res.data);
|
|
|
- })
|
|
|
+ if (angular.isDefined(brand.inputWeight)) {
|
|
|
+ ComponentActive.setSimpleInfoWeight({weight: brand.inputWeight}, brand, function(data){
|
|
|
+ toaster.pop('success', '处理成功', '【' + data.code + '】' + '已修改推广');
|
|
|
+ $scope.load('weight');
|
|
|
+ }, function(res){
|
|
|
+ toaster.pop('error', '错误', res.data);
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ toaster.pop('warning', '请先在右侧输入权重值');
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
$scope.searchComponent = function(keyword){
|