|
|
|
@ -140,8 +140,101 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
|
};
|
|
|
|
|
$scope.loadKYCDashboardInfo();
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('bdHelpKYCProgressCtrl', [ '$scope', '$http', '$state', 'file', 'commonDialog',function ($scope, $http, $state, file, commonDialog) {
|
|
|
|
|
app.controller('bdHelpKYCProgressCtrl', [ '$scope', '$http', '$state', 'file', 'commonDialog', '$location', '$anchorScroll','Upload',function ($scope, $http, $state, file, commonDialog, $location, $anchorScroll, Upload) {
|
|
|
|
|
$scope.file = angular.copy(file.data) || {};
|
|
|
|
|
$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.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.uploadCompanyFile = function (file) {
|
|
|
|
|
if (file != null) {
|
|
|
|
|
if (file.size > 3 * 1024 * 1024) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.billFileProgress = {value: 0};
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/attachment/files',
|
|
|
|
|
data: {file: file}
|
|
|
|
|
}).then(function (resp) {
|
|
|
|
|
delete $scope.billFileProgress;
|
|
|
|
|
$scope.file.utility_bill_info = resp.data.url;
|
|
|
|
|
$scope.updateFile();
|
|
|
|
|
if ($scope.file.utility_bill_info.endsWith('pdf')) {
|
|
|
|
|
$scope.billIsImage = false;
|
|
|
|
|
} else {
|
|
|
|
|
$scope.billIsImage = true;
|
|
|
|
|
}
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
delete $scope.billFileProgress;
|
|
|
|
|
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
$scope.billFileProgress.value = parseInt(100 * evt.loaded / evt.total);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
$scope.updateFile = function () {
|
|
|
|
|
$http.put('/sys/kyc/manage/'+ $scope.file.client.client_moniker + '/update', $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;
|
|
|
|
|
commonDialog.confirm({
|
|
|
|
@ -169,7 +262,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '请提交ID护照或驾照信息', type: 'error'});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (($scope.file.id_type == "" || $scope.file.id_type == undefined || $scope.file.id_type == null) && !$scope.file.file_company.bd_handle) {
|
|
|
|
|
if (($scope.file.file_company.id_type == "" || $scope.file.file_company.id_type == undefined || $scope.file.file_company.id_type == null) && !$scope.file.file_company.bd_handle) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: '请选择ID文件的类型', type: 'error'});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -199,6 +292,12 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.hrefBdHandle = function () {
|
|
|
|
|
$location.hash("bd-handle");
|
|
|
|
|
$anchorScroll();
|
|
|
|
|
$('#bd-handle').focus()
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('partnerDetailForBDHelpCtrl', [ '$scope', '$http', '$state', 'partner', 'commonDialog',function ($scope, $http, $state, partner, commonDialog) {
|
|
|
|
|
$scope.partner = angular.copy(partner.data);
|
|
|
|
|