1
0
ソースを参照

Merge branch 'master' of http://git.ds-bay.com/project/wms

 Conflicts:
	wms-operate/src/main/java/com/lote/wms/controller/operate/outstock/order/PrintWaybillController.java
lsp 4 年 前
コミット
dae63f32c8

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

@@ -21,6 +21,8 @@ import com.lote.wms.user.user.entity.User;
 import org.slf4j.Logger;
 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;
@@ -137,7 +139,7 @@ public class PrintWaybillController extends AbstractController {
 
 		return Result.success(voList);
 	}
-	
+
 	/**
 	 * 批量打印
 	 * 
@@ -218,8 +220,12 @@ public class PrintWaybillController extends AbstractController {
 		return view;
 	}
 
+
+
+
 	/**
 	 * 更新打印运单状态
+	 * 
 	 * @param isUpdateStatus
 	 * @param orderIds
 	 * @return
@@ -232,4 +238,56 @@ public class PrintWaybillController extends AbstractController {
 		message.setExtend(shipwayCodeList);
 		return MessageToResultAdapt.toResult(message);
 	}
+
+
+
+
+	/**
+	 * 批量运单打印(新)
+	 *
+	 * @param orderIds
+	 * @return
+	 */
+	@PostMapping("batchWaybillHtml")
+	@ResponseBody
+	public Result batchWaybillHtml(@RequestBody String orderIds) {
+		List<String> orderIdArray = StringUtil.stringToList(orderIds, String.class, ",");
+
+		List<Map<String,Object>> resultList = new ArrayList<>();
+		for (String orderId : orderIdArray) {
+			Map<String,Object> resultMap = new HashMap();
+			OutOrderResultVo vo = outOrderService.getPrintWaybillData(orderId, this.getUser());
+			// 选择jsp模板
+			String templateName = outOrderService.getPrintWaybillTemplate(vo);
+			resultMap.put("orderId",orderId);
+			resultMap.put("templateName",templateName);
+			resultList.add(resultMap);
+		}
+
+		return Result.success(resultList);
+	}
+
+
+
+
+	/**
+	 * 打印单个运单(新)
+	 *
+	 * @param orderId
+	 *
+	 * @return
+	 */
+	@PostMapping("waybillHtml")
+	@ResponseBody
+	public Result waybillHtml(@RequestBody String orderId) {
+		OutOrderResultVo order = outOrderService.getPrintWaybillData(orderId, this.getUser());
+		order.setExtend10(DateUtil.dateConvertString(new Date(), "yyyy/MM/dd HH:mm:ss"));
+		return Result.success(order);
+	}
+
+
+
+
+
+
 }

+ 5 - 4
wms-operate/src/main/resources/static/ui/js/outstock/order/outOrder/list.js

@@ -1700,10 +1700,11 @@ function printWaybill(){
 	         		    	var shipwayCode = shipwayCodeList[i];
 	         		    	
 	         		    	$.iMessager.show({title: '温馨提示',msg:'正在打印渠道:'+shipwayCode ,timeout:4000});
-	         		    	
-	         		    	var href = '/outstock/printWaybill/batch.do?printType=waybill&shipwayCode={shipwayCode}&orderIds={orderIds}';//预览
-	         		    	var printUrl = href.replace("{shipwayCode}",shipwayCode).replace("{orderIds}",orderIds);
-	         		    	window.open(printUrl);
+
+							var href = '';
+							href =  _ctx + '/views/outstock/order/printWaybill/batch.html?orderIds={orderIds}';
+							href = href.replace("{orderIds}",orderIds);
+							window.open(href);
 	         		    }
 	         		    
 	   	        		//是否刷新

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

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

+ 95 - 0
wms-operate/src/main/resources/static/ui/views/outstock/order/printWaybill/batch.html

