|
|
|
@ -2470,8 +2470,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.loadSubClients = function (page) {
|
|
|
|
|
$scope.page = page || $scope.pagination.page || 1;
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/'+$scope.page).then(function (resp) {
|
|
|
|
|
var params = {};
|
|
|
|
|
params.page = page || $scope.pagination.page || 1;
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page',{params : params}).then(function (resp) {
|
|
|
|
|
$scope.subPartners = resp.data.data;
|
|
|
|
|
$scope.pagination = resp.data.pagination;
|
|
|
|
|
});
|
|
|
|
@ -3383,6 +3384,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.isLevel3All = true;
|
|
|
|
|
$scope.clients = [$scope.partner];
|
|
|
|
|
$scope.showLevel3Clients = false;
|
|
|
|
|
$scope.subClientTable1 = [$scope.partner];
|
|
|
|
|
$scope.subClientTable2 = [];
|
|
|
|
|
$scope.choseSubClientNow = 'chose';
|
|
|
|
|
$scope.more20ChoseSubClient = false;
|
|
|
|
|
$scope.subSearchText = '';
|
|
|
|
|
|
|
|
|
|
$scope.today = new Date();
|
|
|
|
|
$scope.chooseToday = function () {
|
|
|
|
@ -3450,6 +3456,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
delete params.gatewayChilds;
|
|
|
|
|
delete params.gatewayChild;
|
|
|
|
|
}
|
|
|
|
|
if ($scope.isAll) {
|
|
|
|
|
delete params.client_ids;
|
|
|
|
|
}
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/trade_logs', {params: params}).then(function (resp) {
|
|
|
|
|
$scope.tradeLogs = resp.data.data;
|
|
|
|
|
$scope.pagination = resp.data.pagination;
|
|
|
|
@ -3484,6 +3493,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
});
|
|
|
|
|
$scope.chooseClient = function (client) {
|
|
|
|
|
if (client == 'all') {
|
|
|
|
|
$scope.choseSubClientNow = 'chose';
|
|
|
|
|
$scope.params.client_ids = angular.copy($scope.clientIds);
|
|
|
|
|
$scope.isAll = true;
|
|
|
|
|
$scope.chooseClientId = '';
|
|
|
|
@ -3520,10 +3530,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
$scope.loadTradeLogs();
|
|
|
|
|
};
|
|
|
|
|
if ($scope.partner.has_children && !$scope.partner.hide_sub_mch) {
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients').then(function (resp) {
|
|
|
|
|
var clientList = resp.data;
|
|
|
|
|
$scope.searchSubClients = function (subSearchText,page) {
|
|
|
|
|
$scope.subClientTable1 = [$scope.partner];
|
|
|
|
|
$scope.subClientTable2 = [];
|
|
|
|
|
var params = {};
|
|
|
|
|
params.page = page || $scope.subClientPagination.page || 1;
|
|
|
|
|
if (subSearchText != '') {
|
|
|
|
|
$scope.subSearchText = subSearchText;
|
|
|
|
|
params.searchText = subSearchText;
|
|
|
|
|
}
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page',{params: params}).then(function (resp) {
|
|
|
|
|
var clientList = resp.data.data;
|
|
|
|
|
$scope.subClientPagination = resp.data.pagination;
|
|
|
|
|
clientList.forEach(function (client) {
|
|
|
|
|
if ($scope.subClientTable1.length < 11) {
|
|
|
|
|
$scope.subClientTable1.push(client);
|
|
|
|
|
}else {
|
|
|
|
|
$scope.subClientTable2.push(client);
|
|
|
|
|
}
|
|
|
|
|
$scope.clients.push(client);
|
|
|
|
|
});
|
|
|
|
|
$scope.clientIds = [];
|
|
|
|
@ -3536,12 +3560,27 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$scope.params.client_ids = angular.copy($scope.clientIds);
|
|
|
|
|
//console.log($rootScope.currentUser.client.clientList);
|
|
|
|
|
$scope.loadTradeLogs(1);
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if ($scope.partner.has_children && !$scope.partner.hide_sub_mch) {
|
|
|
|
|
$scope.searchSubClients('',1);
|
|
|
|
|
$scope.loadTradeLogs(1);
|
|
|
|
|
} else {
|
|
|
|
|
$scope.loadTradeLogs(1);
|
|
|
|
|
}
|
|
|
|
|
$scope.checkSubClientChoseShow = function (client) {
|
|
|
|
|
$scope.more20ChoseSubClient = !$scope.more20ChoseSubClient;
|
|
|
|
|
if (client != '') {
|
|
|
|
|
$scope.choseSubClientNow = client.short_name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$scope.clickDisplayChoseDiv = function (event) {
|
|
|
|
|
$scope.more20ChoseSubClient = false;
|
|
|
|
|
}
|
|
|
|
|
$scope.choseDivStopPropagation = function (event) {
|
|
|
|
|
event.stopPropagation()
|
|
|
|
|
};
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('partnerPluginsCtrl', ['$scope', '$uibModal', function ($scope, $uibModal) {
|
|
|
|
|
$scope.configRedpack = function () {
|
|
|
|
@ -4355,29 +4394,58 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.isLevel3All = true;
|
|
|
|
|
$scope.clinet = {};
|
|
|
|
|
$scope.isAll = true;
|
|
|
|
|
$scope.more20ChoseSubClient = false;
|
|
|
|
|
$scope.choseSubClientNow = 'chose';
|
|
|
|
|
$scope.searchSubClients = function (subSearchText,page) {
|
|
|
|
|
|
|
|
|
|
$scope.subClientTable1 = [$scope.partner];
|
|
|
|
|
$scope.subClientTable2 = [];
|
|
|
|
|
var params = {};
|
|
|
|
|
params.page = page || $scope.subClientPagination.page || 1;
|
|
|
|
|
if (subSearchText != '') {
|
|
|
|
|
$scope.subSearchText = subSearchText;
|
|
|
|
|
params.searchText = subSearchText;
|
|
|
|
|
}
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page',{params: params}).then(function (resp) {
|
|
|
|
|
var clientList = resp.data.data;
|
|
|
|
|
$scope.subClientPagination = resp.data.pagination;
|
|
|
|
|
clientList.forEach(function (client) {
|
|
|
|
|
if ($scope.subClientTable1.length < 11) {
|
|
|
|
|
$scope.subClientTable1.push(client);
|
|
|
|
|
}else {
|
|
|
|
|
$scope.subClientTable2.push(client);
|
|
|
|
|
}
|
|
|
|
|
$scope.clients.push(client);
|
|
|
|
|
});
|
|
|
|
|
$scope.clientIds = [];
|
|
|
|
|
$scope.clients.forEach(function (client) {
|
|
|
|
|
$scope.clientIds.push(client.client_id);
|
|
|
|
|
if (client.level3Clients) {
|
|
|
|
|
client.level3Clients.forEach(function (level3Client) {
|
|
|
|
|
$scope.clientIds.push(level3Client.client_id);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$scope.params.client_ids = angular.copy($scope.clientIds);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
$scope.initClientInfo = function(){
|
|
|
|
|
$http.get('/sys/partners/'+clientMoniker).then(function (resp) {
|
|
|
|
|
$scope.client = resp.data;
|
|
|
|
|
$scope.clients = [$scope.client];
|
|
|
|
|
if ($scope.client.has_children && !$scope.client.hide_sub_mch) {
|
|
|
|
|
$scope.params.client_ids = [$scope.client.client_id];
|
|
|
|
|
$http.get('/sys/partners/'+clientMoniker+'/sub_clients').then(function (resp) {
|
|
|
|
|
var clientList = resp.data;
|
|
|
|
|
clientList.forEach(function (client) {
|
|
|
|
|
$scope.clients.push(client);
|
|
|
|
|
});
|
|
|
|
|
$scope.clientIds = [];
|
|
|
|
|
$scope.clients.forEach(function (client) {
|
|
|
|
|
$scope.clientIds.push(client.client_id);
|
|
|
|
|
if (client.level3Clients) {
|
|
|
|
|
client.level3Clients.forEach(function (level3Client) {
|
|
|
|
|
$scope.clientIds.push(level3Client.client_id);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$scope.params.client_ids = angular.copy($scope.clientIds);
|
|
|
|
|
$scope.loadSettlementLogs(1);
|
|
|
|
|
})
|
|
|
|
|
$scope.searchSubClients('',1);
|
|
|
|
|
$scope.params.dateto = new Date();
|
|
|
|
|
var day = new Date();
|
|
|
|
|
day.setDate(day.getDate() - 7);
|
|
|
|
|
$scope.params.datefrom = day;
|
|
|
|
|
$scope.chooseClient('all');
|
|
|
|
|
}else {
|
|
|
|
|
$scope.params.dateto = new Date();
|
|
|
|
|
var day = new Date();
|
|
|
|
|
day.setDate(day.getDate() - 7);
|
|
|
|
|
$scope.params.datefrom = day;
|
|
|
|
|
$scope.chooseClient('all');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -4396,7 +4464,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
|
|
|
|
|
url += connectSymbol + 'dateto=' + params.dateto;
|
|
|
|
|
}
|
|
|
|
|
if (params.client_ids){
|
|
|
|
|
if (params.client_ids && !$scope.isAll){
|
|
|
|
|
params.client_ids.forEach(function (i) {
|
|
|
|
|
url += connectSymbol + 'client_ids=' + i;
|
|
|
|
|
connectSymbol = '&';
|
|
|
|
@ -4407,6 +4475,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
|
|
|
|
|
$scope.chooseClient = function (client) {
|
|
|
|
|
if (client == 'all') {
|
|
|
|
|
$scope.choseSubClientNow = 'chose';
|
|
|
|
|
$scope.params.client_ids = angular.copy($scope.clientIds);
|
|
|
|
|
$scope.isAll = true;
|
|
|
|
|
$scope.chooseClientId = '';
|
|
|
|
@ -4477,6 +4546,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
params.page = page || $scope.pagination.page || 1;
|
|
|
|
|
params.limit = 10;
|
|
|
|
|
if ($scope.isAll) {
|
|
|
|
|
delete params.client_ids;
|
|
|
|
|
}
|
|
|
|
|
$http.get('/sys/partners/' + clientMoniker + '/lists_settlements', {params: params}).then(function (resp) {
|
|
|
|
|
$scope.settlementLogs = resp.data.data;
|
|
|
|
|
$scope.padding = resp.data.padding;
|
|
|
|
@ -4496,7 +4568,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
size: 'lg'
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
$scope.chooseLast7Days();
|
|
|
|
|
|
|
|
|
|
$scope.checkSubClientChoseShow = function (client) {
|
|
|
|
|
$scope.more20ChoseSubClient = !$scope.more20ChoseSubClient;
|
|
|
|
|
if (client != '') {
|
|
|
|
|
$scope.choseSubClientNow = client.short_name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$scope.clickDisplayChoseDiv = function (event) {
|
|
|
|
|
$scope.more20ChoseSubClient = false;
|
|
|
|
|
}
|
|
|
|
|
$scope.choseDivStopPropagation = function (event) {
|
|
|
|
|
event.stopPropagation()
|
|
|
|
|
};
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('partnerSurchargeAccountCtrl', ['$scope', '$uibModal', '$http', 'clientMoniker', '$filter', function ($scope, $uibModal, $http, clientMoniker, $filter) {
|
|
|
|
|
$scope.params = {};
|
|
|
|
|