|
|
@@ -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 {
|