@ -167,28 +167,41 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
} ;
$scope . commitToCompliance = function ( ) {
$http . get ( '/client/partner_info/compliance/files' ) . then ( function ( resp ) {
$scope . complianceFiles = resp . data ;
if ( $scope . complianceFiles . client _id _file == null || $scope . complianceFiles . client _bank _file == null || $scope . complianceFiles . client _company _file == null ) {
commonDialog . alert ( { title : 'Message' , content : '请前去完善合规资料,再进行提交!' , type : 'info' } ) ;
return ;
}
if ( $scope . partner . business _structure == null || $scope . partner . logo _url == null || $scope . partner . description == null || ( ( $scope . partner . store _photo == null || $scope . partner . company _photo == null ) && $scope . currentUser . client . company _website == null ) ) {
commonDialog . alert ( { title : 'Message' , content : '请前去完善商户资料,再进行提交!' , type : 'info' } ) ;
return ;
}
if ( ( $scope . partner . business _structure == "Company" && $scope . partner . acn == null ) || ( $scope . partner . business _structure != "Company" && $scope . partner . abn == null ) ) {
commonDialog . alert ( { title : 'Message' , content : '请前去完善商户资料,再进行提交!' , type : 'info' } ) ;
return ;
}
if ( ! $scope . partner . mail _confirm ) {
commonDialog . alert ( { title : 'Message' , content : '请验证邮箱后,再进行提交!' , type : 'info' } ) ;
return ;
commonDialog . confirm ( {
title : 'Commit to Compliance' ,
content : 'Are you sure to commit ' + $scope . partner . company _name + ' to compliance? ' ,
choises : [
{ label : 'Submit' , className : 'btn-success' , key : 1 } ,
{ label : 'Cancel' , className : 'btn-warning' , key : 0 , dismiss : true }
]
} ) . then ( function ( choice ) {
if ( choice == 1 ) {
$http . get ( '/client/partner_info/compliance/files' ) . then ( function ( resp ) {
$scope . complianceFiles = resp . data ;
if ( $scope . complianceFiles . client _id _file == null || $scope . complianceFiles . client _bank _file == null || $scope . complianceFiles . client _company _file == null ) {
commonDialog . alert ( { title : 'Message' , content : '请前去完善合规资料,再进行提交!' , type : 'info' } ) ;
return ;
}
if ( $scope . partner . business _structure == null || $scope . partner . logo _url == null || $scope . partner . description == null || ( ( $scope . partner . store _photo == null || $scope . partner . company _photo == null ) && $scope . currentUser . client . company _website == null ) ) {
commonDialog . alert ( { title : 'Message' , content : '请前去完善商户资料,再进行提交!' , type : 'info' } ) ;
return ;
}
if ( ( $scope . partner . business _structure == "Company" && $scope . partner . acn == null ) || ( $scope . partner . business _structure != "Company" && $scope . partner . abn == null ) ) {
commonDialog . alert ( { title : 'Message' , content : '请前去完善商户资料,再进行提交!' , type : 'info' } ) ;
return ;
}
if ( ! $scope . partner . mail _confirm ) {
commonDialog . alert ( { title : 'Message' , content : '请验证邮箱后,再进行提交!' , type : 'info' } ) ;
return ;
}
$http . post ( '/client/partner_info/compliance_audit' ) . then ( function ( ) {
commonDialog . alert ( { title : 'Success' , content : '已提交至合规,请耐心等待审核!' , type : 'info' } ) ;
$state . reload ( ) ;
} ) ;
} ) ;
}
$http . post ( '/client/partner_info/compliance_audit' ) . then (
commonDialog . alert ( { title : 'Success' , content : '已提交至合规,请耐心等待审核!' , type : 'info' } )
) ;
} ) ;
} )
}
} ] ) ;
app . controller ( 'clientComplianceFilesCtrl' , [ '$scope' , '$http' , '$rootScope' , 'commonDialog' , '$state' , 'Upload' , 'file' , function ( $scope , $http , $rootScope , commonDialog , $state , Upload , file ) {