|
|
|
@ -1027,8 +1027,10 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('aggregateFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state','$uibModal', 'Upload', function ($scope, $http, $rootScope, commonDialog, $state,$uibModal, Upload) {
|
|
|
|
|
app.controller('aggregateFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', '$uibModal', 'Upload', function ($scope, $http, $rootScope, commonDialog, $state, $uibModal, Upload) {
|
|
|
|
|
$scope.signInfo = {};
|
|
|
|
|
$scope.confirmBtn = false;
|
|
|
|
|
$scope.signItBtn = true;
|
|
|
|
|
|
|
|
|
|
$scope.aggregateFile = function () {
|
|
|
|
|
$http.get('/client/partner_info/aggregateFile/client_info').then(function (resp) {
|
|
|
|
@ -1047,66 +1049,77 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
|
|
|
|
|
|
|
|
|
|
$scope.goBottom = function () {
|
|
|
|
|
window.scrollTo(0, document.documentElement.scrollHeight - document.documentElement.clientHeight);
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
backdrop: false,
|
|
|
|
|
templateUrl: '/static/payment/partner/templates/agreement_signature_dialog.html',
|
|
|
|
|
controller: 'agreementSignDialogCtrl',
|
|
|
|
|
size: 'md'
|
|
|
|
|
}).result.then(function (result) {
|
|
|
|
|
$scope.confirmBtn = true;
|
|
|
|
|
$scope.signItBtn = false;
|
|
|
|
|
$scope.signInfo.fullName = result.fullName;
|
|
|
|
|
$scope.signInfo.src = result.src;
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.submitContract = function () {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
backdrop:false,
|
|
|
|
|
backdrop: false,
|
|
|
|
|
templateUrl: '/static/payment/partner/templates/confirmForSubmit.html',
|
|
|
|
|
controller:'submitContractCtrl',
|
|
|
|
|
size: 'md',
|
|
|
|
|
controller: 'submitContractCtrl',
|
|
|
|
|
size: 'md'
|
|
|
|
|
}).result.then(function (result) {
|
|
|
|
|
if(result)
|
|
|
|
|
{
|
|
|
|
|
$scope.uploadSign();
|
|
|
|
|
}
|
|
|
|
|
$scope.uploadSign();
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.uploadSign = function () {
|
|
|
|
|
var sign = $('#img1').attr('src');
|
|
|
|
|
$scope.signInfo.fullName = document.getElementById("full_name").value;
|
|
|
|
|
|
|
|
|
|
if ($scope.signInfo.fullName != null && $scope.signInfo.fullName != "" && sign != null && sign != "") {
|
|
|
|
|
document.getElementById("waiting").src="static/css/img/loading_contract.gif"
|
|
|
|
|
$scope.gray();
|
|
|
|
|
var signFile = dataURLtoFile(sign, $scope.signInfo.fullName);
|
|
|
|
|
$scope.logoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/client/partner_info/clientCompliance/' + $scope.aggregateFileInfo.client_moniker +'/commit_aggregate_file',
|
|
|
|
|
data: {file: signFile}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
document.getElementById("waiting").src = '';
|
|
|
|
|
document.getElementById('loading').style.display="none";
|
|
|
|
|
document.getElementById('tip').style.display="none";
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
$state.go('basic.compliance_to_perfect',{reload: true});
|
|
|
|
|
window.open(resp.data.file_value,'_blank');
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
document.getElementById("waiting").src = '';
|
|
|
|
|
document.getElementById('loading').style.display="none";
|
|
|
|
|
document.getElementById('tip').style.display="none";
|
|
|
|
|
commonDialog.alert({title: 'Commit Aggregate File Fail', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
commonDialog.alert({title: 'Commit Fail', content: 'Please confirm signature and full name entered', type: 'error'});
|
|
|
|
|
if ($scope.signInfo.fullName == null || $scope.signInfo.fullName == "") {
|
|
|
|
|
commonDialog.alert({title: 'Commit Fail', content: 'Please confirm full name entered', type: 'error'});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($scope.signInfo.src == null || $scope.signInfo.src == "") {
|
|
|
|
|
commonDialog.alert({title: 'Commit Fail', content: 'Please confirm signature', type: 'error'});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
document.getElementById("waiting").src = "static/css/img/loading_contract.gif";
|
|
|
|
|
$scope.gray();
|
|
|
|
|
var signFile = dataURLtoFile($scope.signInfo.src, $scope.signInfo.fullName);
|
|
|
|
|
$scope.logoProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/client/partner_info/clientCompliance/' + $scope.aggregateFileInfo.client_moniker + '/commit_aggregate_file',
|
|
|
|
|
data: {file: signFile}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
document.getElementById("waiting").src = '';
|
|
|
|
|
document.getElementById('loading').style.display = "none";
|
|
|
|
|
document.getElementById('tip').style.display = "none";
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
$state.go('basic.compliance_to_perfect', {reload: true});
|
|
|
|
|
window.open(resp.data.file_value, '_blank');
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.logoProgress;
|
|
|
|
|
document.getElementById("waiting").src = '';
|
|
|
|
|
document.getElementById('loading').style.display = "none";
|
|
|
|
|
document.getElementById('tip').style.display = "none";
|
|
|
|
|
commonDialog.alert({title: 'Commit Aggregate File Fail', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.gray=function(){
|
|
|
|
|
$scope.gray = function () {
|
|
|
|
|
$("#loading").css({
|
|
|
|
|
"position":"absolute", //绝对位置
|
|
|
|
|
"display":"block", //让对象成为块级元素
|
|
|
|
|
"position": "absolute", //绝对位置
|
|
|
|
|
"display": "block", //让对象成为块级元素
|
|
|
|
|
|
|
|
|
|
"background-color":"gray", //背景灰色
|
|
|
|
|
"z-index":"9999", //最上层显示
|
|
|
|
|
"opacity":"0.5" //背景透明度
|
|
|
|
|
"background-color": "gray", //背景灰色
|
|
|
|
|
"z-index": "9999", //最上层显示
|
|
|
|
|
"opacity": "0.5" //背景透明度
|
|
|
|
|
});
|
|
|
|
|
document.getElementById('tip').style.display="";
|
|
|
|
|
document.getElementById('tip').style.display = "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function dataURLtoFile(dataurl, filename) {//将base64转换为文件
|
|
|
|
@ -1783,14 +1796,23 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.controller('submitContractCtrl', ['$scope', '$http', function ($scope, $http) {
|
|
|
|
|
$scope.choice= false;
|
|
|
|
|
$scope.choice = false;
|
|
|
|
|
$scope.chooseYes = function () {
|
|
|
|
|
$scope.choice= true;
|
|
|
|
|
$scope.choice = true;
|
|
|
|
|
$scope.$close($scope.choice);
|
|
|
|
|
};
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return app;
|
|
|
|
|
app.controller('agreementSignDialogCtrl', ['$scope', '$http', function ($scope, $http) {
|
|
|
|
|
$scope.submitSign = function (fullName) {
|
|
|
|
|
var sign = $("#signature").jSignature('getData', 'image');
|
|
|
|
|
var signInfo = {};
|
|
|
|
|
signInfo.src = 'data:' + sign[0] + ',' + sign[1];
|
|
|
|
|
signInfo.fullName = fullName;
|
|
|
|
|
$scope.$close(signInfo);
|
|
|
|
|
};
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return app;
|
|
|
|
|
});
|
|
|
|
|