@@ -0,0 +1,95 @@
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
+    <meta name="renderer" content="webkit">
+    <title>JWMS 运单打印</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/batchWaybillHtml",
+            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">
+
+    <%for(var i=0;i<data.length;i++){%>
+        <div class='change-page mt_1mm' style="min-height:100mm;">
+            <iframe onload="this.height=this.contentWindow.document.body.scrollHeight"  src="./<%=data[i].templateName%>.html?orderId=<%=data[i].orderId%>" width="100%" style="overflow: hidden; border: 0" ></iframe>
+            <button><a style="text-decoration:none;" href="./<%=data[i].templateName%>.html?orderId=<%=data[i].orderId%>" target="_blank" >单独打开页面</a></button>
+        </div>
+
+    <%}%>
+</script>
+
+
+
+
+
+
+
+</html>

+ 127 - 0
wms-operate/src/main/resources/static/ui/views/outstock/order/printWaybill/default.html

@@ -0,0 +1,127 @@
+<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>
+	<!-- 浏览器标签图片 -->
+	<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">
+</body>
+
+
+
+<script type="text/javascript">
+	$(function () {
+		var orderId = getParam('orderId');
+		if(orderId == null || orderId ==''){
+			return;
+		}
+		$.ajax({
+			type: "POST",
+			url: "/outstock/printWaybill/waybillHtml",
+			contentType:"application/json",
+			data:orderId,
+			success: function(msg){
+				console.log(msg);
+				if(msg.code!=0){
+					alert("加载数据失败,"+msg.msg);
+					return
+				}
+				//填充数据
+				var html = baidu.template('printBody',msg);
+				$("body").html(html);
+			},
+			error: function () {
+				$.iMessager.alert('注意', '网络断开或服务器已停止运行', 'messager-warning');
+			}
+		},"json");
+
+
+
+		//180秒后自动关闭
+		setTimeout(function () {
+			window.opener = null; window.close();
+		}, 180000);
+
+
+	});
+</script>
+
+
+<script id="printBody" type="text/html">
+
+	<div style="border:1px solid  #000;width: 92mm;height: 92mm;padding-left: 1mm;padding-top: 1mm;">
+
+		<table  style="width:100%;height:12mm;border-bottom:1px solid  #000;" cellpadding="0" cellspacing="0" rules="all">
+			<tr>
+				<td style="width:50%;">
+					&nbsp;<font style="font-weight: bold;font-size: 5mm;"><%=data.receiver.countryCode%></font><br>
+					&nbsp;<font style="font-weight: bold;font-size: 5mm;"><%=data.customerCode%></font>
+				</td>
+				<td>
+					&nbsp;<font style="font-weight: bold;font-size: 5mm;"><%=data.shipwayName%></font>
+				</td>
+			</tr>
+		</table>
+
+		<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.orderNoBarcodeData%>" />
+			<div style="font-size: 4mm; margin-left: 1mm;margin-top: 0mm;"><%=data.orderNo1%></div>
+		</div>
+
+		<div style="height:22mm;width:100%;border-bottom:1px solid  #000;">
+			<div style="width: 84mm;margin-left: 2mm;">
+				&nbsp;<%=data.receiver.countryName%>
+				&nbsp;<%=data.receiver.province%>
+				&nbsp;<%=data.receiver.city%>
+				&nbsp;<%=data.receiver.county%>
+				&nbsp;<%=data.receiver.addressLine1%>
+				&nbsp;<%=data.receiver.addressLine2%>
+				&nbsp;<%=data.receiver.postalCode%>
+				&nbsp;<%=data.receiver.name%>
+				&nbsp;<%=data.receiver.mobileNumber%>
+				&nbsp;<%=data.receiver.phoneNumber%>
+			</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,<%=data.trackingNoBarcodeData%> "/>
+			<div style="font-size: 12px; margin-left: 1mm"><%=data.trackingNo1%></div>
+		</div>
+
+		<div style="height:20mm;width:100%;text-align: left;">
+			<span style="margin-left: 5px;margin-top: 5px;">
+				拣货信息:
+				<%for(var i=0;i<data.allocationList.length;i++){%>
+						&nbsp;<%=data.allocationList[i].barcode%> * <%=data.allocationList[i].quantity%>   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+				<%}%>
+			</span>
+		</div>
+	</div>
+</script>
+
+
+</html>
+