|
@@ -185,7 +185,16 @@ define(['app/app'], function(app) {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $scope.updateTotal = function () {
|
|
|
|
|
|
|
+ $scope.updateTotal = function (data) {
|
|
|
|
|
+ if (isNaN(data.currentTaxUnitPrice)){
|
|
|
|
|
+ data.currentTaxUnitPrice = 0.000001;
|
|
|
|
|
+ toaster.pop('warning', '提示', '输入的价格必须是数字');
|
|
|
|
|
+ return ;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Number(data.currentTaxUnitPrice) <= 0){
|
|
|
|
|
+ data.currentTaxUnitPrice = 0.000001;
|
|
|
|
|
+ }
|
|
|
|
|
+ data.currentTaxUnitPrice = Number(NumberService.toCeil(data.currentTaxUnitPrice, 6));
|
|
|
$scope.purchase.currentTotal = 0;
|
|
$scope.purchase.currentTotal = 0;
|
|
|
angular.forEach($scope.purchase.purchaseDetails, function (detail) {
|
|
angular.forEach($scope.purchase.purchaseDetails, function (detail) {
|
|
|
$scope.purchase.currentTotal += detail.currentTaxUnitPrice * detail.number;
|
|
$scope.purchase.currentTotal += detail.currentTaxUnitPrice * detail.number;
|
|
@@ -217,7 +226,7 @@ define(['app/app'], function(app) {
|
|
|
var param = { };
|
|
var param = { };
|
|
|
param.detailid = $scope.purchase.purchaseDetails[i].detailid;
|
|
param.detailid = $scope.purchase.purchaseDetails[i].detailid;
|
|
|
param.modifyingUnitPrice = $scope.purchase.purchaseDetails[i].currentTaxUnitPrice;
|
|
param.modifyingUnitPrice = $scope.purchase.purchaseDetails[i].currentTaxUnitPrice;
|
|
|
- if($scope.purchase.purchaseDetails[i].currentTaxUnitPrice <= 0.000001){
|
|
|
|
|
|
|
+ if($scope.purchase.purchaseDetails[i].currentTaxUnitPrice < 0.000001){
|
|
|
toaster.pop('info', '金额必须要大于0.000001');
|
|
toaster.pop('info', '金额必须要大于0.000001');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|