|
|
@@ -205,7 +205,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
app.controller('ProjectListCtrl', ['$scope', '$rootScope', 'toaster', 'ngTableParams', 'BaseService', 'Project', '$modal',
|
|
|
function ($scope, $rootScope, toaster, ngTableParams, BaseService, Project, $modal) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
-
|
|
|
+ $rootScope.tree = 'project';
|
|
|
+ $rootScope.thief = 'list';
|
|
|
var getProjectState = function (active) {
|
|
|
var fn = 'getAudited';
|
|
|
switch (active) {
|
|
|
@@ -563,9 +564,12 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
|
* 机构入驻选择
|
|
|
*/
|
|
|
- app.controller('SelectInstitutionsNatureCtrl', ['$scope', 'toaster', 'Organization', '$location', 'AuthenticationService',
|
|
|
- function ($scope, toaster, Organization, $location, AuthenticationService) {
|
|
|
+ app.controller('SelectInstitutionsNatureCtrl', ['$scope', 'toaster', 'Organization', '$location', 'AuthenticationService', 'BaseService', '$rootScope',
|
|
|
+ function ($scope, toaster, Organization, $location, AuthenticationService, BaseService, $rootScope) {
|
|
|
$scope.loading = true;
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'user';
|
|
|
+ $rootScope.thief = 'newOrg';
|
|
|
// 获取当前账户注册机构情况
|
|
|
AuthenticationService.getAuthentication().success(function (data) {
|
|
|
if (data.content) {
|
|
|
@@ -698,9 +702,12 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
|
* 机构入驻同意协议
|
|
|
*/
|
|
|
- app.controller('CertificationStep0Ctrl', ['$scope', 'toaster', 'Organization', '$location', 'AuthenticationService',
|
|
|
- function ($scope, toaster, Organization, $location, AuthenticationService) {
|
|
|
+ app.controller('CertificationStep0Ctrl', ['$scope', 'toaster', 'Organization', '$location', 'AuthenticationService', 'BaseService', '$rootScope',
|
|
|
+ function ($scope, toaster, Organization, $location, AuthenticationService, BaseService, $rootScope) {
|
|
|
$scope.loading = true;
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'user';
|
|
|
+ $rootScope.thief = 'newOrg';
|
|
|
$scope.checked = true;
|
|
|
$scope.changeChecked = function() {
|
|
|
$scope.checked = !$scope.checked;
|
|
|
@@ -746,6 +753,9 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
app.controller('CertificationStep1Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', '$filter', 'toaster', 'Organization', 'AuthenticationService',
|
|
|
function ($scope, BaseService, $http, $rootScope, $timeout, $location, $filter, toaster, Organization, AuthenticationService) {
|
|
|
$scope.loading = true;
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'user';
|
|
|
+ $rootScope.thief = 'newOrg';
|
|
|
// 主要领域
|
|
|
// $scope.areas = ['疾病援助', '扶贫/救灾', '教育/助学' , '环境/动物保护', '其他'];
|
|
|
$scope.org = {
|
|
|
@@ -861,6 +871,9 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
app.controller('CertificationStep2Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization', 'AuthenticationService',
|
|
|
function ($scope, BaseService, $http, $rootScope, $timeout, $location, toaster, Organization, AuthenticationService) {
|
|
|
$scope.loading = true;
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'user';
|
|
|
+ $rootScope.thief = 'newOrg';
|
|
|
var orgCopy;
|
|
|
// 获取当前账户注册机构情况
|
|
|
AuthenticationService.getAuthentication().success(function (data) {
|
|
|
@@ -938,6 +951,9 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
app.controller('CertificationStep3Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization', 'BaseService', 'AuthenticationService',
|
|
|
function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization, BaseService, AuthenticationService) {
|
|
|
$scope.loading = true;
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'user';
|
|
|
+ $rootScope.thief = 'newOrg';
|
|
|
var orgCopy;
|
|
|
// 获取当前账户注册机构情况
|
|
|
AuthenticationService.getAuthentication().success(function (data) {
|
|
|
@@ -1202,6 +1218,9 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
app.controller('PublicCertificationStep4Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization', 'AuthenticationService',
|
|
|
function ($scope, BaseService, $http, $rootScope, $timeout, $location, toaster, Organization, AuthenticationService) {
|
|
|
$scope.loading = true;
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'user';
|
|
|
+ $rootScope.thief = 'newOrg';
|
|
|
var orgCopy;
|
|
|
// 获取当前账户注册机构情况
|
|
|
AuthenticationService.getAuthentication().success(function (data) {
|
|
|
@@ -1386,7 +1405,10 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
*/
|
|
|
app.controller('ProjectNewCtrl', ['$scope', 'BaseService', 'Project', '$http', 'toaster', '$stateParams', '$rootScope',
|
|
|
function($scope, BaseService, Project, $http, toaster, $stateParams, $rootScope) {
|
|
|
-
|
|
|
+ $scope.loading = true;
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'project';
|
|
|
+ $rootScope.thief = 'new';
|
|
|
// 默认捐助领域
|
|
|
$scope.defaultAreas = ['疾病援助', '扶贫/救灾', '教育/助学' , '环境/动物保护', '其他'];
|
|
|
|
|
|
@@ -1413,6 +1435,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
});
|
|
|
|
|
|
Project.getSavedProject({}, {}, function(data) {
|
|
|
+ $scope.loading = false;
|
|
|
if(angular.isObject(data)) {
|
|
|
$scope.project = data;
|
|
|
$scope.pcImgUrl = data.pcImg;
|
|
|
@@ -1424,6 +1447,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
|
|
|
if (!angular.isUndefined($stateParams.id)) {
|
|
|
Project.getDetailById({id : $stateParams.id}, {}, function(data) {
|
|
|
+ $scope.loading = false;
|
|
|
$scope.project = data;
|
|
|
$scope.pcImgUrl = data.pcImg;
|
|
|
$scope.mobileImgUrl = data.mobileImg;
|
|
|
@@ -1480,20 +1504,22 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
BaseService.scrollBackToTop();
|
|
|
return;
|
|
|
}
|
|
|
- if (project.startTime == project.endTime) {
|
|
|
- toaster.pop('info', '项目开始时间与结束时间不能相同,请修改之后再保存');
|
|
|
- } else {
|
|
|
- Project.saveBaseInfo({}, project, function(data) {
|
|
|
- $scope.project = data;
|
|
|
- var proId = $scope.project.id;
|
|
|
- if(proId) {
|
|
|
- BaseService.scrollBackToTop();
|
|
|
- window.location.href = '#/launchProject/detail/' + proId;
|
|
|
- }
|
|
|
- },function(res) {
|
|
|
- toaster.pop('error', '出现错误,操作失败');
|
|
|
- });
|
|
|
- }
|
|
|
+ // if (project.startTime == project.endTime) {
|
|
|
+ // toaster.pop('info', '项目开始时间与结束时间不能相同,请修改之后再保存');
|
|
|
+ // } else {
|
|
|
+ $scope.loading = true;
|
|
|
+ Project.saveBaseInfo({}, project, function(data) {
|
|
|
+ $scope.project = data;
|
|
|
+ var proId = $scope.project.id;
|
|
|
+ if(proId) {
|
|
|
+ $scope.loading = false;
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ window.location.href = '#/launchProject/detail/' + proId;
|
|
|
+ }
|
|
|
+ },function(res) {
|
|
|
+ toaster.pop('error', '出现错误,操作失败');
|
|
|
+ });
|
|
|
+ // }
|
|
|
};
|
|
|
|
|
|
// 删除
|
|
|
@@ -1629,7 +1655,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
BaseService.scrollBackToTop();
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+ $scope.loading = true;
|
|
|
var data = new FormData(); //以下为像后台提交图片数据
|
|
|
data.append('pcImg', $scope.pcImg);
|
|
|
data.append('mobileImg', $scope.mobileImg);
|
|
|
@@ -1654,6 +1680,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
url : url,
|
|
|
data: data
|
|
|
}).success(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
if (type) {
|
|
|
toaster.pop('success', '发布成功');
|
|
|
$rootScope.active = 'unaudited';
|
|
|
@@ -1674,9 +1701,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
|
* 财务披露项目列表
|
|
|
*/
|
|
|
- app.controller('ProjectFinanceListCtrl', ['$scope', 'toaster', 'ngTableParams', 'BaseService', 'Project', '$modal',
|
|
|
- function ($scope, toaster, ngTableParams, BaseService, Project, $modal) {
|
|
|
-
|
|
|
+ app.controller('ProjectFinanceListCtrl', ['$scope', 'toaster', 'ngTableParams', 'BaseService', 'Project', '$modal', '$rootScope',
|
|
|
+ function ($scope, toaster, ngTableParams, BaseService, Project, $modal, $rootScope) {
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'project';
|
|
|
+ $rootScope.thief = 'finance';
|
|
|
$scope.keyword = '';
|
|
|
|
|
|
$scope.reload = function() {
|
|
|
@@ -1753,9 +1782,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
|
* 财务披露详情框
|
|
|
*/
|
|
|
- app.controller('ProjectFinanceDetailCtrl', ['$scope', 'Project', 'toaster', '$modalInstance', 'BaseService', 'id', '$upload', '$http',
|
|
|
- function($scope, Project, toaster, $modalInstance, BaseService, id, $upload, $http) {
|
|
|
-
|
|
|
+ app.controller('ProjectFinanceDetailCtrl', ['$scope', 'Project', 'toaster', '$modalInstance', 'BaseService', 'id', '$upload', '$http', '$rootScope',
|
|
|
+ function($scope, Project, toaster, $modalInstance, BaseService, id, $upload, $http, $rootScope) {
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'project';
|
|
|
+ $rootScope.thief = 'report';
|
|
|
$scope.newFinance = {
|
|
|
amount: null,
|
|
|
path: null,
|
|
|
@@ -1865,9 +1896,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
|
* 报告填写项目列表
|
|
|
*/
|
|
|
- app.controller('ProjectReportListCtrl', ['$scope', 'toaster', 'ngTableParams', 'BaseService', 'Project', '$modal', '$http',
|
|
|
- function ($scope, toaster, ngTableParams, BaseService, Project, $modal, $http) {
|
|
|
-
|
|
|
+ app.controller('ProjectReportListCtrl', ['$scope', 'toaster', 'ngTableParams', 'BaseService', 'Project', '$modal', '$rootScope',
|
|
|
+ function ($scope, toaster, ngTableParams, BaseService, Project, $modal, $rootScope) {
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'project';
|
|
|
+ $rootScope.thief = 'manage';
|
|
|
$scope.keyword = '';
|
|
|
$scope.selectedArea = '全部';
|
|
|
|
|
|
@@ -2164,6 +2197,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
app.controller('ActivityListCtrl', ['$scope', '$rootScope', 'toaster', 'ngTableParams', 'BaseService', 'Activity', '$modal',
|
|
|
function ($scope, $rootScope, toaster, ngTableParams, BaseService, Activity, $modal) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'activity';
|
|
|
+ $rootScope.thief = 'list';
|
|
|
|
|
|
var getActivityState = function (active) {
|
|
|
// 正在进行
|
|
|
@@ -2328,9 +2363,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
|
* 活动发起
|
|
|
*/
|
|
|
- app.controller('ActivityNewCtrl', ['$scope', 'BaseService', 'toaster', 'Activity', '$http', '$upload',
|
|
|
- function($scope, BaseService, toaster, Activity, $http, $upload) {
|
|
|
-
|
|
|
+ app.controller('ActivityNewCtrl', ['$scope', 'BaseService', 'toaster', 'Activity', '$http', '$upload', '$rootScope',
|
|
|
+ function($scope, BaseService, toaster, Activity, $http, $upload, $rootScope) {
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'activity';
|
|
|
+ $rootScope.thief = 'new';
|
|
|
$scope.loading = true;
|
|
|
$scope.activity = {
|
|
|
awards:[],
|
|
|
@@ -2727,7 +2764,9 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
*/
|
|
|
app.controller('OrgListCtrl', ['$scope', '$rootScope', 'toaster', 'ngTableParams', 'BaseService', 'Organization', '$modal',
|
|
|
function ($scope, $rootScope, toaster, ngTableParams, BaseService, Organization, $modal) {
|
|
|
-
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'user';
|
|
|
+ $rootScope.thief = 'organization';
|
|
|
var getOrgState = function (active) {
|
|
|
var fn = 'getAudited';
|
|
|
switch (active) {
|
|
|
@@ -2928,5 +2967,134 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
};
|
|
|
}]);
|
|
|
|
|
|
+ /**
|
|
|
+ * 用户列表
|
|
|
+ */
|
|
|
+ app.controller('UserListCtrl', ['$scope', '$rootScope', 'toaster', 'ngTableParams', 'BaseService', 'User', '$modal',
|
|
|
+ function ($scope, $rootScope, toaster, ngTableParams, BaseService, User, $modal) {
|
|
|
+ BaseService.scrollBackToTop();
|
|
|
+ $rootScope.tree = 'user';
|
|
|
+ $rootScope.thief = 'userList';
|
|
|
+ // var getOrgState = function (active) {
|
|
|
+ // var fn = 'getAudited';
|
|
|
+ // switch (active) {
|
|
|
+ // // 已审核
|
|
|
+ // case 'audited':
|
|
|
+ // fn = 'getAudited';
|
|
|
+ // break;
|
|
|
+ // // 未审核
|
|
|
+ // case 'unaudited':
|
|
|
+ // fn = 'getUnaudited';
|
|
|
+ // break;
|
|
|
+ // // 未通过
|
|
|
+ // case 'disagreed':
|
|
|
+ // fn = 'getDisagreed';
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // return fn;
|
|
|
+ // };
|
|
|
+ //
|
|
|
+ // $scope.active = 'done';
|
|
|
+ // if ($rootScope.active) {
|
|
|
+ // $scope.active = $rootScope.active;
|
|
|
+ // }
|
|
|
+ // $scope.keyword = '';
|
|
|
+ //
|
|
|
+ // /**
|
|
|
+ // * 修改分类
|
|
|
+ // * @param value
|
|
|
+ // */
|
|
|
+ // $scope.setActive = function (value) {
|
|
|
+ // if ($scope.active != value) {
|
|
|
+ // $scope.active = value;
|
|
|
+ // if ($scope.orgParams.page() == 1)
|
|
|
+ // $scope.orgParams.reload();
|
|
|
+ // else
|
|
|
+ // $scope.orgParams.page(1);
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ //
|
|
|
+ // $scope.reload = function() {
|
|
|
+ // if ($scope.orgParams.page() == 1)
|
|
|
+ // $scope.orgParams.reload();
|
|
|
+ // else
|
|
|
+ // $scope.orgParams.page(1);
|
|
|
+ // };
|
|
|
+ //
|
|
|
+ // $scope.orgParams = new ngTableParams({
|
|
|
+ // page: 1,
|
|
|
+ // count: 5,
|
|
|
+ // sorting: {
|
|
|
+ // 'id': 'desc'
|
|
|
+ // }
|
|
|
+ // }, {
|
|
|
+ // total: 0,
|
|
|
+ // counts: [5, 10, 25, 50],
|
|
|
+ // getData: function ($defer, params) {
|
|
|
+ // $scope.loading = true;
|
|
|
+ // var pageParams = params.url();
|
|
|
+ // var realActive = {};
|
|
|
+ // pageParams.searchFilter = { // 筛选条件
|
|
|
+ // keyword: $scope.keyword,
|
|
|
+ // area: $scope.selectedArea,
|
|
|
+ // type: $scope.selectedType
|
|
|
+ // };
|
|
|
+ // Organization[getOrgState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
+ // $scope.loading = false;
|
|
|
+ // if (page) {
|
|
|
+ // params.total(page.totalElements);
|
|
|
+ // $defer.resolve(page.content);
|
|
|
+ // // $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词 做导出时需要的字段
|
|
|
+ // }
|
|
|
+ // }, function (response) {
|
|
|
+ // $scope.loading = false;
|
|
|
+ // toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // $scope.onSearch = function () {
|
|
|
+ // if ($scope.orgParams.page() == 1)
|
|
|
+ // $scope.orgParams.reload();
|
|
|
+ // else
|
|
|
+ // $scope.orgParams.page(1);
|
|
|
+ // };
|
|
|
+ //
|
|
|
+ // var getNum = function() {
|
|
|
+ // Organization.getOrgsNum({}, {}, function(data) {
|
|
|
+ // $scope.auditedNum = data.auditedNum;
|
|
|
+ // $scope.unauditedNum = data.unauditedNum;
|
|
|
+ // $scope.disagreedNum = data.disagreedNum;
|
|
|
+ // });
|
|
|
+ // };
|
|
|
+ // getNum();
|
|
|
+ //
|
|
|
+ // // 弹出详情页模态框
|
|
|
+ // $scope.showDetail = function (id) {
|
|
|
+ // var modalInstance = $modal.open({
|
|
|
+ // templateUrl: 'static/view/user/organization_detail.html',
|
|
|
+ // controller: 'OrgDetailCtrl',
|
|
|
+ // size: 'lg',
|
|
|
+ // resolve: {
|
|
|
+ // id: function () {
|
|
|
+ // return id;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // modalInstance.result.then(function(data){
|
|
|
+ // if (data.success) {
|
|
|
+ // toaster.pop('success', '操作成功');
|
|
|
+ // }
|
|
|
+ // $scope.orgParams.reload();
|
|
|
+ // }, function(){
|
|
|
+ //
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // };
|
|
|
+
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
return app;
|
|
|
});
|