From 99411967019bbf0d7b0b971eae0db2c2c58025f0 Mon Sep 17 00:00:00 2001
From: skyouc <958836976@qq.com>
Date: 星期六, 30 八月 2025 16:27:47 +0800
Subject: [PATCH] 修改任务状态
---
rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx | 39 +++++++++++++++++++++++++++++----------
1 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx b/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
index 7513fbe..99d2114 100644
--- a/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
+++ b/rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
@@ -60,8 +60,24 @@
const refresh = useRefresh();
const translate = useTranslate();
const notify = useNotify();
- const contentRef = useRef(null);
- const reactToPrintFn = useReactToPrint({ contentRef });
+ const contentRef = useRef();
+ const reactToPrintFn = useReactToPrint({
+ content: () => {
+ return contentRef.current
+ },
+ documentTitle: `鐗╂枡淇℃伅`,
+ pageStyle: `
+ @page {
+
+ margin: 10mm;
+ }
+ @media print {
+ html, body {
+ width: 70mm; // A4妯悜瀹藉害
+ height: 40mm; // A4妯悜楂樺害
+ }
+ }`
+ });
const handleClose = (event, reason) => {
if (reason !== "backdropClick") {
@@ -210,9 +226,12 @@
}
}))
setData(val)
- val.forEach((el) => {
- jsbarcode(`#barcode${el.code}`, el.code, { height: 30 });
- });
+ setTimeout(() => {
+ val.forEach((el) => {
+ jsbarcode(`#barcode${el.code}`, el.code, { height: 30 });
+ });
+ }, 10);
+
} else {
@@ -238,7 +257,7 @@
overflow: 'hidden',
fontSize: 'small',
tableLayout: 'fixed',
- width: '280px',
+ width: '520px',
borderCollapse: 'collapse',
borderSpacing: 0,
margin: '0 auto',
@@ -256,11 +275,11 @@
colSpan={9}
style={{ border: '1px solid black' }}
>
- <img id={"barcode" + item.code} style={{ width: '70%', verticalAlign: 'middle' }} />
- {/* <img className="template-code" src={item.barcode} style={{ width: '90%', verticalAlign: 'middle' }} alt="Barcode" /> */}
- {/* <div style={{ letterSpacing: '2px', marginTop: '1px', textAlign: 'center' }}>
+ {/* <img id={"barcode" + item.code} style={{ width: '70%', verticalAlign: 'middle' }} /> */}
+ <img className="template-code" src={item.barcode} style={{ width: '90%', verticalAlign: 'middle' }} alt="Barcode" />
+ <div style={{ letterSpacing: '2px', marginTop: '1px', textAlign: 'center' }}>
<span>{item.code}</span>
- </div> */}
+ </div>
</td>
</tr>
<tr style={{ height: '74px' }}>
--
Gitblit v1.9.1