Browse Source

客户采购订单打印权限

wangmh 8 years ago
parent
commit
c0a310bf54

+ 5 - 0
src/main/java/com/uas/platform/b2b/controller/SaleOrderController.java

@@ -124,6 +124,11 @@ public class SaleOrderController {
 		return purchaseOrderService.findById(id);
 	}
 
+	@RequestMapping(value = "/printCount/permission", method = RequestMethod.POST)
+	@ResponseBody
+	public ModelMap printPermission() {
+		return new ModelMap("success", true);
+	}
 	/**
 	 * 打印订单,增加打印次数(供应商)
 	 * 记录打印日志

+ 15 - 6
src/main/webapp/resources/js/index/app.js

@@ -3141,10 +3141,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //打印    采购单
         $scope.print = function (order) {
-            PurcOrder.printCount({id: order.id}, {});//增加打印此次 // 在此方法内添加记录日志
-            if (order.display == 1) $scope.setDisplay('setRead', order.id);//设置为已查看状态
-            ReportService.print(order.enUU, 'PURCLIST', "where purc$orders.pu_id=" + order.id);
-            $scope.tableParams.reload();
+            PurcOrder.printPermission({}, function () {
+                PurcOrder.printCount({id: order.id}, {});//增加打印此次 // 在此方法内添加记录日志
+                if (order.display == 1) $scope.setDisplay('setRead', order.id);//设置为已查看状态
+                ReportService.print(order.enUU, 'PURCLIST', "where purc$orders.pu_id=" + order.id);
+                $scope.tableParams.reload();
+            },function (response) {
+                toaster.pop('error', '打印失败', response.data);
+            });
+            
         };
 
         $scope.getReply = function (item) {
@@ -3324,8 +3329,12 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         // 采购单
         $scope.print = function (order) {
-            PurcOrder.printCount({id: order.id}, {});//增加打印此次
-            ReportService.print(order.enUU, 'PURCLIST', "where purc$orders.pu_id=" + order.id);
+            PurcOrder.printPermission({}, function () {
+                PurcOrder.printCount({id: order.id}, {});//增加打印此次
+                ReportService.print(order.enUU, 'PURCLIST', "where purc$orders.pu_id=" + order.id);
+            },function (response) {
+                toaster.pop('error', '打印失败', response.data);
+            });
         };
 
         //设置为已查看

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

@@ -27,6 +27,10 @@ define([ 'ngResource'], function() {
 				url: 'sale/orders/printCount/:id',
 				method: 'POST'
 			},
+			printPermission: {
+				url: 'sale/orders/printCount/permission',
+				method: 'POST'
+			},
             custPrintCount: {
                 url: 'sale/orders/custPrintCount/:id',
                 method: 'POST'