Browse Source

发货提醒,发货单导出权限

wangmh 8 years ago
parent
commit
f5d9ae3872

+ 22 - 0
src/main/java/com/uas/platform/b2b/controller/SaleNoticeController.java

@@ -555,6 +555,17 @@ public class SaleNoticeController {
 		return searchService.searchSaleSendIds(keyword, pageParams);
 		return searchService.searchSaleSendIds(keyword, pageParams);
 	}
 	}
 
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	/**
 	 * 导出送货提醒(全部)
 	 * 导出送货提醒(全部)
 	 * 
 	 * 
@@ -655,6 +666,17 @@ public class SaleNoticeController {
 		return modelAndView;
 		return modelAndView;
 	}
 	}
 
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/sends/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportSendsPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	/**
 	 * 导出发货单Excel - 全部
 	 * 导出发货单Excel - 全部
 	 * 
 	 * 

+ 21 - 0
src/main/webapp/resources/js/index/app.js

@@ -6750,6 +6750,18 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         }, function (data) {
         }, function (data) {
             data && ($scope.tableParams.reload());
             data && ($scope.tableParams.reload());
         }, true);
         }, true);
+
+        // 导出
+        $scope.exportXls = function () {
+            PurcNotice.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/sale/notice/xls?_state='+$scope.active+
+                        '&keyword='+($scope.keywordXls || '')+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
     }]);
 
 
     app.controller('SaleNoticeSendByBatchCtrl', ['$scope', '$modalInstance', 'Symbol', 'selectedNotices', 'PurcNotice', 'toaster', '$state', '$timeout', 'token', function ($scope, $modalInstance, Symbol, selectedNotices, PurcNotice, toaster, $state, $timeout, token) {
     app.controller('SaleNoticeSendByBatchCtrl', ['$scope', '$modalInstance', 'Symbol', 'selectedNotices', 'PurcNotice', 'toaster', '$state', '$timeout', 'token', function ($scope, $modalInstance, Symbol, selectedNotices, PurcNotice, toaster, $state, $timeout, token) {
@@ -6966,6 +6978,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.reload();
             $scope.tableParams.reload();
         };
         };
 
 
+        $scope.exportXls = function () {
+            SaleSend.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/sale/notice/sends/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || '')+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
     }]);
 
 
     /**
     /**

+ 9 - 1
src/main/webapp/resources/js/index/services/Purc.js

@@ -840,6 +840,10 @@ define([ 'ngResource'], function() {
 			getUnreadCount:{
 			getUnreadCount:{
 				url: 'sale/notice/unread',
 				url: 'sale/notice/unread',
 				method: 'GET'
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/notice/xls/permission',
+				method: 'GET'
 			}
 			}
 		});
 		});
     }]).factory('PurcNoticeInfo', ['$resource', function($resource) {
     }]).factory('PurcNoticeInfo', ['$resource', function($resource) {
@@ -910,7 +914,11 @@ define([ 'ngResource'], function() {
 			updatePrintStatus: {
 			updatePrintStatus: {
                 url: 'sale/notice/updatePrintStatus',
                 url: 'sale/notice/updatePrintStatus',
                 method: 'POST'
                 method: 'POST'
-            }
+            },
+			exportXls: {
+				url: 'sale/notice/sends/xls/permission',
+				method: 'GET'
+			}
 		});
 		});
 	}]).factory('PurcForecast', ['$resource', function($resource) {
 	}]).factory('PurcForecast', ['$resource', function($resource) {
 		return $resource('sale/forecast/:id', {}, {
 		return $resource('sale/forecast/:id', {}, {

+ 1 - 1
src/main/webapp/resources/tpl/index/sale/notice.html

@@ -187,7 +187,7 @@
     <div class="pub-com_head">
     <div class="pub-com_head">
         <span>客户发货提醒</span>
         <span>客户发货提醒</span>
         <div class="p-right">
         <div class="p-right">
-            <a href="sale/notice/xls?_state={{active}}&keyword={{keywordXls}}&fromDate={{fromDateXls}}&endDate={{endDateXls}}"
+            <a href="#" ng-click="exportXls()"
                target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
                target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
         </div>
         </div>
     </div>
     </div>

+ 1 - 1
src/main/webapp/resources/tpl/index/sale/send.html

@@ -136,7 +136,7 @@
 	<div class="pub-com_head">
 	<div class="pub-com_head">
 		<span>发货单</span>
 		<span>发货单</span>
 		<div class="p-right">
 		<div class="p-right">
-			<a href="sale/notice/sends/xls?_state={{active}}&keyword={{keywordXls}}&fromDate={{fromDateXls}}&endDate={{endDateXls}}" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
+			<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 		</div>
 	</div>
 	</div>
 	<div class="menu condition block">
 	<div class="menu condition block">