|
|
|
@ -33,26 +33,32 @@ export function printAlphaHardTagLabel (printList, icons, printerName, flag) { |
|
|
|
} |
|
|
|
//如果打印正常的标签
|
|
|
|
LODOP.NewPageA(); |
|
|
|
console.log(row) |
|
|
|
if (flag === 'Y'){ |
|
|
|
if (row.printLabelType === 0){ |
|
|
|
sizeTop = 190; |
|
|
|
}else { |
|
|
|
sizeTop = 0; |
|
|
|
} |
|
|
|
// 天线标签 旋转功能不生效 direction都是 ''
|
|
|
|
if (row.printLabelType === 0 || row.printLabelType === 1){ |
|
|
|
LODOP.PRINT_INITA(offsetY,offsetX,1100,512) |
|
|
|
LODOP.SET_PRINTER_INDEXA(printerName) |
|
|
|
printCartonLabel(LODOP,row,icons,direction === 'Vertical'?2:0) // 箱标签
|
|
|
|
printCartonLabel(LODOP,row,icons,0) // 箱标签
|
|
|
|
} |
|
|
|
if (row.printLabelType === 0 || row.printLabelType === 2){ |
|
|
|
LODOP.PRINT_INITA(offsetY,offsetX,1100,512) |
|
|
|
LODOP.SET_PRINTER_INDEXA(printerName) |
|
|
|
printProductLabel(LODOP,row,direction === 'Vertical'?2:0) |
|
|
|
printProductLabel(LODOP,row,0) |
|
|
|
} |
|
|
|
}else { |
|
|
|
LODOP.PRINT_INITA(offsetY,offsetX,1100,512) |
|
|
|
LODOP.SET_PRINTER_INDEXA(printerName) |
|
|
|
printCartonLabel(LODOP,row,icons,direction === 'Vertical'?2:0) // 箱标签
|
|
|
|
if (direction === 'Vertical'){ |
|
|
|
printCartonVerticalLabel(LODOP,row,icons) |
|
|
|
}else { |
|
|
|
printCartonLabel(LODOP,row,icons,0) // 箱标签
|
|
|
|
} |
|
|
|
} |
|
|
|
LODOP.PRINT() |
|
|
|
} |
|
|
|
@ -172,6 +178,142 @@ const printCartonLabel = (LODOP,row,icons,hz) => { |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'Stretch', 2) |
|
|
|
} |
|
|
|
} |
|
|
|
const printCartonVerticalLabel = (LODOP,row,icons) => { |
|
|
|
//如果打印正常的标签
|
|
|
|
LODOP.SET_PRINT_PAGESIZE(0, 512, 1020, '') |
|
|
|
LODOP.ADD_PRINT_IMAGE(257,-6, '26mm', '26mm', row.qrCode) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'Stretch', 1) |
|
|
|
LODOP.ADD_PRINT_IMAGE(120,4, 90, 16, '<img src="data:image/png;base64,' + ckpLogo + '"/>') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'Stretch', 2) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'Alignment', 3) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
LODOP.ADD_PRINT_TEXT(250,17, 40, 20, 'REF') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
LODOP.ADD_PRINT_TEXT(250,34, 40, 20, 'QTY') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
LODOP.ADD_PRINT_TEXT(250,50, 50, 20, 'DESC') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
LODOP.ADD_PRINT_TEXT(200,15, 200, 20, row.ref) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 14) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'Bold', 1) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
|
|
|
|
LODOP.ADD_PRINT_TEXT(200,34, 93, 20, row.qty) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'Bold', 1) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
|
|
|
|
// LODOP.ADD_PRINT_HTM(50,175,186,35,`<div>${row.desc}</div>`);
|
|
|
|
LODOP.ADD_PRINT_TEXT(200,50, 186, 35, row.desc) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'LineSpacing', -5) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 9) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
|
|
|
|
if (row.tradingMark && row.tradingMark === 'Y') { |
|
|
|
LODOP.ADD_PRINT_TEXT(18,55, 50, 35, '®') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 18) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
} |
|
|
|
LODOP.ADD_PRINT_TEXT(105,34, 60, 20, 'UoM') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
LODOP.ADD_PRINT_TEXT(95,32, 70, 20, row.uom) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 14) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'Alignment', 3) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'Bold', 1) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
|
|
|
|
LODOP.ADD_PRINT_LINE(406,85,-2,86,0,1); |
|
|
|
LODOP.ADD_PRINT_LINE(406,145,-2,146,0,1); |
|
|
|
|
|
|
|
LODOP.ADD_PRINT_TEXT(348,116, 150, 20, 'S/N') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
LODOP.ADD_PRINT_TEXT(200,116, 194, 20, row.sn) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
|
|
|
|
LODOP.ADD_PRINT_TEXT(348,130, 151, 20, 'MANUFACTURE DATE') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
LODOP.ADD_PRINT_TEXT(200,130, 190, 20, row.date) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
|
|
|
|
LODOP.ADD_PRINT_TEXT(348,86, 151, 20, 'MANUFACTURER') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
LODOP.ADD_PRINT_TEXT(200,86,190, 20, row.manufacturer) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
|
|
|
|
if (row.weightUmName && row.weight) { |
|
|
|
LODOP.ADD_PRINT_TEXT(151,86, 80, 20, 'WEIGHT') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
|
|
|
|
LODOP.ADD_PRINT_TEXT(100,86, 64, 20, new Decimal(row.weight).toDecimalPlaces(3)) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'Alignment', 3) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
|
|
|
|
LODOP.ADD_PRINT_TEXT(34,86, 60, 20, row.weightUmName) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
if (row.showPound === 'Y'){ |
|
|
|
LODOP.ADD_PRINT_TEXT(100,101, 64, 20,new Decimal(row.weight).mul(new Decimal(2.20462)).toDecimalPlaces(3)) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'Alignment', 3) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
|
|
|
|
LODOP.ADD_PRINT_TEXT(35,101, 60, 20, 'LBS') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
} |
|
|
|
} |
|
|
|
LODOP.ADD_PRINT_TEXT(348,101, 151, 20, 'MOLD CODE') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
LODOP.ADD_PRINT_TEXT(200,101, 189, 20, row.moldCode) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
if (rightIndex === 'Y') { |
|
|
|
LODOP.ADD_PRINT_TEXT(154,151,180, 20, row.freeInfo2) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontName', 'Arial') |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
} |
|
|
|
for (let i = 0; i < icons.length; i++) { |
|
|
|
LODOP.ADD_PRINT_IMAGE( (351 - i * 35),149, 30, 30, `<img src="${icons[i].icon}" style="object-fit: contain"/>`) |
|
|
|
LODOP.SET_PRINT_STYLEA(0, 'Stretch', 2) |
|
|
|
LODOP.SET_PRINT_STYLEA(0,"Angle",90.0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const printProductLabel = (LODOP,row,hz) =>{ |
|
|
|
LODOP.SET_SHOW_MODE("MESSAGE_GETING_URL", "");//该语句隐藏进度条或修改提示信息
|
|
|
|
|