|
@@ -1131,8 +1131,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
/**
|
|
|
* 新建项目
|
|
* 新建项目
|
|
|
*/
|
|
*/
|
|
|
- app.controller('ProjectNewCtrl', ['$scope', 'BaseService', 'Project', '$http', 'toaster', '$stateParams',
|
|
|
|
|
- function($scope, BaseService, Project, $http, toaster, $stateParams) {
|
|
|
|
|
|
|
+ app.controller('ProjectNewCtrl', ['$scope', 'BaseService', 'Project', '$http', 'toaster', '$stateParams', '$rootScope',
|
|
|
|
|
+ function($scope, BaseService, Project, $http, toaster, $stateParams, $rootScope) {
|
|
|
|
|
+ if ($rootScope.active) {
|
|
|
|
|
+ $rootScope.active = 'done';
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 默认捐助领域
|
|
// 默认捐助领域
|
|
|
$scope.defaultAreas = ['疾病援助', '扶贫/救灾', '教育/助学' , '环境/动物保护', '其他'];
|
|
$scope.defaultAreas = ['疾病援助', '扶贫/救灾', '教育/助学' , '环境/动物保护', '其他'];
|
|
@@ -1160,7 +1163,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
Project.getSavedProject({}, {}, function(data) {
|
|
Project.getSavedProject({}, {}, function(data) {
|
|
|
- if(!angular.isObject(data)) {
|
|
|
|
|
|
|
+ if(angular.isObject(data)) {
|
|
|
$scope.project = data;
|
|
$scope.project = data;
|
|
|
$scope.pcImgUrl = data.pcImg;
|
|
$scope.pcImgUrl = data.pcImg;
|
|
|
$scope.mobileImgUrl = data.mobileImg;
|
|
$scope.mobileImgUrl = data.mobileImg;
|
|
@@ -1383,6 +1386,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
if (type) {
|
|
if (type) {
|
|
|
toaster.pop('success', '发布成功');
|
|
toaster.pop('success', '发布成功');
|
|
|
BaseService.scrollBackToTop();
|
|
BaseService.scrollBackToTop();
|
|
|
|
|
+ $rootScope.active = 'todo';
|
|
|
window.location.href='#/launchProject/success';
|
|
window.location.href='#/launchProject/success';
|
|
|
} else {
|
|
} else {
|
|
|
toaster.pop('success', '保存成功');
|
|
toaster.pop('success', '保存成功');
|
|
@@ -1478,8 +1482,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
/**
|
|
|
* 财务披露详情框
|
|
* 财务披露详情框
|
|
|
*/
|
|
*/
|
|
|
- app.controller('ProjectFinanceDetailCtrl', ['$scope', 'Project', 'toaster', '$modalInstance', 'BaseService', 'id', '$upload',
|
|
|
|
|
- function($scope, Project, toaster, $modalInstance, BaseService, id, $upload) {
|
|
|
|
|
|
|
+ app.controller('ProjectFinanceDetailCtrl', ['$scope', 'Project', 'toaster', '$modalInstance', 'BaseService', 'id', '$upload', '$http',
|
|
|
|
|
+ function($scope, Project, toaster, $modalInstance, BaseService, id, $upload, $http) {
|
|
|
|
|
|
|
|
$scope.newFinance = {
|
|
$scope.newFinance = {
|
|
|
amount: null,
|
|
amount: null,
|
|
@@ -1487,6 +1491,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
description: null,
|
|
description: null,
|
|
|
type : null
|
|
type : null
|
|
|
};
|
|
};
|
|
|
|
|
+ $scope.imgUrl = null;
|
|
|
|
|
|
|
|
var loadData = function() {
|
|
var loadData = function() {
|
|
|
// 获取项目详情
|
|
// 获取项目详情
|
|
@@ -1495,11 +1500,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
}, function() {
|
|
}, function() {
|
|
|
toaster.pop('error', '详情加载失败');
|
|
toaster.pop('error', '详情加载失败');
|
|
|
});
|
|
});
|
|
|
- };
|
|
|
|
|
- loadData();
|
|
|
|
|
|
|
|
|
|
- // 获取当前项目财务信息
|
|
|
|
|
- $scope.getFinance = function() {
|
|
|
|
|
|
|
+ // 获取当前项目财务信息
|
|
|
Project.getFinance({id:id}, {}, function(data) {
|
|
Project.getFinance({id:id}, {}, function(data) {
|
|
|
$scope.projectFinance = data.projectFinance;
|
|
$scope.projectFinance = data.projectFinance;
|
|
|
$scope.totalCost = data.totalCost;
|
|
$scope.totalCost = data.totalCost;
|
|
@@ -1509,21 +1511,75 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
toaster.pop('error','财务明细加载失败');
|
|
toaster.pop('error','财务明细加载失败');
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
+ loadData();
|
|
|
|
|
|
|
|
$scope.cancel= function() {
|
|
$scope.cancel= function() {
|
|
|
$modalInstance.dismiss();
|
|
$modalInstance.dismiss();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ $scope.fileChanged = function(ele) {
|
|
|
|
|
+ $scope.newFinance.file = ele.files[0];
|
|
|
|
|
+ $scope.imgUrl = getObjectURL(ele.files[0]);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ //建立一个可存取到该file的url
|
|
|
|
|
+ var getObjectURL = function (file) {
|
|
|
|
|
+ var url = null;
|
|
|
|
|
+ if (window.createObjectURL != undefined) { // basic
|
|
|
|
|
+ url = window.createObjectURL(file);
|
|
|
|
|
+ } else if (window.URL != undefined) { // mozilla(firefox)
|
|
|
|
|
+ url = window.URL.createObjectURL(file);
|
|
|
|
|
+ } else if (window.webkitURL != undefined) { // webkit or chrome
|
|
|
|
|
+ url = window.webkitURL.createObjectURL(file);
|
|
|
|
|
+ }
|
|
|
|
|
+ return url;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // // 查看范例
|
|
|
|
|
+ // $scope.showImg = function () {
|
|
|
|
|
+ // var imgUrl = $scope.imgUrl;
|
|
|
|
|
+ // if (imgUrl != null) {
|
|
|
|
|
+ // var src = imgUrl, box = $('#image-box');
|
|
|
|
|
+ // box.show();
|
|
|
|
|
+ // box.find('img').attr('src', src);
|
|
|
|
|
+ // box.find('a').click(function () {
|
|
|
|
|
+ // box.hide();
|
|
|
|
|
+ // });
|
|
|
|
|
+ // box.dblclick(function () {
|
|
|
|
|
+ // box.hide();
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // };
|
|
|
|
|
+
|
|
|
|
|
+ // 删除活动图或banner
|
|
|
|
|
+ $scope.clearFile = function (type) {
|
|
|
|
|
+ $scope.newFinance.file = null;
|
|
|
|
|
+ $scope.imgUrl = null;
|
|
|
|
|
+ // 清空input框的内容
|
|
|
|
|
+ var file=document.getElementById(type);
|
|
|
|
|
+ //IE,Safari,chrome
|
|
|
|
|
+ if(file.outerHTML){
|
|
|
|
|
+ file.outerHTML=file.outerHTML;
|
|
|
|
|
+ }
|
|
|
|
|
+ else{ //FF
|
|
|
|
|
+ file.value="";
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
// 发布
|
|
// 发布
|
|
|
$scope.saveFinance = function(finance) {
|
|
$scope.saveFinance = function(finance) {
|
|
|
- var file = finance.file;
|
|
|
|
|
- $upload.upload({
|
|
|
|
|
- url: 'project/save/finance' + id,
|
|
|
|
|
- file: file,
|
|
|
|
|
|
|
+ var data = new FormData();
|
|
|
|
|
+ data.append('json', JSON.stringify(finance));
|
|
|
|
|
+ data.append('img', finance.file);
|
|
|
|
|
+ $http({
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ 'Content-Type': undefined
|
|
|
|
|
+ },
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
- data: {
|
|
|
|
|
- json: finance
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ processData: false,
|
|
|
|
|
+ async: false,
|
|
|
|
|
+ url: 'project/save/finance/' + id,
|
|
|
|
|
+ data: data
|
|
|
}).success(function(data){
|
|
}).success(function(data){
|
|
|
toaster.pop('success', '发布财务信息成功');
|
|
toaster.pop('success', '发布财务信息成功');
|
|
|
}).error(function(data){
|
|
}).error(function(data){
|
|
@@ -1635,13 +1691,11 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 获取当前项目所有进度
|
|
// 获取当前项目所有进度
|
|
|
- $scope.getSchedules = function() {
|
|
|
|
|
- Project.getSchedules({id : id}, {}, function(data) {
|
|
|
|
|
- $scope.schedules = data;
|
|
|
|
|
- }, function() {
|
|
|
|
|
- toaster.pop('error', '项目进度加载失败');
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ Project.getSchedules({id : id}, {}, function(data) {
|
|
|
|
|
+ $scope.schedules = data;
|
|
|
|
|
+ }, function() {
|
|
|
|
|
+ toaster.pop('error', '项目进度加载失败');
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
loadData();
|
|
loadData();
|
|
|
|
|
|
|
@@ -1651,14 +1705,18 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
|
|
|
|
|
// 发布
|
|
// 发布
|
|
|
$scope.saveReport = function(report) {
|
|
$scope.saveReport = function(report) {
|
|
|
- var file = report.file;
|
|
|
|
|
- $upload.upload({
|
|
|
|
|
- url: 'project/save/report' + id,
|
|
|
|
|
- file: file,
|
|
|
|
|
|
|
+ var data = new FormData();
|
|
|
|
|
+ data.append('json', JSON.stringify(report));
|
|
|
|
|
+ data.append('img', report.file);
|
|
|
|
|
+ $http({
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ 'Content-Type': undefined
|
|
|
|
|
+ },
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
- data: {
|
|
|
|
|
- json: report
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ processData: false,
|
|
|
|
|
+ async: false,
|
|
|
|
|
+ url: 'project/save/report/' + id,
|
|
|
|
|
+ data: data
|
|
|
}).success(function(data){
|
|
}).success(function(data){
|
|
|
toaster.pop('success', '发布进度信息成功');
|
|
toaster.pop('success', '发布进度信息成功');
|
|
|
}).error(function(data){
|
|
}).error(function(data){
|
|
@@ -1786,14 +1844,18 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
|
|
|
|
|
// 发布
|
|
// 发布
|
|
|
$scope.saveConclude = function(conclude) {
|
|
$scope.saveConclude = function(conclude) {
|
|
|
- var file = conclude.file ? conclude.file : null;
|
|
|
|
|
- $upload.upload({
|
|
|
|
|
- url: 'project/save/conclude' + id,
|
|
|
|
|
- file: file,
|
|
|
|
|
|
|
+ var data = new FormData();
|
|
|
|
|
+ data.append('json', JSON.stringify(conclude));
|
|
|
|
|
+ data.append('img', conclude.file);
|
|
|
|
|
+ $http({
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ 'Content-Type': undefined
|
|
|
|
|
+ },
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
- data: {
|
|
|
|
|
- json: conclude
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ processData: false,
|
|
|
|
|
+ async: false,
|
|
|
|
|
+ url: 'project/save/conclude/' + id,
|
|
|
|
|
+ data: data
|
|
|
}).success(function(data){
|
|
}).success(function(data){
|
|
|
toaster.pop('success', '发布结项信息成功');
|
|
toaster.pop('success', '发布结项信息成功');
|
|
|
}).error(function(data){
|
|
}).error(function(data){
|
|
@@ -2324,6 +2386,9 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
$scope.active = 'done';
|
|
$scope.active = 'done';
|
|
|
|
|
+ if ($rootScope.active) {
|
|
|
|
|
+ $scope.active = $rootScope.active;
|
|
|
|
|
+ }
|
|
|
$scope.keyword = '';
|
|
$scope.keyword = '';
|
|
|
|
|
|
|
|
/**
|
|
/**
|