From be951dc34b5c5038144fdf3cbc43328e5294b672 Mon Sep 17 00:00:00 2001 From: todking Date: Tue, 12 Jan 2021 10:49:11 +0800 Subject: [PATCH] =?UTF-8?q?fix=20BD=E5=90=AF=E7=94=A8=E4=B8=8A=E6=9C=88?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/static/config/bdprize/bdprize.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/ui/static/config/bdprize/bdprize.js b/src/main/ui/static/config/bdprize/bdprize.js index eaac60668..fdd6f20f6 100644 --- a/src/main/ui/static/config/bdprize/bdprize.js +++ b/src/main/ui/static/config/bdprize/bdprize.js @@ -249,15 +249,17 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) { }; $scope.getBDLevels(); $scope.chooseLastConfig = function (mon) { - var index = $scope.months.indexOf(mon); + let year = new Date(mon).getFullYear(); + let month = new Date(mon).getMonth(); if(index == 0){ - var year = new Date().getFullYear(); year--; - mon = year + '-12'; + month = year + '-12'; + }else if(month <= 9){ + month = year + '-0' + month; }else { - mon = $scope.months[index-1]; + month = year + '-' + month; } - $http.get('/sys/bd_prize/commission/le_ma/' + mon).then(function (resp) { + $http.get('/sys/bd_prize/commission/le_ma/' + month).then(function (resp) { $scope.bdlm = []; angular.forEach(resp.data,function (e) { var bdC = {};