Browse Source

客户委外单、委外变更单到处去权限

wangmh 8 years ago
parent
commit
caabef5c0e

+ 16 - 3
src/main/java/com/uas/platform/b2b/controller/MakeOrderChangeController.java

@@ -9,6 +9,7 @@ import org.springframework.data.domain.Sort.Direction;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -60,7 +61,8 @@ public class MakeOrderChangeController {
 	/**
 	 * 作为卖家,收到的委外变更单(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/info/search", method = RequestMethod.GET)
@@ -95,7 +97,7 @@ public class MakeOrderChangeController {
 	 * 处理接口保留,因流程变更不再使用(2015年8月11日10:39:49)
 	 * 
 	 * @param json
-	 * @param changeId
+	 * @param itemId
 	 * @return
 	 */
 	@RequestMapping(value = "/{itemId}/reply", method = RequestMethod.POST)
@@ -118,10 +120,21 @@ public class MakeOrderChangeController {
 		return makeOrderChangeService.findById(id);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/permission/xls", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出 excel - 全部
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)

+ 13 - 2
src/main/java/com/uas/platform/b2b/controller/MakeOrderController.java

@@ -201,7 +201,7 @@ public class MakeOrderController {
 	 * 作为卖家,回复收到的委外加工单
 	 * 
 	 * @param json
-	 * @param orderItemId
+	 * @param orderId
 	 * @return
 	 */
 	@RequestMapping(value = "/{orderId}/reply", method = RequestMethod.POST)
@@ -216,7 +216,7 @@ public class MakeOrderController {
 	/**
 	 * 作为卖家,查看我的委外加工单回复
 	 * 
-	 * @param orderItemId
+	 * @param orderId
 	 *            加工单ID
 	 * @return
 	 */
@@ -252,6 +252,17 @@ public class MakeOrderController {
 		return new ResponseEntity<String>(HttpStatus.OK);
 	}
 
+	/**
+	 * 导出权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/permission/xls", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap exportPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 导出 excel - 全部
 	 * 

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

@@ -11591,6 +11591,17 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     });
                 }
             };
+
+            // 导出
+            $scope.exportXls = function () {
+                MakeOrder.exportXls({}, {}, function (data) {
+                    if (data.success){
+                        window.location.href = window.location.origin + '/make/orders/xls?_state='+$scope.active+'&searchFilter='+angular.toJson($scope.searchFilterXls);
+                    }
+                }, function (response) {
+                    toaster.pop('error', '数据加载失败', response.data);
+                });
+            }
         }]);
 
     /**
@@ -12025,6 +12036,17 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.page(1);
             $scope.tableParams.reload();
         };
+
+        // 导出
+        $scope.exportXls = function () {
+            MakeChange.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = window.location.origin + '/make/changes/xls?_state='+$scope.active+'&searchFilter='+angular.toJson($scope.searchFilterXls);
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
     }]);
 
     app.controller('MakeChangeDetailCtrl', ['$scope', '$stateParams', 'MakeChange', 'toaster', 'BaseService', 'CurrentRole', function ($scope, $stateParams, MakeChange, toaster, BaseService, CurrentRole) {

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

@@ -58,6 +58,10 @@ define([ 'ngResource'], function() {
 			getUnreadCount:{
 				url: 'make/orders/unread',
 				method: 'GET'
+			},
+			exportXls: {
+				url: 'make/orders/permission/xls',
+				method: 'GET'
 			}
 		});
 	}]).factory('MakeChange', ['$resource', function($resource) {
@@ -76,6 +80,10 @@ define([ 'ngResource'], function() {
 			getItem: {
 				url: 'make/changes/:id/info',
 				method: 'GET',
+			},
+			exportXls: {
+				url: 'make/changes/permission/xls',
+				method: 'GET',
 			}
 		});
 	}]).factory('MakeAccept',['$resource',function($resource){

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

@@ -110,7 +110,7 @@
 <div class="pub-com_head">
 	<span>委外变更单</span>
 	<div class="p-right">
-		<a href="make/changes/xls?_state={{active}}&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/make/order.html

@@ -126,7 +126,7 @@
 	<div class="pub-com_head">
 		<span>客户委外单</span>
 		<div class="p-right">
-			<a href="make/orders/xls?_state={{active}}&searchFilter={{keywordXls}}"
+			<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>