|
|
@@ -1,5 +1,5 @@
|
|
1
|
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
|
4
|
$scope.oilCard = {};
|
|
5
|
5
|
|
|
|
@@ -84,24 +84,35 @@ angular.module('app.storage').controller("oilCarAddCtrl", function ($scope, $sta
|
|
84
|
84
|
}
|
|
85
|
85
|
// 验收类型名
|
|
86
|
86
|
if ($scope.oilCard.checkTypeNum === '0') { // 入库验收
|
|
87
|
|
- $scope.oilCard.checkTypeName = '入库验收';
|
|
|
87
|
+ $scope.oilCard.checkTypeName = '入库';
|
|
88
|
88
|
$scope.oilCard.sfmc = '1'; // 是否满仓(入库(0:否,1:是).倒仓,移库(2:表示倒仓移库数据))
|
|
89
|
89
|
} else if ($scope.oilCard.checkTypeNum === '1') { // 倒仓验收
|
|
90
|
|
- $scope.oilCard.checkTypeName = '倒仓验收';
|
|
|
90
|
+ $scope.oilCard.checkTypeName = '倒仓';
|
|
91
|
91
|
$scope.oilCard.sfmc = '2'; // 是否满仓(入库(0:否,1:是).倒仓,移库(2:表示倒仓移库数据))
|
|
92
|
92
|
} else { // 移库验收
|
|
93
|
|
- $scope.oilCard.checkTypeName = '移库验收';
|
|
|
93
|
+ $scope.oilCard.checkTypeName = '移库';
|
|
94
|
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
|
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
|
};
|