Преглед изворни кода

fix:1、修复生成对账单时,beginDate和endDate为空为空
2、生成对账单,新增单据时间

shenjunjie пре 7 година
родитељ
комит
9a47bb846b
1 измењених фајлова са 57 додато и 9 уклоњено
  1. 57 9
      src/main/webapp/resources/js/index/app.js

+ 57 - 9
src/main/webapp/resources/js/index/app.js

@@ -10215,11 +10215,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                         }
                     }
 
-                    //获取筛选时间的开始时间为对账的开始时间
-                    $scope.apCheck.beginDate = $scope.fromDate;
 
-                    //获取筛选的截止时间为对账的截止时间
-                    $scope.apCheck.endDate = $scope.endDate;
 
                     //应收对账单明细行数据
                     $scope.item.orderCode = check.ordercode;
@@ -10255,6 +10251,32 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 }
             });
 
+            if ($scope.apCheckCondition.$open) {
+                $scope.fromDate = $scope.apCheckCondition.dateFrom ? $scope.apCheckCondition.dateFrom.getTime() : null;
+                $scope.endDate = $scope.apCheckCondition.dateTo ? $scope.apCheckCondition.dateTo.getTime() : null;
+            } else {
+                var _isShowApcheckList = $scope.thisMouth + '-01'
+                var _time1 = _isShowApcheckList
+                _time1 = _time1.replace(/-/g, '/')
+                var _d = new Date(_time1)
+                _d.setDate(1)
+                _d.setMonth(_d.getMonth() + 1)
+                _d.setDate(_d.getDate() - 1)
+
+                // 获取筛选时间的开始时间为对账的开始时间
+                var _time2 = _isShowApcheckList
+                _time2 = _time2.replace(/-/g, '/')
+                $scope.fromDate = new Date(_time2).getTime()
+                // 获取筛选的截止时间为对账的截止时间
+                $scope.endDate = _d.getTime()
+            }
+
+            //获取筛选时间的开始时间为对账的开始时间
+            $scope.apCheck.beginDate = $scope.fromDate;
+
+            //获取筛选的截止时间为对账的截止时间
+            $scope.apCheck.endDate = $scope.endDate;
+
             //保存生成的应收对账单
             $scope.saveApCheck = function () {
                 if ($scope.apCheck.items.length == 0) {
@@ -10277,7 +10299,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 $scope.saveApCheck();
             }
 
-
         }
         // 新增
         $scope.MouthOutShow = true
@@ -11033,7 +11054,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     taxrate: '',
                     sendcode: '',
                     whname: '',
-                    custUserUU: ''
+                    custUserUU: '',
+                    pidate: ''
                 };
 
                 //应收对账单明细行来源表信息
@@ -11099,10 +11121,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     }
 
                     //获取筛选时间的开始时间为对账的开始时间
-                    $scope.apCheck.beginDate = $scope.fromDate;
+                    // $scope.apCheck.beginDate = $scope.fromDate;
 
                     //获取筛选的截止时间为对账的截止时间
-                    $scope.apCheck.endDate = $scope.endDate;
+                    // $scope.apCheck.endDate = $scope.endDate;
 
                     //应收对账单明细行数据
                     $scope.item.orderCode = check.ordercode;
@@ -11126,7 +11148,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     $scope.item.sendcode = check.sendcode;
                     $scope.item.whname = check.whname;
                     $scope.item.custUserUU = check.custuseruu;
-
+                    $scope.item.sourceDate = check.pidate
                     //来源表相关信息
                     $scope.sourceInfo.sourceid = check.sourceid;
                     $scope.sourceInfo.sourcetable = check.sourcetable;
@@ -11137,6 +11159,32 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     $scope.haveSelected = true;
                 }
             });
+            if ($scope.apCheckCondition.$open) {
+                $scope.fromDate = $scope.apCheckCondition.dateFrom ? $scope.apCheckCondition.dateFrom.getTime() : null;
+                $scope.endDate = $scope.apCheckCondition.dateTo ? $scope.apCheckCondition.dateTo.getTime() : null;
+            } else {
+                var _isShowApcheckList = $scope.thisMouth + '-01'
+                var _time1 = _isShowApcheckList
+                _time1 = _time1.replace(/-/g, '/')
+                var _d = new Date(_time1)
+                _d.setDate(1)
+                _d.setMonth(_d.getMonth() + 1)
+                _d.setDate(_d.getDate() - 1)
+
+                // 获取筛选时间的开始时间为对账的开始时间
+                var _time2 = _isShowApcheckList
+                _time2 = _time2.replace(/-/g, '/')
+                $scope.fromDate = new Date(_time2).getTime()
+                // 获取筛选的截止时间为对账的截止时间
+                $scope.endDate = _d.getTime()
+            }
+
+            //获取筛选时间的开始时间为对账的开始时间
+            $scope.apCheck.beginDate = $scope.fromDate;
+
+            //获取筛选的截止时间为对账的截止时间
+            $scope.apCheck.endDate = $scope.endDate;
+
 
             //保存生成的应收对账单
             $scope.saveApCheck = function () {