master
yixian 5 years ago
parent 50f92d69cb
commit 3b6db8dff5

@ -97,9 +97,9 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.analysis = resp.data.analysis; $scope.analysis = resp.data.analysis;
}); });
}; };
$scope.excelSettlementAllLogs = function(){ $scope.excelSettlementAllLogs = function () {
var params = angular.copy($scope.params); var params = angular.copy($scope.params);
var url = '/client/trans_flow/settlement/log/excelAll'; var url = '/client/trans_flow/settlement/log/excelAll';
var connectSymbol = '?'; var connectSymbol = '?';
if (params.datefrom) { if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd'); params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
@ -110,7 +110,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd'); params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
url += connectSymbol + 'dateto=' + params.dateto; url += connectSymbol + 'dateto=' + params.dateto;
} }
if (params.client_ids){ if (params.client_ids) {
params.client_ids.forEach(function (i) { params.client_ids.forEach(function (i) {
url += connectSymbol + 'client_ids=' + i; url += connectSymbol + 'client_ids=' + i;
connectSymbol = '&'; connectSymbol = '&';
@ -120,13 +120,15 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}; };
$scope.chooseLast7Days(); $scope.chooseLast7Days();
$scope.exportSettlementLogs = function(pattern) { $scope.exportSettlementLogs = function (pattern) {
var params = angular.copy($scope.params); let params = angular.copy($scope.params);
var url = '/client/trans_flow/settlement/log/excel'; let url = '/client/trans_flow/settlement/log/excel';
if (pattern === 'pdf') { if (pattern === 'pdf') {
url = '/client/trans_flow/settlement/log/pdf'; url = '/client/trans_flow/settlement/log/pdf';
} else if (pattern === 'csv') {
url = '/client/trans_flow/settlement/log/csv';
} }
var connectSymbol = '?'; let connectSymbol = '?';
if (params.datefrom) { if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd'); params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
url += connectSymbol + 'datefrom=' + params.datefrom; url += connectSymbol + 'datefrom=' + params.datefrom;
@ -136,7 +138,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd'); params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
url += connectSymbol + 'dateto=' + params.dateto; url += connectSymbol + 'dateto=' + params.dateto;
} }
if (params.client_ids){ if (params.client_ids) {
params.client_ids.forEach(function (i) { params.client_ids.forEach(function (i) {
url += connectSymbol + 'client_ids=' + i; url += connectSymbol + 'client_ids=' + i;
connectSymbol = '&'; connectSymbol = '&';

@ -107,6 +107,7 @@
</button> </button>
<ul class="dropdown-menu" uib-dropdown-menu aria-labelledby="single-button" style="min-width: 80px"> <ul class="dropdown-menu" uib-dropdown-menu aria-labelledby="single-button" style="min-width: 80px">
<li><a target="_blank" ng-href="{{exportSettlementLogs('pdf')}}">PDF</a></li> <li><a target="_blank" ng-href="{{exportSettlementLogs('pdf')}}">PDF</a></li>
<li><a target="_blank" ng-href="{{exportSettlementLogs('csv')}}">CSV</a></li>
<li><a target="_blank" ng-href="{{exportSettlementLogs('excel')}}">EXCEL</a></li> <li><a target="_blank" ng-href="{{exportSettlementLogs('excel')}}">EXCEL</a></li>
</ul> </ul>
</div> </div>

Loading…
Cancel
Save