fix 商户端清算记录下载时间范围限制为一年

master
Todking 3 years ago
parent de65713f81
commit f906e0e46e

@ -12,7 +12,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
controller: 'partnerSettlementLogCtrl'
})
}]);
app.controller('partnerSettlementLogCtrl', ['$scope', 'clearingDetailService', '$http', '$filter', '$sce', function ($scope, clearingDetailService, $http, $filter, $sce) {
app.controller('partnerSettlementLogCtrl', ['$scope', 'clearingDetailService', '$http', '$filter', '$sce', 'commonDialog', function ($scope, clearingDetailService, $http, $filter, $sce, commonDialog) {
$scope.params = {};
$scope.pagination = {};
$scope.htmlTooltip = $sce.trustAsHtml('<div style="text-align: left;width:350px">' +
@ -29,7 +29,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.subClientTable2 = [];
$scope.choseSubClientNow = 'More';
$scope.subSearchText = '';
$scope.searchSubClients = function (subSearchText,page) {
$scope.searchSubClients = function (subSearchText, page) {
$scope.subClientTable1 = [$scope.currentUser.client];
$scope.subClientTable2 = [];
@ -39,13 +39,13 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.subSearchText = subSearchText;
params.searchText = subSearchText;
}
$http.get('/client/partner_info/sub_partners/page',{params: params}).then(function (resp) {
$http.get('/client/partner_info/sub_partners/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 {
} else {
$scope.subClientTable2.push(client);
}
$scope.clients.push(client);
@ -89,6 +89,11 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
};
$scope.loadSettlementLogs = function (page) {
var params = angular.copy($scope.params);
var day = (params.dateto - params.datefrom) / 86400000
if (day > 365) {
commonDialog.alert({title: 'Error', content: '时间范围不超过一年', type: 'error'})
return
}
if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
}
@ -192,13 +197,13 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
};
if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) {
$scope.searchSubClients('',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 {
} else {
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);

Loading…
Cancel
Save