|
|
@ -46,6 +46,8 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
$scope.states = stateMap.configs();
|
|
|
|
$scope.states = stateMap.configs();
|
|
|
|
$scope.countries = countryMap.configs();
|
|
|
|
$scope.countries = countryMap.configs();
|
|
|
|
$scope.params = {};
|
|
|
|
$scope.params = {};
|
|
|
|
|
|
|
|
$scope.merchantIsValid = false;
|
|
|
|
|
|
|
|
$scope.merchantCodeChecked = false;
|
|
|
|
|
|
|
|
|
|
|
|
$scope.loadPartners = function (page) {
|
|
|
|
$scope.loadPartners = function (page) {
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
@ -57,18 +59,25 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
};
|
|
|
|
};
|
|
|
|
$scope.linkButton = function (obj) {
|
|
|
|
$scope.linkButton = function (obj) {
|
|
|
|
var partner = angular.copy(obj);
|
|
|
|
var partner = angular.copy(obj);
|
|
|
|
partner.link = true;
|
|
|
|
$http.get('/sys/partners/init/merchant_code').then(function (response) {
|
|
|
|
$uibModal.open({
|
|
|
|
partner.client_moniker = response.data.partner_code;
|
|
|
|
templateUrl: '/static/payment/partner/templates/partner_application_pass.html',
|
|
|
|
console.log('partner.client_moniker',partner.client_moniker)
|
|
|
|
controller: 'passApplicationCtrl',
|
|
|
|
console.log('partner',partner)
|
|
|
|
resolve: {
|
|
|
|
$scope.merchantCodeChecked = true;
|
|
|
|
partner: partner
|
|
|
|
$scope.merchantIsValid = true;
|
|
|
|
}
|
|
|
|
partner.link = true;
|
|
|
|
}).result.then(function () {
|
|
|
|
$uibModal.open({
|
|
|
|
commonDialog.alert({title: 'Success', content: '关联成功!', type: 'success'});
|
|
|
|
templateUrl: '/static/payment/partner/templates/partner_application_pass.html',
|
|
|
|
$state.reload();
|
|
|
|
controller: 'passApplicationCtrl',
|
|
|
|
// $state.go('partner_application.detail', {client_apply_id: obj.client_apply_id}, {reload: true});
|
|
|
|
resolve: {
|
|
|
|
})
|
|
|
|
partner: partner
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).result.then(function () {
|
|
|
|
|
|
|
|
commonDialog.alert({title: 'Success', content: '关联成功!', type: 'success'});
|
|
|
|
|
|
|
|
$state.reload();
|
|
|
|
|
|
|
|
// $state.go('partner_application.detail', {client_apply_id: obj.client_apply_id}, {reload: true});
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$scope.loadPartners(1);
|
|
|
|
$scope.loadPartners(1);
|
|
|
@ -177,6 +186,8 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
}]);
|
|
|
|
}]);
|
|
|
|
app.controller('passApplicationCtrl', ['$scope', '$http', '$state', 'partner', function ($scope, $http, $state, partner) {
|
|
|
|
app.controller('passApplicationCtrl', ['$scope', '$http', '$state', 'partner', function ($scope, $http, $state, partner) {
|
|
|
|
$scope.partner = angular.copy(partner);
|
|
|
|
$scope.partner = angular.copy(partner);
|
|
|
|
|
|
|
|
$scope.merchantCodeChecked = false;
|
|
|
|
|
|
|
|
$scope.merchantIsValid = false;
|
|
|
|
$scope.submit = function (form) {
|
|
|
|
$scope.submit = function (form) {
|
|
|
|
if (form.$invalid) {
|
|
|
|
if (form.$invalid) {
|
|
|
|
angular.forEach(form, function (item, key) {
|
|
|
|
angular.forEach(form, function (item, key) {
|
|
|
@ -198,6 +209,28 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
});
|
|
|
|
});
|
|
|
|
//$rootScope.partner_application = $scope.client;
|
|
|
|
//$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) {
|
|
|
|
$scope.link = function (form) {
|
|
|
|
if (form.$invalid) {
|
|
|
|
if (form.$invalid) {
|
|
|
|
angular.forEach(form, function (item, key) {
|
|
|
|
angular.forEach(form, function (item, key) {
|
|
|
|