fix saveSubMerchantId refresh

master
luoyang 6 years ago
parent 7d8ec01b19
commit e2f050450b

@ -647,7 +647,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.showFile();
$scope.passClient = function () {
if(!$scope.partner.wechat_institution_merchant_id){
commonDialog.alert({title: 'info', content: 'Wechat Institution Merchant Id not Refresh', type: 'info'});
commonDialog.alert({title: 'info', content: 'HF Institution Merchant Id not Refresh', type: 'info'});
return;
}
if ($scope.partner.enable_hf) {
@ -1297,7 +1297,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
}]);
app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog','$uibModal', '$sce', function ($scope, $http, $state, commonDialog,$uibModal, $sce) {
$scope.refresh = false;
$scope.copyHfLink = function() {
var e=document.getElementById("cpbt");
e.select();
@ -1452,23 +1451,26 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.ctrl = {};
$scope.saveSubMerchantId = function () {
if(!$scope.refresh){
commonDialog.alert({title: 'info', content: 'Wechat Institution Merchant Id not Refresh', type: 'info'});
return;
}
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: $scope.paymentInfo.sub_merchant_id}).then(function (resp) {
$scope.refreshInstitutionAfterSaveMerchantId();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
$scope.refreshInstitutionAfterSaveMerchantId = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_institution_merchant_id', {wechat_institution_merchant_id: $scope.paymentInfo.wechat_institution_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Modify Wechat Sub Merchant ID successfully',
content: 'Modify Wechat Sub Merchant ID And Refresh Wechat Institution Merchant Id successfully',
type: 'success'
});
$scope.refresh = false;
$scope.loadPartnerPaymentInfo();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
$scope.refreshWechatInstitutionMerchantId = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_institution_merchant_id', {wechat_institution_merchant_id: $scope.paymentInfo.wechat_institution_merchant_id}).then(function (resp) {
commonDialog.alert({
@ -1476,7 +1478,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
content: 'Refresh Wechat Institution Merchant Id successfully',
type: 'success'
});
$scope.refresh = true;
$scope.loadPartnerPaymentInfo();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})

Loading…
Cancel
Save