|
|
@ -144,7 +144,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
industries.push(industry.label);
|
|
|
|
industries.push(industry.label);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
industries.push('未知行业');
|
|
|
|
industries.push('未知行业');
|
|
|
|
console.log(industries);
|
|
|
|
// console.log(industries);
|
|
|
|
// 加载风险注册事件
|
|
|
|
// 加载风险注册事件
|
|
|
|
$scope.loadRiskEvents = function (page) {
|
|
|
|
$scope.loadRiskEvents = function (page) {
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
@ -509,8 +509,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
app.controller('auditMaterialCtrl', ['$scope', '$state', '$http', '$uibModal', '$filter', '$sce', 'commonDialog',
|
|
|
|
app.controller('auditMaterialCtrl', ['$scope', '$state', '$http', '$uibModal', '$filter', '$sce', 'commonDialog', 'Upload',
|
|
|
|
function ($scope, $state, $http, $uibModal, $filter, $sce, commonDialog) {
|
|
|
|
function ($scope, $state, $http, $uibModal, $filter, $sce, commonDialog, Upload) {
|
|
|
|
|
|
|
|
|
|
|
|
// 一键下载功能
|
|
|
|
// 一键下载功能
|
|
|
|
$scope.downloadAsZip = function () {
|
|
|
|
$scope.downloadAsZip = function () {
|
|
|
@ -543,6 +543,61 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
$scope.loadRiskMaterial();
|
|
|
|
$scope.loadRiskMaterial();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.uploadShowFlag = ($scope.riskEvent.result_type == 1 || $scope.riskEvent.result_type == 4) ? true : false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 材料上传
|
|
|
|
|
|
|
|
$scope.uploadFile = function(files, index) {
|
|
|
|
|
|
|
|
if (files && files.length) {
|
|
|
|
|
|
|
|
var urls = new Array();
|
|
|
|
|
|
|
|
var value = 0;
|
|
|
|
|
|
|
|
$scope.riskMaterial.material[index].fileProgressValue = 0;
|
|
|
|
|
|
|
|
for (var i = 0; i < files.length; i++) {
|
|
|
|
|
|
|
|
var file = files[i];
|
|
|
|
|
|
|
|
Upload.upload({
|
|
|
|
|
|
|
|
url: '/attachment/riskFiles',
|
|
|
|
|
|
|
|
data: {file: file}
|
|
|
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
|
|
|
urls.push(resp.data.url);
|
|
|
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
|
|
|
delete $scope.riskMaterial.material[index].fileProgressValue;
|
|
|
|
|
|
|
|
alert('Upload Failed');
|
|
|
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
|
|
|
value += parseInt(100 * evt.loaded / evt.total );
|
|
|
|
|
|
|
|
$scope.riskMaterial.material[index].fileProgressValue = value/(files.length*2);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$scope.riskMaterial.material[index].file = urls;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.submit = function (form) {
|
|
|
|
|
|
|
|
var index = $scope.riskEvent.submit_url.lastIndexOf('=');
|
|
|
|
|
|
|
|
if (index < 0)
|
|
|
|
|
|
|
|
index = $scope.riskEvent.submit_url.lastIndexOf('/');
|
|
|
|
|
|
|
|
var codeKey = $scope.riskEvent.submit_url.substring(index + 1);
|
|
|
|
|
|
|
|
$scope.material.update_time=$filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss');
|
|
|
|
|
|
|
|
$scope.material.risk_id = $scope.riskEvent.risk_id;
|
|
|
|
|
|
|
|
for (var i = 0; i < $scope.riskMaterial.material.length; i++) {
|
|
|
|
|
|
|
|
var key = 'file' + (i + 1) + "_url";
|
|
|
|
|
|
|
|
$scope.material[key] = $scope.riskMaterial.material[i].file;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$scope.material.description = $scope.riskMaterial.description;
|
|
|
|
|
|
|
|
$http.post('/risk/upload/' + codeKey, $scope.material).then(function (resp) {
|
|
|
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
|
|
|
title: 'Success',
|
|
|
|
|
|
|
|
content: 'Submit successfully',
|
|
|
|
|
|
|
|
type: 'success'
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$state.go('analysis_monitoring.risk_business');
|
|
|
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
|
|
|
title: 'Error',
|
|
|
|
|
|
|
|
content: resp.data.message,
|
|
|
|
|
|
|
|
type: 'error'
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 材料审核
|
|
|
|
// 材料审核
|
|
|
|
$scope.auditMaterial = function(auditType) {
|
|
|
|
$scope.auditMaterial = function(auditType) {
|
|
|
|
|
|
|
|
|
|
|
@ -553,7 +608,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
title: 'Warning',
|
|
|
|
title: 'Warning',
|
|
|
|
contentHtml: $sce.trustAsHtml(warningMessageHTML)
|
|
|
|
contentHtml: $sce.trustAsHtml(warningMessageHTML)
|
|
|
|
}).then(function () {
|
|
|
|
}).then(function () {
|
|
|
|
$scope.riskEvent.result_type = auditType;
|
|
|
|
// $scope.riskEvent.result_type = auditType;
|
|
|
|
$http.put(url, $scope.riskEvent).then(function (resp) {
|
|
|
|
$http.put(url, $scope.riskEvent).then(function (resp) {
|
|
|
|
commonDialog.alert({title: 'Success', content: "材料已通过!"});
|
|
|
|
commonDialog.alert({title: 'Success', content: "材料已通过!"});
|
|
|
|
$state.go('^', {}, {reload: true});
|
|
|
|
$state.go('^', {}, {reload: true});
|
|
|
|