Explorar o código

成品粮分仓保管账录入页面优化

fanxw %!s(int64=4) %!d(string=hai) anos
pai
achega
46d6414580

+ 19 - 1
src/main/resources/static/app/storage/product/controller/productCtrl.js

@@ -259,9 +259,27 @@ angular.module('app.storage').controller("productCtrl", function($scope, $rootSc
259 259
 		var nums = parseFloat($scope.productEdit.specifications);//规格
260 260
 		if($scope.storage !== undefined && $scope.storage !== ""){//入库
261 261
 			$scope.productEdit.storageQuantity = ((parseFloat($scope.storage)*100) * (parseFloat(nums)*100))/10000;
262
+			if ($scope.productEdit.storageQuantity > 0) {
263
+				$scope.ckjs = true;
264
+				$scope.outbound = "";
265
+			} else {
266
+				$scope.ckjs = false;
267
+			}
268
+		} else {
269
+			$scope.productEdit.storageQuantity = "";
270
+			$scope.ckjs = false;
262 271
 		}
263
-		if($scope.outbound !== undefined || $scope.outbound !== ""){//出库
272
+		if($scope.outbound !== undefined && $scope.outbound !== ""){//出库
264 273
 			$scope.productEdit.outboundQuantity = ((parseFloat($scope.outbound)*100) * (parseFloat(nums)*100))/10000;
274
+			if ($scope.productEdit.outboundQuantity > 0) {
275
+				$scope.rkjs = true;
276
+				$scope.storage = "";
277
+			} else {
278
+				$scope.rkjs = false;
279
+			}
280
+		} else {
281
+			$scope.rkjs = false;
282
+			$scope.productEdit.outboundQuantity = "";
265 283
 		}
266 284
 	};
267 285
 

+ 2 - 2
src/main/resources/static/app/storage/product/views/product-edit.html

@@ -223,7 +223,7 @@
223 223
 												<th width='15%'>
224 224
 													<label class="input">
225 225
 														<i class="input"></i>
226
-														<input type="text" name="storage" ng-model="storage"
226
+														<input type="text" name="storage" ng-model="storage" ng-readonly="rkjs"
227 227
 															   ng-blur="calculate()" onkeyup="this.value=this.value.match(/^\+?[1-9]\d*$/) ? this.value.match(/\d+(\d{0,5})?/)[0] : '' "/>
228 228
 													</label>
229 229
 												</th>
@@ -233,7 +233,7 @@
233 233
 												<th width='15%'>
234 234
 													<label class="input">
235 235
 														<i class="input"></i>
236
-														<input type="text" name="outbound" ng-model="outbound"
236
+														<input type="text" name="outbound" ng-model="outbound" ng-readonly="ckjs"
237 237
 															   ng-blur="calculate()" onkeyup="this.value=this.value.match(/^\+?[1-9]\d*$/) ? this.value.match(/\d+(\d{0,5})?/)[0] : '' "/>
238 238
 													</label>
239 239
 												</th>