|
|
@@ -183,8 +183,8 @@ define([ 'app/app' ], function(app) {
|
|
|
/**
|
|
|
* 审核通过模态框控制器
|
|
|
*/
|
|
|
- app.register.controller('auditRegulpicpassController', ['$scope', '$modalInstance', 'toaster', 'Commodity', 'Search','item', 'StoreAdminListInformation',
|
|
|
- function ($scope, $modalInstance, toaster, Commodity, Search, item, StoreAdminListInformation) {
|
|
|
+ app.register.controller('auditRegulpicpassController', ['$scope', '$modalInstance', 'toaster', 'Commodity', 'Search','item', 'StoreAdminListInformation', 'Kind',
|
|
|
+ function ($scope, $modalInstance, toaster, Commodity, Search, item, StoreAdminListInformation, Kind) {
|
|
|
|
|
|
$scope.kindPojo = {
|
|
|
first: '请选择一级类目',
|
|
|
@@ -199,7 +199,8 @@ define([ 'app/app' ], function(app) {
|
|
|
$scope.item = item;
|
|
|
$scope.keyword = item.brand ? item.brand.nameEn : '';
|
|
|
$scope.kindId = item.kind ? item.kind.nameCn : '';
|
|
|
- /**
|
|
|
+ $scope.FisrtkindInfo = []
|
|
|
+ /**
|
|
|
* 品牌联想词
|
|
|
*/
|
|
|
$scope.onBrandChange = function(name) {
|
|
|
@@ -217,11 +218,19 @@ define([ 'app/app' ], function(app) {
|
|
|
/**
|
|
|
* 品牌联想词失去焦点
|
|
|
*/
|
|
|
+ var _Ch = false
|
|
|
$scope.onBrandBlur = function(name) {
|
|
|
- if (name === '') {
|
|
|
- $scope.BrandList = []
|
|
|
- return false
|
|
|
- }
|
|
|
+ setTimeout(function() {
|
|
|
+ if (name !== '') {
|
|
|
+ if (!_Ch) {
|
|
|
+ $scope.keyword = ''
|
|
|
+ angular.element('#brannameid').val('')
|
|
|
+ angular.element('.listUl').hide()
|
|
|
+ $scope.BrandList = []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _Ch = false
|
|
|
+ }, 250)
|
|
|
}
|
|
|
/**
|
|
|
* 保存不通过原因
|
|
|
@@ -237,21 +246,19 @@ define([ 'app/app' ], function(app) {
|
|
|
toaster.pop('error', '商城一级类目未选择');
|
|
|
return;
|
|
|
}
|
|
|
- if ($scope.kindPojo.second === ''
|
|
|
- && $scope.kindInfo[$scope.kindPojo.first].children) {
|
|
|
+ if ($scope.kindPojo.second === '请选择二级类目' && $scope.TwokindInfo.length > 0) {
|
|
|
toaster.pop('error', '商城二级类目未选择');
|
|
|
return;
|
|
|
}
|
|
|
- if ($scope.kindPojo.third === ''
|
|
|
- && $scope.kindInfo[$scope.kindPojo.first].children[$scope.kindPojo.second].children) {
|
|
|
+ if ($scope.kindPojo.third === '请选择三级类目' && $scope.ThreekindInfo.length > 0) {
|
|
|
toaster.pop('error', '商城三级类目未选择');
|
|
|
return;
|
|
|
}
|
|
|
- if ($scope.kindPojo.third !== '') {
|
|
|
+ if ($scope.kindPojo.third !== '请选择三级类目') {
|
|
|
info = $scope.kindPojo.third
|
|
|
- } else if ($scope.kindPojo.second !== '') {
|
|
|
+ } else if ($scope.kindPojo.second !== '请选择二级类目') {
|
|
|
info = $scope.kindPojo.second
|
|
|
- } else if ($scope.kindPojo.first !== '') {
|
|
|
+ } else if ($scope.kindPojo.first !== '请选择一级类目') {
|
|
|
info = $scope.kindPojo.first
|
|
|
}
|
|
|
$scope.item.kindId = info.id
|
|
|
@@ -273,6 +280,7 @@ define([ 'app/app' ], function(app) {
|
|
|
$scope.setBrand = function(item, id) {
|
|
|
$scope.keyword = item
|
|
|
$scope.brandId = id
|
|
|
+ _Ch = true
|
|
|
$scope.BrandList = []
|
|
|
}
|
|
|
|
|
|
@@ -284,12 +292,28 @@ define([ 'app/app' ], function(app) {
|
|
|
}
|
|
|
|
|
|
var initKindDataInfo = function () {
|
|
|
- Commodity.getAllKindInfo({}, function (data) {
|
|
|
- $scope.kindInfo = data[0].children;
|
|
|
+ Kind.Getparentid({parentid: 0}, function (data) {
|
|
|
+ $scope.FisrtkindInfo = data.data
|
|
|
})
|
|
|
};
|
|
|
initKindDataInfo();
|
|
|
|
|
|
+ $scope.ChooseFirstItem = function() {
|
|
|
+ $scope.kindPojo.second = '请选择二级类目'
|
|
|
+ $scope.kindPojo.third = '请选择三级类目'
|
|
|
+ $scope.ThreekindInfo = []
|
|
|
+ Kind.Getparentid({parentid: $scope.kindPojo.first}, function (data) {
|
|
|
+ $scope.TwokindInfo = data.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ $scope.ChooseTwoItem = function() {
|
|
|
+ $scope.kindPojo.third = '请选择三级类目'
|
|
|
+ Kind.Getparentid({parentid: $scope.kindPojo.second}, function (data) {
|
|
|
+ $scope.ThreekindInfo = data.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取品牌联想词
|
|
|
*
|
|
|
@@ -340,5 +364,6 @@ define([ 'app/app' ], function(app) {
|
|
|
function dismiss() {
|
|
|
$modalInstance.dismiss();
|
|
|
}
|
|
|
+
|
|
|
}])
|
|
|
});
|