fanxw 5 роки тому
батько
коміт
6a0485e6e9

+ 7 - 0
src/main/resources/static/app/basic/tank/controller/TankCtrl.js

@@ -142,4 +142,11 @@ angular.module('app.basic')
142 142
         $state.go("app.basic.tankList");
143 143
     }
144 144
 
145
+    $scope.crkzt = [
146
+                    {"id":"1","name":"空仓"},
147
+                    {"id":"2","name":"入库中"},
148
+                    {"id":"3","name":"封仓"},
149
+                    {"id":"4","name":"出库中"}
150
+                    ];
151
+
145 152
 });

+ 12 - 12
src/main/resources/static/app/basic/tank/view/tank-edit.html

@@ -161,18 +161,6 @@
161 161
 	                                                </select>
162 162
 	                                            </label>
163 163
 	                                        </th>
164
-	<!--                                         <th> -->
165
-	<!--                                             <label class="label" style="margin-top: 9px;text-align: center;">油罐使用情况</label> -->
166
-	<!--                                         </th> -->
167
-	<!--                                         <th> -->
168
-	<!--                                             <label class="select"> -->
169
-	<!--                                                 <select ng-model="tank.tankApply" ng-disabled="isNotEdit" -->
170
-	<!--                                                         ng-options="enum.enumid as enum.enumname for enum in dicDataList[7004]" -->
171
-	<!--                                                         class="form-control"> -->
172
-	<!--                                                     <option value="">--请选择--</option> -->
173
-	<!--                                                 </select> -->
174
-	<!--                                             </label> -->
175
-	<!--                                         </th> -->
176 164
 											<th>
177 165
 	                                            <label class="label" style="margin-top: 9px;text-align: center;">油罐状态<span style="color: red;margin-left: 5px;text-align: center;">*</span></label>
178 166
 	                                        </th>
@@ -197,6 +185,18 @@
197 185
 													name="builddate" ng-disabled="isNotEdit" required>
198 186
 												</label>
199 187
 	                                        </th>
188
+	                                        <th>
189
+	                                        	<label class="label" style="margin-top: 9px;text-align: center;">出入库状态<span style="color: red;margin-left: 5px;text-align: center;">*</span></label>
190
+	                                        </th>
191
+		                                    <th>
192
+		                                    	<label class="select">
193
+		                                    		<select ng-model="tank.crkStatus" ng-disabled="isNotEdit" name="crkStatus"
194
+	                                                        ng-options="enum.id as enum.name for enum in crkzt"
195
+	                                                        class="form-control" required>
196
+	                                                    <option value="">--请选择--</option>
197
+	                                                </select>
198
+		                                    	</label>
199
+		                                    </th>
200 200
 	                                    </tr>
201 201
 <!--                                     <tr> -->
202 202
 <!--                                         <th> -->

+ 39 - 9
src/main/resources/static/app/basic/warehouse/controller/warehouseCtrl.js

@@ -162,7 +162,23 @@ angular.module('app.basic')
162 162
             console.log(data);
163 163
         });
164 164
     };
165
-	
165
+
166
+    $scope.wlist = [];
167
+    $scope.warehouseObj = function(houseId) {
168
+    	warehouseService.getStorehouse($rootScope.orgInfo.orgId, houseId, "0").then(function(data){
169
+        	$scope.wlist = data.wareList;  //下拉列表数据
170
+        },function(data){
171
+        	console.log(data);
172
+        });
173
+    }
174
+    $scope.gethouse = function(houseId) {
175
+    	StorehouseService.findByStorehouse(houseId, $rootScope.orgInfo.orgId).then(function(data){
176
+    		$scope.basicStorehouse = data;
177
+    	},function(datas){
178
+        	console.log(datas);
179
+        });
180
+    }
181
+
166 182
 	// 初始化模态窗口数据
167 183
     $scope.edit = function() {
168 184
     	warehouseService.findByWarehouse(id).then(function(datas){
@@ -172,6 +188,10 @@ angular.module('app.basic')
172 188
                 $scope.isNotEdit = true;
173 189
             }
174 190
             $scope.getBasicData();
191
+            if (id == "" || id == undefined) {
192
+            	$scope.warehouseObj($scope.warehouse.storehouseId);
193
+            	$scope.gethouse($scope.warehouse.storehouseId);
194
+            }
175 195
         },function(datas){
176 196
         	console.log(datas);
177 197
         });
@@ -235,16 +255,26 @@ angular.module('app.basic')
235 255
 			return this.optional(element); 
236 256
 		}else{
237 257
 			if($scope.warehouse.storehouseId != null && $scope.warehouse.storehouseId != ""){
238
-				for(var i=0;i<$scope.storehouseList.length;i++){
239
-					if($scope.warehouse.storehouseId == $scope.storehouseList[i].storehouseId){
240
-						if(parseFloat($scope.storehouseList[i].designCapacity) < parseFloat($scope.warehouse.warehouseCapacity)){
241
-							return this.optional(element) || false;
242
-						}else{
243
-							return this.optional(element) || true;
244
-						}
245
-						break;
258
+				//先查询当前仓房下的货位数据
259
+
260
+				$scope.warehouseObj($scope.warehouse.storehouseId);
261
+				//除当前货位之外的其它货位容量之和
262
+				var ware_sum = 0;
263
+				//当前仓房的设计容量
264
+				var cf_sum = $scope.basicStorehouse.designCapacity;
265
+				for (var i = 0; i < $scope.wlist.length; i++) {
266
+					if ($scope.warehouse.warehouseId != $scope.wlist[i].warehouseId) {
267
+						ware_sum = parseFloat(ware_sum) + parseFloat($scope.wlist[i].warehouseCapacity);
246 268
 					}
247 269
 				}
270
+				//新的货位总容量 = 除当前货位之外的其它货位容量之和 + 当前货位容量
271
+				var this_sum_cr = parseFloat(ware_sum) + $scope.warehouse.warehouseCapacity;
272
+				//如果新的总容量超过了仓房的设计容量,那么返回false
273
+				if (parseFloat(this_sum_cr) >= parseFloat(cf_sum)) {
274
+					return this.optional(element) || false;
275
+				} else {
276
+					return this.optional(element) || true;
277
+				}
248 278
 			}else{
249 279
 				return this.optional(element) || true;
250 280
 			}

+ 1 - 1
src/main/resources/static/app/basic/warehouse/views/warehouse-edit.html

@@ -26,7 +26,7 @@
26 26
 						<label class="select">
27 27
 						<select ng-model="warehouse.storehouseId" required ng-disabled="isNotEdit"
28 28
 							ng-options="store.storehouseId as store.storehouseName for store in storehouseList"
29
-							class="form-control">
29
+							class="form-control" ng-change="gethouse(warehouse.storehouseId)">
30 30
 								<option value="">--请选择--</option>
31 31
 						</select>
32 32
 						</label>

+ 1 - 1
src/main/resources/static/app/system/views/org-edit.html

@@ -112,7 +112,7 @@
112 112
 										<section class="col col-4">
113 113
 											<label class="label">社会信用代码</label> 
114 114
 											<label class="input"> 
115
-												<input type="text" name="creditCode" ng-model="orgInfo.creditCode" maxlength="30">
115
+												<input type="text" name="creditCode" ng-model="orgInfo.creditCode" maxlength="30" required>
116 116
 											</label>
117 117
 										</section>
118 118
 										<section class="col col-4">

Різницю між файлами не показано, бо вона завелика
+ 26609 - 26572
src/main/resources/static/build/app.js