/** * Created by pushkeji on 2018/8/16. */ angular.module('push') .controller('wujingTechnicalDetailCtrl', ['$scope', '$stateParams', '$ionicActionSheet', '$ionicLoading', '$ionicScrollDelegate', 'UtilService', 'dataToolsService', '$sce', 'AccountService', 'UserService', '$ionicSlideBoxDelegate', '$timeout', '$state', '$http', 'ConfigService', 'CommonService', '$ionicPopup', 'ResourceLibraryService', 'taskModuleService', 'ScienceCircleService', '$ionicModal', '$q', function ($scope, $stateParams, $ionicActionSheet, $ionicLoading, $ionicScrollDelegate, UtilService, dataToolsService, $sce, AccountService, UserService, $ionicSlideBoxDelegate, $timeout, $state, $http, ConfigService, CommonService, $ionicPopup, ResourceLibraryService, taskModuleService, ScienceCircleService, $ionicModal, $q) { $scope.resource = $stateParams.resource; taskModuleService.thisUserIsAdmin().then(function (res) { if (res.code == 3350) { $scope.isAdmin = res.data; } }) ResourceLibraryService.getResourceByID($scope.resource.unique).then(function (res1) { if(res1.code == 3350){ taskModuleService.judgeUserInOrg(res1.data.oid).then(function (res2) { if (res2.code == 3350) { $scope.isuserInOrg = res2.data; } }) } }) var unionOtherOrgList = function () { ResourceLibraryService.unionOtherOrgList($scope.resource.title).then(function (res1) { if (res1.code == 3350) { $scope.viceorglist = res1.data; } }) ResourceLibraryService.getResourceByID($scope.resource.unique).then(function (res2) { if (res2.code == 3350) { $scope.res = res2.data; if ($scope.res.orgscale != null) { ResourceLibraryService.getTypeentryByCode($scope.res.orgscale).then(function (res4) { if (res4.code == 3350) { $scope.orgscale = res4.data.itemkey; } }) } $scope.category = ""; if ($scope.res.category != null && $scope.res.category != undefined && $scope.res.category != '') { ResourceLibraryService.getCategoryByCode($scope.res.category).then(function (res5) { if (res5.code == 3350) { $scope.category = res5.data.name; } }) } } }) } unionOtherOrgList(); $scope.completeOrgInfo = function (org) { ResourceLibraryService.getConnId(org.name).then(function (res) { if (res.code == 3350) { if (res.data.id == null || res.data.id == '') { $scope.go('visitModularForm', { companyid: org.id, pageid: 1, orgtype: 10104, pagecode: 1000003, isedit: 0, node: UserService.node, pageTitle: '新增企业信息', title: org.name }); } else { $scope.go('visitModularForm', { companyid: org.id, pageid: 1, orgtype: 10104, isedit: 1, connid: res.data.id, pagecode: 1000003, node: UserService.node, pageTitle: '完善企业信息', title: org.name }); } } }) } $scope.goback1 = function (){ $scope.go('wujingTechnical'); } $scope.goOrgDetail = function (org) { taskModuleService.getResourceByDemandName(org.name,"320412000").then(function (res) { if (res.code == 3350) { var resource = res.data; if (resource.groupid == "0") { $scope.go('resourceDetails', { recourceid: resource.id, recourcetype: resource.restype, recourcecomefrom: resource.comefrom, title: resource.title }); } else { $scope.go('resourceCommonDetailsPage', { recourceid: resource.id, recourcetype: resource.restype, recourcecomefrom: resource.comefrom, creator: resource.creator, title: resource.title, orgtype: 0, pagecode: 0 }); } } }) } $scope.deleteorg = function (org) { ResourceLibraryService.getOrgByName($scope.resource.title,"320412000").then(function (res1) { if (res1.code == 3350) { ResourceLibraryService.deleteorg(res1.data.id, org.id).then(function (res2) { if (res2.code == 3350) { unionOtherOrgList(); } }) } }) } }]) ;