@ -55,6 +55,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope . pagination = resp . data . pagination ;
} ) ;
} ;
$scope . linkButton = function ( obj ) {
var partner = angular . copy ( obj ) ;
partner . link = true ;
@ -153,12 +154,19 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
commonDialog . alert ( { title : 'Error' , content : resp . data . message , type : 'error' } )
} ) ;
} ;
$scope . pass = function ( obj ) {
$scope . pass = function ( partner ) {
$http . get ( '/sys/partners/init/merchant_code' ) . then ( function ( response ) {
partner . client _moniker = response . data . partner _code ;
console . log ( 'partner.client_moniker' , partner . client _moniker )
console . log ( 'partner' , partner )
$scope . merchantCodeChecked = true ;
$scope . merchantIsValid = true ;
$uibModal . open ( {
templateUrl : '/static/payment/partner/templates/partner_application_pass.html' ,
controller : 'passApplicationCtrl' ,
resolve : {
partner : obj
partner : partner
}
} ) . result . then ( function ( ) {
commonDialog . alert ( {
@ -168,6 +176,26 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
} ) ;
// $state.go('partner_application.detail', {client_apply_id: obj.client_apply_id}, {reload: true});
} )
} ) ;
/ * $ u i b M o d a l . o p e n ( {
templateUrl : '/static/payment/partner/templates/partner_application_pass.html' ,
controller : 'passApplicationCtrl' ,
resolve : {
partner : obj ,
isPass : true
}
} ) . result . then ( function ( ) {
commonDialog . alert ( {
title : 'Success' ,
content : 'Pass Successfully ! 您成功建立了新的商户,请及时完善信息。' ,
type : 'success'
} ) ;
// $state.go('partner_application.detail', {client_apply_id: obj.client_apply_id}, {reload: true});
} ) * /
} ;
$scope . updateRemark = function ( ) {
var obj = angular . copy ( $scope . partner ) ;
@ -177,6 +205,8 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
} ] ) ;
app . controller ( 'passApplicationCtrl' , [ '$scope' , '$http' , '$state' , 'partner' , function ( $scope , $http , $state , partner ) {
$scope . partner = angular . copy ( partner ) ;
$scope . merchantCodeChecked = false ;
$scope . merchantIsValid = false ;
$scope . submit = function ( form ) {
if ( form . $invalid ) {
angular . forEach ( form , function ( item , key ) {
@ -198,6 +228,28 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
} ) ;
//$rootScope.partner_application = $scope.client;
} ;
$scope . initMerchantCode = function ( ) {
$http . get ( '/sys/partners/init/merchant_code' ) . then ( function ( response ) {
$scope . partner . client _moniker = response . data . partner _code ;
console . log ( 'refresh' , $scope . partner . client _moniker )
$scope . merchantCodeChecked = true ;
$scope . merchantIsValid = true ;
} ) ;
} ;
$scope . checkMerchantCodeIsValid = function ( code ) {
if ( code . length != 4 ) {
$scope . merchantCodeChecked = false ;
$scope . merchantIsValid = false ;
return ;
}
$http . get ( '/sys/partners/init/check_code_isvalid' , { params : { clientMoniker : code } } ) . then ( function ( response ) {
$scope . merchantIsValid = response . data ;
$scope . merchantCodeChecked = true ;
} ) ;
} ;
$scope . link = function ( form ) {
if ( form . $invalid ) {
angular . forEach ( form , function ( item , key ) {