Browse Source

发票、应收对账导出权限
注释报错修改

wangmh 8 years ago
parent
commit
c28f9fd5aa

+ 17 - 2
src/main/java/com/uas/platform/b2b/controller/SaleApBillController.java

@@ -6,6 +6,7 @@ import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -56,7 +57,8 @@ public class SaleApBillController {
 	/**
 	 * 作为卖家,客户的应付票据(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(method = RequestMethod.GET)
@@ -104,10 +106,23 @@ public class SaleApBillController {
 		return purchaseApBillService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 
-	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 18 - 7
src/main/java/com/uas/platform/b2b/controller/SaleApCheckController.java

@@ -103,7 +103,6 @@ public class SaleApCheckController {
 	/**
 	 * 作为卖家,获取应收对账单(全部)
 	 * 
-	 * @param json
 	 * @return
 	 */
 	@RequestMapping(value = "/getAll", method = RequestMethod.GET)
@@ -279,7 +278,6 @@ public class SaleApCheckController {
 	 * 作为卖家,获取应收对账单(全部)
 	 * 
 	 * @param params
-	 * @param keyword
 	 * @param searchFilter
 	 * @return
 	 */
@@ -415,7 +413,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 全部
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", method = RequestMethod.GET)
@@ -438,7 +436,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 已确认
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", params = RequestState.DONE, method = RequestMethod.GET)
@@ -461,7 +459,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 未对账
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", params = RequestState.TODO, method = RequestMethod.GET)
@@ -484,7 +482,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 已做废
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", params = RequestState.END, method = RequestMethod.GET)
@@ -504,10 +502,23 @@ public class SaleApCheckController {
 		return modelAndView;
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 全部导出
 	 * 
-	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

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

@@ -9268,6 +9268,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.reload();
         };
 
+        // 导出
+        $scope.exportXls = function () {
+            FaApBill.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/sale/apBill/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || "")+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
 
     /**
@@ -9600,6 +9610,17 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.page(1);
             $scope.tableParams.reload();
         };
+
+        // 导出
+        $scope.exportXls = function () {
+            FaApCheck.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/sale/inquiry/xls?_state='+$scope.active+'&searchFilter='+angular.toJson($scope.searchFilterXls);
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
 
     //应收对账单详情

+ 8 - 0
src/main/webapp/resources/js/index/services/Fa.js

@@ -5,6 +5,10 @@ define([ 'ngResource'], function() {
 			getAll: {
 				url: 'sale/apBill/:id/info',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/apBill/xls/permission',
+				method: 'GET'
 			}
 		});
 	}]).factory('FaApBillOut', ['$resource', function($resource) {
@@ -183,6 +187,10 @@ define([ 'ngResource'], function() {
 			getBilled: {
 				url: 'sale/apCheck/getBilled',
 				method: 'GET',
+			},
+			exportXls: {
+				url: 'sale/apCheck/xls/permission',
+				method: 'GET',
 			}
 		});
 	}]).factory('ApbillAdjustment', ['$resource', function($resource) {

+ 1 - 1
src/main/webapp/resources/tpl/index/fa/apBill.html

@@ -114,7 +114,7 @@
 	<div class="pub-com_head">
 		<span>发票</span>
 		<div class="p-right">
-			<a href="sale/apBill/xls?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 class="condition block">

+ 1 - 1
src/main/webapp/resources/tpl/index/fa/apCheck.html

@@ -133,7 +133,7 @@
 		<span>应收对账单</span>
 		<div class="p-right">
 			<a class="text-simple append" ui-sref="fa.apCheckList" title="新增对账单"><img src="static/img/icon/add.png">新增对账单</a>&nbsp;&nbsp;&nbsp;
-			<a href="sale/apCheck/allxls?_state={{active}}&searchFilter={{searchFilterXls}}"
+			<a href="#" ng-click="exportXls()"
 			   target="_self" title="导出Excel表格" class="blue f14"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>