|
|
@ -169,20 +169,20 @@ export default { |
|
|
const startX = '20mm'; // 文字左边距
|
|
|
const startX = '20mm'; // 文字左边距
|
|
|
const fullTextWidth = '55mm'; // 单行完整文字区域宽度
|
|
|
const fullTextWidth = '55mm'; // 单行完整文字区域宽度
|
|
|
const fontSize = 4; // 字体大小(缩小到2.5号,确保超长文本能显示)
|
|
|
const fontSize = 4; // 字体大小(缩小到2.5号,确保超长文本能显示)
|
|
|
const packingFontSize = 4; // Packing List 比主文本小一号
|
|
|
|
|
|
const lineHeight = '3mm'; // 行高
|
|
|
|
|
|
|
|
|
const packingFontSize = fontSize; // Packing List 与主文本同字号
|
|
|
|
|
|
const lineHeight = '3.5mm'; // 行高(避免同字号时看起来偏小)
|
|
|
|
|
|
|
|
|
// 第1行:编码(左) + Packing List(右)
|
|
|
// 第1行:编码(左) + Packing List(右)
|
|
|
const packingList = printData.packingList || printData.PackingList || printData.packinglist || ''; |
|
|
const packingList = printData.packingList || printData.PackingList || printData.packinglist || ''; |
|
|
const text1 = LODOP.ADD_PRINT_TEXT('3mm', startX, '34mm', lineHeight, `No.:${printData.partNo || ''}`); |
|
|
|
|
|
|
|
|
// 第一行总可用宽度约 48mm:No 区 28mm,Packing List 区 20mm
|
|
|
|
|
|
const text1 = LODOP.ADD_PRINT_TEXT('2.8mm', startX, '28mm', lineHeight, `No.:${printData.partNo || ''}`); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontName", "Microsoft YaHei"); // 使用Arial,比微软雅黑窄
|
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontName", "Microsoft YaHei"); // 使用Arial,比微软雅黑窄
|
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontSize", fontSize); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontSize", fontSize); |
|
|
const text1Right = LODOP.ADD_PRINT_TEXT('3mm', '54mm', '14mm', lineHeight, `${packingList}`); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontName", "Microsoft YaHei"); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontSize", packingFontSize); |
|
|
|
|
|
// 双保险:部分打印环境按对象索引设置更稳定
|
|
|
|
|
|
|
|
|
// 右侧从48mm开始,宽20mm,结束于68mm,不会超出边框
|
|
|
|
|
|
const text1Right = LODOP.ADD_PRINT_TEXT('2.8mm', '48mm', '20mm', lineHeight, `${packingList}`); |
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontName", "Microsoft YaHei"); |
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontName", "Microsoft YaHei"); |
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontSize", packingFontSize); |
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontSize", packingFontSize); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "Alignment", 1); |
|
|
|
|
|
|
|
|
// 第2行:卷号 - 关键字段,使用最宽区域和最紧凑设置
|
|
|
// 第2行:卷号 - 关键字段,使用最宽区域和最紧凑设置
|
|
|
const text2 = LODOP.ADD_PRINT_TEXT('6.5mm', startX, fullTextWidth, lineHeight, `RN.:${printData.rollNo || ''}`); |
|
|
const text2 = LODOP.ADD_PRINT_TEXT('6.5mm', startX, fullTextWidth, lineHeight, `RN.:${printData.rollNo || ''}`); |
|
|
@ -312,19 +312,20 @@ export default { |
|
|
const startX = '20mm'; // 文字左边距
|
|
|
const startX = '20mm'; // 文字左边距
|
|
|
const textWidth = '55mm'; // 文字区域宽度
|
|
|
const textWidth = '55mm'; // 文字区域宽度
|
|
|
const fontSize = 5; // 字体大小(比A002稍大,因为只有3行)
|
|
|
const fontSize = 5; // 字体大小(比A002稍大,因为只有3行)
|
|
|
const packingFontSize = 5; // Packing List 比主文本小一号
|
|
|
|
|
|
|
|
|
const packingFontSize = fontSize; // Packing List 与主文本同字号
|
|
|
|
|
|
const lineHeight = '4mm'; // 行高
|
|
|
|
|
|
|
|
|
// 第1行:编码(左) + Packing List(右)
|
|
|
// 第1行:编码(左) + Packing List(右)
|
|
|
const packingList = printData.packingList || printData.PackingList || printData.packinglist || ''; |
|
|
const packingList = printData.packingList || printData.PackingList || printData.packinglist || ''; |
|
|
const text1 = LODOP.ADD_PRINT_TEXT('3.5mm', startX, '34mm', '4mm', `No.:${printData.partNo || ''}`); |
|
|
|
|
|
|
|
|
// 第一行总可用宽度约 48mm:No 区 28mm,Packing List 区 20mm
|
|
|
|
|
|
const text1 = LODOP.ADD_PRINT_TEXT('3.5mm', startX, '28mm', lineHeight, `No.:${printData.partNo || ''}`); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontName", "Microsoft YaHei"); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontName", "Microsoft YaHei"); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontSize", fontSize); |
|
|
LODOP.SET_PRINT_STYLEA(text1, "FontSize", fontSize); |
|
|
const text1Right = LODOP.ADD_PRINT_TEXT('3.5mm', '54mm', '14mm', '4mm', `${packingList}`); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontName", "Microsoft YaHei"); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontSize", packingFontSize); |
|
|
|
|
|
// 双保险:部分打印环境按对象索引设置更稳定
|
|
|
|
|
|
|
|
|
// 右侧从48mm开始,宽20mm,结束于68mm,不会超出边框
|
|
|
|
|
|
const text1Right = LODOP.ADD_PRINT_TEXT('3.5mm', '48mm', '20mm', lineHeight, `${packingList}`); |
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontName", "Microsoft YaHei"); |
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontName", "Microsoft YaHei"); |
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontSize", packingFontSize); |
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "FontSize", packingFontSize); |
|
|
|
|
|
LODOP.SET_PRINT_STYLEA(text1Right, "Alignment", 1); |
|
|
|
|
|
|
|
|
// 第2行:卷号
|
|
|
// 第2行:卷号
|
|
|
const text2 = LODOP.ADD_PRINT_TEXT('8mm', startX, textWidth, '4mm', `RN.:${printData.rollNo || ''}`); |
|
|
const text2 = LODOP.ADD_PRINT_TEXT('8mm', startX, textWidth, '4mm', `RN.:${printData.rollNo || ''}`); |
|
|
|