|
|
@ -10,6 +10,11 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
templateUrl: '/static/payment/good/templates/goods.html',
|
|
|
|
templateUrl: '/static/payment/good/templates/goods.html',
|
|
|
|
controller: 'goodListCtrl',
|
|
|
|
controller: 'goodListCtrl',
|
|
|
|
data: {label: '商品列表'}
|
|
|
|
data: {label: '商品列表'}
|
|
|
|
|
|
|
|
}).state('goods.sale', {
|
|
|
|
|
|
|
|
url: '/sale',
|
|
|
|
|
|
|
|
templateUrl: '/static/payment/good/templates/good_sale.html',
|
|
|
|
|
|
|
|
controller: 'goodOrderListCtrl',
|
|
|
|
|
|
|
|
data: {label: '商品列表'}
|
|
|
|
}).state('goods.new', {
|
|
|
|
}).state('goods.new', {
|
|
|
|
url: '/new',
|
|
|
|
url: '/new',
|
|
|
|
templateUrl: '/static/payment/good/templates/add_good.html',
|
|
|
|
templateUrl: '/static/payment/good/templates/add_good.html',
|
|
|
@ -196,7 +201,57 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
$scope.ctrl = {};
|
|
|
|
$scope.ctrl = {};
|
|
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
}]);
|
|
|
|
|
|
|
|
app.controller('goodOrderListCtrl', ['$scope', '$http', function ($scope, $http) {
|
|
|
|
|
|
|
|
$scope.pagination = {};
|
|
|
|
|
|
|
|
$scope.params = {status:'1'};
|
|
|
|
|
|
|
|
$scope.today = new Date();
|
|
|
|
|
|
|
|
$scope.chooseToday = function () {
|
|
|
|
|
|
|
|
$scope.params.datefrom = $scope.params.dateto = new Date();
|
|
|
|
|
|
|
|
$scope.loadGoodOrders(1);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.chooseYesterday = function () {
|
|
|
|
|
|
|
|
var yesterday = new Date();
|
|
|
|
|
|
|
|
yesterday.setDate(yesterday.getDate() - 1);
|
|
|
|
|
|
|
|
$scope.params.datefrom = $scope.params.dateto = yesterday;
|
|
|
|
|
|
|
|
$scope.loadGoodOrders(1);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.chooseLast7Days = function () {
|
|
|
|
|
|
|
|
$scope.params.dateto = new Date();
|
|
|
|
|
|
|
|
var day = new Date();
|
|
|
|
|
|
|
|
day.setDate(day.getDate() - 7);
|
|
|
|
|
|
|
|
$scope.params.datefrom = day;
|
|
|
|
|
|
|
|
$scope.loadGoodOrders(1);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.thisMonth = function () {
|
|
|
|
|
|
|
|
$scope.params.dateto = new Date();
|
|
|
|
|
|
|
|
var monthBegin = new Date();
|
|
|
|
|
|
|
|
monthBegin.setDate(1);
|
|
|
|
|
|
|
|
$scope.params.datefrom = monthBegin;
|
|
|
|
|
|
|
|
$scope.loadGoodOrders(1);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.lastMonth = function () {
|
|
|
|
|
|
|
|
var monthFinish = new Date();
|
|
|
|
|
|
|
|
monthFinish.setDate(0);
|
|
|
|
|
|
|
|
$scope.params.dateto = monthFinish;
|
|
|
|
|
|
|
|
var monthBegin = new Date();
|
|
|
|
|
|
|
|
monthBegin.setDate(0);
|
|
|
|
|
|
|
|
monthBegin.setDate(1);
|
|
|
|
|
|
|
|
$scope.params.datefrom = monthBegin;
|
|
|
|
|
|
|
|
$scope.loadGoodOrders(1);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.loadGoodOrders = function (page) {
|
|
|
|
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
|
|
|
|
if (params.status=='ALL'){
|
|
|
|
|
|
|
|
delete params.status;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
params.page = page || $scope.pagination.page || 1;
|
|
|
|
|
|
|
|
$http.get('/sys/client/goods/goodOrders', {params: params}).then(function (resp) {
|
|
|
|
|
|
|
|
$scope.sales = resp.data.data;
|
|
|
|
|
|
|
|
$scope.pagination = resp.data.pagination;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.loadGoodOrders(1);
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
|
|
return app;
|
|
|
|
return app;
|
|
|
|
});
|
|
|
|
});
|