Browse Source

改价交互调整

hulh 8 years ago
parent
commit
dda785fd32

+ 9 - 6
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_detail.js

@@ -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);

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/purchase_detail.html

@@ -521,7 +521,7 @@
 						</span>
 							<span style="width: 10%;" ng-bind="detail.number">100</span>
 							<span ng-show="!isChange" class="wd01 red" ng-bind="detail.taxUnitPrice * detail.number | formateNumber : 6 | currencySysmbol : detail.currencyName"></span>
-							<span ng-show="isChange" class="wd01 red" ng-bind="detail.currentTaxUnitPrice * detail.number | formateNumber : 6 | currencySysmbol : detail.currencyName"></span>
+							<span ng-show="isChange" class="wd01 red" ng-bind="detail.detailTotal | formateNumber : 6 | currencySysmbol : detail.currencyName"></span>
 							<!--物料编码-->
 							<span class="wd01" style="line-height: 18px;">
 								<em ng-if="!detail.goodsnumber">&nbsp;</em>