master
yuan 7 years ago
parent 6c33158e66
commit d6de760fe0

@ -69,9 +69,19 @@ define(['angular','decimal'], function (angular,decimal) {
var params = angular.copy($scope.params); var params = angular.copy($scope.params);
if (params.datefrom) { if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd'); params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
}else {
alert("请选择开始时间");
return;
} }
if (params.dateto) { if (params.dateto) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd'); params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
}else {
alert("请选择结束时间");
return
}
if(getTime2Time()>30){
alert("开始时间与结束时间不得超过三十天");
return;
} }
params.page = page || $scope.pagination.page || 1; params.page = page || $scope.pagination.page || 1;
$http.get('/partner/invoice/trans_flow', {params: params}).then(function (resp) { $http.get('/partner/invoice/trans_flow', {params: params}).then(function (resp) {
@ -89,6 +99,14 @@ define(['angular','decimal'], function (angular,decimal) {
commonDialog.alert({title: 'Search failed', content: resp.data.message, type: 'error'}); commonDialog.alert({title: 'Search failed', content: resp.data.message, type: 'error'});
}); });
}; };
var getTime2Time = function () {
var time = angular.copy($scope.params);
var from = time.datefrom = $filter('date')(time.datefrom, 'yyyy-MM-dd');
var to = time.dateto = $filter('date')(time.dateto, 'yyyy-MM-dd');
var longTime = new Date(to).getTime() - new Date(from).getTime() ;
return Math.floor(longTime/(24*60*60*1000));
};
$scope.export = function (type,page) { $scope.export = function (type,page) {
var url='/partner/invoice/trans_flow/pdf'; var url='/partner/invoice/trans_flow/pdf';
var connectSymbol = '?'; var connectSymbol = '?';

Loading…
Cancel
Save