From faaf07e1d8dfa4ef890209faa9e77b286b337466 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 01 七月 2020 15:14:06 +0800
Subject: [PATCH] #
---
src/main/webapp/views/matCode/matCode.html | 9 +++++----
src/main/webapp/static/js/matCode/matCode.js | 4 +++-
src/main/webapp/static/css/print.css | 7 +++++++
src/main/java/com/zy/common/utils/BarcodeUtils.java | 4 ++--
4 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/zy/common/utils/BarcodeUtils.java b/src/main/java/com/zy/common/utils/BarcodeUtils.java
index ad0e8ca..6705f88 100644
--- a/src/main/java/com/zy/common/utils/BarcodeUtils.java
+++ b/src/main/java/com/zy/common/utils/BarcodeUtils.java
@@ -18,8 +18,8 @@
*/
public class BarcodeUtils {
- private static final int DEFAULT_WIDTH = 100;
- private static final int DEFAULT_HEIGHT = 20;
+ private static final int DEFAULT_WIDTH = 110;
+ private static final int DEFAULT_HEIGHT = 40;
/**
* 鏉″舰鐮佺紪鐮�
diff --git a/src/main/webapp/static/css/print.css b/src/main/webapp/static/css/print.css
new file mode 100644
index 0000000..94ee215
--- /dev/null
+++ b/src/main/webapp/static/css/print.css
@@ -0,0 +1,7 @@
+@media print {
+ @page {
+ /*A4: 210mm 脳 297mm锛宻ize: 794px 脳 1123px锛�0杈硅窛*/
+ /*171.9mm 脳 258.9mm锛宻ize锛�649px 脳 978px锛�19.05mm杈硅窛锛坕e娴忚鍣ㄩ粯璁ゆ墦鍗拌竟璺濓級 */
+ margin: 0.3cm
+ }
+}
\ No newline at end of file
diff --git a/src/main/webapp/static/js/matCode/matCode.js b/src/main/webapp/static/js/matCode/matCode.js
index 09a58d7..b3c4d7e 100644
--- a/src/main/webapp/static/js/matCode/matCode.js
+++ b/src/main/webapp/static/js/matCode/matCode.js
@@ -359,7 +359,9 @@
var template = Handlebars.compile(tpl);
var html = template(res);
let box = $("#box");
- box.html(html);box.show();box.print();box.hide();
+ box.html(html);box.show();
+ box.print({mediaPrint:true});
+ box.hide();
} else if (res.code === 403){
top.location.href = baseUrl+"/";
}else {
diff --git a/src/main/webapp/views/matCode/matCode.html b/src/main/webapp/views/matCode/matCode.html
index f9b187d..9b408bd 100644
--- a/src/main/webapp/views/matCode/matCode.html
+++ b/src/main/webapp/views/matCode/matCode.html
@@ -9,6 +9,7 @@
<link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
<link rel="stylesheet" href="../../static/css/cool.css" media="all">
<link rel="stylesheet" href="../../static/css/common.css" media="all">
+ <link rel="stylesheet" href="../../static/css/print.css" media="all">
<style>
#search-box {
padding: 30px 30px 10px 30px;
@@ -245,17 +246,17 @@
<!-- 妯℃澘1 -->
<script type="text/template" id="templatePreview1" class="template-barcode">
{{#each data}}
- <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;">
- <tr style="height: 55px">
+ <table class="contain" width="280" style="overflow: hidden;font-size: small;table-layout: fixed;">
+ <tr style="height: 74px">
<td align="center" colspan="3" scope="col">鐗╂枡缂栫爜</td>
<td align="center" class="barcode" colspan="9" scope="col">
- <img class="template-code" src="{{this.barcodeUrl}}" width="80%">
+ <img class="template-code" src="{{this.barcodeUrl}}" width="90%">
<div style="letter-spacing: 2px;margin-top: 1px; text-align: center">
<span>{{this.matNo}}</span>
</div>
</td>
</tr>
- <tr style="height: 55px">
+ <tr style="height: 74px">
<td align="center" colspan="3">鐗╂枡鍚嶇О</td>
<td align="center" colspan="5" style="overflow: hidden; white-space: nowrap;text-overflow: ellipsis;">{{this.matName}}</td>
<td align="center" colspan="2">鍗曚綅</td>
--
Gitblit v1.9.1