fanxw 1 år sedan
förälder
incheckning
d7c4fcdea4

+ 4 - 4
src/main/resources/static/app/storage/grainCard/controller/grainCarAddCtrl.js

@@ -156,15 +156,15 @@ angular.module('app.storage').controller("grainCarAddCtrl", function ($scope, $s
156
                 $scope.pageInfo = data.data;
156
                 $scope.pageInfo = data.data;
157
                 if ($scope.pageInfo.list.length > 0) {
157
                 if ($scope.pageInfo.list.length > 0) {
158
                 	$scope.grainCard.fcqrdId = $scope.pageInfo.list[0].id;
158
                 	$scope.grainCard.fcqrdId = $scope.pageInfo.list[0].id;
159
-                	grainCardService.saveGrainOilCardData($scope.grainCard).then(function (data) {
160
-                        if (data.retCode === '200' && data.message === 'success') {
159
+                	grainCardService.saveGrainOilCardData($scope.grainCard).then(function (datas) {
160
+                        if (datas.retCode === '200' && datas.message === 'success') {
161
                             alert("保存成功");
161
                             alert("保存成功");
162
                             $scope.retList();
162
                             $scope.retList();
163
                         } else {
163
                         } else {
164
                             alert("保存失败");
164
                             alert("保存失败");
165
                         }
165
                         }
166
-                    }, function (data) {
167
-                        console.log(data);
166
+                    }, function (datas) {
167
+                        console.log(datas);
168
                     });
168
                     });
169
                 } else {
169
                 } else {
170
                 	alert("请先做封仓确认单业务!");
170
                 	alert("请先做封仓确认单业务!");

+ 22 - 11
src/main/resources/static/app/storage/grainCard/controller/oilCarAddCtrl.js

@@ -1,5 +1,5 @@
1
 "use strict"; // 新增原油 (补录)
1
 "use strict"; // 新增原油 (补录)
2
-angular.module('app.storage').controller("oilCarAddCtrl", function ($scope, $state, $rootScope, $uibModal, $filter, $stateParams, grainCardService) {
2
+angular.module('app.storage').controller("oilCarAddCtrl", function ($scope, $state, $rootScope, $filter, $stateParams, grainCardService, pageListService) {
3
     // 初始保存对象
3
     // 初始保存对象
4
     $scope.oilCard = {};
4
     $scope.oilCard = {};
5
 
5
 
@@ -84,24 +84,35 @@ angular.module('app.storage').controller("oilCarAddCtrl", function ($scope, $sta
84
             }
84
             }
85
             // 验收类型名
85
             // 验收类型名
86
             if ($scope.oilCard.checkTypeNum === '0') { // 入库验收
86
             if ($scope.oilCard.checkTypeNum === '0') { // 入库验收
87
-                $scope.oilCard.checkTypeName = '入库验收';
87
+                $scope.oilCard.checkTypeName = '入库';
88
                 $scope.oilCard.sfmc = '1'; // 是否满仓(入库(0:否,1:是).倒仓,移库(2:表示倒仓移库数据))
88
                 $scope.oilCard.sfmc = '1'; // 是否满仓(入库(0:否,1:是).倒仓,移库(2:表示倒仓移库数据))
89
             } else if ($scope.oilCard.checkTypeNum === '1') { // 倒仓验收
89
             } else if ($scope.oilCard.checkTypeNum === '1') { // 倒仓验收
90
-                $scope.oilCard.checkTypeName = '倒仓验收';
90
+                $scope.oilCard.checkTypeName = '倒仓';
91
                 $scope.oilCard.sfmc = '2'; // 是否满仓(入库(0:否,1:是).倒仓,移库(2:表示倒仓移库数据))
91
                 $scope.oilCard.sfmc = '2'; // 是否满仓(入库(0:否,1:是).倒仓,移库(2:表示倒仓移库数据))
92
             } else { // 移库验收
92
             } else { // 移库验收
93
-                $scope.oilCard.checkTypeName = '移库验收';
93
+                $scope.oilCard.checkTypeName = '移库';
94
                 $scope.oilCard.sfmc = '2'; // 是否满仓(入库(0:否,1:是).倒仓,移库(2:表示倒仓移库数据))
94
                 $scope.oilCard.sfmc = '2'; // 是否满仓(入库(0:否,1:是).倒仓,移库(2:表示倒仓移库数据))
95
             }
95
             }
96
-            grainCardService.saveGrainOilCardData($scope.oilCard).then(function (data) {
97
-                if (data.retCode === '200' && data.message === 'success') {
98
-                    alert("保存成功");
99
-                    $scope.retList();
96
+            $scope.search = {auditState: 3, houseId: $scope.grainCard.storehouseId, warehouseId: null};
97
+            pageListService.getPageList(1, 1, $scope.search).then(function (datas) {
98
+            	$scope.pageInfo = datas.data;
99
+                if ($scope.pageInfo.list.length > 0) {
100
+                	$scope.oilCard.fcqrdId = $scope.pageInfo.list[0].id;
101
+                	grainCardService.saveGrainOilCardData($scope.oilCard).then(function (data) {
102
+                        if (data.retCode === '200' && data.message === 'success') {
103
+                            alert("保存成功");
104
+                            $scope.retList();
105
+                        } else {
106
+                            alert("保存失败");
107
+                        }
108
+                    }, function (data) {
109
+                        console.log(data);
110
+                    });
100
                 } else {
111
                 } else {
101
-                    alert("保存失败");
112
+                	alert("请先做封仓确认单业务!");
102
                 }
113
                 }
103
-            }, function (data) {
104
-                console.log(data);
114
+            }, function (datas) {
115
+                console.log(datas);
105
             });
116
             });
106
         }
117
         }
107
     };
118
     };