ソースを参照

虫害检查-修改

hanqingsong 1 年間 前
コミット
caf9f52238

+ 14 - 1
src/main/resources/static/app/storage/insectPestDetection/controller/insectPestDetectionNewCtrl.js

@@ -276,7 +276,7 @@ angular.module('app.storage').controller("insectPestDetectionNewCtrl", function
276 276
     };
277 277
 })
278 278
 // 虫害手工录入
279
-.controller("insectPestEditNewCtrl", function($scope, $filter, $http, $stateParams, $state, $rootScope, $uibModal, insectPestDetectionNewService, warehouseService) {
279
+.controller("insectPestEditNewCtrl", function($scope, $filter, $http, $stateParams, $state, $rootScope, $uibModal, insectPestDetectionNewService, warehouseService, pageListService) {
280 280
 
281 281
     // 仓房列表
282 282
     $scope.loadWare = function(houseId) {
@@ -287,6 +287,16 @@ angular.module('app.storage').controller("insectPestDetectionNewCtrl", function
287 287
         });
288 288
     };
289 289
 
290
+    // 获取库存信息
291
+    $scope.getStorageInfo = function(warehouseId) {
292
+        insectPestDetectionNewService.getCheckGrainAttribute($rootScope.orgInfo.orgId, $scope.houseId, warehouseId).then(function(data){
293
+            $scope.insectPests.lypz = data.data.lypz;
294
+            $scope.insectPests.kcsl = data.data.kcsl;
295
+        },function(data){
296
+            console.log(data);
297
+        });
298
+    };
299
+
290 300
     $scope.isEdit = false;
291 301
 
292 302
     if ($stateParams.id != "0") {
@@ -296,6 +306,7 @@ angular.module('app.storage').controller("insectPestDetectionNewCtrl", function
296 306
             $scope.houseId = $rootScope.storeHouseCodeObj[data.data.vCcCode].storehouseId;
297 307
             $scope.insectPests.vHwCode = parseInt(data.data.vHwCode);
298 308
             $scope.insectPests.cldjpd = parseInt(data.data.cldjpd);
309
+            $scope.insectPests.hcjcdh = $scope.insectPests.hcjcdh.substr(-12);
299 310
             $scope.pestList = [];
300 311
             if (data.data != "error") {
301 312
                 var hczl = data.data.hczl;
@@ -323,6 +334,8 @@ angular.module('app.storage').controller("insectPestDetectionNewCtrl", function
323 334
         $scope.saveFlag = false;
324 335
         $scope.insectPests.vUpdatePeople = $rootScope.userInfo.realName;
325 336
         $scope.insectPests.orgId = $rootScope.orgInfo.orgId;
337
+        $scope.insectPests.commitPeople = $rootScope.userInfo.realName;
338
+        $scope.insectPests.commitTime = $filter('date')(new Date(), "yyyy-MM-dd hh:mm:ss");
326 339
     }
327 340
 
328 341
     var validator = $("#insectPests-form").validate();

+ 16 - 0
src/main/resources/static/app/storage/insectPestDetection/service/insectPestDetectionNewService.js

@@ -144,4 +144,20 @@ angular.module('app.storage').service("insectPestDetectionNewService", function(
144 144
         return d.promise;
145 145
     };
146 146
 
147
+    // 获取粮食品种,库存数量(吨)
148
+    this.getCheckGrainAttribute = function (orgId, houseId, warehouseId) {
149
+        var d = $q.defer();
150
+        $http({
151
+            method : 'GET',
152
+            url : APP_CONFIG.qualitycheckUrl + '/intelligents/insectPestDetection/getCheckGrainAttribute/' + orgId + '/' + houseId + '/' + warehouseId
153
+        }).then(function successCallback(response) {
154
+            // 请求成功执行代码
155
+            d.resolve(response.data);
156
+        }, function errorCallback(response) {
157
+            // 请求失败执行代码
158
+            d.reject("error");
159
+        });
160
+        return d.promise;
161
+    };
162
+
147 163
 });

+ 48 - 10
src/main/resources/static/app/storage/insectPestDetection/view/insectPestDetection-edit.html

@@ -44,7 +44,7 @@
44 44
 											<th width='15%'>
45 45
 												<label class="select">
46 46
 													<select ng-model="insectPests.vHwCode" name="vHwCode" class="form-control input-sm" ng-disabled="isEdit"
47
-															ng-options="ware.warehouseId as ware.warehouseName for ware in warelist" required>
47
+															ng-options="ware.warehouseId as ware.warehouseName for ware in warelist" ng-change="getStorageInfo(insectPests.vHwCode)" required>
48 48
 														<option value="">请选择</option>
49 49
 													</select> <i></i>
50 50
 												</label>
@@ -80,7 +80,7 @@
80 80
 											<th>
81 81
 												<label class="input">
82 82
 													<input type="text" ng-model="insectPests.standTime" name="standTime" ng-disabled="isEdit"
83
-														   class="form-control datepicker" onClick="WdatePicker({lang:'zh-cn', dateFmt:'yyyy-MM-dd HH:mm:ss'})" required>
83
+														   class="form-control datepicker" onClick="WdatePicker({lang:'zh-cn', dateFmt:'yyyy-MM-dd'})" required>
84 84
 												</label>
85 85
 											</th>
86 86
 											<th >
@@ -115,21 +115,21 @@
115 115
 											<th>
116 116
 												<label class="input">
117 117
 													<input type="text" ng-model="insectPests.vUpdateTime" name="vUpdateTime" ng-disabled="isEdit"
118
-														   class="form-control datepicker" onClick="WdatePicker({lang:'zh-cn', dateFmt:'yyyy-MM-dd HH:mm:ss'})" required/>
118
+														   class="form-control datepicker" onClick="WdatePicker({lang:'zh-cn', dateFmt:'yyyy-MM-dd'})" required/>
119 119
 												</label>
120 120
 											</th>
121 121
 											<th>
122
-												<label class="label" style="margin-top: 9px;text-align: center;">检测人</label>
122
+												<label class="label" style="margin-top: 9px;text-align: center;">检测人<span style="color: red;">*</span></label>
123 123
 											</th>
124 124
 											<th>
125 125
 												<label class="input">
126
-													<input type="text" ng-model="insectPests.vUpdatePeople" ng-readonly="isEdit" />
126
+													<input type="text" ng-model="insectPests.vUpdatePeople" ng-readonly="isEdit" required/>
127 127
 												</label>
128 128
 											</th>
129 129
 										</tr>
130 130
 										<tr>
131 131
 											<th>
132
-												<label label class="label" style="margin-top: 9px;text-align: center;">发生部位<span style="color: red;">*</span></label>
132
+												<label class="label" style="margin-top: 9px;text-align: center;">发生部位<span style="color: red;">*</span></label>
133 133
 											</th>
134 134
 											<th>
135 135
 												<section>
@@ -139,10 +139,48 @@
139 139
 													</label>
140 140
 												</section>
141 141
 											</th>
142
-											<th></th>
143
-											<th></th>
144
-											<th></th>
145
-											<th></th>
142
+											<th>
143
+												<label class="label" style="margin-top: 9px;text-align: center;">粮油品种</label>
144
+											</th>
145
+											<th>
146
+												<label class="input">
147
+													<input type="text" ng-model="dicData[insectPests.lypz]" ng-readonly="true" />
148
+												</label>
149
+											</th>
150
+											<th>
151
+												<label class="label" style="margin-top: 9px;text-align: center;">库存数量(吨)</label>
152
+											</th>
153
+											<th>
154
+												<label class="input">
155
+													<input type="text" ng-model="insectPests.kcsl" ng-readonly="true" />
156
+												</label>
157
+											</th>
158
+										</tr>
159
+										<tr>
160
+											<th>
161
+												<label class="label" style="margin-top: 9px;text-align: center;">提交人</label>
162
+											</th>
163
+											<th>
164
+												<label class="input">
165
+													<input type="text" ng-model="insectPests.commitPeople" ng-readonly="true" />
166
+												</label>
167
+											</th>
168
+											<th>
169
+												<label class="label" style="margin-top: 9px;text-align: center;">提交时间</label>
170
+											</th>
171
+											<th>
172
+												<label class="input">
173
+													<input type="text" ng-model="insectPests.commitTime" ng-readonly="true" />
174
+												</label>
175
+											</th>
176
+											<th>
177
+												<label class="label" style="margin-top: 9px;text-align: center;">虫害检测单号</label>
178
+											</th>
179
+											<th>
180
+												<label class="input">
181
+													<input type="text" placeholder="自动生成 检测日期(yyyyMMdd)+4 位顺序号" ng-model="insectPests.hcjcdh" ng-readonly="true" />
182
+												</label>
183
+											</th>
146 184
 										</tr>
147 185
 									</table>
148 186
 								</fieldset>

+ 3 - 3
src/main/resources/static/app/storage/insectPestDetection/view/insectPestDetection-list.html

@@ -73,7 +73,7 @@
73 73
                                         <td style="text-align:center;">{{ storeHouseCodeObj[insectPest.vCcCode].storehouseName }}</td>
74 74
                                         <td style="text-align:center;">{{ wares[insectPest.vHwCode].warehouseName }}</td>
75 75
                                         <td style="text-align:center;">{{ insectPest.standOr }}</td>
76
-                                        <td style="text-align:center;">{{ insectPest.standTime | date:'yyyy-MM-dd HH:mm:ss' }}</td>
76
+                                        <td style="text-align:center;">{{ insectPest.standTime | date:'yyyy-MM-dd' }}</td>
77 77
                                         <!-- <td style="text-align:center;">{{ insectPest.itdh }}</td> -->
78 78
                                         <td style="text-align:center;">
79 79
                                             <span ng-repeat="cIns in insectPest.hczl.split('#') track by $index">
@@ -88,11 +88,11 @@
88 88
                                             </span>&nbsp;
89 89
                                         </td>
90 90
                                         <td style="text-align:center;">{{ insectPest.vUpdatePeople }}</td>
91
-                                        <td style="text-align:center;">{{ insectPest.vUpdateTime | date:'yyyy-MM-dd HH:mm:ss' }}</td>
91
+                                        <td style="text-align:center;">{{ insectPest.vUpdateTime | date:'yyyy-MM-dd' }}</td>
92 92
                                         <td style="text-align:center;">
93 93
                                             <!-- <a ng-hide="isArchive" ng-hide="insectPest.iTdh == null" href-void ng-click="onlyInsectPestDetection(insectPest.vcfcode)"><i class=""></i>{{storeHouseCodeObj[insectPest.vcfcode].storehouseName}}检测</a> -->
94 94
                                             <a ng-hide="isArchive" href-void ng-click="edit(insectPest.id, 'view')"><i class=""></i>查看</a>
95
-                                            <a ng-hide="isArchive" href-void ng-click="edit(insectPest.id, 'update')"><i class=""></i>修改</a>
95
+                                            <!--<a ng-hide="isArchive" href-void ng-click="edit(insectPest.id, 'update')"><i class=""></i>修改</a>-->
96 96
                                         </td>
97 97
                                     </tr>
98 98
                                     </tbody>