diff --git a/src/main/ui/static/commons/directives/multiLevelSelect.js b/src/main/ui/static/commons/directives/multiLevelSelect.js
index 1e389668f..512f1c4b2 100644
--- a/src/main/ui/static/commons/directives/multiLevelSelect.js
+++ b/src/main/ui/static/commons/directives/multiLevelSelect.js
@@ -10,7 +10,8 @@ define(['../app', 'angular', 'jquery', 'css!../css/multiLevelSelect'], function
multiLevelSelectPopup: '=',
childrenKey: '@',
labelKey: '@',
- onSelect: '&'
+ onSelect: '&',
+ choseOneLevel: '='
},
link: function (scope, element, attr) {
var selectBox,bg;
@@ -27,8 +28,8 @@ define(['../app', 'angular', 'jquery', 'css!../css/multiLevelSelect'], function
top: (offset.top + $(this).outerHeight() + 3) + 'px',
left: offset.left + 'px'
});
- var container = $('
').appendTo(selectBox);
- initSelectLevel(container, scope.multiLevelSelectPopup, 0);
+ var container = $('
').appendTo(selectBox);
+ initSelectLevel(container, scope.multiLevelSelectPopup, 0, scope.choseOneLevel);
var $body = $('body');
selectBox.appendTo($body);
bg = $('
').css({position:'fixed',top:0,left:0,right:0,bottom:0,zIndex:9998}).appendTo($body);
@@ -40,8 +41,7 @@ define(['../app', 'angular', 'jquery', 'css!../css/multiLevelSelect'], function
});
-
- function initSelectLevel(container, list, groupIndex) {
+ function initSelectLevel(container, list, groupIndex, choseOneLevel) {
if (selectGroups[groupIndex]) {
var groups = selectGroups.splice(groupIndex, 999);
angular.forEach(groups, function (group) {
@@ -61,7 +61,8 @@ define(['../app', 'angular', 'jquery', 'css!../css/multiLevelSelect'], function
scope.onSelect({$selected: item});
})
- }catch(err){}
+ } catch (err) {
+ }
selectBox.remove();
bg.remove();
selectBox = null;
@@ -74,10 +75,25 @@ define(['../app', 'angular', 'jquery', 'css!../css/multiLevelSelect'], function
li.addClass('active');
initSelectLevel(container, item.children, groupIndex + 1);
});
+ if (choseOneLevel) {
+ li.click(function () {
+ if (angular.isFunction(scope.onSelect)) {
+ try {
+ scope.$apply(function () {
+ scope.onSelect({$selected: item});
+
+ })
+ }catch(err){}
+ selectBox.remove();
+ bg.remove();
+ selectBox = null;
+ }
+ });
+ }
}
})
}
}
}
}])
-});
\ No newline at end of file
+});
diff --git a/src/main/ui/static/commons/filters/commonFilters.js b/src/main/ui/static/commons/filters/commonFilters.js
index e6452c454..2bb0caf65 100644
--- a/src/main/ui/static/commons/filters/commonFilters.js
+++ b/src/main/ui/static/commons/filters/commonFilters.js
@@ -9,6 +9,12 @@ define(['../app', 'jquery'], function (app, $) {
dataType: 'json',
success: function (data) {
royalpay = data;
+ var selectAll = {
+ "label": "All",
+ "mccCode": "0",
+ "children":{}
+ };
+ royalpay.unshift(selectAll);
}
});
diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js
index f00a66158..a6c2209ce 100644
--- a/src/main/ui/static/payment/partner/partner-manage.js
+++ b/src/main/ui/static/payment/partner/partner-manage.js
@@ -224,14 +224,32 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.analysisClients();
}
$scope.pagination = {};
- $scope.industries = industryMap.configs();
$scope.states = stateMap.configs();
$scope.countries = countryMap.configs();
$scope.sectors = sectorMap.configs();
$scope.business_structures = businessStructuresMap.configs();
$scope.clean_days = angular.copy(clean_days_map);
$scope.bd_citys = angular.copy(bd_city_map);
- $scope.params = {textType: 'all', org_name: 'ALL'};
+ $scope.params = {textType: 'all', org_name: 'ALL', industry: "0"};
+ $scope.loadRoyalpayindustry = function () {
+ $http.get('/static/data/royalpayindustry.json').then(function (resp) {
+ $scope.royalpayindustry = resp.data;
+ var selectAll = {
+ "label": "All",
+ "mccCode": "0",
+ "children":{}
+ };
+ $scope.royalpayindustry.unshift(selectAll);
+ })
+ };
+
+ $scope.loadRoyalpayindustry();
+
+ $scope.onRoyalPayIndustrySelect = function (selectedItem) {
+ $scope.params.royalpay_label = selectedItem.label;
+ $scope.params.industry = selectedItem.mccCode;
+ $scope.loadPartners(1);
+ };
$scope.loadPartners = function (page) {
var params = angular.copy($scope.params);
diff --git a/src/main/ui/static/payment/partner/templates/add_partner.html b/src/main/ui/static/payment/partner/templates/add_partner.html
index a89d75908..81a32685b 100644
--- a/src/main/ui/static/payment/partner/templates/add_partner.html
+++ b/src/main/ui/static/payment/partner/templates/add_partner.html
@@ -1197,7 +1197,8 @@
name="alipay_category" readonly
ng-model="partner.alipay_category"
multi-level-select-popup="alipayMccCategory"
- on-select="onAlipayMccSelect($selected)">
+ on-select="onAlipayMccSelect($selected)"
+ chose-one-level="false">
Required
@@ -1291,13 +1292,14 @@