|
|
@@ -149,6 +149,18 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
return sHtml.replace(/[<>&"]/g,function(c){return {'<':'<','>':'>','&':'&','"':'"'}[c];});
|
|
|
};
|
|
|
|
|
|
+ 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;
|
|
|
+ };
|
|
|
+
|
|
|
/**
|
|
|
* 项目列表
|
|
|
*/
|
|
|
@@ -295,6 +307,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
|
|
|
}]);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 项目详情框
|
|
|
*/
|
|
|
@@ -305,7 +319,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
// 获取项目详情
|
|
|
Project.getDetailById({id :id}, {}, function(data) {
|
|
|
$scope.project = data;
|
|
|
- $scope.code = $sce.trustAsHtml( $scope.project.introduction);
|
|
|
+ $scope.code = $sce.trustAsHtml($scope.project.introduction);
|
|
|
}, function() {
|
|
|
toaster.pop('error', '详情加载失败');
|
|
|
});
|
|
|
@@ -347,7 +361,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
};
|
|
|
|
|
|
$scope.deleteSchedule = function(scheduleId) {
|
|
|
- Project.deleteSchedule({scheduleId: scheduleId}, {}, function() {
|
|
|
+ Project.deleteSchedule({id: scheduleId}, {}, function() {
|
|
|
toaster.pop('success', '操作成功');
|
|
|
// 重新加载
|
|
|
$scope.getSchedules();
|
|
|
@@ -1431,7 +1445,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
pageParams.searchFilter = { // 筛选条件
|
|
|
keyword: $scope.keyword
|
|
|
};
|
|
|
- Project.getAudited.call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
+ Project.getNotEnd.call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
$scope.loading = false;
|
|
|
if (page) {
|
|
|
params.total(page.totalElements);
|
|
|
@@ -1582,6 +1596,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
data: data
|
|
|
}).success(function(data){
|
|
|
toaster.pop('success', '发布财务信息成功');
|
|
|
+ $modalInstance.close();
|
|
|
}).error(function(data){
|
|
|
toaster.pop('error', '出现错误,发布失败');
|
|
|
});
|
|
|
@@ -1593,8 +1608,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
|
* 报告填写项目列表
|
|
|
*/
|
|
|
- app.controller('ProjectReportListCtrl', ['$scope', 'toaster', 'ngTableParams', 'BaseService', 'Project', '$modal',
|
|
|
- function ($scope, toaster, ngTableParams, BaseService, Project, $modal) {
|
|
|
+ app.controller('ProjectReportListCtrl', ['$scope', 'toaster', 'ngTableParams', 'BaseService', 'Project', '$modal', '$http',
|
|
|
+ function ($scope, toaster, ngTableParams, BaseService, Project, $modal, $http) {
|
|
|
|
|
|
$scope.keyword = '';
|
|
|
$scope.selectedArea = '全部';
|
|
|
@@ -1623,7 +1638,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
keyword: $scope.keyword,
|
|
|
area: $scope.selectedArea
|
|
|
};
|
|
|
- Project.getAudited.call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
+ Project.getNotEnd.call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
$scope.loading = false;
|
|
|
if (page) {
|
|
|
params.total(page.totalElements);
|
|
|
@@ -1674,8 +1689,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
|
* 报告填写详情框
|
|
|
*/
|
|
|
- app.controller('ProjectReportDetailCtrl', ['$scope', 'Project', 'toaster', '$modalInstance', 'BaseService', 'id', '$upload',
|
|
|
- function($scope, Project, toaster, $modalInstance, BaseService, id, $upload) {
|
|
|
+ app.controller('ProjectReportDetailCtrl', ['$scope', 'Project', 'toaster', '$modalInstance', 'BaseService', 'id', '$http',
|
|
|
+ function($scope, Project, toaster, $modalInstance, BaseService, id, $http) {
|
|
|
|
|
|
$scope.report = {
|
|
|
path: null,
|
|
|
@@ -1699,10 +1714,28 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
};
|
|
|
loadData();
|
|
|
|
|
|
+ // 图片上传
|
|
|
+ $scope.fileChanged = function(ele){
|
|
|
+ $scope.report.file = ele.files[0];
|
|
|
+ $scope.imgUrl = getObjectURL(ele.files[0]);
|
|
|
+ $scope.$apply();
|
|
|
+ };
|
|
|
+
|
|
|
$scope.cancel= function() {
|
|
|
$modalInstance.dismiss();
|
|
|
};
|
|
|
|
|
|
+ // delete
|
|
|
+ $scope.deleteSchedule = function(scheduleId) {
|
|
|
+ Project.deleteSchedule({id: scheduleId}, {}, function() {
|
|
|
+ toaster.pop('success', '操作成功');
|
|
|
+ // 重新加载
|
|
|
+ loadData();
|
|
|
+ }, function() {
|
|
|
+ toaster.pop('error', '出现错误,操作失败');
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
// 发布
|
|
|
$scope.saveReport = function(report) {
|
|
|
var data = new FormData();
|
|
|
@@ -1719,6 +1752,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
data: data
|
|
|
}).success(function(data){
|
|
|
toaster.pop('success', '发布进度信息成功');
|
|
|
+ $modalInstance.close();
|
|
|
}).error(function(data){
|
|
|
toaster.pop('error', '出现错误,发布失败');
|
|
|
});
|
|
|
@@ -1760,7 +1794,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
keyword: $scope.keyword,
|
|
|
area: $scope.selectedArea
|
|
|
};
|
|
|
- Project.getAudited.call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
+ Project.getNotEnd.call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
$scope.loading = false;
|
|
|
if (page) {
|
|
|
params.total(page.totalElements);
|
|
|
@@ -1811,8 +1845,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
|
* 结项管理详情框
|
|
|
*/
|
|
|
- app.controller('ProjectManagementDetailCtrl', ['$scope', 'Project', 'toaster', '$modalInstance', 'BaseService', 'id', '$upload',
|
|
|
- function($scope, Project, toaster, $modalInstance, BaseService, id, $upload) {
|
|
|
+ app.controller('ProjectManagementDetailCtrl', ['$scope', 'Project', 'toaster', '$modalInstance', 'BaseService', 'id', '$http',
|
|
|
+ function($scope, Project, toaster, $modalInstance, BaseService, id, $http) {
|
|
|
|
|
|
$scope.conclude = {
|
|
|
description: null
|
|
|
@@ -1858,6 +1892,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
data: data
|
|
|
}).success(function(data){
|
|
|
toaster.pop('success', '发布结项信息成功');
|
|
|
+ $modalInstance.close();
|
|
|
}).error(function(data){
|
|
|
toaster.pop('error', '出现错误,发布失败');
|
|
|
});
|