@ -404,6 +404,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
}
} )
} )
}
}
if ( ! window . frames [ 'merchant_detail' ] . merchant _location ) {
alert ( "Please Locate Merchant's Location" ) ;
return ;
}
$http . post ( '/sys/partners' , $scope . partner ) . then ( function ( resp ) {
$http . post ( '/sys/partners' , $scope . partner ) . then ( function ( resp ) {
commonDialog . alert ( { title : 'Success' , content : 'Register new partner successfully' , type : 'success' } ) ;
commonDialog . alert ( { title : 'Success' , content : 'Register new partner successfully' , type : 'success' } ) ;
$scope . updateMerchantLocation ( ) ;
$scope . updateMerchantLocation ( ) ;
@ -473,8 +477,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
if ( params ) {
if ( params ) {
$http . put ( '/sys/partners/modify/' + $scope . partner . client _moniker + '/location' , params ) . then ( function ( ) {
$http . put ( '/sys/partners/modify/' + $scope . partner . client _moniker + '/location' , params ) . then ( function ( ) {
} ) ;
} ) ;
} else {
alert ( "Please Locate Merchant's Location" ) ;
}
}
}
}
} ] ) ;
} ] ) ;
@ -954,11 +956,14 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
}
} )
} )
}
}
$scope . updateMerchantLocation ( ) ;
var content = '' ;
var content = '' ;
if ( ! origin _referrer _id && $scope . partner . referrer _id ) {
if ( ! origin _referrer _id && $scope . partner . referrer _id ) {
content = 'Update partner info successfully,But You Had add new Referrer,Please Change the BD Commission Proportion!' ;
content = 'Update partner info successfully,But You Had add new Referrer,Please Change the BD Commission Proportion!' ;
}
}
if ( ! window . frames [ 'merchant_detail' ] . merchant _location ) {
alert ( "Please Locate Merchant Location!" ) ;
return ;
}
$http . put ( '/sys/partners/' + $scope . partner . client _moniker , $scope . partner ) . then ( function ( ) {
$http . put ( '/sys/partners/' + $scope . partner . client _moniker , $scope . partner ) . then ( function ( ) {
if ( content != '' ) {
if ( content != '' ) {
commonDialog . alert ( {
commonDialog . alert ( {
@ -973,6 +978,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
type : 'success'
type : 'success'
} ) ;
} ) ;
}
}
$scope . updateMerchantLocation ( ) ;
$scope . loadPartners ( ) ;
$scope . loadPartners ( ) ;
$state . go ( '^.detail' , { clientMoniker : $scope . partner . client _moniker } , { reload : true } ) ;
$state . go ( '^.detail' , { clientMoniker : $scope . partner . client _moniker } , { reload : true } ) ;
} , function ( resp ) {
} , function ( resp ) {
@ -1046,12 +1052,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
if ( params ) {
if ( params ) {
$http . put ( '/sys/partners/modify/' + $scope . partner . client _moniker + '/location' , params ) . then ( function ( ) {
$http . put ( '/sys/partners/modify/' + $scope . partner . client _moniker + '/location' , params ) . then ( function ( ) {
} ) ;
} ) ;
} else {
commonDialog . alert ( {
title : 'Warning' ,
content : 'Please Locate Merchant Location' ,
type : 'error'
} ) ;
}
}
}
}
} ] ) ;
} ] ) ;
@ -1495,6 +1495,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} ;
} ;
$scope . getRates ( ) ;
$scope . getRates ( ) ;
$scope . saveBankAccount = function ( ) {
$scope . saveBankAccount = function ( ) {
if ( isNaN ( $scope . bankaccount . account _no ) ) {
alert ( "Account No应输入数字!" ) ;
return ;
} ;
$http . put ( '/sys/partners/' + $scope . partner . client _moniker + '/bank_account' , $scope . bankaccount ) . then ( function ( ) {
$http . put ( '/sys/partners/' + $scope . partner . client _moniker + '/bank_account' , $scope . bankaccount ) . then ( function ( ) {
$scope . getBankAccount ( ) ;
$scope . getBankAccount ( ) ;
} , function ( resp ) {
} , function ( resp ) {
@ -1823,6 +1827,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
return ;
return ;
}
}
}
}
if ( ! $scope . partner . logo _url ) {
alert ( "Logo is necessary!" ) ;
return ;
}
if ( $scope . partner . partner _type == 'photo' ) {
if ( ! $scope . partner . company _photo ) {
alert ( 'Shop Photo1 is necessary' ) ;
return ;
}
if ( ! $scope . partner . store _photo ) {
alert ( 'Shop Photo2 is necessary' ) ;
return ;
}
}
if ( ! window . frames [ 'merchant_detail' ] . merchant _location ) {
alert ( "Please Locate Merchant Location!" ) ;
return ;
}
$http . post ( '/sys/partners/' + clientMoniker + '/sub_clients' , $scope . partner ) . then ( function ( ) {
$http . post ( '/sys/partners/' + clientMoniker + '/sub_clients' , $scope . partner ) . then ( function ( ) {
$scope . updateMerchantLocation ( ) ;
$scope . updateMerchantLocation ( ) ;
$scope . $close ( ) ;
$scope . $close ( ) ;
@ -1851,18 +1873,36 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope . uploadShopPhoto = function ( file ) {
$scope . uploadShopPhoto = function ( file ) {
if ( file != null ) {
if ( file != null ) {
$scope . photoProgress = { value : 0 } ;
$scope . sho pP hotoProgress = { value : 0 } ;
Upload . upload ( {
Upload . upload ( {
url : '/attachment/files' ,
url : '/attachment/files' ,
data : { file : file }
data : { file : file }
} ) . then ( function ( resp ) {
} ) . then ( function ( resp ) {
delete $scope . photoProgress;
delete $scope . sho pP hotoProgress;
$scope . partner . company _photo = resp . data . url ;
$scope . partner . company _photo = resp . data . url ;
} , function ( resp ) {
} , function ( resp ) {
delete $scope . photoProgress;
delete $scope . sho pP hotoProgress;
commonDialog . alert ( { title : 'Upload Failed' , content : resp . data . message , type : 'error' } )
commonDialog . alert ( { title : 'Upload Failed' , content : resp . data . message , type : 'error' } )
} , function ( evt ) {
} , function ( evt ) {
$scope . photoProgress . value = parseInt ( 100 * evt . loaded / evt . total ) ;
$scope . shopPhotoProgress . value = parseInt ( 100 * evt . loaded / evt . total ) ;
} )
}
} ;
$scope . uploadStorePhoto = function ( file ) {
if ( file != null ) {
$scope . storePhotoProgress = { value : 0 } ;
Upload . upload ( {
url : '/attachment/files' ,
data : { file : file }
} ) . then ( function ( resp ) {
delete $scope . storePhotoProgress ;
$scope . partner . store _photo = resp . data . url ;
} , function ( resp ) {
delete $scope . storePhotoProgress ;
commonDialog . alert ( { title : 'Upload Failed' , content : resp . data . message , type : 'error' } )
} , function ( evt ) {
$scope . storePhotoProgress . value = parseInt ( 100 * evt . loaded / evt . total ) ;
} )
} )
}
}
} ;
} ;
@ -1871,12 +1911,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
if ( params ) {
if ( params ) {
$http . put ( '/sys/partners/modify/' + $scope . partner . client _moniker + '/location' , params ) . then ( function ( ) {
$http . put ( '/sys/partners/modify/' + $scope . partner . client _moniker + '/location' , params ) . then ( function ( ) {
} ) ;
} ) ;
} else {
commonDialog . alert ( {
title : 'Warning' ,
content : 'Please Locate Merchant Location' ,
type : 'error'
} ) ;
}
}
}
}
} ] ) ;
} ] ) ;