Professional Documents
Culture Documents
Printbackup
Printbackup
// Merge two html content and have it in two different page to print.
const htmlContent = '<html><body>' + coverSheetHtml + boxHtml +
'</html></body>';
console.log(htmlContent);
return htmlContent;
}
#generateEndRunBoxSheetHtml(boxItems, userName) {
const sortedItems = boxItems.sort((a, b) => {
// TODO: confirm logic with business - copied from HJ4MFG
if (a.itemNumber.Length < b.itemNumber.Length) return -1;
else if (a.itemNumber.Length > b.itemNumber.Length) return 1;
else {
if (a.itemNumber < b.itemNumber) return -1;
else if (a.itemNumber > b.itemNumber) return 1;
else return 0;
}
});
let html = `
<div style='display:block; margin:15px; clear:both; page-break-after:always'>
<div style='width:100%; text-align:center;'>
<span style='margin-top: 0.67em; margin-bottom: 0.67em; font-weight: bold;
float:right'>${dateTimeStr} ${boxItems.length} Parts</span>
<br>
<span style='font-size: 2em; margin-top: 0.67em; margin-bottom: 0.67em;
font-weight: bold'>Rack Location : ________________</span>
<br><br>
<span style='font-size: 2em; margin-top: 0.67em; margin-bottom: 0.67em;
font-weight: bold'>BOX-SHEET</span>
</div>
<table style='width: 100%; border-collapse: collapse; margin-bottom: 10px;
margin-top: 10px; border: 1px solid black'>
<tr>
<th style='text-align: center; padding:3px; border: 1px solid black;
font-weight: bold'>Line</th>
<th style='text-align: center; padding:3px; border: 1px solid black;
font-weight: bold'>Order Number</th>
<th style='text-align: center; padding:3px; border: 1px solid black;
font-weight: bold'>Model Number</th>
<th style='text-align: center; padding:3px; border: 1px solid black;
font-weight: bold'>Run Qty</th>
<th style='text-align: center; padding:3px; border: 1px solid black;
font-weight: bold'>Submitted By</th>
</tr>
<tr>
<td style='text-align: center; padding:3px; border: 1px solid black'>$
{boxItems[0].line}</td>
<td style='text-align: center; padding:3px; border: 1px solid black'>$
{boxItems[0].orderNumber}</td>
<td style='text-align: center; padding:3px; border: 1px solid black'>$
{boxItems[0].model}</td>
<td style='text-align: center; padding:3px; border: 1px solid black'>$
{boxItems[0].orderQty}</td>
<td style='text-align: center; padding:3px; border: 1px solid black'>$
{userName}</td>
</tr>
</table>
<br></br>Parent Tag - <span style='font-size: 1em; margin-top: 0.67em; margin-
bottom: 0.67em'>${boxItems[0].containerTagId}</span>
<table style='table-layout: fixed;width: 100%; border-collapse: collapse;
margin-bottom: 10px; margin-top: 10px; border: 1px solid black'>
<tr>
<th style='text-align: center; width:50px; padding:3px; border: 1px
solid black;font-weight: bold'>#</th>
<th style='text-align: center; padding:3px; border: 1px solid
black;font-weight: bold'>Quantity</th>
<th style='text-align: center; padding:3px; border: 1px solid
black;font-weight: bold'>Part Number</th>
<th style='text-align: center; padding:3px; border: 1px solid
black;font-weight: bold'>Description</th>
</tr>`;
#generateEndRunCoverSheetHtml(model, containerTagId) {
let fontSize = '265px';
// if (model.length >= 8) fontSize = '250px';
// else if (model.length >= 9) fontSize = '220px';
// else if (model.length >= 10) fontSize = '200px';
// else if (model.length >= 12) fontSize = '170px';
// else if (model.length >= 14) fontSize = '150px';