|
|
@@ -631,6 +631,23 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}
|
|
|
return fn;
|
|
|
};
|
|
|
+
|
|
|
+ var getDateCondition = function(zone, condition) {
|
|
|
+ var date = new Date();
|
|
|
+ if(zone == 1) {
|
|
|
+ date.setMonth(date.getMonth() - 1);
|
|
|
+ condition.dateFrom = date;
|
|
|
+ condition.dateTo = null;
|
|
|
+ } else if (zone == 6) {
|
|
|
+ date.setMonth(date.getMonth() - 6);
|
|
|
+ condition.dateFrom = date;
|
|
|
+ condition.dateTo = null;
|
|
|
+ } else {
|
|
|
+ condition.dateFrom = null;
|
|
|
+ condition.dateTo = null;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
app.controller('SaleOrderCtrl', ['$scope', '$filter', 'PurcOrderItem', 'PurcOrder', 'ngTableParams', 'toaster', 'ReportService', 'BaseService', 'PurcOrderItemHis',
|
|
|
function($scope, $filter, PurcOrderItem, PurcOrder, ngTableParams, toaster, ReportService, BaseService, PurcOrderItemHis){
|
|
|
$scope.active = 'todo';
|
|
|
@@ -640,6 +657,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.condition.dateZone = zone;
|
|
|
$scope.dateZoneText = typeof zone == 'undefined' ? '半年前' : (zone == 1 ? '一个月内' : '半年内');
|
|
|
$scope.condition.$dateZoneOpen = false;
|
|
|
+ getDateCondition(zone, $scope.condition);
|
|
|
+ $scope.tableParams.reload();
|
|
|
};
|
|
|
$scope.setActive = function(state) {
|
|
|
if($scope.active != state) {
|
|
|
@@ -667,12 +686,16 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.loading = true;
|
|
|
var pageParams = params.url();
|
|
|
pageParams.keyword = $scope.keyword;
|
|
|
+ pageParams.fromDate = $scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null;
|
|
|
+ pageParams.endDate = $scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null;
|
|
|
getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
|
params.total(page.totalElements);
|
|
|
$defer.resolve(page.content);
|
|
|
$scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
|
|
|
+ $scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
|
|
|
+ $scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
|
|
|
}
|
|
|
}, function(response){
|
|
|
$scope.loading = false;
|
|
|
@@ -793,6 +816,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.onSearch = function() {
|
|
|
$scope.tableParams.reload();
|
|
|
};
|
|
|
+ // 选择查找日期
|
|
|
+ $scope.onDateCondition = function(){
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
//设置为已查看
|
|
|
$scope.setDisplay = function(state, orderId) {
|
|
|
if(orderId) {//设置单个
|
|
|
@@ -1572,13 +1599,16 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
getData : function($defer, params) {
|
|
|
$scope.loading = true;
|
|
|
var pageParams = params.url();
|
|
|
- pageParams.keyword = $scope.keyword;
|
|
|
+ pageParams.keyword = $scope.keyword;pageParams.fromDate = $scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null;
|
|
|
+ pageParams.endDate = $scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null;
|
|
|
getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
|
params.total(page.totalElements);
|
|
|
$defer.resolve(page.content);
|
|
|
$scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
|
|
|
+ $scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
|
|
|
+ $scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
|
|
|
}
|
|
|
}, function(response){
|
|
|
$scope.loading = false;
|
|
|
@@ -1692,6 +1722,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.tableParams.reload();
|
|
|
};
|
|
|
|
|
|
+ // 选择查找日期
|
|
|
+ $scope.onDateCondition = function(){
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
//货车功能
|
|
|
var truck = $rootScope.truck;
|
|
|
if(!truck) {
|
|
|
@@ -1832,12 +1867,16 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.loading = true;
|
|
|
var pageParams = params.url();
|
|
|
pageParams.keyword = $scope.keyword;
|
|
|
+ pageParams.fromDate = $scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null;
|
|
|
+ pageParams.endDate = $scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null;
|
|
|
getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
|
params.total(page.totalElements);
|
|
|
$defer.resolve(page.content);
|
|
|
$scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
|
|
|
+ $scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
|
|
|
+ $scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
|
|
|
}
|
|
|
}, function(response){
|
|
|
$scope.loading = false;
|
|
|
@@ -1857,6 +1896,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.tableParams.reload();
|
|
|
};
|
|
|
|
|
|
+ // 选择查找日期
|
|
|
+ $scope.onDateCondition = function(){
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
}]);
|
|
|
|
|
|
/**
|
|
|
@@ -2539,12 +2583,16 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.loading = true;
|
|
|
var pageParams = params.url();
|
|
|
pageParams.keyword = $scope.keyword;
|
|
|
+ pageParams.fromDate = $scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null;
|
|
|
+ pageParams.endDate = $scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null;
|
|
|
getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
|
params.total(page.totalElements);
|
|
|
$defer.resolve(page.content);
|
|
|
$scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
|
|
|
+ $scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
|
|
|
+ $scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
|
|
|
}
|
|
|
}, function(response){
|
|
|
$scope.loading = false;
|
|
|
@@ -2564,6 +2612,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.tableParams.reload();
|
|
|
};
|
|
|
|
|
|
+ // 选择查找日期
|
|
|
+ $scope.onDateCondition = function(){
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ };
|
|
|
+
|
|
|
}]);
|
|
|
|
|
|
app.controller('EnterpriseCtrl', ['$scope', 'AccountEnterprise', function($scope, AccountEnterprise){
|
|
|
@@ -3109,5 +3162,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}
|
|
|
};
|
|
|
}]);
|
|
|
+
|
|
|
+
|
|
|
return app;
|
|
|
});
|