|
|
@ -41,7 +41,9 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
|
|
|
|
|
|
|
|
|
|
|
|
app.controller('bdPrizeRootCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', function ($scope, $http, $uibModal, commonDialog) {
|
|
|
|
app.controller('bdPrizeRootCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', function ($scope, $http, $uibModal, commonDialog) {
|
|
|
|
$scope.params = {year: new Date().getFullYear()};
|
|
|
|
$scope.params = {year: new Date().getFullYear()};
|
|
|
|
|
|
|
|
$scope.availableYears = [new Date().getFullYear() - 1, new Date().getFullYear()];
|
|
|
|
$scope.initMonth = function (year) {
|
|
|
|
$scope.initMonth = function (year) {
|
|
|
|
|
|
|
|
$scope.params.year = year;
|
|
|
|
$scope.months = [];
|
|
|
|
$scope.months = [];
|
|
|
|
for (var i = 1; i < 13; i++) {
|
|
|
|
for (var i = 1; i < 13; i++) {
|
|
|
|
var mon = '00' + i;
|
|
|
|
var mon = '00' + i;
|
|
|
@ -68,7 +70,7 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
|
|
|
|
$scope.reportMonths = resp.data.data;
|
|
|
|
$scope.reportMonths = resp.data.data;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
$scope.getYearReports($scope.params.year);
|
|
|
|
$scope.getYearReports(new Date().getFullYear());
|
|
|
|
$scope.generateReport = function () {
|
|
|
|
$scope.generateReport = function () {
|
|
|
|
commonDialog.confirm({
|
|
|
|
commonDialog.confirm({
|
|
|
|
title: 'Warning',
|
|
|
|
title: 'Warning',
|
|
|
@ -193,6 +195,7 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
|
|
|
|
// $scope.bdmon;
|
|
|
|
// $scope.bdmon;
|
|
|
|
// $scope.newSwitch;
|
|
|
|
// $scope.newSwitch;
|
|
|
|
$scope.initMonth = function (year) {
|
|
|
|
$scope.initMonth = function (year) {
|
|
|
|
|
|
|
|
$scope.params.year = year;
|
|
|
|
$scope.months = [];
|
|
|
|
$scope.months = [];
|
|
|
|
for (var i = 1; i < 13; i++) {
|
|
|
|
for (var i = 1; i < 13; i++) {
|
|
|
|
var mon = '00' + i;
|
|
|
|
var mon = '00' + i;
|
|
|
@ -200,9 +203,9 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
|
|
|
|
$scope.months.push(year + '-' + mon);
|
|
|
|
$scope.months.push(year + '-' + mon);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
$scope.initMonth($scope.params.year);
|
|
|
|
$scope.initMonth(new Date().getFullYear());
|
|
|
|
$scope.hasReport = function (mon) {
|
|
|
|
$scope.hasReport = function (mon) {
|
|
|
|
var start = '2017-01';
|
|
|
|
var start = '2017-01';//todo change for different country
|
|
|
|
var end = $filter('date')(new Date(), 'yyyy-MM');
|
|
|
|
var end = $filter('date')(new Date(), 'yyyy-MM');
|
|
|
|
return start <= mon && end >= mon
|
|
|
|
return start <= mon && end >= mon
|
|
|
|
};
|
|
|
|
};
|
|
|
|