master
yuan 7 years ago
parent e00d2bf155
commit 873ec92e6c

@ -16,7 +16,6 @@ define(['angular','decimal'], function (angular,decimal) {
$scope.today = new Date(); $scope.today = new Date();
$scope.pagination = {}; $scope.pagination = {};
$scope.today = new Date(); $scope.today = new Date();
$scope.isAll = true;
$scope.clients = [$scope.currentUser.client]; $scope.clients = [$scope.currentUser.client];
if ($scope.currentUser.client.has_children) { if ($scope.currentUser.client.has_children) {
$scope.params.client_ids = [$scope.currentUser.client.client_id]; $scope.params.client_ids = [$scope.currentUser.client.client_id];
@ -25,23 +24,11 @@ define(['angular','decimal'], function (angular,decimal) {
clientList.forEach(function (client) { clientList.forEach(function (client) {
$scope.clients.push(client); $scope.clients.push(client);
}); });
$scope.clientIds = [];
$scope.clients.forEach(function (client) {
$scope.clientIds.push(client.client_id);
});
$scope.params.client_ids = angular.copy($scope.clientIds);
}) })
}; };
$scope.chooseClient = function (clientId) { $scope.chooseClient = function (clientId) {
if (clientId == 'all') {
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.isAll = true;
$scope.chooseClientId = '';
} else {
$scope.chooseClientId = clientId; $scope.chooseClientId = clientId;
$scope.params.client_ids = [clientId]; $scope.params.client_ids = [clientId];
$scope.isAll = false;
}
$scope.loadTradeLogs(1); $scope.loadTradeLogs(1);
}; };
$scope.chooseToday = function () { $scope.chooseToday = function () {

@ -91,8 +91,6 @@
<label class="control-label col-xs-4 col-sm-2">Sub Partner</label> <label class="control-label col-xs-4 col-sm-2">Sub Partner</label>
<div class="col-sm-10 col-xs-8"> <div class="col-sm-10 col-xs-8">
<p class="form-control-static"> <p class="form-control-static">
<a role="button" ng-class="{'bg-primary':isAll}"
ng-click="chooseClient('all')">All</a>
<label ng-repeat="sub in clients"> <label ng-repeat="sub in clients">
|&nbsp;<a role="button" |&nbsp;<a role="button"
ng-class="{'bg-primary':sub.client_id==chooseClientId}" ng-class="{'bg-primary':sub.client_id==chooseClientId}"

Loading…
Cancel
Save