Commit d353e947 authored by wuhao's avatar wuhao 🎯

asder

parent ba8ec324
...@@ -334,4 +334,28 @@ table { ...@@ -334,4 +334,28 @@ table {
>span:last-child{ >span:last-child{
flex:1 flex:1
} }
} }
\ No newline at end of file
@media all {
.page-break {
display: none;
}
}
@media print {
html,
body {
height: initial !important;
overflow: initial !important;
-webkit-print-color-adjust: exact;
}
}
@media print {
.page-break {
margin-top: 2rem;
display: block;
page-break-after: always;
}
}
This diff is collapsed.
...@@ -10,34 +10,7 @@ import { ProDescriptions } from '@ant-design/pro-components'; ...@@ -10,34 +10,7 @@ import { ProDescriptions } from '@ant-design/pro-components';
import JsBarcode from 'jsbarcode' import JsBarcode from 'jsbarcode'
import { useReactToPrint } from 'react-to-print'; import { useReactToPrint } from 'react-to-print';
import PrintProvider, { Print, NoPrint } from 'react-easy-print'; import PrintProvider, { Print, NoPrint } from 'react-easy-print';
const pageStyle = `
@media all {
.page-break {
display: none;
}
}
@media print {
html, body {
height: initial !important;
overflow: initial !important;
-webkit-print-color-adjust: exact;
}
}
@media print {
.page-break {
margin-top: 2rem;
display: block;
page-break-before: auto;
}
}
@page {
size: auto;
margin: 20mm;
}
`;
const initState = { const initState = {
vs: false, vs: false,
...@@ -203,7 +176,11 @@ const StoreApp = (props) => { ...@@ -203,7 +176,11 @@ const StoreApp = (props) => {
await dispatch({ type: "only" }); await dispatch({ type: "only" });
setTimeout(async () => { setTimeout(async () => {
await Promise.all(selectedRowKeys.map(async (it) => { await Promise.all(selectedRowKeys.map(async (it) => {
await JsBarcode("#s" + it.id, it.id); await JsBarcode("#s" + it.id, it.id, {
lineColor: "green",
width: 2,
height: 100,
});
})) }))
}, 600) }, 600)
...@@ -272,9 +249,6 @@ const StoreApp = (props) => { ...@@ -272,9 +249,6 @@ const StoreApp = (props) => {
extraparams={{ storeId: props?.curitem?.id ?? "0" }} extraparams={{ storeId: props?.curitem?.id ?? "0" }}
rowSelection={{ rowSelection={{
onChange: (selectedRowKeys, selectedRows) => { onChange: (selectedRowKeys, selectedRows) => {
console.log('====================================');
console.log(selectedRows);
console.log('====================================');
setselectedRowKeys(selectedRows) setselectedRowKeys(selectedRows)
}, },
...@@ -306,9 +280,6 @@ const StoreApp = (props) => { ...@@ -306,9 +280,6 @@ const StoreApp = (props) => {
{ {
selectedRowKeys.map(it => { selectedRowKeys.map(it => {
return <div> return <div>
<style type="text/css" media="print">
{pageStyle}
</style>
<NoPrint> <NoPrint>
<span>{it.storePositionName}</span> <span>{it.storePositionName}</span>
</NoPrint> </NoPrint>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment