|
|
|
@ -167,6 +167,15 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
return $http.get('/sys/partners/' + $stateParams.clientMoniker + '/file');
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
}).state('partners.detail.kyc_files', {
|
|
|
|
|
url: '/kyc_files',
|
|
|
|
|
templateUrl: '/static/payment/kyc/templates/partner_kyc_files.html',
|
|
|
|
|
controller: 'partnerKycFileCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
file: ['$http', '$stateParams', function ($http, $stateParams) {
|
|
|
|
|
return $http.get('/sys/partners/' + $stateParams.clientMoniker + '/kycFile');
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
}).state('partners.detail.settlement', {
|
|
|
|
|
url: '/settlement',
|
|
|
|
|
templateUrl: '/static/payment/partner/templates/partner_settlement.html',
|
|
|
|
@ -4044,6 +4053,171 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.complianceChangeCheck();
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('partnerKycFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) {
|
|
|
|
|
|
|
|
|
|
$scope.file = file.data || {};
|
|
|
|
|
//kyc 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.bankIsImage = true;
|
|
|
|
|
if ($scope.file.file_bank_info && $scope.file.file_bank_info.endsWith('pdf')) {
|
|
|
|
|
$scope.bankIsImage = false;
|
|
|
|
|
}
|
|
|
|
|
$scope.idIsImage = true;
|
|
|
|
|
if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) {
|
|
|
|
|
$scope.idIsImage = false;
|
|
|
|
|
}
|
|
|
|
|
$scope.billIsImage = true;
|
|
|
|
|
if ($scope.file.file_company_info && $scope.file.file_company_info.endsWith('pdf')) {
|
|
|
|
|
$scope.billIsImage = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//上传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.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.downloadAsZip = function () {
|
|
|
|
|
var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP';
|
|
|
|
|
return url;
|
|
|
|
|
};*/
|
|
|
|
|
|
|
|
|
|
$scope.deleteComplianceFiles = function (file_id) {
|
|
|
|
|
commonDialog.confirm({
|
|
|
|
|
title: 'Warning',
|
|
|
|
|
content: 'This operation will delete the file, Are you sure?'
|
|
|
|
|
}).then(function () {
|
|
|
|
|
$http.put('/sys/partners/auth_file/' + file_id + '/delete').then(function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Delete Successful',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
$state.reload();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.updateFile = function () {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/kycFile', $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.complianceCheck = function () {
|
|
|
|
|
if (!$rootScope.complianceCheck) {
|
|
|
|
|
$rootScope.complianceCheck = {};
|
|
|
|
|
}
|
|
|
|
|
$rootScope.complianceCheck.client_id = $scope.partner.client_id;
|
|
|
|
|
$rootScope.complianceCheck.authFile = true;
|
|
|
|
|
};
|
|
|
|
|
$scope.complianceChangeCheck = function () {
|
|
|
|
|
if ($rootScope.complianceCheck) {
|
|
|
|
|
if ($scope.partner.client_id != $rootScope.complianceCheck.client_id) {
|
|
|
|
|
delete $rootScope.complianceCheck;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
$scope.complianceChangeCheck();
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('partnerSettlementCtrl', ['$scope', '$uibModal', '$http', 'clientMoniker', '$filter', function ($scope, $uibModal, $http, clientMoniker, $filter) {
|
|
|
|
|
$scope.params = {};
|
|
|
|
|
$scope.pagination = {};
|
|
|
|
|