|
|
@@ -677,6 +677,15 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
|
|
|
});
|
|
|
var applyPromise = deferred1.promise;
|
|
|
|
|
|
+ // 是否pcb
|
|
|
+ var deferred2 = $q.defer();
|
|
|
+ StoreInfo.isPcb({enuu: $rootScope.userInfo.enterprise.uu}, function (result) {
|
|
|
+ deferred1.resolve(result);
|
|
|
+ }, function (error) {
|
|
|
+ deferred1.reject(error);
|
|
|
+ });
|
|
|
+ $rootScope.pcbPromise = deferred2.promise;
|
|
|
+
|
|
|
// 合并多个Promise对象
|
|
|
$q.all([storePromise, applyPromise]).then(function (result) {
|
|
|
$rootScope.store = result[0] && result[0].uuid ? result[0] : null;
|
|
|
@@ -687,24 +696,26 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
|
|
|
} else {
|
|
|
$rootScope.applyStatus = 'NONE';
|
|
|
}
|
|
|
-
|
|
|
- if ($location.$$path === '/index') {
|
|
|
- AuthenticationService.getAuthentication().success(function (data) {
|
|
|
- angular.forEach(data.enterprises, function (item) {
|
|
|
- if (item.current) {
|
|
|
- data.enterprise = item;
|
|
|
- }
|
|
|
- });
|
|
|
- $rootScope.userInfo = data;
|
|
|
+ AuthenticationService.getAuthentication().success(function (data) {
|
|
|
+ angular.forEach(data.enterprises, function (item) {
|
|
|
+ if (item.current) {
|
|
|
+ data.enterprise = item;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $rootScope.userInfo = data;
|
|
|
+ if ($location.$$path === '/index') {
|
|
|
if ($rootScope.applyStatus === 'NONE') {
|
|
|
$state.go('vendor_store_apply');
|
|
|
} else if ($rootScope.applyStatus === 'PASS') {
|
|
|
$state.go('vendor_store_maintain');
|
|
|
}
|
|
|
- }).error(function (error) {
|
|
|
- toaster.pop('error', '获取登录信息失败');
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
+ $q.all[$rootScope.pcbPromise].then(function (res) {
|
|
|
+ $rootScope.isPcbStore = res == 1;
|
|
|
+ })
|
|
|
+ }).error(function (error) {
|
|
|
+ toaster.pop('error', '获取登录信息失败');
|
|
|
+ })
|
|
|
|
|
|
$rootScope.$on('$stateChangeStart', function (event, toState) {
|
|
|
|