Selaa lähdekoodia

Merge remote-tracking branch 'origin/release-201844-wangcz' into release-201844-wangcz

yangc 7 vuotta sitten
vanhempi
commit
951516d5f3
1 muutettua tiedostoa jossa 33 lisäystä ja 6 poistoa
  1. 33 6
      src/main/webapp/resources/js/vendor/controllers/b2b/apCheck.js

+ 33 - 6
src/main/webapp/resources/js/vendor/controllers/b2b/apCheck.js

@@ -679,24 +679,30 @@ define(['app/app'], function (app) {
           }
       };
       $scope.addMouth = function(val) {
-          var _sp = new Date().getMonth() + 1
+          var _sp = new Date()
           var _time = new Date($scope.thisMouth)
           _time.setMonth(_time.getMonth() + val)
-          if (_time.getMonth() + 1 >= Number(_sp)) {
+          _time.setDate(1)
+          _time.setMonth(_time.getMonth() + 1)
+          _time.setDate(_time.getDate() - 1)
+          if (_time.getTime() >= _sp.getTime()) {
               $scope.MouthinShow = false
           } else {
               $scope.MouthinShow = true
           }
           $scope.thisMouth = _time.getFullYear() + '-' + (_time.getMonth() + 1)
           $scope.apCheckCondition.$open = false
-          this.searchOrder()
+          $scope.searchOrder()
       }
 
       $scope.addMouthOut = function(val) {
-          var _sp = new Date().getMonth() + 1
+          var _sp = new Date()
           var _time = new Date($scope.thisMouthOut)
           _time.setMonth(_time.getMonth() + val)
-          if (_time.getMonth() + 1 >= Number(_sp)) {
+          _time.setDate(1)
+          _time.setMonth(_time.getMonth() + 1)
+          _time.setDate(_time.getDate() - 1)
+          if (_time.getTime() >= _sp.getTime()) {
               $scope.MouthOutShow = false
           } else {
               $scope.MouthOutShow = true
@@ -724,6 +730,16 @@ define(['app/app'], function (app) {
               return
           }
           if (newVal !== oldVal) {
+              var _d = new Date(newVal)
+              _d.setDate(1)
+              _d.setMonth(_d.getMonth() + 1)
+              _d.setDate(_d.getDate() - 1)
+
+              if (_d.getTime() >= _fromDate.getTime()) {
+                  $scope.MouthOutShow = false
+              } else {
+                  $scope.MouthOutShow = true
+              }
               $scope.tableParams.page(1);
               $scope.tableParams.reload();
           }
@@ -742,12 +758,23 @@ define(['app/app'], function (app) {
               return
           }
           if (newVal !== oldVal) {
+              var _d = new Date(newVal)
+              _d.setDate(1)
+              _d.setMonth(_d.getMonth() + 1)
+              _d.setDate(_d.getDate() - 1)
+
+              if (_d.getTime() >= _fromDate.getTime()) {
+                  $scope.MouthinShow = false
+              } else {
+                  $scope.MouthinShow = true
+              }
               $scope.searchOrder()
           }
       })
 
 
-    /**
+
+      /**
      * 将日期转化为整数日期
      */
     var getDateTime = function (date) {