|
@@ -121,6 +121,7 @@ define(['app/app'], function(app) {
|
|
|
// 获取企业信息
|
|
// 获取企业信息
|
|
|
Enterprise.getEnterpriseInfo({enuu : $scope.userInfo.enterprise.uu}, function(data) {
|
|
Enterprise.getEnterpriseInfo({enuu : $scope.userInfo.enterprise.uu}, function(data) {
|
|
|
$scope.enterpriseInfo = data;
|
|
$scope.enterpriseInfo = data;
|
|
|
|
|
+ $scope.enBusinessScope = $scope.enterpriseInfo.enBusinessScope ? angular.copy($scope.enterpriseInfo.enBusinessScope).split(',') : [];
|
|
|
$scope.enterpriseInfoBackup = angular.copy($scope.enterpriseInfo);
|
|
$scope.enterpriseInfoBackup = angular.copy($scope.enterpriseInfo);
|
|
|
$scope.enAdminuu = $scope.enterpriseInfo.enAdminuu;
|
|
$scope.enAdminuu = $scope.enterpriseInfo.enAdminuu;
|
|
|
User.getUserByUU({uu: $scope.enAdminuu}, {}, function(data){
|
|
User.getUserByUU({uu: $scope.enAdminuu}, {}, function(data){
|
|
@@ -129,7 +130,7 @@ define(['app/app'], function(app) {
|
|
|
}, function(){
|
|
}, function(){
|
|
|
toaster.pop('error', '获取管理员信息失败');
|
|
toaster.pop('error', '获取管理员信息失败');
|
|
|
});
|
|
});
|
|
|
- },function(response) {
|
|
|
|
|
|
|
+ },function() {
|
|
|
toaster.pop('error', '获取企业信息失败');
|
|
toaster.pop('error', '获取企业信息失败');
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -351,10 +352,88 @@ define(['app/app'], function(app) {
|
|
|
return flag;
|
|
return flag;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 获取行业信息
|
|
|
|
|
+ $http.get('static/data/profession.json').success(function (data) {
|
|
|
|
|
+ $scope.list = data;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 选择行业
|
|
|
|
|
+ $scope.profession = new Array();
|
|
|
|
|
+ $scope.showProfession = false;
|
|
|
|
|
+ $scope.selectProfession = function () {
|
|
|
|
|
+ $scope.professionArray = [];
|
|
|
|
|
+ $scope.active = [];
|
|
|
|
|
+ $scope.showProfession = !$scope.showProfession;
|
|
|
|
|
+ $scope.profession[0] = $scope.list;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.isInList = false;
|
|
|
|
|
+ $scope.isInInput = false;
|
|
|
|
|
+ $scope.hideList = function () {
|
|
|
|
|
+ if (!$scope.isInList && !$scope.isInInput && $scope.showProfession) {
|
|
|
|
|
+ $scope.showProfession = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.enterInput = function () {
|
|
|
|
|
+ $scope.isInInput = true;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.leaveInput = function () {
|
|
|
|
|
+ $scope.isInInput = false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.enterList = function () {
|
|
|
|
|
+ $scope.isInList = true;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.leaveList = function () {
|
|
|
|
|
+ $scope.isInList = false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 行业子菜单点击
|
|
|
|
|
+ $scope.onItemClick = function (key, index, value) {
|
|
|
|
|
+ $scope.active[index] = key;
|
|
|
|
|
+ if (angular.isString(value)){ // 值为字符串说明点击的是最后一级
|
|
|
|
|
+ $scope.enterpriseInfo.enIndustry = value;
|
|
|
|
|
+ $scope.showProfession = false;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ $scope.professionArray = [];
|
|
|
|
|
+ $scope.profession.splice(index+1);
|
|
|
|
|
+ if (angular.isArray(value)){ // 值为数组说明下一级是最后一级
|
|
|
|
|
+ $scope.professionArray = value;
|
|
|
|
|
+ } else if (angular.isObject(value)) {
|
|
|
|
|
+ $scope.profession[index+1] = value;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 判断值是否为字符串
|
|
|
|
|
+ $scope.isString = function (value) {
|
|
|
|
|
+ return angular.isString(value);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 增加经营范围内容标签
|
|
|
|
|
+ $scope._scope = $scope
|
|
|
|
|
+ $scope.addBusinessScope = function () {
|
|
|
|
|
+ if(!$scope.businessScope) return false;
|
|
|
|
|
+ if($scope.enBusinessScope.length > 20) {
|
|
|
|
|
+ toaster.pop('error', '经营范围内容标签不能超过20个!');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ $scope.enBusinessScope.push($scope.businessScope);
|
|
|
|
|
+ $scope.businessScope = '';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 删除选择的内容标签
|
|
|
|
|
+ $scope.clearBusinessScope = function (key) {
|
|
|
|
|
+ $scope.enBusinessScope.splice(key, 1);
|
|
|
|
|
+ }
|
|
|
/**
|
|
/**
|
|
|
* 保存企业信息
|
|
* 保存企业信息
|
|
|
*/
|
|
*/
|
|
|
$scope.saveUpdate = function () {
|
|
$scope.saveUpdate = function () {
|
|
|
|
|
+ $scope.enterpriseInfo.enBusinessScope = $scope.enBusinessScope.join(',');
|
|
|
// 先检查信息是否为空
|
|
// 先检查信息是否为空
|
|
|
if (angular.equals($scope.enterpriseInfo,
|
|
if (angular.equals($scope.enterpriseInfo,
|
|
|
$scope.enterpriseInfoBackup)) {
|
|
$scope.enterpriseInfoBackup)) {
|
|
@@ -367,6 +446,7 @@ define(['app/app'], function(app) {
|
|
|
toaster.pop('error', '请补充完信息后再次提交');
|
|
toaster.pop('error', '请补充完信息后再次提交');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
Enterprise.updateEnterpriseInfo(
|
|
Enterprise.updateEnterpriseInfo(
|
|
|
{enuu: $scope.userInfo.enterprise.uu}, $scope.enterpriseInfo,
|
|
{enuu: $scope.userInfo.enterprise.uu}, $scope.enterpriseInfo,
|
|
|
function () {
|
|
function () {
|