|
|
|
@ -38,9 +38,9 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
}).state('basic.compliance_to_perfect', {
|
|
|
|
|
url: '/{client_moniker}/compliance_to_prefect',
|
|
|
|
|
url: '/compliance_to_prefect',
|
|
|
|
|
templateUrl: '/static/payment/partner/templates/client_compliance_to_prefect.html',
|
|
|
|
|
controller: 'clientComplianceFilesCtrl',
|
|
|
|
|
controller: 'clientCommitToComplianceFilesCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
file: ['$http', function ($http) {
|
|
|
|
|
return $http.get('/client/partner_info/compliance/clientViewFiles');
|
|
|
|
@ -584,6 +584,236 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
$scope.uploadCompanyFile = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
if (file.size > 3 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.companyFileProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.companyFileProgress;
|
|
|
|
|
$scope.file.file_company_info = resp.data.url;
|
|
|
|
|
$scope.updateFile();
|
|
|
|
|
if ($scope.file.file_company_info.endsWith('pdf')) {
|
|
|
|
|
$scope.companyIsImage = false;
|
|
|
|
|
} else {
|
|
|
|
|
$scope.companyIsImage = true;
|
|
|
|
|
}
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.companyFileProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.companyFileProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
//上传ID信息
|
|
|
|
|
$scope.uploadIDFile = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
if (file.size > 3 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.idFileProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.idFileProgress;
|
|
|
|
|
$scope.file.file_id_info = resp.data.url;
|
|
|
|
|
$scope.updateFile();
|
|
|
|
|
if ($scope.file.file_id_info.endsWith('pdf')) {
|
|
|
|
|
$scope.idIsImage = false;
|
|
|
|
|
} else {
|
|
|
|
|
$scope.idIsImage = true;
|
|
|
|
|
}
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.idFileProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.idFileProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//上传协议文件
|
|
|
|
|
$scope.uploadAgreementFile = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
if (file.size > 10 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过5MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.agreementFileProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.agreementFileProgress;
|
|
|
|
|
$scope.file.file_agreement_info = resp.data.url;
|
|
|
|
|
$scope.updateFile();
|
|
|
|
|
if ($scope.file.file_agreement_info.endsWith('pdf')) {
|
|
|
|
|
$scope.agreeIsImage = false;
|
|
|
|
|
} else {
|
|
|
|
|
$scope.agreeIsImage = true;
|
|
|
|
|
}
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.agreementFileProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.agreementFileProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//上传申请表
|
|
|
|
|
$scope.uploadApplyFile = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
if (file.size > 3 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.applyFileProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.applyFileProgress;
|
|
|
|
|
$scope.file.file_apply_info = resp.data.url;
|
|
|
|
|
$scope.updateFile();
|
|
|
|
|
if ($scope.file.file_apply_info.endsWith('pdf')) {
|
|
|
|
|
$scope.applyIsImage = false;
|
|
|
|
|
} else {
|
|
|
|
|
$scope.applyIsImage = true;
|
|
|
|
|
}
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.applyFileProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.applyFileProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* $scope.downloadAsZip = function () {
|
|
|
|
|
var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP';
|
|
|
|
|
return url;
|
|
|
|
|
};
|
|
|
|
|
*/
|
|
|
|
|
$scope.updateFile = function () {
|
|
|
|
|
$http.put('/client/partner_info/update/file', $scope.file).then(function () {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Upload Successful',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
$state.reload();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function commitError() {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Error',
|
|
|
|
|
content: 'Missing file',
|
|
|
|
|
type: 'error'
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.clientComplianceViewCommit= function () {
|
|
|
|
|
if(!$scope.file.client_agree_file)
|
|
|
|
|
{
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '请提交* Agreement', type: 'error'});
|
|
|
|
|
return;
|
|
|
|
|
}else if(!$scope.file.client_id_file)
|
|
|
|
|
{
|
|
|
|
|
commonDialog.alert({title: 'Error', content:'请提交* ID', type: 'error'});
|
|
|
|
|
return;
|
|
|
|
|
}else if(!$scope.file.client_bank_file)
|
|
|
|
|
{
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '请提交* bank statement', type: 'error'});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if(!$scope.file.client_company_file)
|
|
|
|
|
{
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '请提交* Certificate of Registration', type: 'error'});
|
|
|
|
|
return;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/viewCommit', $scope.file).then(function () {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Upload Successful',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
$state.reload();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.deleteComplianceFiles = function (file_id) {
|
|
|
|
|
$scope.file_id = file_id;
|
|
|
|
|
|
|
|
|
|
/*$http.put('/sys/partners/' + $scope.partner.client_moniker + '/saveAdditional_content', {additional_content: $scope.partner.additional_content}).then(function (resp) {*/
|
|
|
|
|
$http.put('/client/partner_info/auth_file/' + $scope.file_id + '/delete').then(function (resp) {
|
|
|
|
|
$state.reload();
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.commitPartner = function () {
|
|
|
|
|
if ($scope.file) {
|
|
|
|
|
if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) {
|
|
|
|
|
$http.put('/client/partner_info/compliance_audit').then(function (resp) {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
commitError();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
commitError();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('clientCommitToComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) {
|
|
|
|
|
|
|
|
|
|
$scope.file = file.data || {};
|
|
|
|
|
$scope.client_files = file.data.client_files;
|
|
|
|
|
//audit files
|
|
|
|
|
$scope.uploadBankFile = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
if (file.size > 3 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.bankFileProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.bankFileProgress;
|
|
|
|
|
$scope.file.file_bank_info = resp.data.url;
|
|
|
|
|
$scope.updateFile();
|
|
|
|
|
if ($scope.file.file_bank_info.endsWith('pdf')) {
|
|
|
|
|
$scope.bankIsImage = false;
|
|
|
|
|
} else {
|
|
|
|
|
$scope.bankIsImage = true;
|
|
|
|
|
}
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.bankFileProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.bankFileProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
$scope.agreeIsImage = true;
|
|
|
|
|
if ($scope.file.file_agreement_info && $scope.file.file_agreement_info.endsWith('pdf')) {
|
|
|
|
|
$scope.agreeIsImage = false;
|
|
|
|
@ -720,11 +950,11 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* $scope.downloadAsZip = function () {
|
|
|
|
|
var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP';
|
|
|
|
|
return url;
|
|
|
|
|
};
|
|
|
|
|
*/
|
|
|
|
|
/* $scope.downloadAsZip = function () {
|
|
|
|
|
var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP';
|
|
|
|
|
return url;
|
|
|
|
|
};
|
|
|
|
|
*/
|
|
|
|
|
$scope.updateFile = function () {
|
|
|
|
|
$http.put('/client/partner_info/update/file', $scope.file).then(function () {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
@ -767,7 +997,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
|
|
|
|
|
return;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$http.put('/client/partner_info/clientCompliance/viewCommit', $scope.file).then(function () {
|
|
|
|
|
$http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/viewCommit', $scope.file).then(function () {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Upload Successful',
|
|
|
|
@ -780,11 +1010,10 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.deleteComplianceFiles = function (file_id) {
|
|
|
|
|
debugger;
|
|
|
|
|
$scope.file_id = file_id;
|
|
|
|
|
|
|
|
|
|
/*$http.put('/sys/partners/' + $scope.partner.client_moniker + '/saveAdditional_content', {additional_content: $scope.partner.additional_content}).then(function (resp) {*/
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/delete',{file_id: $scope.file_id}).then(function (resp) {
|
|
|
|
|
$http.put('/client/partner_info/auth_file/' + $scope.file_id + '/delete').then(function (resp) {
|
|
|
|
|
$state.reload();
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
@ -804,7 +1033,6 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('clientPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog','$uibModal', function ($scope, $http, $state, commonDialog, $uibModal) {
|
|
|
|
|
$scope.paymentInfo = $scope.partner;
|
|
|
|
|
$scope.old_customer_surcharge_rate = angular.copy($scope.partner.customer_surcharge_rate);
|
|
|
|
|