瀏覽代碼

fix:登统表导出

XuPengHui 3 年之前
父節點
當前提交
0207ecd082

+ 32 - 0
src/main/resources/static/app/storage/registrationTable/controller/registrationCtrl.js

@@ -154,6 +154,22 @@ angular.module('app.registrationTable').controller("registrationWheatCtrl", func
154 154
 	        console.log(reason);
155 155
 	    });
156 156
     }
157
+
158
+		// 导出
159
+		$scope.exportFile = function() {
160
+			// console.log($rootScope);
161
+			const params = {
162
+				houseId: $scope.houseId,
163
+				warehouseId: $scope.warehouseId,
164
+				startDate: $("#startDate").val(),
165
+				endDate: $("#endDate").val(),
166
+				zbr: $rootScope.depotInfo.legalPerson,
167
+				shdw: $rootScope.depotInfo.orgName,
168
+				dwfzr: ""
169
+			};
170
+			registrationService.exportWheat(params)
171
+			console.log("奥利给");
172
+		}
157 173
     
158 174
 })
159 175
 
@@ -629,6 +645,22 @@ angular.module('app.registrationTable').controller("registrationRiceCtrl", funct
629 645
 	        console.log(reason);
630 646
 	    });
631 647
     }
648
+
649
+		// 导出
650
+		$scope.exportFile = function() {
651
+			// console.log($rootScope);
652
+			const params = {
653
+				houseId: $scope.houseId,
654
+				warehouseId: $scope.warehouseId,
655
+				startDate: $("#startDate").val(),
656
+				endDate: $("#endDate").val(),
657
+				zbr: $rootScope.depotInfo.legalPerson,
658
+				shdw: $rootScope.depotInfo.orgName,
659
+				dwfzr: ""
660
+			};
661
+			registrationService.exportRice(params)
662
+			console.log("奥利给");
663
+		}
632 664
 })
633 665
 
634 666
 angular.module('app.registrationTable').controller("registrationCrudeOilCtrl", function($scope, $state, $rootScope,$stateParams,$uibModal,FileUploader,APP_CONFIG,registrationService,archiveService,$filter) {

+ 51 - 0
src/main/resources/static/app/storage/registrationTable/service/registrationService.js

@@ -162,4 +162,55 @@ angular.module('app.registrationTable').service("registrationService", function(
162 162
     	return d.promise;
163 163
     }
164 164
 
165
+    // 小麦导出
166
+    this.exportWheat = function (params) {
167
+    	var d = $q.defer();
168
+    	$http({
169
+    		method : 'GET',
170
+    		url : APP_CONFIG.agileUrl + '/agile/registration/exportWheatListPageInfo',
171
+    		params : {
172
+    			...params
173
+    		},
174
+				responseType: "blob"
175
+    	}).then(function successCallback(response) {
176
+				let url = window.URL.createObjectURL(response.data);
177
+        let link = document.createElement("a");
178
+        link.download = "小麦登统表.xls";
179
+        link.href = url;
180
+				link.click();
181
+    		// 请求成功执行代码
182
+    		d.resolve(response.data);
183
+    	}, function errorCallback(response) {
184
+    		// 请求失败执行代码
185
+    		d.reject("error");
186
+    	});
187
+    	return d.promise;
188
+    }
189
+		
190
+    // 稻谷导出
191
+    this.exportRice = function (params) {
192
+    	var d = $q.defer();
193
+    	$http({
194
+    		method : 'GET',
195
+    		url : APP_CONFIG.agileUrl + '/agile/registration/exportRiceListPageInfo',
196
+    		params : {
197
+    			...params
198
+    		},
199
+				responseType: "blob"
200
+    	}).then(function successCallback(response) {
201
+				let url = window.URL.createObjectURL(response.data);
202
+        let link = document.createElement("a");
203
+          link.download = "稻谷登统表.xls";
204
+        link.href = url;
205
+				link.click();
206
+    		// 请求成功执行代码
207
+    		d.resolve(response.data);
208
+
209
+    	}, function errorCallback(response) {
210
+    		// 请求失败执行代码
211
+    		d.reject("error");
212
+    	});
213
+    	return d.promise;
214
+    }
215
+
165 216
 });

+ 3 - 0
src/main/resources/static/app/storage/registrationTable/views/rice-list.html

@@ -47,6 +47,9 @@
47 47
                                                 <div ng-hide="isArchive" class="form-group">
48 48
 		                                            <label class="btn btn-primary btn-sm" for="exampleFile"><i class="glyphicon glyphicon-import"></i>&nbsp;导&nbsp;入</label>
49 49
 		                                        </div>
50
+                                                <div ng-hide="isArchive" class="form-group" ng-click="exportFile()">
51
+		                                            <label class="btn btn-primary btn-sm"><i class="fa fa-file-excel-o"></i>&nbsp;导&nbsp;出</label>
52
+		                                        </div>
50 53
                                                 <!-- <a class="btn btn-primary btn-sm" ng-click="print()">
51 54
 									                <span class="fa fa-print"></span>&nbsp;打&nbsp;印
52 55
 									            </a> -->

+ 3 - 0
src/main/resources/static/app/storage/registrationTable/views/wheat-list.html

@@ -47,6 +47,9 @@
47 47
                                                 <div ng-hide="isArchive" class="form-group">
48 48
 		                                            <label class="btn btn-primary btn-sm" for="exampleFile"><i class="glyphicon glyphicon-import"></i>&nbsp;导&nbsp;入</label>
49 49
 		                                        </div>
50
+                                                <div ng-hide="isArchive" class="form-group" ng-click="exportFile()">
51
+		                                            <label class="btn btn-primary btn-sm"><i class="fa fa-file-excel-o"></i>&nbsp;导&nbsp;出</label>
52
+		                                        </div>
50 53
                                                 <!-- <a class="btn btn-primary btn-sm" ng-click="print()">
51 54
 									                <span class="fa fa-print"></span>&nbsp;打&nbsp;印
52 55
 									            </a> -->