Browse Source

主动报价导出权限

wangmh 8 years ago
parent
commit
a45e67fc22

+ 11 - 0
src/main/java/com/uas/platform/b2b/controller/SaleQuotationController.java

@@ -477,6 +477,17 @@ public class SaleQuotationController {
 		return saleQuotationService.findItemById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/permission/xls", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出Excel - 全部
 	 * 

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

@@ -6008,6 +6008,17 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.page(1);
             $scope.tableParams.reload();
         };
+
+        // 导出
+        $scope.exportXls = function () {
+            Quotation.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/sale/quotation/xls?_state='+$scope.active+'&searchFilter='+angular.toJson($scope.searchFilterXls);
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
 
     // Controller 主动报价 - 新增

+ 4 - 0
src/main/webapp/resources/js/index/services/Purc.js

@@ -1325,6 +1325,10 @@ define([ 'ngResource'], function() {
 			deleteById: {
 				url: 'sale/quotation/deleteById/:id',
 				method: 'DELETE'
+			},
+			exportXls: {
+				url: 'sale/quotation/permission/xls',
+				method: 'GET'
 			}
 		});
 	}]).factory('QuotationInfo', ['$resource', function($resource){

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

@@ -195,7 +195,7 @@
 		<!--</a>-->
 		<div class="p-right">
 			<a ui-sref="sale.quotation.new" title="新增主动报价单"><img src="static/img/icon/add.png"/>新增</a>
-			<a href="sale/quotation/xls?_state={{active}}&searchFilter={{searchFilterXls}}" 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>