Browse Source

客户打样申请,发货单打印权限

wangmh 8 years ago
parent
commit
64937cb606

+ 12 - 1
src/main/java/com/uas/platform/b2b/controller/SaleNoticeController.java

@@ -451,6 +451,17 @@ public class SaleNoticeController {
 		return purchaseNoticeService.findSaleSendById(id);
 	}
 
+	/**
+	 * 打印权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/sends/print/permission", method = RequestMethod.POST)
+	@ResponseBody
+	public ModelMap printPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 增加发货单打印次数
 	 *
@@ -460,7 +471,7 @@ public class SaleNoticeController {
 	@RequestMapping(value = "/sends/print/{id}", method = RequestMethod.POST)
 	@ResponseBody
 	public void printCount(PageParams params, @PathVariable("id") Long id) {
-		logger.log("发货单", "打印单个货单", "根据Id查找", "", id);
+		logger.log("发货单", "打印单个货单", "根据Id查找", "", id);
 		purchaseNoticeService.printCount(id);
 	}
 

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

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

+ 12 - 1
src/main/java/com/uas/platform/b2b/controller/SaleSampleController.java

@@ -523,6 +523,17 @@ public class SaleSampleController {
 		return purchaseProofingService.findByidApproval(id);
 	}
 
+	/**
+	 * 打印权限判断
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/printCount/permission", method = RequestMethod.POST)
+	@ResponseBody
+	public ModelMap printPermission() {
+		return new ModelMap("success", true);
+	}
+
 	/**
 	 * 记录打样申请单的打印次数
 	 * 
@@ -533,7 +544,7 @@ public class SaleSampleController {
 	@ResponseBody
 	public ResponseEntity<String> printCount(@PathVariable("id") Long id) {
 		purchaseProofingService.print(id);
-		logger.log("客户采购单", "打印客户采购订单", id.toString());
+		logger.log("客户打样申请单", "打印打样申请单", id.toString());
 		return new ResponseEntity<String>(HttpStatus.OK);
 	}
 

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

@@ -6977,9 +6977,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //打印    发货单
         $scope.print = function (send) {
-            SaleSend.printCount({id: send.id}, {});   //增加打印此次
-            $scope.tableParams.reload();
-            ReportService.print(send.custUU, 'SALESEND', "where sale$send.ss_id=" + send.id);
+            SaleSend.printPermission({}, function () {
+                SaleSend.printCount({id: send.id}, {});   //增加打印此次
+                $scope.tableParams.reload();
+                ReportService.print(send.custUU, 'SALESEND', "where sale$send.ss_id=" + send.id);
+            }, function (response) {
+                toaster.pop('error', '打印失败', response.data);
+            });
         };
 
         $scope.openDatePicker = function ($event, item, openParam) {
@@ -7709,9 +7713,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         };
         //打印  样品采购单
         $scope.print = function (sample) {
-            PurcSample.printCount({id: sample.id}, {});//增加打印此次
-            ReportService.print(sample.proofing.enUU, 'PURCPROOFING', "where purc$proofingitems.ppi_id =" + sample.id);
-        };
+            PurcSample.printPermission({}, function () {
+                PurcSample.printCount({id: sample.id}, {});//增加打印此次
+                ReportService.print(sample.proofing.enUU, 'PURCPROOFING', "where purc$proofingitems.ppi_id =" + sample.id);
+            }, function (response) {
+                toaster.pop('error', '打印失败', response.data);
+            });
+            };
 
         $scope.getSend = function (proofing) {
             if (!proofing.sends) {

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

@@ -902,6 +902,10 @@ define([ 'ngResource'], function() {
             printCount:{
             	url: 'sale/notice/sends/print/:id',
                 method: 'POST'
+       	 	},
+			printPermission:{
+            	url: 'sale/notice/sends/print/permission',
+                method: 'POST'
        	 	},
 			generateBarcodes :{
 				url: 'sale/notice/generateBarcodes',
@@ -992,6 +996,10 @@ define([ 'ngResource'], function() {
 				url: 'sale/sample/printCount/:id',
 				method: 'POST'
 			},
+            printPermission: {
+				url: 'sale/sample/printCount/permission',
+				method: 'POST'
+			},
 			getSend: {
 				url: 'sale/sample/:id/send',
 				method: 'GET',