|
|
@@ -50,41 +50,51 @@ define(['app/app', 'jquery-uploadify'], function (app) {
|
|
|
*/
|
|
|
function activate() {
|
|
|
// 获取企业信息
|
|
|
- var enterprise = $rootScope.userInfo.enterprise;
|
|
|
- Enterprise.getEnterpriseInfo({ enuu : enterprise.uu}, {}, function (enterprise) {
|
|
|
- $scope.enterprise = enterprise || {};
|
|
|
-
|
|
|
- StoreInfo.findLastUnPassApplyByEnuu({}, {}, function (result) {
|
|
|
- console.log('UN_PASS_APPLY', result);
|
|
|
- if (result) {
|
|
|
- switchTab(result.type);
|
|
|
- if (result.qualifications) {
|
|
|
- angular.forEach(result.qualifications, function (qualification) {
|
|
|
- $scope.qualifications[qualification.type] = qualification;
|
|
|
- });
|
|
|
- }else {
|
|
|
- Enterprise.getEnterpriseDetailInfo({ enuu : enterprise.uu},{},function (enterpriseDetail) {
|
|
|
- $scope.enBuinesssCode = enterpriseDetail.businessCodeImage;
|
|
|
- $scope.qualifications[$scope.qType.businessLicense] = generateQualification($scope.enBuinesssCode, $scope.qType.businessLicense);;
|
|
|
- });
|
|
|
- }
|
|
|
- if (result.brands) {
|
|
|
- $scope.brands = [];
|
|
|
- angular.forEach(result.brands, function (brand) {
|
|
|
- var newBrand = {};
|
|
|
- newBrand.name = brand.name;
|
|
|
- newBrand.url = brand.url;
|
|
|
- $scope.brands.push(newBrand);
|
|
|
- });
|
|
|
- }
|
|
|
- $scope.reason = result.reason;
|
|
|
+ AuthenticationService.getAuthentication().success(function (data) {
|
|
|
+ angular.forEach(data.enterprises, function (item) {
|
|
|
+ if (item.current) {
|
|
|
+ data.enterprise = item;
|
|
|
}
|
|
|
- }, function (error) {
|
|
|
- console.log('INITIAL_ERROR', error);
|
|
|
});
|
|
|
- }, function () {
|
|
|
- toaster.pop('error', '获取企业信息失败');
|
|
|
- });
|
|
|
+ $rootScope.userInfo = data;
|
|
|
+ var enterprise = $rootScope.userInfo.enterprise;
|
|
|
+ Enterprise.getEnterpriseInfo({ enuu : enterprise.uu}, {}, function (enterprise) {
|
|
|
+ $scope.enterprise = enterprise || {};
|
|
|
+
|
|
|
+ StoreInfo.findLastUnPassApplyByEnuu({}, {}, function (result) {
|
|
|
+ console.log('UN_PASS_APPLY', result);
|
|
|
+ if (result) {
|
|
|
+ switchTab(result.type);
|
|
|
+ if (result.qualifications) {
|
|
|
+ angular.forEach(result.qualifications, function (qualification) {
|
|
|
+ $scope.qualifications[qualification.type] = qualification;
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ Enterprise.getEnterpriseDetailInfo({ enuu : enterprise.uu},{},function (enterpriseDetail) {
|
|
|
+ $scope.enBuinesssCode = enterpriseDetail.businessCodeImage;
|
|
|
+ $scope.qualifications[$scope.qType.businessLicense] = generateQualification($scope.enBuinesssCode, $scope.qType.businessLicense);;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (result.brands) {
|
|
|
+ $scope.brands = [];
|
|
|
+ angular.forEach(result.brands, function (brand) {
|
|
|
+ var newBrand = {};
|
|
|
+ newBrand.name = brand.name;
|
|
|
+ newBrand.url = brand.url;
|
|
|
+ $scope.brands.push(newBrand);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ $scope.reason = result.reason;
|
|
|
+ }
|
|
|
+ }, function (error) {
|
|
|
+ console.log('INITIAL_ERROR', error);
|
|
|
+ });
|
|
|
+ }, function () {
|
|
|
+ toaster.pop('error', '获取企业信息失败');
|
|
|
+ });
|
|
|
+ }).error(function (error) {
|
|
|
+ toaster.pop('error', '获取登录信息失败');
|
|
|
+ })
|
|
|
}
|
|
|
// 获取已登录的用户信息
|
|
|
var getAuthentication = function() {
|