Browse Source

客户出入库单导出权限

wangmh 8 years ago
parent
commit
be1f897d4d

+ 15 - 1
src/main/java/com/uas/platform/b2b/controller/MakeAcceptController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 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;
@@ -99,10 +100,23 @@ public class MakeAcceptController {
 		return makeAcceptService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出Excel-全部
 	 * 
-	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 16 - 2
src/main/java/com/uas/platform/b2b/controller/MakeReturnController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 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;
@@ -58,7 +59,7 @@ public class MakeReturnController {
 	 * 作为卖家,客户的委外验收单(全部)
 	 * 
 	 * @param params
-	 * @param keyword
+	 * @param searchFilter
 	 *            查找关键词
 	 * @return
 	 */
@@ -103,10 +104,23 @@ public class MakeReturnController {
 		return makeReturnService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出Excel-全部
 	 * 
-	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 14 - 2
src/main/java/com/uas/platform/b2b/controller/SaleAcceptController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 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;
@@ -59,7 +60,7 @@ public class SaleAcceptController {
 	 * 作为卖家,客户的采购验收单(全部)
 	 * 
 	 * @param params
-	 * @param keyword
+	 * @param searchFilter
 	 *            查找关键词
 	 * @return
 	 */
@@ -105,10 +106,21 @@ public class SaleAcceptController {
 		return purchaseAcceptService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 15 - 2
src/main/java/com/uas/platform/b2b/controller/SaleBadInController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -59,7 +60,8 @@ public class SaleBadInController {
 	/**
 	 * 作为卖家,客户的不良品入库(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(method = RequestMethod.GET)
@@ -101,10 +103,21 @@ public class SaleBadInController {
 		return purchaseBadInService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 15 - 2
src/main/java/com/uas/platform/b2b/controller/SaleBadOutController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -59,7 +60,8 @@ public class SaleBadOutController {
 	/**
 	 * 作为卖家,客户的不良品出库(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(method = RequestMethod.GET)
@@ -101,10 +103,21 @@ public class SaleBadOutController {
 		return purchaseBadOutService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 15 - 2
src/main/java/com/uas/platform/b2b/controller/SaleMRBController.java

@@ -7,6 +7,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -59,7 +60,8 @@ public class SaleMRBController {
 	/**
 	 * 作为卖家,客户的MRB(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(method = RequestMethod.GET)
@@ -104,10 +106,21 @@ public class SaleMRBController {
 		return purchaseMRBService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 15 - 2
src/main/java/com/uas/platform/b2b/controller/SaleReturnController.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.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -61,7 +62,8 @@ public class SaleReturnController {
 	/**
 	 * 作为卖家,客户的采购验退单(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(method = RequestMethod.GET)
@@ -116,7 +118,18 @@ public class SaleReturnController {
 	public Enterprise getEnterprieNameByEnuu(@PathVariable("id")Long id,Long enuu) {
 		return enterpriseService.findByEnUU(enuu);
 	}
-	
+
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/xls/permission", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出
 	 * 

+ 76 - 2
src/main/webapp/resources/js/index/app.js

@@ -8080,6 +8080,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.reload();
         };
 
+        // 导出
+        $scope.exportXls = function () {
+            PurcAccept.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/sale/accept/xls?_state='+$scope.active+'&searchFilter='+angular.toJson($scope.searchFilterXls);
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
 
     /**
@@ -8216,6 +8226,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.reload();
         };
 
+        // 导出
+        $scope.exportXls = function () {
+            PurcReturn.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/sale/return/xls?_state='+$scope.active+'&searchFilter='+angular.toJson($scope.searchFilterXls);
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
 
     /**
@@ -8345,6 +8365,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.reload();
         };
 
+        // 导出
+        $scope.exportXls = function () {
+            PurcBadIn.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/sale/badIn/xls?_state='+$scope.active+'&searchFilter='+angular.toJson($scope.searchFilterXls);
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
 
     /**
@@ -8448,6 +8478,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.reload();
         };
 
+        // 导出
+        $scope.exportXls = function () {
+            PurcBadOut.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/sale/badOut/xls?_state='+$scope.active+'&searchFilter='+angular.toJson($scope.searchFilterXls);
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
 
     /**
@@ -8547,6 +8587,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.reload();
         };
 
+        // 导出
+        $scope.exportXls = function () {
+            PurcMRB.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/sale/MRB/xls?_state='+$scope.active+'&searchFilter='+angular.toJson($scope.searchFilterXls);
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
 
     //客户航天开票
@@ -11802,7 +11852,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     if (page) {
                         params.total(page.totalElement);
                         $defer.resolve(page.content);
-                        $scope.keywordXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
+                        $scope.keywordXls = angular.copy(pageParams.searchFilter.keyword);//保存当前取值的关键词
+                        $scope.fromDateXls = angular.copy(pageParams.searchFilter.fromDate);//保存当前取值的关键词
+                        $scope.endDateXls = angular.copy(pageParams.searchFilter.endDate);//保存当前取值的关键词
                     }
                 }, function (response) {
                     $scope.loading = false;
@@ -11838,6 +11890,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.reload();
         };
 
+        // 导出
+        $scope.exportXls = function () {
+            MakeAccept.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/make/accept/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || "")+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
 
     /**
@@ -11911,7 +11973,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     if (page) {
                         params.total(page.totalElement);
                         $defer.resolve(page.content);
-                        $scope.keywordXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
+                        $scope.keywordXls = angular.copy(pageParams.searchFilter.keyword);//保存当前取值的关键词
+                        $scope.fromDateXls = angular.copy(pageParams.searchFilter.fromDate);//保存当前取值的关键词
+                        $scope.endDateXls = angular.copy(pageParams.searchFilter.endDate);//保存当前取值的关键词
                     }
                 }, function (response) {
                     $scope.loading = false;
@@ -11947,6 +12011,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.reload();
         };
 
+        // 导出
+        $scope.exportXls = function () {
+            MakeReturn.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + 'make/return/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || "")+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
     /**
      * 委外加工变更

+ 10 - 2
src/main/webapp/resources/js/index/services/Make.js

@@ -88,11 +88,19 @@ define([ 'ngResource'], function() {
 		});
 	}]).factory('MakeAccept',['$resource',function($resource){
 		return $resource('make/accept/:id',{},{
-			getAll: {}
+			getAll: {},
+			exportXls: {
+				url: 'make/accept/xls/permission',
+				method: 'GET'
+			}
 		});
 	}]).factory('MakeReturn',['$resource',function($resource){
 		return $resource('make/return/:id',{},{
-			getAll: {}
+			getAll: {},
+			exportXls: {
+				url: 'make/return/xls/permission',
+				method: 'GET'
+			}
 		});
 	}]).factory('MakeOutOrder', ['$resource',function($resource){
 		return $resource('make/outorders/:id', {}, {

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

@@ -931,6 +931,10 @@ define([ 'ngResource'], function() {
 			getDetail : {
 				url: 'sale/accept/:id/info',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/accept/xls/permission',
+				method: 'GET'
 			}
 		});
 	}]).factory('PurcReturn', ['$resource', function($resource) {
@@ -943,16 +947,32 @@ define([ 'ngResource'], function() {
 			getDetail: {
 				url: 'sale/return/:id/info',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'sale/return/xls/permission',
+				method: 'GET'
 			}
 		});
 	}]).factory('PurcBadIn', ['$resource', function($resource) {
 		return $resource('sale/badIn/:id', {}, {
+			exportXls: {
+				url: 'sale/badIn/xls/permission',
+				method:'GET'
+			}
 		});
 	}]).factory('PurcBadOut', ['$resource', function($resource) {
 		return $resource('sale/badOut/:id', {}, {
+			exportXls: {
+				url: 'sale/badOut/xls/permission',
+				method:'GET'
+			}
 		});
 	}]).factory('PurcMRB', ['$resource', function($resource) {
 		return $resource('sale/MRB/:id', {}, {
+			exportXls: {
+				url: 'sale/MRB/xls/permission',
+				method:'GET'
+			}
 		});
 	}]).factory('PurcSample', ['$resource', function($resource) {
 		return $resource('sale/sample/info/search', {}, {

+ 1 - 1
src/main/webapp/resources/tpl/index/make/accept.html

@@ -107,7 +107,7 @@
 	<div class="pub-com_head">
 		<span>客户委外验收单</span>
 		<div class="p-right">
-			<a href="make/accept/xls?_state={{active}}&keyword={{keywordXls.keyword}}&fromDate={{keywordXls.fromDate}}&endDate={{keywordXls.endDate}}"
+			<a href="#" ng-click="exportXls()"
 			   target="_self" class="text-simple" title="导出Excel表格"><i
 					class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>

+ 1 - 1
src/main/webapp/resources/tpl/index/make/returns.html

@@ -112,7 +112,7 @@
 	<div class="pub-com_head">
 		<span>客户委外验退单</span>
 		<div class="p-right">
-			<a href="make/return/xls?_state={{active}}&keyword={{keywordXls.keyword}}&fromDate={{keywordXls.fromDate}}&endDate={{keywordXls.endDate}}" target="_self"
+			<a href="#" target="_self" ng-click="exportXls()"
 			   class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>

+ 1 - 1
src/main/webapp/resources/tpl/index/qc/MRB.html

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

+ 1 - 1
src/main/webapp/resources/tpl/index/qc/badIn.html

@@ -111,7 +111,7 @@
 	<div class="pub-com_head">
 		<span>不良品入库单</span>
 		<div class="p-right">
-			<a href="sale/badIn/xls?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 class="condition block">

+ 1 - 1
src/main/webapp/resources/tpl/index/qc/badOut.html

@@ -111,7 +111,7 @@
 	<div class="pub-com_head">
 		<span>不良品出库单</span>
 		<div class="p-right">
-			<a href="sale/badOut/xls?searchFilter={{keywordXls}}" 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/sale/accept.html

@@ -112,7 +112,7 @@
 	<div class="pub-com_head">
 		<span>客户采购验收单</span>
 		<div class="p-right">
-			<a href="sale/accept/xls?searchFilter={{searchFilterXls}}" target="_self" class="text-simple" title="导出Excel表格"><i
+			<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>

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

@@ -112,7 +112,7 @@
 	<div class="pub-com_head">
 		<span>客户采购验退单</span>
 		<div class="p-right">
-			<a href="sale/return/xls?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 class="condition block">