|
|
@@ -488,24 +488,27 @@ define(['app/app'], function(app) {
|
|
|
}
|
|
|
$scope.updateTotal = function (data) {
|
|
|
if (data.currentTaxUnitPrice == null){
|
|
|
- data.currentTaxUnitPrice = 0.000001;
|
|
|
- return;
|
|
|
+ data.currentTaxUnitPrice = "";
|
|
|
}
|
|
|
if (isNaN(data.currentTaxUnitPrice)){
|
|
|
- data.currentTaxUnitPrice = 0.000001;
|
|
|
+ data.currentTaxUnitPrice = "";
|
|
|
toaster.pop('warning', '提示', '输入的价格必须是数字');
|
|
|
- return ;
|
|
|
}
|
|
|
if (Number(data.currentTaxUnitPrice) < 0){
|
|
|
- data.currentTaxUnitPrice = 0.000001;
|
|
|
+ data.currentTaxUnitPrice = "";
|
|
|
}
|
|
|
if (Number(data.currentTaxUnitPrice) > 100000){
|
|
|
data.currentTaxUnitPrice = 100000;
|
|
|
}
|
|
|
+ if (data.currentTaxUnitPrice.length == 0) {
|
|
|
+ data.detailTotal = "-";
|
|
|
+ $scope.purchase.currentTotal = "-";
|
|
|
+ return;
|
|
|
+ }
|
|
|
data.currentTaxUnitPrice = Number(NumberService.toCeil(data.currentTaxUnitPrice, 6));
|
|
|
$scope.purchase.currentTotal = 0;
|
|
|
angular.forEach($scope.purchase.purchaseDetails, function (detail) {
|
|
|
- $scope.purchase.currentTotal += detail.currentTaxUnitPrice * detail.number;
|
|
|
+ $scope.purchase.currentTotal += NumberService.mul(detail.currentTaxUnitPrice, detail.number);
|
|
|
});
|
|
|
//加上运费
|
|
|
$scope.purchase.currentTotal = NumberService.add($scope.purchase.currentTotal, $scope.purchase.fare);
|