Browse Source

1、优化应收对账,新增 本月已对,本月未对字段
2、优化应付对账,新增 本月已对,本月未对字段

shenjunjie 7 years ago
parent
commit
404653aca0

+ 105 - 30
src/main/webapp/resources/js/index/app.js

@@ -9654,13 +9654,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 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)
+                    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
@@ -9867,6 +9870,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.chooseItem = item;
             $scope.showNotCheck = true
             $scope.vendorUU = item.vendorEnterprise.uu
+            $scope.thisMouth = $scope.thisMouthOut
             this.searchOrder()
         }
 
@@ -9951,19 +9955,36 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                             item.$selected = true;
                         });
                         var _mouthArr = []
-                        data.thisMonthCount.forEach(function(item) {
+                        data.thisMonthCount && data.thisMonthCount.forEach(function(item) {
                             if (item.amount > 0) {
                                 _mouthArr.push(item)
                             }
                         })
                         data.thisMonthCount = _mouthArr
                         var _totalArr = []
-                        data.totalCount.forEach(function(item) {
+                        data.totalCount && data.totalCount.forEach(function(item) {
                             if (item.amount > 0) {
                                 _totalArr.push(item)
                             }
                         })
                         data.totalCount = _totalArr
+
+                        var _MonthTodoCountArr = []
+                        data.thisMonthTodoCount && data.thisMonthTodoCount.forEach(function(item) {
+                            if (item.amount > 0) {
+                                _MonthTodoCountArr.push(item)
+                            }
+                        })
+                        data.thisMonthTodoCount = _MonthTodoCountArr
+
+                        var _MonthDoneCountArr = []
+                        data.thisMonthDoneCount && data.thisMonthDoneCount.forEach(function(item) {
+                            if (item.amount > 0) {
+                                _MonthDoneCountArr.push(item)
+                            }
+                        })
+                        data.thisMonthDoneCount = _MonthDoneCountArr
+
                         $scope.dataInfo = data
                         $scope.data = data.details;
                         $scope.checkboxes.checked = true;
@@ -10041,12 +10062,12 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.getTotalMoney = function () {
             $scope.totalMoney = 0;
             angular.forEach($scope.data, function (check) {
-                if (check.$selected) {
+                // if (check.$selected) {
                     var price = DecimalNumber.accMul((check.thischeckqty || 0), (check.orderprice || 0));
                     $scope.totalMoney += Math.round(price * 100) / 100;
-                } else {
-                    $scope.totalMoney += 0;
-                }
+                // } else {
+                //     $scope.totalMoney += 0;
+                // }
             });
 
         }
@@ -10271,7 +10292,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         };
         $scope.addMouth = function(val) {
             var _sp = new Date()
-            var _time = new Date($scope.thisMouth)
+            var _time1 = $scope.thisMouth + '-01'
+            _time1 = _time1.replace(/-/g, '/')
+            var _time  = new Date(_time1)
+
             _time.setMonth(_time.getMonth() + val)
             _time.setDate(1)
             _time.setMonth(_time.getMonth() + 1)
@@ -10283,12 +10307,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }
             $scope.thisMouth = _time.getFullYear() + '-' + (_time.getMonth() + 1)
             $scope.apCheckCondition.$open = false
-            $scope.searchOrder()
+            // $scope.searchOrder()
         }
 
         $scope.addMouthOut = function(val) {
             var _sp = new Date()
-            var _time = new Date($scope.thisMouthOut)
+            // var _time = new Date($scope.thisMouthOut)
+            var _time1 = $scope.thisMouthOut + '-01'
+            _time1 = _time1.replace(/-/g, '/')
+            var _time  = new Date(_time1)
+            // var _time  = new Date($scope.thisMouthOut.replace(/-/g,'/'))
             _time.setMonth(_time.getMonth() + val)
             _time.setDate(1)
             _time.setMonth(_time.getMonth() + 1)
@@ -10299,8 +10327,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 $scope.MouthOutShow = true
             }
             $scope.thisMouthOut = _time.getFullYear() + '-' + (_time.getMonth() + 1)
-            $scope.tableParams.page(1);
-            $scope.tableParams.reload();
+            // $scope.tableParams.page(1);
+            // $scope.tableParams.reload();
         }
 
         $scope.hideshowNotCheck = function() {
@@ -10309,7 +10337,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         $scope.$watch('thisMouthOut', function(newVal, oldVal) {
             var _fromDate = new Date()
+
             var _d = new Date(_fromDate)
+            // var _d  = new Date(_fromDate.replace(/-/g,'/'))
             _d.setDate(1)
             _d.setMonth(_d.getMonth() + 1)
             _d.setDate(_d.getDate() - 1)
@@ -10321,7 +10351,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 return
             }
             if (newVal !== oldVal) {
-                var _d = new Date(newVal)
+                var _newVal = newVal.replace(/-/g,'/')
+                var _d  = new Date(_newVal)
                 _d.setDate(1)
                 _d.setMonth(_d.getMonth() + 1)
                 _d.setDate(_d.getDate() - 1)
@@ -10338,6 +10369,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.$watch('thisMouth', function(newVal, oldVal) {
             var _fromDate = new Date()
             var _d = new Date(_fromDate)
+            // var _d  = new Date(_fromDate.replace(/-/g,'/'))
             _d.setDate(1)
             _d.setMonth(_d.getMonth() + 1)
             _d.setDate(_d.getDate() - 1)
@@ -10349,7 +10381,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 return
             }
             if (newVal !== oldVal) {
-                var _d = new Date(newVal)
+                var _newVal = newVal.replace(/-/g,'/')
+                var _d  = new Date(_newVal)
                 _d.setDate(1)
                 _d.setMonth(_d.getMonth() + 1)
                 _d.setDate(_d.getDate() - 1)
@@ -10491,11 +10524,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 if ($scope.active === 'all') {
                     pageParams.keyword = $scope.keyword
                     var _fromDate =  $scope.thisMouthOut + '-01 00:00:00'
-                    var _d = new Date(_fromDate)
+                    // 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
@@ -10705,6 +10742,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.showNotCheck = true
             $scope.suuorname = item.myEnterprise.enName
             $scope.customerUU = item.myEnterprise.uu
+            $scope.thisMouth = $scope.thisMouthOut
             this.searchOrder()
         }
 
@@ -10798,7 +10836,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                                 item.$selected = true;
                             });
                             var _mouthArr = []
-                            data.thisMonthCount.forEach(function(item) {
+                            data.thisMonthCount && data.thisMonthCount.forEach(function(item) {
                                 if (item.amount > 0) {
                                     _mouthArr.push(item)
                                 }
@@ -10806,16 +10844,33 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                             data.thisMonthCount = _mouthArr
 
                             var _totalArr = []
-                            data.totalCount.forEach(function(item) {
+                            data.totalCount && data.totalCount.forEach(function(item) {
                                 if (item.amount > 0) {
                                     _totalArr.push(item)
                                 }
                             })
                             data.totalCount = _totalArr
 
+                            var _MonthTodoCountArr = []
+                            data.thisMonthTodoCount && data.thisMonthTodoCount.forEach(function(item) {
+                                if (item.amount > 0) {
+                                    _MonthTodoCountArr.push(item)
+                                }
+                            })
+                            data.thisMonthTodoCount = _MonthTodoCountArr
+
+                            var _MonthDoneCountArr = []
+                            data.thisMonthDoneCount && data.thisMonthDoneCount.forEach(function(item) {
+                                if (item.amount > 0) {
+                                    _MonthDoneCountArr.push(item)
+                                }
+                            })
+                            data.thisMonthDoneCount = _MonthDoneCountArr
+
                             $scope.dataInfo = data
                             $scope.data = data.details;
                             $scope.checkboxes.checked = true;
+                            // $scope.Checkall()
                             $scope.getTotalMoney();
                         } else {
                             toaster.pop('info', '提示', '当前没有需要对账记录');
@@ -10874,9 +10929,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             // var dateFrom = $scope.condition.dateFrom;
             // var dateTo = $scope.condition.dateTo;
             angular.forEach($scope.filteredData, function (item) {
-                // if ((item.pidate >= dateFrom || dateFrom == '') && (item.pidate < dateTo || dateTo == '')) {
+                if (item.haveChecked !== 1) {
+                    // if ((item.pidate >= dateFrom || dateFrom == '') && (item.pidate < dateTo || dateTo == '')) {
                     item.$selected = $scope.checkboxes.checked;
-                // }
+                    // }
+                }
             });
             $scope.getTotalMoney();
         };
@@ -10885,18 +10942,21 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.getTotalMoney = function () {
             $scope.totalMoney = 0;
             angular.forEach($scope.data, function (check) {
-                if (check.$selected) {
+                // if (check.$selected) {
                     var price = DecimalNumber.accMul((check.thischeckqty || 0), (check.orderprice || 0));
                     $scope.totalMoney += Math.round(price * 100) / 100;
-                } else {
-                    $scope.totalMoney += 0;
-                }
+                // } else {
+                //     $scope.totalMoney += 0;
+                // }
             });
 
         }
 
         // 点击其中一个明细的复选框
         $scope.checkOne = function (check) {
+            if (check.haveChecked === 1) {
+                return
+            }
             check.$selected = !check.$selected
             $scope.Checkall()
         };
@@ -10985,7 +11045,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
                 //此次对账后新的已转数
                 $scope.newYCheckQty = 0;
-                if (check.$selected == true) {
+                if (check.$selected == true && !check.haveChecked) {
                     $scope.apCheck.custName = check.custname;
                     $scope.apCheck.enUu = check.enuu;
                     $scope.apCheck.checkAmount += (check.thischeckqty || 0) * (check.orderprice || 0);
@@ -11115,7 +11175,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         };
         $scope.addMouth = function(val) {
             var _sp = new Date()
-            var _time = new Date($scope.thisMouth)
+            // var _time = new Date($scope.thisMouth)
+            var _time = $scope.thisMouth + '-01'
+            _time = _time.replace(/-/g,'/')
+            _time  = new Date(_time)
             _time.setMonth(_time.getMonth() + val)
             _time.setDate(1)
             _time.setMonth(_time.getMonth() + 1)
@@ -11132,7 +11195,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         $scope.addMouthOut = function(val) {
             var _sp = new Date()
-            var _time = new Date($scope.thisMouthOut)
+            var _time = $scope.thisMouthOut + '-01'
+            _time = _time.replace(/-/g,'/')
+            _time  = new Date(_time)
+            // var _time = new Date($scope.thisMouthOut)
+            // var _time  = new Date($scope.thisMouthOut.replace(/-/g,'/'))
             _time.setMonth(_time.getMonth() + val)
             _time.setDate(1)
             _time.setMonth(_time.getMonth() + 1)
@@ -11154,6 +11221,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.$watch('thisMouthOut', function(newVal, oldVal) {
             var _fromDate = new Date()
             var _d = new Date(_fromDate)
+            // var _d  = new Date(_fromDate.replace(/-/g,'/'))
             _d.setDate(1)
             _d.setMonth(_d.getMonth() + 1)
             _d.setDate(_d.getDate() - 1)
@@ -11165,7 +11233,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 return
             }
             if (newVal !== oldVal) {
-                var _d = new Date(newVal)
+                // var _d = new Date(newVal)
+                var _d = newVal + '-01'
+                _d = _d.replace(/-/g,'/')
+                _d  = new Date(_d)
+                // var _d  = new Date(newVal.replace(/-/g,'/'))
                 _d.setDate(1)
                 _d.setMonth(_d.getMonth() + 1)
                 _d.setDate(_d.getDate() - 1)
@@ -11182,6 +11254,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.$watch('thisMouth', function(newVal, oldVal) {
             var _fromDate = new Date()
             var _d = new Date(_fromDate)
+            // var _d  = new Date(_fromDate.replace(/-/g,'/'))
             _d.setDate(1)
             _d.setMonth(_d.getMonth() + 1)
             _d.setDate(_d.getDate() - 1)
@@ -11193,11 +11266,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 return
             }
             if (newVal !== oldVal) {
-                var _d = new Date(newVal)
+                var _d = newVal + '-01'
+                _d = _d.replace(/-/g,'/')
+                _d  = new Date(_d)
+                // var _d  = new Date(newVal.replace(/-/g,'/'))
                 _d.setDate(1)
                 _d.setMonth(_d.getMonth() + 1)
                 _d.setDate(_d.getDate() - 1)
-
                 if (_d.getTime() >= _fromDate.getTime()) {
                     $scope.MouthinShow = false
                 } else {

+ 27 - 5
src/main/webapp/resources/tpl/index/fa/apCheck.html

@@ -316,11 +316,11 @@
 				<thead>
 					<tr class="header">
 						<th width="200">客户名称</th>
-						<th width="150">本月应收</th>
-						<th width="150">本月未对</th>
-						<th width="150">本月已对</th>
-						<th width="150">应收总额</th>
-						<th width="160">操作</th>
+						<th width="170">本月应收</th>
+						<th width="170">本月未对</th>
+						<th width="170">本月已对</th>
+						<th width="170">应收总额</th>
+						<th width="80">操作</th>
 					</tr>
 				</thead>
 				<tbody ng-repeat="check in ALLList">
@@ -501,6 +501,28 @@
 							</div>
 						</label>
 					</div>
+					<div style="text-align: left;margin-top: 20px">
+						<label>本期间已对总额:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisMonthDoneCount.length > 0" ng-repeat="count in dataInfo.thisMonthDoneCount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisMonthDoneCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
+					<div style="text-align: left;margin-top: 20px">
+						<label>本期间未对总额:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisMonthTodoCount.length > 0" ng-repeat="count in dataInfo.thisMonthTodoCount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisMonthTodoCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
 					<div style="text-align: left;margin-top: 20px">
 						<label>应收总额:</label>
 						<label style="text-align:left;vertical-align: top;">

+ 29 - 5
src/main/webapp/resources/tpl/index/fa/arCheck.html

@@ -293,11 +293,11 @@
 				<thead>
 				<tr class="header">
 					<th width="200">应付供应商名称</th>
-					<th width="150">本月应付</th>
-					<th width="150">本月未对</th>
-					<th width="150">本月已对</th>
-					<th width="150">应付总额</th>
-					<th width="160">操作</th>
+					<th width="170">本月应付</th>
+					<th width="170">本月未对</th>
+					<th width="170">本月已对</th>
+					<th width="170">应付总额</th>
+					<th width="80">操作</th>
 				</tr>
 				</thead>
 				<tbody ng-repeat="check in ALLList">
@@ -425,6 +425,30 @@
 							</div>
 						</label>
 					</div>
+
+					<div style="text-align: left;margin-top: 20px">
+						<label>本期间已对总额:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisMonthDoneCount.length > 0" ng-repeat="count in dataInfo.thisMonthDoneCount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisMonthDoneCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
+					<div style="text-align: left;margin-top: 20px">
+						<label>本期间未对总额:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisMonthTodoCount.length > 0" ng-repeat="count in dataInfo.thisMonthTodoCount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisMonthTodoCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
+
 					<div style="text-align: left;margin-top: 20px">
 						<label>应付总额:</label>
 						<label style="text-align:left;vertical-align: top;">