Browse Source

fix:调整应付对账 新增自定义时间选项

shenjunjie 7 years ago
parent
commit
8c226fddca

+ 32 - 15
src/main/webapp/resources/js/usercenter/controllers/b2b/fa/arCheck.js

@@ -263,11 +263,12 @@
                   $scope.changeDateZone(1)
               }
           };
-          $scope.changeDateZone = function (zone) {
+          $scope.changeDateZone = function (zone, flg) {
               $scope.condition.dateZone = zone;
               $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
               $scope.condition.$dateZoneOpen = false;
               getDateCondition(zone, $scope.condition);
+              if (flg) return
               $scope.tableParams.page(1);
               $scope.tableParams.reload();
           };
@@ -294,20 +295,22 @@
                   pageParams.keyword = $scope.keyword;
                   if ($scope.active === 'all') {
                       pageParams.keyword = $scope.keyword
-                      var _fromDate = $scope.thisMouthOut + '-01 00:00:00'
-                      _fromDate = _fromDate.replace(/-/g,'/')
-                      var _d  = new Date(_fromDate)
-                      _d.setDate(1)
-                      _d.setMonth(_d.getMonth() + 1)
-                      _d.setDate(_d.getDate() - 1)
-                      var _endDate = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate() + ' 00:00:00'
-                      _endDate = _endDate.replace(/-/g, '/')
-                      _endDate = new Date(_endDate).getTime()
-                      // _fromDate = _fromDate.replace(/-/g, '/')
-                      _fromDate = new Date(_fromDate).getTime()
-
-                      pageParams.searchFilter.fromDate =  _fromDate
-                      pageParams.searchFilter.endDate = _endDate
+                      if (!$scope.condition.$open) {
+                          var _fromDate = $scope.thisMouthOut + '-01 00:00:00'
+                          _fromDate = _fromDate.replace(/-/g, '/')
+                          var _d = new Date(_fromDate)
+                          _d.setDate(1)
+                          _d.setMonth(_d.getMonth() + 1)
+                          _d.setDate(_d.getDate() - 1)
+                          var _endDate = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate() + ' 00:00:00'
+                          _endDate = _endDate.replace(/-/g, '/')
+                          _endDate = new Date(_endDate).getTime()
+                          // _fromDate = _fromDate.replace(/-/g, '/')
+                          _fromDate = new Date(_fromDate).getTime()
+
+                          pageParams.searchFilter.fromDate = _fromDate
+                          pageParams.searchFilter.endDate = _endDate
+                      }
                       FaApCheck.vendor(BaseService.parseParams(pageParams), function (page) {
                           $scope.loading = false;
                           page.content && page.content.forEach(function(list) {
@@ -523,6 +526,7 @@
               $scope.showNotCheck = true
               $scope.vendorUU = item.vendorEnterprise.uu
               $scope.thisMouth = $scope.thisMouthOut
+              $scope.condition.$open = false
               this.searchOrder()
           }
 
@@ -992,10 +996,16 @@
           }
 
           $scope.hideshowNotCheck = function() {
+              $scope.apCheckCondition.$open = false
+              $scope.condition.$open = false
               $scope.showNotCheck = false
+              $scope.condition.$open2 = false
+              $scope.condition.dateZone = 1
           }
 
           $scope.$watch('thisMouthOut', function(newVal, oldVal) {
+              $scope.condition.$open = false
+              $scope.condition.dateZone = 1
               var _fromDate = new Date()
 
               var _d = new Date(_fromDate)
@@ -1058,6 +1068,13 @@
               }
           })
 
+          $scope.resetHandle = function() {
+              if ($scope.condition.$open) return
+              $scope.condition.$open = true;
+              $scope.changeDateZone(-1)
+          }
+
+
 
 
           /**

+ 30 - 15
src/main/webapp/resources/js/vendor/controllers/b2b/apCheck.js

@@ -52,11 +52,12 @@ define(['app/app'], function (app) {
               $scope.changeDateZone(1)
           }
       };
-      $scope.changeDateZone = function (zone) {
+      $scope.changeDateZone = function (zone, flg) {
           $scope.condition.dateZone = zone;
           $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
           $scope.condition.$dateZoneOpen = false;
           getDateCondition(zone, $scope.condition);
+          if (flg) return
           $scope.tableParams.page(1);
           $scope.tableParams.reload();
       };
@@ -82,20 +83,22 @@ define(['app/app'], function (app) {
               pageParams.keyword = $scope.keyword;
               if ($scope.active === 'all') {
                   pageParams.keyword = $scope.keyword
-                  var _fromDate =  $scope.thisMouthOut + '-01 00:00:00'
-                  // var _d = new Date(_fromDate)
-                  _fromDate = _fromDate.replace(/-/g,'/')
-                  var _d  = new Date(_fromDate)
-                  _d.setDate(1)
-                  _d.setMonth(_d.getMonth() + 1)
-                  _d.setDate(_d.getDate() - 1)
-                  var _endDate = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate() + ' 00:00:00'
-                  _endDate = _endDate.replace(/-/g,'/')
-                  _fromDate = _fromDate.replace(/-/g,'/')
-                  _endDate = new Date(_endDate).getTime()
-                  _fromDate = new Date(_fromDate).getTime()
-                  pageParams.searchFilter.fromDate =  _fromDate
-                  pageParams.searchFilter.endDate = _endDate
+                  if (!$scope.condition.$open) {
+                      var _fromDate = $scope.thisMouthOut + '-01 00:00:00'
+                      // var _d = new Date(_fromDate)
+                      _fromDate = _fromDate.replace(/-/g, '/')
+                      var _d = new Date(_fromDate)
+                      _d.setDate(1)
+                      _d.setMonth(_d.getMonth() + 1)
+                      _d.setDate(_d.getDate() - 1)
+                      var _endDate = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate() + ' 00:00:00'
+                      _endDate = _endDate.replace(/-/g, '/')
+                      _fromDate = _fromDate.replace(/-/g, '/')
+                      _endDate = new Date(_endDate).getTime()
+                      _fromDate = new Date(_fromDate).getTime()
+                      pageParams.searchFilter.fromDate = _fromDate
+                      pageParams.searchFilter.endDate = _endDate
+                  }
                   FaApCheck.customer(BaseService.parseParams(pageParams), function (page) {
                       $scope.loading = false;
                       page.content && page.content.forEach(function(list) {
@@ -311,6 +314,7 @@ define(['app/app'], function (app) {
           $scope.suuorname = item.myEnterprise.enName
           $scope.customerUU = item.myEnterprise.uu
           $scope.thisMouth = $scope.thisMouthOut
+          $scope.condition.$open = false
           this.searchOrder()
       }
 
@@ -806,10 +810,16 @@ define(['app/app'], function (app) {
       }
 
       $scope.hideshowNotCheck = function() {
+          $scope.apCheckCondition.$open = false
+          $scope.condition.$open = false
           $scope.showNotCheck = false
+          $scope.condition.$open2 = false
+          $scope.condition.dateZone = 1
       }
 
       $scope.$watch('thisMouthOut', function(newVal, oldVal) {
+          $scope.condition.$open = false
+          $scope.condition.dateZone = 1
           var _fromDate = new Date()
           var _d = new Date(_fromDate)
           // var _d  = new Date(_fromDate.replace(/-/g,'/'))
@@ -874,6 +884,11 @@ define(['app/app'], function (app) {
               $scope.searchOrder()
           }
       })
+        $scope.resetHandle = function() {
+          if ($scope.condition.$open) return
+            $scope.condition.$open = true;
+            $scope.changeDateZone(-1)
+        }
 
 
       /**

+ 12 - 5
src/main/webapp/resources/view/usercenter/b2b/fa/arCheck.html

@@ -603,6 +603,7 @@
                 line-height: 32px;
                 cursor: pointer;
                 vertical-align: middle;"><img src="/static/img/vendor/images/arrow-right-d-l.png" width="24"/></span>
+      <a ng-click="resetHandle()" title="自定义" ng-class="{'active':condition.dateZone=='-1'}"  style="margin-left: 10px" >自定义</a>
     </div>
     <div class="sreach fr">
       <div ng-show="condition.$open" class="date fl">
@@ -960,10 +961,10 @@
       </div>
       <div class="form-group form-group-sm form-group-inline">
         <div class="col-sm-12 text-right">
-          <a ng-click="condition.$open=!condition.$open" class="text-simple"><span
-                  ng-bind="condition.$open ? '收起筛选条件' : '更多筛选条件'"></span><i
+          <a ng-click="condition.$open2=!condition.$open2" class="text-simple"><span
+                  ng-bind="condition.$open2 ? '收起筛选条件' : '更多筛选条件'"></span><i
                   class="fa fa-fw"
-                  ng-class="{'fa-angle-up': condition.$open, 'fa-angle-down': !condition.$open}"></i></a>
+                  ng-class="{'fa-angle-up': condition.$open2, 'fa-angle-down': !condition.$open2}"></i></a>
           <div class="btn-group btn-group-sm">
             <a class="btn btn-default" ng-click="searchOrder()" title="筛选"><i class="fa fa-search fa-fw btn-icon-left"></i>筛选</a>
             <!--<a class="btn btn-default" ng-click="createApCheck(check.$selected)" ng-disabled="!data || data.length==0"><i class="fa fa-check-circle-o fa-fw btn-icon-left"></i>对账</a>-->
@@ -972,7 +973,7 @@
         </div>
       </div>
       <div class="form-group form-group-sm form-group-inline"
-           ng-show="condition.$open">
+           ng-show="condition.$open2">
         <!--<label class="col-sm-2 control-label">应付供应商:</label>-->
         <!--<div class="col-sm-4">-->
         <!--<div class="form-group form-group-sm has-feedback">-->
@@ -1003,7 +1004,7 @@
         </div>
       </div>
       <div class="form-group form-group-sm form-group-inline"
-           ng-show="condition.$open">
+           ng-show="condition.$open2">
         <label class="col-sm-2 control-label">物料名称:</label>
         <div class="col-sm-4">
           <div class="form-group form-group-sm has-feedback">
@@ -1110,6 +1111,11 @@
     text-align: center;
     padding: 20px 0
   }
+  a.active {
+    background: #5078cb;
+    padding: 0 5px;
+    color: #fff;
+  }
 </style>
 <style>
   .wui-date-picker.left {
@@ -1218,6 +1224,7 @@
     font-size: 14px;
     color: #3f84f6;
     font-weight: bold;
+    width: 150px
   }
   .wui-date-editor .iconfont {
     color: #3f84f6

+ 24 - 7
src/main/webapp/resources/view/vendor/b2b/apCheck.html

@@ -526,7 +526,7 @@
     color: #5078cb;
     border: 1px solid #5078cb;
     margin-top: 6px;
-    padding: 0 5px;"  ng-click="setActive()">查看对账记录
+    padding: 0 5px;"  ng-click="setActive();changeDateZone(1, true);condition.$open=false">查看对账记录
                 <!--<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>-->
             </div>
         </li>
@@ -602,6 +602,17 @@
                 line-height: 32px;
                 cursor: pointer;
                 vertical-align: middle;"><img src="/static/img/vendor/images/arrow-right-d-l.png" width="24"/></span>
+         <!--<div class="radio-block date-radio" style="width: 33%">-->
+             <!--<label class="com-check-radio">-->
+                 <!--<input type="radio" id="autoMonth_man" name="date" ng-click="condition.$open=!condition.$open;changeDateZone(-1)">-->
+                 <!--<label for="autoMonth_man"></label>-->
+
+         <a ng-click="resetHandle()" title="自定义" ng-class="{'active':condition.dateZone=='-1'}"  style="margin-left: 10px" >自定义</a>
+             <!--</label>-->
+         <!--</div>-->
+
+
+
       </div>
     <div class="sreach fr">
       <div ng-show="condition.$open" class="date fl">
@@ -955,10 +966,10 @@
       </div>
       <div class="form-group form-group-sm form-group-inline">
         <div class="col-sm-12 text-right">
-          <a ng-click="condition.$open=!condition.$open" class="text-simple"><span
-                  ng-bind="condition.$open ? '收起筛选条件' : '更多筛选条件'"></span><i
+          <a ng-click="condition.$open2=!condition.$open2" class="text-simple"><span
+                  ng-bind="condition.$open2 ? '收起筛选条件' : '更多筛选条件'"></span><i
                   class="fa fa-fw"
-                  ng-class="{'fa-angle-up': condition.$open, 'fa-angle-down': !condition.$open}"></i></a>
+                  ng-class="{'fa-angle-up': condition.$open2, 'fa-angle-down': !condition.$open2}"></i></a>
           <div class="btn-group btn-group-sm">
             <a class="btn btn-default" ng-click="searchOrder()" title="筛选"><i class="fa fa-search fa-fw btn-icon-left"></i>筛选</a>
             <a class="btn btn-default" ng-click="createApCheck(check.$selected)" ng-disabled="!data || data.length==0"><i class="fa fa-check-circle-o fa-fw btn-icon-left"></i>确认</a>
@@ -967,7 +978,7 @@
         </div>
       </div>
       <div class="form-group form-group-sm form-group-inline"
-           ng-show="condition.$open">
+           ng-show="condition.$open2">
         <!--<label class="col-sm-2 control-label">应付供应商:</label>-->
         <!--<div class="col-sm-4">-->
           <!--<div class="form-group form-group-sm has-feedback">-->
@@ -977,7 +988,7 @@
                   <!--class="fa fa-search"></i></span>-->
           <!--</div>-->
         <!--</div>-->
-        <!--ng-show="condition.$open">-->
+        <!--ng-show="condition.$open2">-->
         <label class="col-sm-2 control-label">税&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;率:</label>
         <div class="col-sm-4">
           <div class="form-group form-group-sm has-feedback">
@@ -998,7 +1009,7 @@
         </div>
       </div>
       <div class="form-group form-group-sm form-group-inline"
-           ng-show="condition.$open">
+           ng-show="condition.$open2">
         <label class="col-sm-2 control-label">物料名称:</label>
         <div class="col-sm-4">
           <div class="form-group form-group-sm has-feedback">
@@ -1123,6 +1134,11 @@
     text-align: center;
     padding: 20px 0
   }
+    a.active {
+        background: #5078cb;
+        padding: 0 5px;
+        color: #fff;
+    }
 </style>
 <style>
   .wui-date-picker.left {
@@ -1231,6 +1247,7 @@
       font-size: 14px;
       color: #3f84f6;
       font-weight: bold;
+      width: 150px
   }
   .wui-date-editor .iconfont {
       color: #3f84f6