/** * Created by pushkeji on 2018/10/11. */ angular.module('push') .controller('unionDetailCtrl', ['$scope', '$stateParams', '$ionicActionSheet', '$ionicLoading', '$ionicScrollDelegate', 'UtilService', 'dataToolsService', '$sce', 'UserService', '$ionicSlideBoxDelegate', '$timeout', '$state', '$http', 'ConfigService', '$ionicPopup', 'ResourceLibraryService', 'taskModuleService', 'ScienceCircleService', '$ionicModal', '$q', function ($scope, $stateParams, $ionicActionSheet, $ionicLoading, $ionicScrollDelegate, UtilService, dataToolsService, $sce, UserService, $ionicSlideBoxDelegate, $timeout, $state, $http, ConfigService, $ionicPopup, ResourceLibraryService, taskModuleService, ScienceCircleService, $ionicModal, $q) { var unionInfo = {}; var getUnionList = function () { taskModuleService.unionList().then(function (res) { if (res.code == 3350) { if (res.data.length == 0) { $scope.name = "武进区科技创新创业联盟"; } else { var data = res.data[0]; $scope.name = data.name; $scope.content = data.content; $scope.viceorgList = []; $scope.tel = data.tel; if (data.org != null && data.org != undefined && data.org != "") { dataToolsService.getOrganizationModelByOrgid(data.org).then(function (orgres) { if (orgres.code == 3350) { $scope.org = orgres.data.name; } }) } if (data.viceorg != null && data.viceorg != undefined && data.viceorg != "") { var viceorgArr = data.viceorg.split(','); angular.forEach(viceorgArr, function (val, index) { if (val != "") { dataToolsService.getOrganizationModelByOrgid(val).then(function (orgres1) { if (orgres1.code == 3350) { $scope.viceorgList.push(orgres1.data.name); } }) } }) } } } }) } getUnionList(); //当前登陆用户是否是管理员 var thisUserIsAdmin = function () { taskModuleService.thisUserIsAdmin().then(function (res) { if (res.code == 3350) { $scope.isAdmin = res.data; } }) } thisUserIsAdmin(); $scope.editUnion = function () { unionInfo.name = $scope.name; unionInfo.content = $scope.content; unionInfo.tel = $scope.tel; unionInfo.org = $scope.org; unionInfo.viceorgList = $scope.viceorgList; $scope.go("unionIntroduction", {union: unionInfo}); } } ]) ;