1
0
Selaa lähdekoodia

Merge branch 'master' of lsp/wms into master

肖文浩 4 vuotta sitten
vanhempi
commit
5e898c3aa9

+ 21 - 1
wms-operate/src/main/java/com/lote/wms/controller/operate/outstock/order/PrintWaybillController.java

@@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
@@ -119,7 +120,26 @@ public class PrintWaybillController extends AbstractController {
 		view.setViewName("/outstock/order/printCustoms/" + templateName);
 		return view;
 	}
-	
+
+	/**
+	 * 打印报单表
+	 * @param orderIds
+	 * @return
+	 */
+	@RequestMapping("customsHtml")
+	@ResponseBody
+	public Result customsHtml(@RequestBody String orderIds) {
+		List<OutOrderResultVo> voList = new ArrayList<>();
+		// 查询打印运单需要的数据
+		List<String> orderIdArray = StringUtil.stringToList(orderIds, String.class, ",");
+		for (String orderId : orderIdArray){
+			OutOrderResultVo vo = outOrderService.getPrintWaybillData(orderId, this.getUser());
+			voList.add(vo);
+		}
+
+		return Result.success(voList);
+	}
+
 	/**
 	 * 批量打印
 	 * 

+ 5 - 3
wms-operate/src/main/resources/static/ui/js/outstock/wave/outWave/list.js

@@ -327,9 +327,11 @@ function printWaybill(orderIds){
 	         		    	
 	         		    	$.iMessager.show({title: '温馨提示',msg:'正在打印渠道:'+shipwayCode ,timeout:4000});
 	         		    	
-	         		    	var href = '/outstock/printWaybill/batch?printType=customs&shipwayCode={shipwayCode}&orderIds={orderIds}';//预览
-	         		    	var printUrl = href.replace("{shipwayCode}",shipwayCode).replace("{orderIds}",orderIds);
-	         		    	window.open(printUrl);
+	         		    	//var href = '/outstock/printWaybill/batch?printType=customs&shipwayCode={shipwayCode}&orderIds={orderIds}';//预览
+							// var printUrl = href.replace("{shipwayCode}",shipwayCode).replace("{orderIds}",orderIds);
+							var href = _ctx + '/views/outstock/order/printCustoms/defaultNew.html?orderIds={orderIds}';
+							var printUrl = href.replace("{orderIds}",orderIds);
+							window.open(printUrl);
 	         		    }
 	   	        		//是否刷新
 	   	        		if(isRefresh =='Y'){

+ 7 - 7
wms-operate/src/main/resources/static/ui/views/outstock/order/printCustoms/default.jsp

@@ -13,18 +13,18 @@
 
 </head>
 <body class="print-page-label" id="printpage">
-	
+
 	<div style="border:1px solid  #000;width: 92mm;height: 72mm;padding-left: 1mm;padding-top: 1mm;">
 		<div style="height:16mm;width:100%; text-align: center; border-bottom:1px solid  #000;">
 			<img  style="margin-top:1mm;" src="data:image/png;base64,<c:out value="${order.orderNoBarcodeData}"/>">
 			<div style="font-size: 4mm; margin-left: 1mm;margin-top: 0mm;">${order.orderNo1}</div>
-		</div>	
-					
+		</div>
+
 		<div style="height:17mm;width:100%; text-align: center; border-bottom:1px solid  #000;">
 			<img  style="margin-top:1mm;" src="data:image/png;base64,<c:out value="${order.trackingNoBarcodeData}"/>">
 			<div style="font-size: 12px; margin-left: 1mm">${order.trackingNo1}</div>
-		</div>	
-				
+		</div>
+
 		<div style="height:20mm;width:100%;text-align: left;">
 			<span style="margin-left: 5px;margin-top: 5px;">
 				报关信息:
@@ -45,7 +45,7 @@
 					</table>
 				</c:if>
 			</span>
-		</div>			
+		</div>
 	</div>
 </body>
 
@@ -54,7 +54,7 @@
 <!-- <script language="javascript" src="/ui/js/common/LodopFuncs.js"></script> -->
 
 <script type="text/javascript">
- 
+
 </script>
 
 </html>

+ 114 - 0
wms-operate/src/main/resources/static/ui/views/outstock/order/printCustoms/defaultNew.html

@@ -0,0 +1,114 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+	<style>
+		/*标签纸打印宽度*/
+		.print-page-label{width:100mm;margin: 0;}
+		/*分页命令*/
+		.change-page{page-break-after: always;font: 12px 'Microsoft Yahei';color: #000;}
+	</style>
+	<title>报关单打印</title>
+	<!-- 浏览器标签图片 -->
+	<link rel="shortcut icon" href="./topjui/image/favicon.ico"/>
+	<!-- jQuery相关引用 -->
+	<script type="text/javascript" src="/ui/static/plugins/jquery/jquery.min.js"></script>
+	<script type="text/javascript" src="/ui/static/plugins/jquery/jquery.cookie.js"></script>
+	<script type="text/javascript" src="/ui/static/public/js/baiduTemplate.js"></script>
+	<script type="text/javascript" src="/ui/static/public/js/datefmt.js?v=1"></script>
+	<script type="text/javascript" src="/ui/static/public/js/common.js?v=1"></script>
+	<!-- 日期格式化js -->
+	<script type="text/javascript" src="/ui/static/public/js/datefmt.js?v=1"></script>
+	<!-- 进度条 -->
+	<script src="/ui/static/3rd/pace/pace.js"></script>
+	<link rel="stylesheet" href="/ui/static/3rd/pace/themes/blue/pace-theme-center-simple.css" />
+	<!-- 	<link rel="stylesheet" href="/ui/static/plugins/bootstrap/css/bootstrap.css" /> -->
+	<!-- 打印页css -->
+	<link rel="stylesheet" href="/ui/css/print.css" />
+</head>
+
+<!-- print-page-label 限制了页面宽度100mm -->
+<body class="print-page-label" style="width:105mm;">
+</body>
+
+<script type="text/javascript">
+	$(function () {
+		var orderIds = getParam('orderIds');
+		if(orderIds == null || orderIds ==''){
+			return;
+		}
+
+		$.ajax({
+			type: "POST",
+			url: "/outstock/printWaybill/customsHtml",
+			contentType:"application/json",
+			data:orderIds,
+			success: function(msg){
+				console.log(msg);
+				if(msg.code!=0){
+					alert("加载数据失败,"+msg.msg);
+					return;
+				}
+				//填充数据
+				var html = baidu.template('printBody',msg);
+				$("body").html(html);
+				hideLoad();
+			},
+			error: function () {
+				$.iMessager.alert('注意', '网络断开或服务器已停止运行', 'messager-warning');
+			}
+		},"json");
+
+		function hideLoad(){
+			//进度条隐藏
+			Pace.on('hide', function(){
+				console.info('加载完毕');
+			});
+		}
+
+		//180秒后自动关闭
+		setTimeout(function () {
+			window.opener = null; window.close();
+		}, 180000);
+	});
+</script>
+
+<script id="printBody" type="text/html">
+	<%if(data != null){%>
+		<%for(var i=0; i<data.length; i++){%>
+			<div style="border:1px solid  #000;width: 92mm;height: 72mm;padding-left: 1mm;padding-top: 1mm;">
+				<div style="height:16mm;width:100%; text-align: center; border-bottom:1px solid  #000;">
+					<img  style="margin-top:1mm;" src="data:image/png;base64,<%=data[i].orderNoBarcodeData%>">
+					<div style="font-size: 4mm; margin-left: 1mm;margin-top: 0mm;"><%=data[i].orderNo1%></div>
+				</div>
+
+				<div style="height:17mm;width:100%; text-align: center; border-bottom:1px solid  #000000;">
+					<img  style="margin-top:1mm;" src="data:image/png;base64,<%=data[i].trackingNoBarcodeData%>">
+					<div style="font-size: 12px; margin-left: 1mm"><%=data[i].trackingNo1%></div>
+				</div>
+
+				<div style="height:20mm;width:100%;text-align: left;">
+					<span style="margin-left: 5px;margin-top: 5px;">
+						报关信息:
+						<%if(data[i].allocationList != null){%>
+							<table style="width: 100%;" border="1px solid #ccc" cellspacing="0" cellpadding="0">
+								<tr>
+									<th>商品条码</th>
+									<th>品名</th>
+									<th>数量</th>
+								</tr>
+								<%for(var j=0; j<data[i].allocationList.length; j++){%>
+									<tr>
+										<td><%=data[i].allocationList[j].barcode%></td>
+										<td><%=data[i].allocationList[j].customsName%></td>
+										<td><%=data[i].allocationList[j].quantity%></td>
+									</tr>
+								<%}%>
+							</table>
+						<%}%>
+					</span>
+				</div>
+			</div>
+		<%}%>
+	<%}%>
+</script>
+</html>