| | |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | import { useReactToPrint } from "react-to-print"; |
| | | import jsbarcode from 'jsbarcode' |
| | | import { el } from "date-fns/locale"; |
| | | // import jsbarcode from 'jsbarcode' |
| | | import Barcode from 'react-barcode'; |
| | | import { padding } from "@mui/system"; |
| | | |
| | | const PrintModal = ({ open, setOpen, rows }) => { |
| | |
| | | }} |
| | | > |
| | | <tbody> |
| | | <tr style={{ height: '94px' ,padding: '5px', }}> |
| | | <tr style={{ height: '94px', padding: '5px', }}> |
| | | <td |
| | | align="center" |
| | | className="barcode" |
| | |
| | | const PrintTemp = ({ rows }) => { |
| | | const notify = useNotify(); |
| | | const [data, setData] = useState([]); |
| | | const [barcodeConfig, setBarcodeConfig] = useState({ |
| | | width: 2, |
| | | height: 100, |
| | | displayValue: true |
| | | }); |
| | | |
| | | |
| | | const http = async () => { |
| | | const res = await request.post(`/basContainer/many/${rows?.join()}`); |
| | | if (res?.data?.code === 200) { |
| | | let val = res.data.data.map((el => { |
| | | return { |
| | | barcode: '/img/barcode.jpeg', |
| | | barcode: el.code, |
| | | code: el.code, |
| | | name: el.name, |
| | | memo: el.memo |
| | | } |
| | | })) |
| | | setData(val) |
| | | setTimeout(() => { |
| | | val.forEach((el) => { |
| | | jsbarcode(`#barcode${el.code}`, el.code, { height: 30 }); |
| | | }); |
| | | }, 10); |
| | | |
| | | |
| | | |
| | | // setTimeout(() => { |
| | | // val.forEach((el) => { |
| | | // jsbarcode(`#barcode${el.code}`, el.code, { height: 30 }); |
| | | // }); |
| | | // }, 10); |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | |
| | | 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' }}> |
| | | <Barcode value={item.code} {...barcodeConfig} /> |
| | | {/* <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> |
| | | </tbody> |