浏览代码

封仓确认单-修改

hanqingsong 1 年之前
父节点
当前提交
b4faf195e2

+ 16 - 7
src/main/resources/static/app/business/storageSealedConfirmation/controller/pageEditCtrl.js

@@ -1,7 +1,6 @@
1 1
 angular.module('app.business').controller("pageEditCtrl", function ($scope, $http, $stateParams, $state, $rootScope, APP_CONFIG, $uibModal, pageListService, warehouseService) {
2 2
     $scope.title = $stateParams.title;
3 3
     $scope.sealedStorage = {};
4
-
5 4
     // console.log("userInfoAllData", $rootScope.userInfoAllData)
6 5
 
7 6
     // 根据id查询数据
@@ -106,17 +105,28 @@ angular.module('app.business').controller("pageEditCtrl", function ($scope, $htt
106 105
 
107 106
     // 货位列表
108 107
     $scope.loadWare = function() {
109
-        warehouseService.getStorehouse($rootScope.orgInfo.orgId, $scope.sealedStorage.houseId).then(function(data){
110
-            $scope.warelist = data.wareList;
111
-        },function(data){
112
-            console.log(data);
113
-        });
108
+        // datatype 0:仓房,1:油罐
109
+        console.log($rootScope.storehouseObj[$scope.sealedStorage.houseId].datatype)
110
+        if ($rootScope.storehouseObj[$scope.sealedStorage.houseId].datatype == 1) {
111
+            // 油罐,没有货位
112
+            $scope.warelist = [];
113
+            $scope.checkGrainAttribute();
114
+        } else {
115
+            // 仓房获取货位
116
+            warehouseService.getStorehouse($rootScope.orgInfo.orgId, $scope.sealedStorage.houseId).then(function(data){
117
+                $scope.warelist = data.wareList;
118
+            },function(data){
119
+                console.log(data);
120
+            });
121
+        }
114 122
     };
115 123
 
116 124
     // 获取封仓数据
117 125
     $scope.checkGrainAttribute = function() {
126
+        console.log($scope.sealedStorage.houseId)
118 127
         pageListService.checkGrainAttribute($rootScope.orgInfo.orgId, $scope.sealedStorage.houseId, $scope.sealedStorage.warehouseId).then(function(data){
119 128
             $scope.sealedStorage = data.data;
129
+            console.log($scope.sealedStorage)
120 130
         },function(data){
121 131
             console.log(data);
122 132
         });
@@ -124,7 +134,6 @@ angular.module('app.business').controller("pageEditCtrl", function ($scope, $htt
124 134
 
125 135
     // 表单效验
126 136
     var validator = $("#storageSealed-form").validate();
127
-
128 137
     // 保存
129 138
     $scope.save = function() {
130 139
         if(validator.form()) {

+ 4 - 1
src/main/resources/static/app/business/storageSealedConfirmation/service/pageListService.js

@@ -42,7 +42,10 @@ angular.module('app.business').service("pageListService", function ($http, $root
42 42
         var d = $q.defer();
43 43
         $http({
44 44
             method : 'GET',
45
-            url : APP_CONFIG.sharedUrl + '/storageSealedConfirmation/checkGrainAttribute/' + orgId + '/' + houseId + '/' + warehouseId
45
+            url : APP_CONFIG.sharedUrl + '/storageSealedConfirmation/checkGrainAttribute/' + orgId + '/' + houseId,
46
+            params : {
47
+                warehouseId : warehouseId
48
+            }
46 49
         }).then(function successCallback(response) {
47 50
             // 请求成功执行代码
48 51
             d.resolve(response.data);

+ 14 - 14
src/main/resources/static/app/business/storageSealedConfirmation/views/pageEdit.html

@@ -36,11 +36,11 @@
36 36
                                             </label>
37 37
                                         </section>
38 38
                                         <section class="col col-3">
39
-                                            <label class="label">货位名称:<span style="color: red;margin-left: 5px;text-align: center;">*</span></label>
39
+                                            <label class="label">货位名称:</label>
40 40
                                             <label class="select">
41 41
                                                 <select ng-model="sealedStorage.warehouseId" ng-disabled="isNotEdit" ng-change="checkGrainAttribute()"
42 42
                                                         ng-options="ware.warehouseId as ware.warehouseName for ware in warelist"
43
-                                                        class="form-control" required>
43
+                                                        class="form-control">
44 44
                                                     <option value="">--请选择--</option>
45 45
                                                 </select>
46 46
                                             </label>
@@ -48,15 +48,15 @@
48 48
                                         <section class="col col-3">
49 49
                                             <label class="label">粮食品种:<span style="color: red;margin-left: 5px;text-align: center;">*</span></label>
50 50
                                             <label class="input">
51
-                                                <input type="text" ng-model="dicData[sealedStorage.grainKind]" name="idCard"
52
-                                                       placeholder="" ng-readonly="true" sfzhm="true" maxlength="18" required>
51
+                                                <input type="text" ng-model="dicData[sealedStorage.grainKind]" name="grainKind"
52
+                                                       placeholder="" ng-readonly="true" required>
53 53
                                             </label>
54 54
                                         </section>
55 55
                                         <section class="col col-3">
56 56
                                             <label class="label">粮食品性质:<span style="color: red;margin-left: 5px;text-align: center;">*</span></label>
57 57
                                             <label class="input">
58
-                                                <input type="text" ng-model="dicData[sealedStorage.grainAttribute]" name="idCard"
59
-                                                       placeholder="" ng-readonly="true" sfzhm="true" maxlength="18" required>
58
+                                                <input type="text" ng-model="dicData[sealedStorage.grainAttribute]" name="grainAttribute"
59
+                                                       placeholder="" ng-readonly="true" required>
60 60
                                             </label>
61 61
                                         </section>
62 62
                                     </div>
@@ -64,29 +64,29 @@
64 64
                                         <section class="col col-3">
65 65
                                             <label class="label">封仓数量(公斤):<span style="color: red;margin-left: 5px;text-align: center;">*</span></label>
66 66
                                             <label class="input">
67
-                                                <input type="text" ng-model="sealedStorage.sealedNumber" name="idCard"
68
-                                                       placeholder="" ng-readonly="true" sfzhm="true" maxlength="18" required>
67
+                                                <input type="text" ng-model="sealedStorage.sealedNumber" name="sealedNumber"
68
+                                                       placeholder="" ng-readonly="true" required>
69 69
                                             </label>
70 70
                                         </section>
71 71
                                         <section class="col col-3">
72 72
                                             <label class="label">等级:<span style="color: red;margin-left: 5px;text-align: center;">*</span></label>
73 73
                                             <label class="input">
74
-                                                <input type="text" ng-model="dicData[sealedStorage.grainGrade]" name="idCard"
75
-                                                       placeholder="" ng-readonly="true" sfzhm="true" maxlength="18" required>
74
+                                                <input type="text" ng-model="dicData[sealedStorage.grainGrade]" name="grainGrade"
75
+                                                       placeholder="" ng-readonly="true" required>
76 76
                                             </label>
77 77
                                         </section>
78 78
                                         <section class="col col-3">
79 79
                                             <label class="label">产地:<span style="color: red;margin-left: 5px;text-align: center;">*</span></label>
80 80
                                             <label class="input">
81
-                                                <input type="text" ng-model="dicData[sealedStorage.placeOfOrigin]" name="idCard"
82
-                                                       placeholder="" ng-readonly="true" sfzhm="true" maxlength="18" required>
81
+                                                <input type="text" ng-model="dicData[sealedStorage.placeOfOrigin]" name="placeOfOrigin"
82
+                                                       placeholder="" ng-readonly="true" required>
83 83
                                             </label>
84 84
                                         </section>
85 85
                                         <section class="col col-3">
86 86
                                             <label class="label">收获年度:<span style="color: red;margin-left: 5px;text-align: center;">*</span></label>
87 87
                                             <label class="input">
88
-                                                <input type="text" ng-model="dicData[sealedStorage.harvestYear]" name="idCard"
89
-                                                       placeholder="" ng-readonly="true" sfzhm="true" maxlength="18" required>
88
+                                                <input type="text" ng-model="dicData[sealedStorage.harvestYear]" name="harvestYear"
89
+                                                       placeholder="" ng-readonly="true" required>
90 90
                                             </label>
91 91
                                         </section>
92 92
                                     </div>