|
|
|
@ -500,15 +500,37 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('partnerDetailCtrl', ['$scope', '$http', '$state', '$uibModal', '$rootScope', 'Upload', 'commonDialog', 'partner', function ($scope, $http, $state, $uibModal, $rootScope, Upload, commonDialog, partner) {
|
|
|
|
|
app.controller('partnerDetailCtrl', ['$scope', '$http', '$state', '$uibModal', '$rootScope', 'Upload', 'commonDialog', 'partner', '$sce', function ($scope, $http, $state, $uibModal, $rootScope, Upload, commonDialog, partner, $sce) {
|
|
|
|
|
$scope.init = {wechat_compliance: false, local_merchant: false};
|
|
|
|
|
$scope.partner = partner.data;
|
|
|
|
|
$scope.isComplianceOfCompanyName = false;
|
|
|
|
|
$scope.isComplianceOfShortName = false;
|
|
|
|
|
$scope.isComplianceOfBusinessStructure = false;
|
|
|
|
|
var website = partner.data.company_website;
|
|
|
|
|
if (website!=null){
|
|
|
|
|
if (website.indexOf('http')!=0){
|
|
|
|
|
$scope.partner.company_website= 'http://'+angular.copy(website);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$scope.decideCompliance = function (name) {
|
|
|
|
|
var keywords = ['education','financial' ,'train','immigrant','invest',
|
|
|
|
|
'律师咨询','会计事务所','移民留学','娱乐','金融','地产','投资'];
|
|
|
|
|
for(var i = 0; i < keywords.length; i++){
|
|
|
|
|
if (name.indexOf(keywords[i]) != -1) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
if (partner.data.company_name != null) {
|
|
|
|
|
$scope.isComplianceOfCompanyName = $scope.decideCompliance(partner.data.company_name);
|
|
|
|
|
}
|
|
|
|
|
if (partner.data.short_name != null) {
|
|
|
|
|
$scope.isComplianceOfShortName = $scope.decideCompliance(partner.data.short_name);
|
|
|
|
|
}
|
|
|
|
|
if (partner.data.business_structure != null) {
|
|
|
|
|
$scope.isComplianceOfBusinessStructure = $scope.decideCompliance(partner.data.business_structure);
|
|
|
|
|
}
|
|
|
|
|
$scope.showDBUsers = function () {
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/bd_user').then(function (resp) {
|
|
|
|
|
$scope.partner.client_bds = resp.data;
|
|
|
|
@ -548,9 +570,33 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
alert("Bank Account not checked");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var title = 'Audit Partner';
|
|
|
|
|
var content = 'Are you sure to mark partner ' + $scope.partner.company_name + ' audited?';
|
|
|
|
|
var choises = '';
|
|
|
|
|
var contentHtml = '';
|
|
|
|
|
if ($scope.isComplianceOfCompanyName || $scope.isComplianceOfShortName
|
|
|
|
|
|| $scope.isComplianceOfBusinessStructure) {
|
|
|
|
|
var info = [];
|
|
|
|
|
if ($scope.isComplianceOfCompanyName) {
|
|
|
|
|
info.push('Company Name');
|
|
|
|
|
}
|
|
|
|
|
if ($scope.isComplianceOfShortName) {
|
|
|
|
|
info.push('Short Name');
|
|
|
|
|
}
|
|
|
|
|
if ($scope.isComplianceOfBusinessStructure) {
|
|
|
|
|
info.push('Business Structure');
|
|
|
|
|
}
|
|
|
|
|
title = 'Warning';
|
|
|
|
|
contentHtml = $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],<span style="color: red">'+ info.toString() +'</span>存在微信渠道不合规信息');
|
|
|
|
|
choises = [{label: '取消', className: 'btn-danger', key: '2', dismiss: true},
|
|
|
|
|
{label: '确认提交', className: 'btn-success', key: '1'}];
|
|
|
|
|
content = '';
|
|
|
|
|
}
|
|
|
|
|
commonDialog.confirm({
|
|
|
|
|
title: 'Audit Partner',
|
|
|
|
|
content: 'Are you sure to mark partner ' + $scope.partner.company_name + ' audited?'
|
|
|
|
|
title: title,
|
|
|
|
|
content: content,
|
|
|
|
|
choises: choises,
|
|
|
|
|
contentHtml: contentHtml
|
|
|
|
|
}).then(function () {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit', {pass: 1}).then(function () {
|
|
|
|
|
if ($scope.partner.approve_result == 2 && ($scope.partner.source == 1 || $scope.partner.source == 2)) {
|
|
|
|
@ -1115,7 +1161,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog','$uibModal', function ($scope, $http, $state, commonDialog,$uibModal) {
|
|
|
|
|
app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog','$uibModal', '$sce', function ($scope, $http, $state, commonDialog,$uibModal, $sce) {
|
|
|
|
|
$scope.refresh = false;
|
|
|
|
|
$scope.loadPartnerPaymentInfo = function () {
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker).then(function (resp) {
|
|
|
|
@ -1314,6 +1360,34 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
var info = [];
|
|
|
|
|
$scope.decideCompliance = function (name) {
|
|
|
|
|
var keywords = ['education','financial' ,'train','immigrant','invest',
|
|
|
|
|
'律师咨询','会计事务所','移民留学','娱乐','金融','地产','投资'];
|
|
|
|
|
for(var i = 0; i < keywords.length; i++){
|
|
|
|
|
if (name.indexOf(keywords[i]) != -1) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
$scope.getComplianceInfo = function () {
|
|
|
|
|
if ($scope.paymentInfo.company_name != null) {
|
|
|
|
|
if($scope.decideCompliance($scope.paymentInfo.company_name)) {
|
|
|
|
|
info.push('Company Name');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($scope.paymentInfo.short_name != null) {
|
|
|
|
|
if($scope.decideCompliance($scope.paymentInfo.short_name)) {
|
|
|
|
|
info.push('Short Name');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($scope.paymentInfo.business_structure != null) {
|
|
|
|
|
if($scope.decideCompliance($scope.paymentInfo.business_structure)) {
|
|
|
|
|
info.push('Business Structure');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
$scope.toggleChannel = function (channel) {
|
|
|
|
|
if (!channel) {
|
|
|
|
|
return;
|
|
|
|
@ -1325,6 +1399,21 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.init.channel[channel] = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$scope.getComplianceInfo();
|
|
|
|
|
if ($scope.paymentInfo['enable_wechat'] && channel == 'wechat'
|
|
|
|
|
&& $scope.paymentInfo.open_status == 5 && info.length > 0) {
|
|
|
|
|
commonDialog.confirm({
|
|
|
|
|
title: "Warning",
|
|
|
|
|
contentHtml: $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],<span style="color: red">'+ info.toString() +'</span>存在微信渠道不合规信息')
|
|
|
|
|
}).then(function () {
|
|
|
|
|
$scope.saveChannel(channel);
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
$scope.saveChannel(channel);
|
|
|
|
|
}
|
|
|
|
|
info = [];
|
|
|
|
|
};
|
|
|
|
|
$scope.saveChannel = function (channel) {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/channels/' + channel + '/permission', {allow: $scope.paymentInfo['enable_' + channel]}).then(function () {
|
|
|
|
|
$scope.loadPartnerPaymentInfo();
|
|
|
|
|
}, function (resp) {
|
|
|
|
@ -1334,7 +1423,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
type: 'error'
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
$scope.toggleHfLink = function (channel) {
|
|
|
|
|
if (!channel) {
|
|
|
|
|
return;
|
|
|
|
|