|
|
|
@ -32,51 +32,51 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
];
|
|
|
|
|
var wxMerchantIndustries = [
|
|
|
|
|
{
|
|
|
|
|
"label": "鞋包服饰",
|
|
|
|
|
"label": "鞋包服饰|Shoes&Garments",
|
|
|
|
|
"value": "343"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "机票行业",
|
|
|
|
|
"label": "机票行业|Air Ticket",
|
|
|
|
|
"value": "493"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "文具/办公用品",
|
|
|
|
|
"label": "文具/办公用品|Stationery/office supplies",
|
|
|
|
|
"value": "492"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "酒店行业",
|
|
|
|
|
"label": "酒店行业|Hotel Industry",
|
|
|
|
|
"value": "491"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "教育行业",
|
|
|
|
|
"label": "教育行业|Education Industry",
|
|
|
|
|
"value": "490"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "国际物流",
|
|
|
|
|
"label": "国际物流|Logistics",
|
|
|
|
|
"value": "489"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "数码电器",
|
|
|
|
|
"label": "数码电器|Digital appliance",
|
|
|
|
|
"value": "488"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "母婴",
|
|
|
|
|
"label": "母婴|Maternal and infant",
|
|
|
|
|
"value": "487"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "化妆品",
|
|
|
|
|
"label": "化妆品|Cosmetics",
|
|
|
|
|
"value": "486"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "食品",
|
|
|
|
|
"label": "食品|Food",
|
|
|
|
|
"value": "485"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "综合商城",
|
|
|
|
|
"label": "综合商城|Comprehensive mall",
|
|
|
|
|
"value": "484"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "其它货物贸易行业",
|
|
|
|
|
"label": "其它货物贸易行业|Other trade industry",
|
|
|
|
|
"value": "494"
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
@ -2576,12 +2576,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('subMerchantIdApplicaitonsCtrl', ['$scope', '$http', '$uibModal','$state', function ($scope, $http, $uibModal, $state) {
|
|
|
|
|
app.controller('subMerchantIdApplicaitonsCtrl', ['$scope', '$http', '$uibModal','$state','commonDialog', function ($scope, $http, $uibModal, $state,commonDialog) {
|
|
|
|
|
$scope.loadSubMerchantInfos = function () {
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_sub_applices', {params: {}}).then(function (resp) {
|
|
|
|
|
$scope.subMerchantInfos = resp.data;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
$scope.useSubMerchantId = function (sub_merchant_id) {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: sub_merchant_id}).then(function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Modify Wechat Sub Merchant ID successfully',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
$state.reload();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
$scope.applySubMerchantId = function () {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/payment/partner/templates/apply_sub_merchant_id.html',
|
|
|
|
@ -2600,7 +2612,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
};
|
|
|
|
|
$scope.loadSubMerchantInfos();
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('applySubMerchantIdCtrl', ['$scope', '$http', '$uibModal','$state','subMerchantInfo', '$filter','merchantIds', function ($scope, $http, $uibModal, $state, subMerchantInfo,$filter,merchantIds) {
|
|
|
|
|
app.controller('applySubMerchantIdCtrl', ['$scope', '$http', '$uibModal','$state','subMerchantInfo', '$filter','merchantIds','commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo,$filter,merchantIds,commonDialog) {
|
|
|
|
|
$scope.wxIndustries = angular.copy(wxMerchantIndustries);
|
|
|
|
|
$scope.subMerchantInfo = angular.copy(subMerchantInfo);
|
|
|
|
|
$scope.merchantIds = merchantIds.data;
|
|
|
|
@ -2615,10 +2627,34 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker+ '/sub_apply', $scope.subMerchantInfo).then(function () {
|
|
|
|
|
alert("Success");
|
|
|
|
|
$http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker+ '/sub_apply', $scope.subMerchantInfo).then(function (resp) {
|
|
|
|
|
$scope.apply_sub_merchant_id = resp.data;
|
|
|
|
|
$scope.$close();
|
|
|
|
|
$state.reload();
|
|
|
|
|
if(subMerchantInfo.sub_merchant_id != null){
|
|
|
|
|
commonDialog.confirm({title:'Confirm',content:'已申请成功,是否确认使用'}).then(function () {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Modify Wechat Sub Merchant ID successfully',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
$state.reload();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Apply Success And Modify Wechat Sub Merchant ID successfully',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
$state.reload();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
$scope.errmsg = resp.data.message;
|
|
|
|
|
})
|
|
|
|
@ -2640,7 +2676,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
return bdUsers;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.filter('wxMerchants', function () {
|
|
|
|
|
return function (values) {
|
|
|
|
|
var industry = '';
|
|
|
|
|
angular.forEach(wxMerchantIndustries, function (wxMerchant) {
|
|
|
|
|
if (wxMerchant.value == values) {
|
|
|
|
|
industry = wxMerchant.label;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return industry;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
app.filter('bdOrgSelect', function () {
|
|
|
|
|
return function (bdUsers, params) {
|
|
|
|
|
var org_id;
|
|
|
|
@ -2700,5 +2746,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.filter('cut', function () {
|
|
|
|
|
return function (value, wordwise, max, tail) {
|
|
|
|
|
if (!value) return '';
|
|
|
|
|
|
|
|
|
|
max = parseInt(max, 10);
|
|
|
|
|
if (!max) return value;
|
|
|
|
|
if (value.length <= max) return value;
|
|
|
|
|
|
|
|
|
|
value = value.substr(0, max);
|
|
|
|
|
if (wordwise) {
|
|
|
|
|
var lastspace = value.lastIndexOf(' ');
|
|
|
|
|
if (lastspace != -1) {
|
|
|
|
|
value = value.substr(0, lastspace);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return value + (tail || ' …');
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
return app;
|
|
|
|
|
});
|